From: Pascale Noyret Date: Tue, 16 Nov 2010 08:44:17 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V2_1_1_beta~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=75dbf8c02ecee5daa593dddc48a33d162fe7afff;p=modules%2Feficas.git *** empty log message *** --- diff --git a/Accas/A_MCSIMP.py b/Accas/A_MCSIMP.py index 68943b98..5588614b 100644 --- a/Accas/A_MCSIMP.py +++ b/Accas/A_MCSIMP.py @@ -26,3 +26,4 @@ class MCSIMP(I_MCSIMP.MCSIMP,N_MCSIMP.MCSIMP,V_MCSIMP.MCSIMP): def __init__(self,val,definition,nom,parent): N_MCSIMP.MCSIMP.__init__(self,val,definition,nom,parent) V_MCSIMP.MCSIMP.__init__(self) + I_MCSIMP.MCSIMP.__init__(self) diff --git a/Editeur/autre_analyse_cata.py b/Editeur/autre_analyse_cata.py index a41004e0..69ac1888 100644 --- a/Editeur/autre_analyse_cata.py +++ b/Editeur/autre_analyse_cata.py @@ -63,11 +63,13 @@ def traite_entite(entite,liste_simp_reel): def traite_cache(objet): if not hasattr(objet, "cache"): return if objet.cache == 0 :return + clef=objet.nom + if objet.equiv != None : clef=objet.equiv if hasattr(objet.pere,"mcOblig"): - objet.pere.mcOblig[objet.equiv]=objet.defaut + objet.pere.mcOblig[clef]=objet.defaut else : objet.pere.mcOblig={} - objet.pere.mcOblig[objet.equiv]=objet.defaut + objet.pere.mcOblig[clef]=objet.defaut def traite_reel(objet,liste_simp_reel): if objet.__class__.__name__ == "SIMP": diff --git a/Ihm/I_MCCOMPO.py b/Ihm/I_MCCOMPO.py index f9b03c33..8d76911f 100644 --- a/Ihm/I_MCCOMPO.py +++ b/Ihm/I_MCCOMPO.py @@ -60,6 +60,14 @@ class MCCOMPO(I_OBJECT.OBJECT): for arg in liste: objet_cata = dico[arg] dico=objet_cata.entites + l=[] + specifique=0 + for obj in dico.keys() : + if not(hasattr(dico[obj],'cache')) or dico[obj].cache==0 : + l.append(obj) + else : + specifique=1 + if specifique == 1 : return l return objet_cata.ordre_mc def filtre_liste_mc(self,liste_brute): diff --git a/Ihm/I_MCSIMP.py b/Ihm/I_MCSIMP.py index 3c4052a3..7e19c4f6 100644 --- a/Ihm/I_MCSIMP.py +++ b/Ihm/I_MCSIMP.py @@ -53,6 +53,9 @@ from I_VALIDATOR import ValError,listProto class MCSIMP(I_OBJECT.OBJECT): + def __init__(self) : + pass + def isvalid(self,cr='non'): if self.state == 'unchanged': return self.valid diff --git a/InterfaceQT4/configuration.py b/InterfaceQT4/configuration.py index f3fa8096..2c917818 100644 --- a/InterfaceQT4/configuration.py +++ b/InterfaceQT4/configuration.py @@ -72,6 +72,8 @@ class CONFIG_BASE: #Lecture des fichiers utilisateurs self.lecture_fichier_ini_standard() + if hasattr(self,'make_ssCode'): + self.make_ssCode(self.ssCode) self.lecture_fichier_ini_utilisateur() self.lecture_catalogues() @@ -90,15 +92,13 @@ class CONFIG_BASE: setattr(self,k,valeur) except : pass - if hasattr(self,'map_path') : - oldPath=self.map_path - #-------------------------------------- def lecture_fichier_ini_utilisateur(self): #-------------------------------------- # Surcharge les paramètres standards par les paramètres utilisateur s'ils existent self.fic_ini_utilisateur = os.path.join(self.rep_user,self.prefsUser) + print self.fic_ini_utilisateur if not os.path.isfile(self.fic_ini_utilisateur): return txt = utils.read_file(self.fic_ini_utilisateur) diff --git a/InterfaceQT4/editor.py b/InterfaceQT4/editor.py index 4605279b..4279d400 100644 --- a/InterfaceQT4/editor.py +++ b/InterfaceQT4/editor.py @@ -285,7 +285,7 @@ class JDCEditor(QSplitter): #----------------------------------------------# def _viewText(self, txt, caption = "FILE_VIEWER"): #----------------------------------------------# - w = qtCommun.ViewText( self.QWParent ) + w = qtCommun.ViewText( self.QWParent, editor=self ) w.setWindowTitle( caption ) w.setText(txt) w.show() diff --git a/InterfaceQT4/qtCommun.py b/InterfaceQT4/qtCommun.py index 6f03ed97..41ae6473 100644 --- a/InterfaceQT4/qtCommun.py +++ b/InterfaceQT4/qtCommun.py @@ -345,9 +345,9 @@ class ViewText(Ui_dView,QDialog): """ Classe permettant la visualisation de texte """ - def __init__(self,parent): + def __init__(self,parent,editor=None): QDialog.__init__(self,parent) - self.parent=parent + self.editor=editor self.setupUi(self) self.resize( QSize(600,600).expandedTo(self.minimumSizeHint()) ) @@ -361,10 +361,10 @@ class ViewText(Ui_dView,QDialog): #recuperation du nom du fichier fn = QFileDialog.getSaveFileName(None, self.trUtf8("Save File"), - self.appliEficas.CONFIGURATION.savedir) + self.editor.appliEficas.CONFIGURATION.savedir) if fn.isNull() : return ulfile = os.path.abspath(unicode(fn)) - self.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0] + self.editor.appliEficas.CONFIGURATION.savedir=os.path.split(ulfile)[0] try: f = open(fn, 'wb') f.write(str(self.view.toPlainText())) diff --git a/MAP/configuration_MAP.py b/MAP/configuration_MAP.py index e7bba405..c36432aa 100644 --- a/MAP/configuration_MAP.py +++ b/MAP/configuration_MAP.py @@ -33,7 +33,7 @@ class CONFIG(configuration.CONFIG_BASE): #----------------------------------- def __init__(self,appli,repIni): #----------------------------------- - + self.ssCode=appli.ssCode configuration.CONFIG_BASE.__init__(self,appli,repIni,'.Eficas_MAP') self.INSTALLDIR =os.path.dirname(__file__) @@ -48,7 +48,16 @@ class CONFIG(configuration.CONFIG_BASE): self.cataFile="catalogues_MAP.ini" self.setValeurs() - + + def make_ssCode(self,ssCode): + if ssCode == None : return + try : + name='prefs_'+ssCode + prefs_ssCode=__import__(name) + prefs_ssCode.ajout(self) + except : + pass + def make_config(appli,rep): return CONFIG(appli,rep) diff --git a/MAP/s_polymers_st_1_V1.py b/MAP/s_polymers_st_1_V1.py index d3ce44c6..8f9146ab 100644 --- a/MAP/s_polymers_st_1_V1.py +++ b/MAP/s_polymers_st_1_V1.py @@ -6,6 +6,9 @@ # from Accas import * from prefs_MAP import PATH_MODULE +from prefs_MAP import PATH_STUDY +from prefs_MAP import PATH_PYGMEE + class Tuple: def __init__(self,ntuple): self.ntuple=ntuple @@ -33,17 +36,23 @@ JdC = JDC_CATA ( code = 'MAP', METHODE= PROC(nom="METHODE",op=None, fr='choix de la methode de calcul (maillage ou grille cartesienne)', - CHOIX=SIMP(statut = "o",fr="elements finis sur maillage ou differences finies sur grilles", typ='TXM', defaut="FD+grid", into=("FEM+mesh","FD+grid")), - LANCEMENT=SIMP(statut = "o",fr="lancement de Code_Aster ou de fdvgrid selon le choix", typ='TXM', defaut="oui", into=("oui","non")), -) + CHOIX=SIMP(statut = "o",fr="elements finis sur maillage ou differences finies sur grilles", + typ='TXM', defaut="FD+grid", into=("FEM+mesh","FD+grid")), + LANCEMENT=SIMP(statut = "o",fr="lancement de Code_Aster ou de fdvgrid selon le choix", + typ='TXM', defaut="oui", into=("oui","non")), + ) MATERIAUX= PROC(nom="MATERIAUX",op=None, fr='definition des proprietes du materiau : fuseau, taille du VER, proprietes des phases', - TAILLE=SIMP(statut = "o",fr="taille du VER", typ='R', defaut=50.), - FUSEAU = SIMP ( statut = "o", fr="Fichier représentant le fuseau granulaire",typ = "Fichier", defaut=PATH_MODULE+"/s_poly_st_1/inclusion_size_distribution.txt"), - DISTANCE=SIMP(statut = "o",fr="distance de replusions", typ='R', defaut=0.1), + TAILLE=SIMP(statut = "o",fr="taille du VER", typ='R', defaut=50.,equiv="size"), + FUSEAU = SIMP ( statut = "o", fr="Fichier représentant le fuseau granulaire",typ = "Fichier", defaut=PATH_STUDY+"/inclusion_size_distribution.txt"), + distance=SIMP(statut = "o",fr="distance de replusions", typ='R', defaut=0.1), CONDUCTIVITE_M=SIMP(statut = "o",fr="conductivite de la matrice", typ='R', defaut=1.0 , val_min =0.), CONDUCTIVITE_I=SIMP(statut = "o",fr="conductivite des inclusions", typ='R', defaut=10.0, val_min =0.), + inclusion_name=SIMP(statut = "f",fr="", typ='TXM',defaut=PATH_STUDY+"/pygmee_v2_test_1.inclusions",cache=1), + rve_name=SIMP(statut = "f",fr="", typ='TXM',defaut=PATH_STUDY+"/pygmee_v2_test_1.rvz",cache=1), + sieve_in=SIMP(statut = "f",fr="", typ='TXM',defaut=PATH_PYGMEE+"/tests/pygmee_v2_test_1.sieve_in",cache=1), + sieve_out=SIMP(statut = "f",fr="", typ='TXM',defaut=PATH_STUDY+"pygmee_v2.sieve_out",cache=1), ) DISCRETISATION= PROC(nom="DISCRETISATION",op=None, diff --git a/Noyau/N_SIMP.py b/Noyau/N_SIMP.py index bba73d60..6125a1ce 100644 --- a/Noyau/N_SIMP.py +++ b/Noyau/N_SIMP.py @@ -49,7 +49,8 @@ class SIMP(N_ENTITE.ENTITE): def __init__(self,typ,fr="",ang="",statut='f',into=None,defaut=None, min=1,max=1,homo=1,position ='local', - val_min = '**',val_max='**',docu="",validators=None): + val_min = '**',val_max='**',docu="",validators=None, + equiv=None,cache=0): """ Un mot-clé simple est caractérisé par les attributs suivants : @@ -57,27 +58,16 @@ class SIMP(N_ENTITE.ENTITE): - type : cet attribut est obligatoire et indique le type de valeur attendue - fr : - - ang : - - statut : - - into : - - defaut : - - min - - max - - homo - - position - - val_min - - val_max - - docu """ N_ENTITE.ENTITE.__init__(self,validators) @@ -98,6 +88,8 @@ class SIMP(N_ENTITE.ENTITE): self.val_min=val_min self.val_max=val_max self.docu = docu + self.equiv=equiv + self.cache=cache def verif_cata(self): """ diff --git a/generator/generator_map.py b/generator/generator_map.py index 9835fe77..94707549 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -27,12 +27,17 @@ import traceback import types,string,re,os from generator_python import PythonGenerator +try : + sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'classes/python/')) + from class_MAP_parameters import * +except : + pass + def entryPoint(): """ Retourne les informations necessaires pour le chargeur de plugins - Ces informations sont retournees dans un dictionnaire """ return { @@ -121,25 +126,30 @@ class MapGenerator(PythonGenerator): self.texteExecution=self.texteExecution+texteCode def generPROC_ETAPE(self,obj): - clefDico=obj.nom self.DictTemp={} s=PythonGenerator.generPROC_ETAPE(self,obj) dico={} dico[obj.nom]=self.DictTemp self.listeCODE.append(dico) + if hasattr(obj.definition,"mcOblig") : + for clef in obj.definition.mcOblig.keys(): + setattr(self,clef,obj.definition.mcOblig[clef]) return s def generMCSIMP(self,obj) : """ Convertit un objet MCSIMP en texte python - Remplit le dictionnaire des MCSIMP si nous ne sommes ni dans une loi, ni dans une variable """ s=PythonGenerator.generMCSIMP(self,obj) clef="" for i in obj.get_genealogie() : clef=clef+"_"+i self.DictTemp[clef]=obj.valeur + if hasattr(obj.definition,'equiv') and obj.definition.equiv!= None: + setattr(self,obj.definition.equiv,obj.valeur) + else : + setattr(self,obj.nom,obj.valeur) return s @@ -150,6 +160,7 @@ class MapGenerator(PythonGenerator): chaine=result return chaine + def remplaceDICO(self,chaine,dico) : for mot in dico.keys() : rplact="%"+mot+"%" diff --git a/generator/generator_s_polymers_st_1.py b/generator/generator_s_polymers_st_1.py index 7017ec20..4ad61836 100644 --- a/generator/generator_s_polymers_st_1.py +++ b/generator/generator_s_polymers_st_1.py @@ -35,37 +35,8 @@ try : except : pass #____________________________________________________________________________________ -# PYGMEEDict contient une equivalence entre le catalogue Map et les lignes generees -# comme entete (commentaire ?) dans le fichier d'input de pygmee # - CONFIGliste=('NAME_SCHEME', 'PATH_ASTER', 'PATH_BENHUR', 'PATH_MODULE', 'PATH_PYGMEE', 'PATH_STUDY', 'repIni') -PYGMEEDict={ - "_PYGMEE_FUSEAU1_b_forme_FICHIER" : "#fuseau 1 (entree de lecfus) format : diametre DCE croissant / fraction cumulee decroisant ", - "FUSEAU2" : "#fuseau 2 (entree de lecfus) format : diametre DCE croissant / fraction cumulee decroisant", - "_PYGMEE_TAILLE" : "# taille du VER en microns ", - "_PYGMEE_DISTANCE" : "# distance de repulsion :", - } - -#_______________________________________________________________________________________________________ -# listeOrdonneeMCPygmee contient une liste (donc ordonnee) des mots clefs pour -# imposer l'ordre des lignes generees -listeOrdonneeMCPygmee =('_PYGMEE_FUSEAU1_b_forme_FICHIER', 'FUSEAU2', '_PYGMEE_TAILLE','_PYGMEE_DISTANCE') - - -BENHURDict={ - "_BENHUR_FINESSE" : "discretisation des arretes du VER ", - } - -ASTERDict={ - "_ASTER_LANCEMENT" : "execution de Code_Aster", - "_ASTER_CONDUCTIVITE_I" : "conductivite des inclusions", - "_ASTER_CONDUCTIVITE_M" : "conductivite de la matrice", - } - -GMSHDict={ - "_GMSH_LANCEMENT" : "execution de GMSH", - } def entryPoint(): """ @@ -131,144 +102,134 @@ class s_poly_st_1Generator(MapGenerator): else: return "" - def METHODE(self,execution) : - self.config.PATH_STUDY=self.config.PATH_MAP+"/studies/demonstrateur_s_polymers_st_1" - print "self.config.PATH_STUDY has been forced to :", self.config.PATH_STUDY - self.dicoMETHODE=self.dictMCVal["METHODE"] - print "_____________________" - print self.dicoMETHODE - result=self.dicoMETHODE['_METHODE_LANCEMENT'] - print '_METHODE_LANCEMENT =', result - if (result=='oui') : - composant="pygmee_v2" - self.size=float(self.dicoMATERIAUX['_MATERIAUX_TAILLE']) - self.sieve_in=self.config.PATH_PYGMEE+"/tests/pygmee_v2_test_1.sieve_in" - self.sieve_out=self.config.PATH_STUDY+"/pygmee_v2.sieve_out" - self.distance=self.dicoMATERIAUX['_MATERIAUX_DISTANCE'] - self.inclusion_name=self.config.PATH_STUDY+"/pygmee_v2_test_1.inclusions" - self.rve_name=self.config.PATH_STUDY+"/pygmee_v2_test_1.rve" - pygmee_v2_input=self.config.PATH_STUDY+"/pygmee_v2.input" - print "pygmee_v2_input =", pygmee_v2_input - parameter=MAP_parameters() - parameter.add_component(composant) - parameter.add_parameter(composant, 'rve_size', self.size) - parameter.add_parameter(composant, 'phase_number', 1) - parameter.add_parameter(composant, 'sieve_curve_in', self.sieve_in) - parameter.add_parameter(composant, 'sieve_curve_out', self.sieve_out) - parameter.add_parameter(composant, 'repulsion_distance', self.distance) - parameter.add_parameter(composant, 'study_name', "study") - parameter.add_parameter(composant, 'file_result_inclusions', self.inclusion_name) - parameter.add_parameter(composant, 'file_result_rve', self.rve_name) - commande_python=parameter.write_for_shell(pygmee_v2_input) - commande="echo 'parametres de PYGMEE v2';\n" + def PYGMEE(self) : + composant="pygmee_v2" + pygmee_v2_input=self.config.PATH_STUDY+"/pygmee_v2.input" + parameter=MAP_parameters() + parameter.add_component(composant) + parameter.add_parameter(composant, 'rve_size', self.size) + parameter.add_parameter(composant, 'phase_number', 1) + parameter.add_parameter(composant, 'sieve_curve_in', self.sieve_in) + parameter.add_parameter(composant, 'sieve_curve_out', self.sieve_out) + parameter.add_parameter(composant, 'repulsion_distance', self.distance) + parameter.add_parameter(composant, 'study_name', "study") + parameter.add_parameter(composant, 'file_result_inclusions', self.inclusion_name) + parameter.add_parameter(composant, 'file_result_rve', self.rve_name) + commande_python=parameter.write_for_shell(pygmee_v2_input) + + commande="echo 'parametres de PYGMEE v2';\n" + commande+= commande_python + commande+= "echo 'execution de PYGMEE v2';\n" + commande+= "cd "+self.config.PATH_PYGMEE+"/src;\n" + commande+= "python pygmee_v2.py -i "+pygmee_v2_input+";\n" + commande+= "echo 'fin execution de PYGMEE v2';\n" + return commande - commande+= commande_python - - commande+= "echo 'execution de PYGMEE v2';\n" - commande+= "cd "+self.config.PATH_PYGMEE+"/src;\n" - commande+= "python pygmee_v2.py -i "+pygmee_v2_input+";\n" - commande+= "echo 'fin execution de PYGMEE v2';\n" - self.contrast=float(self.dicoMATERIAUX['_MATERIAUX_CONDUCTIVITE_I']/self.dicoMATERIAUX['_MATERIAUX_CONDUCTIVITE_M']) - choix=self.dicoMETHODE['_METHODE_CHOIX'] + def FDVGRID(self): + if ( self.FINESSE < 32): self.FINESSE=32 + self.contrast=float(self.CONDUCTIVITE_I/self.CONDUCTIVITE_M) + commande= "echo 'execution de FDVGRID';\n" + commande+= "cd "+self.config.PATH_FDVGRID+";\n" + commande+= "echo "+ str(self.size)+" > "+"rve.input"+";\n" + commande+= "cp " +str(self.config.PATH_STUDY+"/pygmee_v2_test_1.inclusions")+" "+"inclusions.input"+";\n" + commande+= "echo "+str(self.contrast)+" > "+"contrast.input"+";\n" + commande+= "./fdvgrid 3D 1.0 0.0 0.0 v t "+str(self.FINESSE)+" cross 1e-6 "+";\n" + commande+= "echo 'fin execution de FDVGRID';\n" + print "commande issue du generator :", commande + return commande - finesse=int(self.dicoDISCRETISATION['_DISCRETISATION_FINESSE']) + def METHODE(self,execution) : + #if (self.LANCEMENT =='oui') : + # if (self.LANCEMENT =='non' : return "" - if (choix=="FD+grid") : - commande+= "echo 'execution de FDVGRID';\n" - commande+= "cd "+self.config.PATH_FDVGRID+";\n" - if (finesse<32): - finesse=32 - commande+= "echo "+str(self.size)+" > "+"rve.input"+";\n" - commande+= "cp "+str(self.config.PATH_STUDY+"/pygmee_v2_test_1.inclusions")+" "+"inclusions.input"+";\n" - commande+= "echo "+str(self.contrast)+" > "+"contrast.input"+";\n" - commande+= "./fdvgrid 3D 1.0 0.0 0.0 v t "+str(finesse)+" cross 1e-6 "+";\n" - commande+= "echo 'fin execution de FDVGRID';\n" - print "commande issue du generator :", commande + commande=self.PYGMEE() + if (self.CHOIX=="FD+grid") : commande+= self.FDVGRID() + return commande - if (choix=="FEM+mesh") : - print "option Code_Aster" - commande+= "echo 'execution de BENHUR';\n" + #if (choix=="FEM+mesh") : + # print "option Code_Aster" + # commande+= "echo 'execution de BENHUR';\n" #Lecture du fichier a trous - print "name_SCHEME =", self.config.NAME_SCHEME - monFichierInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/benhur_template.txt" - monFichierOutput=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+str(finesse)+".bhr" + # print "name_SCHEME =", self.config.NAME_SCHEME + # monFichierInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/benhur_template.txt" + # monFichierOutput=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+str(finesse)+".bhr" - f = file(monFichierInput) - string_0 = f.read() - f.close() + # f = file(monFichierInput) + # string_0 = f.read() + # f.close() # find and replace with CONFIG idctionnary - string_1=self.remplaceCONFIG(string_0,CONFIGliste) - dicoBenhur=dict() - dicoBenhur["_RVE_SIZE"]=self.size - dicoBenhur["_MESH_SIZE"]=finesse - dicoBenhur["_INCLUSION_FILE"]=self.inclusion_name - # find and replace with BENHUR idctionnary - string_2=self.remplaceDICO(string_1,dicoBenhur) + # string_1=self.remplaceCONFIG(string_0,CONFIGliste) + # dicoBenhur=dict() + # dicoBenhur["_RVE_SIZE"]=self.size + # dicoBenhur["_MESH_SIZE"]=finesse + # dicoBenhur["_INCLUSION_FILE"]=self.inclusion_name + # find and replace with BENHUR dictionnary + # string_2=self.remplaceDICO(string_1,dicoBenhur) # write into ouput file - f=open(monFichierOutput,'wb') - f.write(string_2) - f.close() + # f=open(monFichierOutput,'wb') + # f.write(string_2) + # f.close() # launch of BENHUR on the previous file - commande=commande + "cd "+self.config.PATH_BENHUR+"/bin;\n" - commande=commande + "./benhur -i "+monFichierOutput+";\n" - commande=commande + "echo 'fin execution de BENHUR';\n" + # commande=commande + "cd "+self.config.PATH_BENHUR+"/bin;\n" + # commande=commande + "./benhur -i "+monFichierOutput+";\n" + # commande=commande + "echo 'fin execution de BENHUR';\n" - commande+= "echo 'execution de CODE_ASTER';\n" - monFichierCommInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.comm" - monFichierExportInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.export" - - monFichierCommOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.comm" - monFichierExportOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.export" - # Lecture du fichier a trous a pour le fichier export - f = file(monFichierExportInput) - string_0 = f.read() - f.close() + # commande+= "echo 'execution de CODE_ASTER';\n" + # monFichierCommInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.comm" + # monFichierExportInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.export" + + # monFichierCommOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.comm" + # monFichierExportOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.export" + # # Lecture du fichier a trous a pour le fichier export + # f = file(monFichierExportInput) + # string_0 = f.read() + # f.close() # find and replace with CONFIG dictionnary - string_1=self.remplaceCONFIG(string_0,CONFIGliste) + # string_1=self.remplaceCONFIG(string_0,CONFIGliste) # find and replace with CODE_ASTER dictionnary - dicoAster=dict() - dicoAster["_MESH_SIZE"]=finesse - dicoAster["_ASTER_VERSION"]="STA10" - dicoAster["_NAME_STUDY"]="s_polymers_st_1" - string_2=self.remplaceDICO(string_1,dicoAster) + # dicoAster=dict() + # dicoAster["_MESH_SIZE"]=finesse + # dicoAster["_ASTER_VERSION"]="STA10" + # dicoAster["_NAME_STUDY"]="s_polymers_st_1" + # string_2=self.remplaceDICO(string_1,dicoAster) # write into output file - f=open(monFichierExportOutput,'wb') - f.write(string_2) - f.close() + # f=open(monFichierExportOutput,'wb') + # f.write(string_2) + # f.close() # Lecture du fichier a trous a pour le fichier comm - f = file(monFichierCommInput) - string_0 = f.read() - f.close() - # find and replace with CONFIG dictionnary - string_1=self.remplaceCONFIG(string_0,CONFIGliste) + # f = file(monFichierCommInput) + # string_0 = f.read() + # f.close() + # # find and replace with CONFIG dictionnary + # string_1=self.remplaceCONFIG(string_0,CONFIGliste) # find and replace with CODE_ASTER dictionnary - dicoAster=dict() - dicoAster["_RVE_SIZE"]=self.size - dicoAster["_CONDUCTIVITE_I"]=self.dicoMATERIAUX["_MATERIAUX_CONDUCTIVITE_I"] - dicoAster["_CONDUCTIVITE_M"]=self.dicoMATERIAUX["_MATERIAUX_CONDUCTIVITE_M"] - string_2=self.remplaceDICO(string_1,dicoAster) - # write into output file - f=open(monFichierCommOutput,'wb') - f.write(string_2) - f.close() + # dicoAster=dict() + # dicoAster["_RVE_SIZE"]=self.size + # dicoAster["_CONDUCTIVITE_I"]=self.dicoMATERIAUX["_MATERIAUX_CONDUCTIVITE_I"] + # dicoAster["_CONDUCTIVITE_M"]=self.dicoMATERIAUX["_MATERIAUX_CONDUCTIVITE_M"] + # string_2=self.remplaceDICO(string_1,dicoAster) + # # write into output file + # f=open(monFichierCommOutput,'wb') + # f.write(string_2) + # f.close() # launch of CODE_ASTER on the study - commande=commande + "cd "+self.config.PATH_STUDY+";" - commande=commande + self.config.PATH_ASTER + "/as_run "+monFichierExportOutput +";\n" - commande=commande + "echo 'fin execution de CODE_ASTER';\n" + # commande=commande + "cd "+self.config.PATH_STUDY+";" + # commande=commande + self.config.PATH_ASTER + "/as_run "+monFichierExportOutput +";\n" + # commande=commande + "echo 'fin execution de CODE_ASTER';\n" - commande+= "echo 'execution de GMSH';\n" - commande+= "gmsh "+self.config.PATH_STUDY+"/s_polymers_st_1_aster.resu.msh;\n" - commande+= "echo 'fin execution de GMSH';\n" - - print commande + # commande+= "echo 'execution de GMSH';\n" + # commande+= "gmsh "+self.config.PATH_STUDY+"/s_polymers_st_1_aster.resu.msh;\n" + # commande+= "echo 'fin execution de GMSH';\n" + # + # print commande - print "METHODE Ok - 20101105" - print "_____________________\n" - return commande + #print "METHODE Ok - 20101105" + #print "_____________________\n" + #return commande def MATERIAUX(self,execution) : self.dicoMATERIAUX=self.dictMCVal["MATERIAUX"] diff --git a/generator/monCreateYacs.py b/generator/monCreateYacs.py index 2d495d7f..3773de24 100755 --- a/generator/monCreateYacs.py +++ b/generator/monCreateYacs.py @@ -44,7 +44,7 @@ class CreeSchemaYacs : def write_yacs_proc(self,proc, yacs_schema_filename): proc.saveSchema(yacs_schema_filename) -class s_poly_st_1(CreeSchemaYacs) : +class s_polymers_st_1(CreeSchemaYacs) : def BENHURYACS(self,proc,dico): monFichierInput=self.config.PATH_BENHUR+"/BHR_files.txt" @@ -83,6 +83,14 @@ class s_poly_st_1(CreeSchemaYacs) : proc.edAddCFLink(self.nodeAvant,self.asterNode) self.nodeAvant=self.asterNode + def FDVGRIDYACS(self,proc,dico): + print "iiiii" + + def METHODEYACS(self,proc,dico) + self.PYGMEEYACS(proc,dico) + if (self.CHOIX=="FD+grid") : self.FDVGRIDYACS(proc,dico) + + dictKlass={'s_poly_st_1':s_poly_st_1} def getSchema(config): schema=config.appli.ssCode