import log
import optparse
-from load import getJDC
+from load import getJDC
from mocles import parseKeywords
-import removemocle
-import renamemocle
-import movemocle
-import inseremocle
+from removemocle import *
+from renamemocle import *
+from renamemocle import *
+from inseremocle import *
+from changeValeur import *
+from movemocle import *
import calcG
atraiter=("IMPR_GENE","CALC_FONCTION", "DEFI_MATERIAU","STAT_NON_LINE",
"CALC_G_LOCAL_T","CALC_G_THETA_T","CALC_G","AFFE_CHAR_MECA",
"AFFE_CHAR_THER_F","IMPR_CO","DEFI_SQUELETTE","DEFI_FONCTION",
+ "CALC_THETA","AFFE_MODELE","DYNA_NON_LINE",
)
#atraiter=("CALC_FONCTION","IMPR_GENE","STAT_NON_LINE","DEFI_MATERIAU",
#Parse les mocles des commandes
parseKeywords(root)
- #removemocle.removeMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","TOUT")
- #removemocle.removeMotCle(jdc,"STAT_NONLINE","SOLVEUR")
- #renamemocle.renameMotCleInFact(jdc,"AFFE_MODELE","AFFE","PHENOMENE","TOTO")
- #renamemocle.renameMotCleInFact(jdc,"AFFE_MODELE","AFFE","MODELISATION","TITI")
- #renamemocle.renameMotCleInFact(jdc,"DEFI_GROUP","CREA_GROUP_NO","GROUP_MA","TUTU")
- #removemocle.removeMotCle(jdc,"LIRE_MAILLAGE","INFO")
- #removemocle.removeMotCle(jdc,"LIRE_MAILLAGE","UNITE")
- #renamemocle.renameMotCle(jdc,"DEFI_MATERIAU","ELAS","ELASTIC")
- #renamemocle.renameMotCle(jdc,"AFFE_MATERIAU","MAILLAGE","MAILL")
- #removemocle.removeMotCleInFact(jdc,"STAT_NONLINE","SOLV","METHOD")
- #removemocle.removeMotCle(jdc,"STAT_NONLINE","AFFE")
- #renamemocle.renameCommande(jdc,"AFFE_CHAR_MECA","AFFE_CHAR_MECA_PN")
- #renamemocle.renameCommande(jdc,"DEBUT","DEBUT_PN")
+ #removeMotCleInFact(jdc,"AFFE_MATERIAU","AFFE","TOUT")
+ #removeMotCle(jdc,"STAT_NONLINE","SOLVEUR")
+ #renameMotCleInFact(jdc,"AFFE_MODELE","AFFE","PHENOMENE","TOTO")
+ #renameMotCleInFact(jdc,"AFFE_MODELE","AFFE","MODELISATION","TITI")
+ #renameMotCleInFact(jdc,"DEFI_GROUP","CREA_GROUP_NO","GROUP_MA","TUTU")
+ #removeMotCle(jdc,"LIRE_MAILLAGE","INFO")
+ #removeMotCle(jdc,"LIRE_MAILLAGE","UNITE")
+ #renameMotCle(jdc,"DEFI_MATERIAU","ELAS","ELASTIC")
+ #renameMotCle(jdc,"AFFE_MATERIAU","MAILLAGE","MAILL")
+ #removeMotCleInFact(jdc,"STAT_NONLINE","SOLV","METHOD")
+ #removeMotCle(jdc,"STAT_NONLINE","AFFE")
+ #renameCommande(jdc,"AFFE_CHAR_MECA","AFFE_CHAR_MECA_PN")
+ #renameCommande(jdc,"DEBUT","DEBUT_PN")
# A decommenter a partir d ici
# les arguments sont jdc,ancien-nom-de-commande,nouveau-nom-de-commande
- renamemocle.renameCommandeSiRegle(jdc,"CALC_FONCTION","INFO_FONCTION", ((("RMS","MAX","NOCI_SEISME","NORME","ECART-TYPE"),"existeMCFParmi"),))
+ renameCommandeSiRegle(jdc,"CALC_FONCTION","INFO_FONCTION", ((("RMS","MAX","NOCI_SEISME","NORME","ECART-TYPE"),"existeMCFParmi"),))
# Les arguments sont - jdc,
# - nom de la procedure (pas teste avec autre chose)
# - nom du mot clef facteur contenant,
# - nom du mot cle simple
# Attention ne fonctionne pas pour l instant avec +sieurs occurences du mot cle à déplacer
- movemocle.moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","UNITE")
- movemocle.moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","FORMAT")
+ moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","UNITE")
+ moveMotCleFromFactToFather(jdc,"IMPR_GENE","GENE","FORMAT")
# Les arguments sont - jdc
# - nom de l operateur (pas teste avec autre chose)
# - nom du mot cle simple
# - liste de mots clef facteur arrivée possible
# Attention ne fonctionne pas pour l instant avec +sieurs occurences du mot cle à déplacer
- movemocle.moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS"))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS"))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS"))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"STAT_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESI_INTE_RELA",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_MAXI",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","ITER_INTE_PAS",("COMP_INCR","COMP_ELAS"))
+ moveMotCleFromFactToFactMulti(jdc,"DYNA_NON_LINE","CONVERGENCE","RESO_INTE",("COMP_INCR","COMP_ELAS"))
- renamemocle.renameMotCle(jdc,"DEFI_MATERIAU","LEMAITRE","LEMAITRE_IRRA")
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","QSR_K",("LEMAITRE_IRRA",))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","BETA",("LEMAITRE_IRRA",))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","PHI_ZERO",("LEMAITRE_IRRA",))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","L",("LEMAITRE_IRRA",))
- removemocle.removeMotCle(jdc,"DEFI_MATERIAU","FLU_IRRA")
+ renameMotCle(jdc,"DEFI_MATERIAU","LEMAITRE","LEMAITRE_IRRA")
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","QSR_K",("LEMAITRE_IRRA",))
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","BETA",("LEMAITRE_IRRA",))
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","PHI_ZERO",("LEMAITRE_IRRA",))
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","FLU_IRRA","L",("LEMAITRE_IRRA",))
+ removeMotCle(jdc,"DEFI_MATERIAU","FLU_IRRA")
- renamemocle.renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","A","GRAN_A")
- renamemocle.renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","B","GRAN_B")
- renamemocle.renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","S","GRAN_S")
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_A",("LEMAITRE_IRRA",))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_B",("LEMAITRE_IRRA",))
- movemocle.moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_S",("LEMAITRE_IRRA",))
- removemocle.removeMotCle(jdc,"DEFI_MATERIAU","GRAN_IRRA")
+ renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","A","GRAN_A")
+ renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","B","GRAN_B")
+ renameMotCleInFact(jdc,"DEFI_MATERIAU","GRAN_IRRA","S","GRAN_S")
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_A",("LEMAITRE_IRRA",))
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_B",("LEMAITRE_IRRA",))
+ moveMotCleFromFactToFactMulti(jdc,"DEFI_MATERIAU","GRAN_IRRA","GRAN_S",("LEMAITRE_IRRA",))
+ removeMotCle(jdc,"DEFI_MATERIAU","GRAN_IRRA")
- inseremocle.chercheOperInsereFacteur(jdc,"IMPR_CO","CONCEPT")
- movemocle.moveMotClefInOperToFact(jdc,"IMPR_CO","CO","CONCEPT")
- renamemocle.renameMotCleInFact(jdc,"IMPR_CO","CONCEPT","CO","NOM")
+ chercheOperInsereFacteur(jdc,"IMPR_CO","CONCEPT")
+ moveMotClefInOperToFact(jdc,"IMPR_CO","CO","CONCEPT")
+ renameMotCleInFact(jdc,"IMPR_CO","CONCEPT","CO","NOM")
- inseremocle.chercheOperInsereFacteur(jdc,"DEFI_SQUELETTE","CYCLIQUE")
- movemocle.moveMotClefInOperToFact(jdc,"DEFI_SQUELETTE","MODE_CYCL","CYCLIQUE")
+ chercheOperInsereFacteur(jdc,"DEFI_SQUELETTE","CYCLIQUE")
+ moveMotClefInOperToFact(jdc,"DEFI_SQUELETTE","MODE_CYCL","CYCLIQUE")
- removemocle.removeMotCle(jdc,"AFFE_CHAR_MECA","VERI_DDL")
- removemocle.removeMotCle(jdc,"AFFE_CHAR_THER_F","VERI_DDL")
- renamemocle.renameOper(jdc,"CALC_G_LOCAL_T","CALC_G")
- renamemocle.renameOper(jdc,"CALC_G_THETA_T","CALC_G")
+ removeMotCle(jdc,"AFFE_CHAR_MECA","VERI_DDL")
+ removeMotCle(jdc,"AFFE_CHAR_THER_F","VERI_DDL")
+
+ dlocal={"CALC_G_LGLO":"G_LAGR", "G_BILINEAIRE":"G_BILI", "CALC_G_MAX":"G_MAX"}
+ ChangementValeur(jdc,"CALC_G_LOCAL_T","OPTION",dlocal)
+
+ dtheta={"CALC_G_LAGR":"G_LAGR_GLOB", "G_BILINEAIRE":"G_BILI_GLOB", "CALC_G_MAX":"G_MAX_GLOB","CALC_G":"CALC_G_GLOB"}
+ # Attention si le defaut doit generer un avertissement Il faut le mettre comme dernier mot de la liste
+ lavertit=("CALC_G_LAGR","CALC_G","defaut")
+ ChangementValeurAvecAvertissement(jdc,"CALC_G_THETA_T","OPTION",dtheta,lavertit)
+ renameOper(jdc,"CALC_G_LOCAL_T","CALC_G")
+ renameOper(jdc,"CALC_G_THETA_T","CALC_G")
# Attention cela necessite un traitement particulier et ne peut pas
calcG.traitementRayon(jdc)
- renamemocle.renameMotCle(jdc,"CALC_G","THETA","THETA_OLD")
- inseremocle.chercheOperInsereFacteur(jdc,"CALC_G","THETA")
- movemocle.moveMotClefInOperToFact(jdc,"CALC_G","THETA_OLD","THETA")
- renamemocle.renameMotCleInFact(jdc,"CALC_G","THETA","THETA_OLD","THETA")
+ renameMotCle(jdc,"CALC_G","THETA","THETA_OLD")
+ chercheOperInsereFacteur(jdc,"CALC_G","THETA")
+ moveMotClefInOperToFact(jdc,"CALC_G","THETA_OLD","THETA")
+ renameMotCleInFact(jdc,"CALC_G","THETA","THETA_OLD","THETA")
- movemocle.moveMotClefInOperToFact(jdc,"CALC_G","FOND_FISS","THETA")
- movemocle.moveMotClefInOperToFact(jdc,"CALC_G","R_INF_FO","THETA")
- movemocle.moveMotClefInOperToFact(jdc,"CALC_G","R_SUP_FO","THETA")
- inseremocle.chercheOperInsereFacteurSiRegle(jdc,"CALC_G","LISSAGE",((("DEGRE",),"existe"),))
- movemocle.moveMotClefInOperToFact(jdc,"CALC_G","DEGRE","LISSAGE")
+ moveMotClefInOperToFact(jdc,"CALC_G","FOND_FISS","THETA")
+ moveMotClefInOperToFact(jdc,"CALC_G","R_INF_FO","THETA")
+ moveMotClefInOperToFact(jdc,"CALC_G","R_SUP_FO","THETA")
+ chercheOperInsereFacteurSiRegle(jdc,"CALC_G","LISSAGE",((("DEGRE",),"existe"),))
+ moveMotClefInOperToFact(jdc,"CALC_G","DEGRE","LISSAGE")
f=open(outfile,'w')
f.write(jdc.getSource())
f.close()
+
def main():
parser = optparse.OptionParser(usage=usage)