From: Pascale Noyret Date: Thu, 15 Apr 2010 08:44:50 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: V2_0~117 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b253fe346f65f2cea8861e57c92e40bd3c94bcce;p=tools%2Feficas.git *** empty log message *** --- diff --git a/Map/configuration_Map.py b/Map/configuration_Map.py index ff86ca91..b18b082f 100644 --- a/Map/configuration_Map.py +++ b/Map/configuration_Map.py @@ -50,6 +50,7 @@ class CONFIG: self.code = appli.code self.salome = appli.salome self.repIni = repIni + self.REPINI = repIni if self.appli: self.parent=appli.top @@ -65,8 +66,8 @@ class CONFIG: self.savedir = self.rep_user self.exec_acrobat = self.rep_user - self.labels_user=('exec_acrobat', 'catalogues','savedir','path_doc','map_path','PATH_PYGMEE','PATH_BENHUR') - self.labels_eficas=("map_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir","catalogues",'PATH_PYGMEE','PATH_BENHUR') + self.labels_user=('exec_acrobat', 'catalogues','savedir','path_doc','map_path','PATH_PYGMEE','PATH_BENHUR','PATH_ASTER','PATH_MODULE','PATH_STUDY','NAME_SCHEME') + self.labels_eficas=("map_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir","catalogues",'PATH_PYGMEE','PATH_BENHUR','PATH_ASTER','PATH_MODULE','PATH_STUDY','NAME_SCHEME') #Lecture des fichiers utilisateurs self.lecture_fichier_ini_standard() diff --git a/generator/generator_map.py b/generator/generator_map.py index 3210a1c3..9d7501f9 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -33,7 +33,7 @@ from generator_python import PythonGenerator # comme entete (commentaire ?) dans le fichier d'input de pygmee # -CONFIGliste=('NAME_SCHEME', 'PATH_ASTER', 'PATH_BENHUR', 'PATH_MODULE', 'PATH_PYGMEE', 'PATH_STUDY', 'REPINI') +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", @@ -95,6 +95,7 @@ class MapGenerator(PythonGenerator): return self.text def generRUN(self,obj,format='brut',config=None): + self.config=config self.dictMCVal={} self.listeTemp=[] self.text=PythonGenerator.gener(self,obj,format) @@ -141,20 +142,29 @@ class MapGenerator(PythonGenerator): def PYGMEE(self) : print "Generation de PYGMEE" dicoPygmee=self.dictMCVal["PYGMEE"] - dicoPygmee['FUSEAU2']='toto.txt' - - txt="# fichier de mise en donnee de la generation du VER MOX" +"\n" - txt=txt+"# nombre de phases"+"\n" - txt=txt+"1"+"\n" - for mot in listeOrdonneeMCPygmee : - if mot in dicoPygmee.keys() : - txt=txt+PYGMEEDict[mot]+"\n" - txt=txt+str(dicoPygmee[mot])+"\n" - - if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui': - print txt - return txt - else : + + monFichier=self.config.PATH_PYGMEE+"/pygmee_input.txt" + + #Lecture du fichier a trous + f = file(self.config.repIni+"/pygmee_input.txt","r") + chaine = f.read() + f.close() + chaine2=self.remplaceCONFIG(chaine) + chaine=self.remplaceDICO(chaine2,dicoPygmee) + + if os.path.isfile(monFichier) : + #print "je detruis pygmee_input.txt" + commande="rm -rf " + monFichier + os.system (commande) + f=open(monFichier,'wb') + f.write(chaine) + f.close() + if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui': + commande="cd "+self.config.PATH_PYGMEE+";" + commande=commande + "python "+self.config.PATH_PYGMEE+"/pygmee_v1.py" + #print commande + os.system(commande) + else: return "" def BENHUR(self) : @@ -166,16 +176,33 @@ class MapGenerator(PythonGenerator): dicoBenhur["_PYGMEE_TAILLE"]=0 print "Attention la variable Taille_VER non definie" - nom_fichier_BHR=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+str(dicoBenhur["_BENHUR_FINESSE"])+".bhr" + finesse=str(dicoBenhur["_BENHUR_FINESSE"]) + nom_fichier_BHR=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+finesse+".bhr" + nom_BHR_Files=self.config.PATH_BENHUR+"/BHR_files.txt" #Lecture du fichier a trous - f = file(self.config.REPINI+"/benhur_pygmee.txt","r") + f = file(self.config.repIni+"/benhur_pygmee.txt","r") chaine = f.read() f.close() chaine2=self.remplaceCONFIG(chaine) + print "chaine2 =", chaine2 chaine=self.remplaceDICO(chaine2,dicoBenhur) + print "chaine =", chaine + + f=open(nom_fichier_BHR,'wb') + f.write(chaine) + f.close() + + f=open(nom_BHR_Files,'wb') + f.write(nom_fichier_BHR) + f.write("\n\n\n") + f.close() + if ('_BENHUR_LANCEMENT' in dicoBenhur.keys()) and dicoBenhur['_BENHUR_LANCEMENT'] == 'oui': - return(nom_fichier_BHR,chaine) + commande="cd "+self.config.PATH_BENHUR+";" + commande=commande + "./benhur" + print commande + os.system(commande) else: return "" @@ -199,18 +226,34 @@ class MapGenerator(PythonGenerator): def ASTER(self) : print "Generation de ASTER" dicoAster=self.dictMCVal["ASTER"] + dicoPygmee=self.dictMCVal["PYGMEE"] nom_racine=self.config.PATH_MODULE+"/"+self.config.NAME_SCHEME+"/"+self.config.NAME_SCHEME - nom_mat=nom_racine+"_aster.mat" - lambda_matrice=self.dictMCVal["ASTER"]['_ASTER_CONDUCTIVITE_M'] - lambda_inclusions=self.dictMCVal["ASTER"]['_ASTER_CONDUCTIVITE_I'] - contraste=lambda_inclusions/lambda_matrice - f=open(nom_mat,'wb') - for i in range(11): - fraction=(1.0*i/10) - lambda_local=1.0+fraction - f.write(str(lambda_local)) - f.write("\n") + nom_fichier_ASTER=nom_racine+"_aster.comm" +# nom_mat=nom_racine+"_aster.mat" +# lambda_matrice=self.dictMCVal["ASTER"]['_ASTER_CONDUCTIVITE_M'] +# lambda_inclusions=self.dictMCVal["ASTER"]['_ASTER_CONDUCTIVITE_I'] +# contraste=lambda_inclusions/lambda_matrice +# f=open(nom_mat,'wb') +# for i in range(11): +# fraction=(1.0*i/10) +# lambda_local=1.0+fraction +# f.write(str(lambda_local)) +# f.write("\n") +# f.close() + + #Lecture du fichier a trous + f = file(self.config.repIni+"/s_poly_st_1_aster_template.comm","r") + chaine = f.read() + f.close() + chaine2=self.remplaceDICO(chaine,dicoPygmee) + print "chaine2 =", chaine2 + chaine=self.remplaceDICO(chaine2,dicoAster) + print "chaine =", chaine + + f=open(nom_fichier_ASTER,'wb') + f.write(chaine) f.close() + if ('_ASTER_LANCEMENT' in dicoAster.keys()) and dicoAster['_ASTER_LANCEMENT'] == 'oui': commande="cd "+self.config.PATH_MODULE+";" commande=commande + self.config.PATH_ASTER + "/as_run "+self.config.PATH_MODULE