]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
PN
authorPascale Noyret <pascale.noyret@edf.fr>
Thu, 21 Dec 2006 13:15:09 +0000 (13:15 +0000)
committerPascale Noyret <pascale.noyret@edf.fr>
Thu, 21 Dec 2006 13:15:09 +0000 (13:15 +0000)
Traducteur/dictErreurs.py
Traducteur/inseremocle.py
Traducteur/log.py
Traducteur/traduitV7V8.py

index 46e37dd884af3fd5c19fe33d4a8ae4a24a26f109..67664e13852ceca862e3541159aebd6e72a94b7f 100644 (file)
@@ -27,6 +27,7 @@ dict_erreurs={
               "DEFI_MATERIAU_COMP_THM_LIQU_SATU_GAT" : "le materiau LIQU_SATU_GAT a ete supprime",
               "DEFI_MATERIAU_COMP_THM_LIQU_NSAT_GAT" : "le materiau LIQU_NSAT_GAT a ete supprime",
               "DEFI_MATERIAU_GLRC" : "le materiau GLRC a ete remplace par GLRC_DAMAGE",
+              "DEFI_MATERIAU_GLRC_FO" : "le materiau GLRC_FO a ete remplace par GLRC_DAMAGE",
               "DEFI_MATERIAU_OHNO" : "le materiau OHNO a ete remplace par TAHERI",
               "DEFI_MATERIAU_OHNO_FO" : "le materiau OHNO a ete remplace par TAHERI",
               "CALC_CHAM_ELEM":"reecrire la partie SOUR_ELGA_ELEC",
index ff8a33575e29a429733cb734ea8a3d959ff543b9..f8307f5e1ed910dc37be11a40195644ad85f097f 100644 (file)
@@ -58,7 +58,11 @@ def insereMotCleDansFacteur(jdc,facteur,texte):
     indice = -1
     while texte[indice] == " " : 
        indice = indice -1
-    if texte[indice] != "," : texte=texte+","
+    if texte[indice] != "," : 
+       texte=texte+","
+    if (texte.find("#") > -1) and (texte.find("#") < texte.find(",")) :
+          texte=texte+"\n,"
+          
     texteinfo=texte
     texte=texte+"\n"
   
index 3e440867a7a3bf6255b564b1666eb934942078cf..3c43d51a8d019a3ea16044e705d4a6112fa512fe 100644 (file)
@@ -3,8 +3,9 @@
 import logging
 logger=logging.getLogger()
 
-def initialise() :
-    hdlr=logging.FileHandler('/tmp/convert.log','w')
+def initialise(flog=None):
+    flog = flog or '/tmp/convert.log'
+    hdlr=logging.FileHandler(flog,'w')
     formatter = logging.Formatter('%(levelname)s: %(message)s')
     hdlr.setFormatter(formatter)
     logger.addHandler(hdlr) 
index e74f31a19e0ef0cd89f5780def3d223c8013dff0..a64079c5491cdeb240e3e946b0dc0b2b8268a237 100644 (file)
@@ -20,7 +20,6 @@ from changeValeur import *
 from movemocle    import *
 from dictErreurs  import GenereErreurPourCommande
 
-# Demander a emmanuel pour affe_char_ther et test_resu
 import calcG
 
 atraiter=( "IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE",
@@ -34,16 +33,16 @@ atraiter=( "IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE",
           "POST_SIMPLIFIE","AFFE_MATERIAU","DEFI_MAILLAGE","DEPL_INTERNE",
           "POST_DYNA_ALEA","RECU_FONCTION","DYNA_TRAN_MODAL","DEFI_INTERF_DYNA",
           "CALC_PRECONT","DEFI_TEXTURE","TEST_RESU","COMB_CHAM_NO","COMB_CHAM_ELEM",
-          "CALC_FATIGUE","IMPR_OAR",
+          "CALC_FATIGUE","IMPR_OAR", "AFFE_CHAR_MECA_F",
            "MACR_ASCOUF_CALC","MACR_ASPIC_CALC","MACR_CABRI_CALC",
            "MACR_ADAP_MAIL","IMPR_FICO_HOMARD"
         )
 
 #atraiter=( "MACR_ADAP_MAIL",)
 
-def traduc(infile,outfile):
+def traduc(infile,outfile,flog=None):
 
-    hdlr=log.initialise()
+    hdlr=log.initialise(flog)
     jdc=getJDC(infile,atraiter)
     root=jdc.root
 
@@ -111,6 +110,7 @@ def traduc(infile,outfile):
     renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO","TAHERI")
     renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","OHNO_FO","TAHERI_FO")
     renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC","GLRC_DAMAGE")
+    renameMotCleAvecErreur(jdc,"DEFI_MATERIAU","GLRC_FO","GLRC_DAMAGE")
 
     renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","A","GRAN_A")
     renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","B","GRAN_B")
@@ -158,11 +158,17 @@ def traduc(infile,outfile):
     ####################### traitement AFFE_CHAR_MECA (CONTACT)   #######################
     renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","COEF_MULT_ESCL","COEF_MULT")
     renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NOM_CHAM","NOM_CMP")
-    renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","NOM_CHAM","NOM_CMP")
-    renameMotCleInFact(jdc,"AFFE_CHAR_MECA","CONTACT","GROUP_MA_ESCL","GROUP_MA")
+    renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),))
     renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),))
     removeMotCleInFact(jdc,"AFFE_CHAR_MECA","LIAISON_UNILATER","APPARIEMENT")
 
+    ####################### traitement AFFE_CHAR_MECA_F (CONTACT)   #######################
+    renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","COEF_MULT_ESCL","COEF_MULT")
+    renameMotCleInFact(jdc,"AFFE_CHAR_MECA_F","CONTACT","NOM_CHAM","NOM_CMP")
+    renameMotCleInFactSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","GROUP_MA_ESCL","GROUP_MA",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),))
+    renameMotCleSiRegle(jdc,"AFFE_CHAR_MECA_F","CONTACT","LIAISON_UNILATER",((("CONTACT","NOM_CMP"),"existeMCsousMCF"),))
+    removeMotCleInFact(jdc,"AFFE_CHAR_MECA_F","LIAISON_UNILATER","APPARIEMENT")
+
     ####################### traitement CALC_G   #######################
     chercheOperInsereFacteurSiRegle(jdc,"CALC_G_LOCAL_T","LISSAGE",((("LISSAGE_G","LISSAGE_THETA","DEGRE"),"existeMCFParmi"),))
     moveMotClefInOperToFact(jdc,"CALC_G_LOCAL_T","LISSAGE_THETA","LISSAGE")