self.code = appli.code\r
self.salome = appli.salome\r
self.repIni = repIni\r
+ self.REPINI = repIni\r
\r
if self.appli: \r
self.parent=appli.top\r
self.savedir = self.rep_user\r
self.exec_acrobat = self.rep_user\r
\r
- self.labels_user=('exec_acrobat', 'catalogues','savedir','path_doc','map_path','PATH_PYGMEE','PATH_BENHUR')\r
- self.labels_eficas=("map_path","rep_user","INSTALLDIR","path_doc","exec_acrobat","rep_cata","initialdir","savedir","catalogues",'PATH_PYGMEE','PATH_BENHUR')\r
+ self.labels_user=('exec_acrobat', 'catalogues','savedir','path_doc','map_path','PATH_PYGMEE','PATH_BENHUR','PATH_ASTER','PATH_MODULE','PATH_STUDY','NAME_SCHEME')\r
+ 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')\r
\r
#Lecture des fichiers utilisateurs\r
self.lecture_fichier_ini_standard()\r
# 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",
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)
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)
+\r
+ if os.path.isfile(monFichier) :\r
+ #print "je detruis pygmee_input.txt"\r
+ commande="rm -rf " + monFichier\r
+ os.system (commande)\r
+ f=open(monFichier,'wb')\r
+ f.write(chaine)\r
+ f.close()\r
+ if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui':\r
+ commande="cd "+self.config.PATH_PYGMEE+";"\r
+ commande=commande + "python "+self.config.PATH_PYGMEE+"/pygmee_v1.py"\r
+ #print commande\r
+ os.system(commande)\r
+ else:\r
return ""
def BENHUR(self) :
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"\r
+ 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 ""
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
+\r
+ f=open(nom_fichier_ASTER,'wb')\r
+ f.write(chaine)\r
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