From: eficas <> Date: Fri, 10 Dec 2004 12:49:00 +0000 (+0000) Subject: PN changement anciennes macros X-Git-Tag: CCAR_poursuite_deb~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7a093b6c27dd12223d522aff144a4b57c75c2000;p=tools%2Feficas.git PN changement anciennes macros --- diff --git a/Aster/Cata/cataSTA6/cata.py b/Aster/Cata/cataSTA6/cata.py index 91d86d7b..89c335e6 100755 --- a/Aster/Cata/cataSTA6/cata.py +++ b/Aster/Cata/cataSTA6/cata.py @@ -30,7 +30,7 @@ except: # __version__="$Name: $" -__Id__="$Id: cata_STA6.py,v 1.5 2004/09/10 15:51:42 eficas Exp $" +__Id__="$Id: cata.py,v 1.1 2004/11/19 09:06:20 eficas Exp $" # JdC = JDC_CATA(code='ASTER', execmodul=None, @@ -12614,7 +12614,7 @@ MACR_RECAL = MACRO(nom="MACR_RECAL",op=macr_recal_ops,docu="U4.73.02", # ====================================================================== # RESPONSABLE JMBHH01 J.M.PROIX -from Macro.macro_cara_poutre_ops import macro_cara_poutre_ops +from Macro.macr_cara_poutre_ops import macro_cara_poutre_ops MACRO_CARA_POUTRE=MACRO(nom="MACRO_CARA_POUTRE",op=macro_cara_poutre_ops,sd_prod=tabl_cara_geom, docu="U4.42.02-d1",reentrant='n', @@ -15419,7 +15419,7 @@ PRE_GIBI=PROC(nom="PRE_GIBI",op=49,docu="U7.01.11-f", # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. # ====================================================================== -from Macro.pre_gmsh_ops import pre_gmsh_ops +from cataSTA6.pre_gmsh_ops import pre_gmsh_ops PRE_GMSH=MACRO(nom="PRE_GMSH",op=pre_gmsh_ops,docu="U7.01.01-f", UIinfo={"groupes":("Gestion du travail",)}, diff --git a/Aster/Cata/cataSTA6/pre_gmsh_ops.py b/Aster/Cata/cataSTA6/pre_gmsh_ops.py new file mode 100644 index 00000000..8ff4170e --- /dev/null +++ b/Aster/Cata/cataSTA6/pre_gmsh_ops.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +#@ MODIF pre_gmsh_ops Macro DATE 11/06/2002 AUTEUR DURAND C.DURAND +# CONFIGURATION MANAGEMENT OF EDF VERSION +# ====================================================================== +# COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG +# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY +# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY +# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR +# (AT YOUR OPTION) ANY LATER VERSION. +# +# THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT +# WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF +# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU +# GENERAL PUBLIC LICENSE FOR MORE DETAILS. +# +# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE +# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER, +# 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE. +# ====================================================================== + +def pre_gmsh_ops(self,UNITE_MAILLAGE,UNITE_GMSH,MODI_QUAD,**args): + """ + Ecriture de la macro PRE_GMSH + """ + import os + from Macro.ajout_quad_gmsh import ajout_quad_gmsh + ier=0 + + PRE_GMSH_LECT =self.get_cmd('PRE_GMSH_LECT') + + # La macro compte pour 1 dans la numerotation des commandes + self.icmd=1 + + if MODI_QUAD=='OUI': + cur_dir=os.getcwd() + unit = str(UNITE_GMSH) + nomFichierGmsh = cur_dir+'/fort.'+unit + nomFichierMail = cur_dir+'/sortie' + +# récupération du fichier .msh complet mis dans la string 'texte' + + fproc=open(nomFichierGmsh,'r') + texte=fproc.read() + fproc.close() + + resu=ajout_quad_gmsh(texte) + if not resu: + ier=ier+1 + self.cr.fatal("Erreur dans la methode python de transformation mailles lineaires-quadratiques") + return ier + + fsort=open(nomFichierMail,'w') + fsort.write(resu) + fsort.close() + os.system('cp '+nomFichierMail+' '+nomFichierGmsh) + + PRE_GMSH_LECT(UNITE_MAILLAGE = UNITE_MAILLAGE, + UNITE_GMSH = UNITE_GMSH ) + + return ier +