self.affiche_infos("Format %s non reconnu" % format)
QMessageBox.critical( self, "Format "+format+" non reconnu","EFICAS ne sait pas convertir le JDC selon le format "+format)
return ""
+
+ #------------#
+ def run(self):
+ #------------#
+ format=self.appliEficas.format_fichier
+ self.textePython=""
+ if generator.plugins.has_key(format):
+ # Le generateur existe on l'utilise
+ self.generator=generator.plugins[format]()
+ self.dicoRun=self.generator.generRUN(self.jdc,format='beautifie',configuration=self.appliEficas.CONFIGURATION)
+ if not self.generator.cr.estvide():
+ self.affiche_infos("Erreur à la generation")
+ QMessageBox.critical( self, "Erreur a la generation","EFICAS ne sait pas convertir ce JDC")
+ return ""
+ for code in self.dicoRun.keys():
+ txt= apply(JDCEditor.__dict__[code],(self,))
+ if txt !="" :
+ self.textePython=self.textePython+txt
+ os.system(self.textePython)
+
+ def PYGMEE(self) :
+ if self.dicoRun['PYGMEE']== "" : return ""
+ monFichier=self.CONFIGURATION.PATH_PYGMEE+"/pygmee_input.txt"
+ if os.path.isfile(monFichier) :
+ print "je detruis pygmee_input.txt"
+ commande="rm -rf " + monFichier
+ os.system (commande)
+ f=open(monFichier,'wb')
+ f.write(self.dicoRun['PYGMEE'])
+ f.close()
+
+ commande=""
+ commande="cd "+self.CONFIGURATION.PATH_PYGMEE+";"
+ commande=commande + "python "+self.CONFIGURATION.PATH_PYGMEE+"/pygmee_v1.py\n"
+ return commande
+
+ def BENHUR(self) :
+ if self.dicoRun['BENHUR']== "" : return ""
+
+ # verifier que le fichier nom_fichier_fuseau existe
+ nom_BHR_Files=self.CONFIGURATION.PATH_BENHUR+"/BHR_files.txt"
+ nom_fichier_bhr=self.dicoRun['BENHUR'][0]
+ f=open(nom_fichier_bhr,'wb')
+ f.write(self.dicoRun['BENHUR'][1])
+ f.close
+ f=open(nom_BHR_Files,'wb')
+ f.write(nom_fichier_bhr)
+ f.write('\n\n\n\n')
+ f.close
+
+ commande="cd "+self.CONFIGURATION.PATH_BENHUR+"\n\n"
+ commande=commande + "./benhur\n"
+ return commande
+
- #-----------------------------------------#
+ #-----------------------------------------#e
def cherche_Groupes(self):
listeMA,listeNO=self.get_text_JDC("GroupMA")
return listeMA,listeNO
self.actionCopier.setIcon(icon4)
icon5 = QIcon(self.RepIcon+"/Paste24.png")
self.actionColler.setIcon(icon5)
+ icon6 = QIcon(self.RepIcon+"/compute.png")
+ self.actionExecution.setIcon(icon6)
def connecterSignaux(self) :
self.connect(self.action_Ouvrir,SIGNAL("activated()"),self.fileOpen)
self.connect(self.actionEnregistrer,SIGNAL("activated()"),self.fileSave)
self.connect(self.actionEnregistrer_sous,SIGNAL("activated()"),self.fileSaveAs)
+ self.connect(self.actionEnregistrer_Python,SIGNAL("activated()"),self.SaveRun)
self.connect(self.actionFermer,SIGNAL("activated()"),self.fileClose)
self.connect(self.actionFermer_tout,SIGNAL("activated()"),self.fileCloseAll)
self.connect(self.actionQuitter,SIGNAL("activated()"),self.fileExit)
self.connect(self.actionCouper,SIGNAL("activated()"),self.editCut)
self.connect(self.actionCopier,SIGNAL("activated()"),self.editCopy)
self.connect(self.actionColler,SIGNAL("activated()"),self.editPaste)
+ self.connect(self.actionExecution,SIGNAL("activated()"),self.run)
self.connect(self.actionSupprimer,SIGNAL("activated()"),self.supprimer)
self.connect(self.actionRapport_de_Validation,SIGNAL("activated()"),self.jdcRapport)
def editPaste(self):
self.viewmanager.handleEditPaste()
+ def run(self):
+ self.viewmanager.run()
+
+ def SaveRun(self):
+ self.viewmanager.run()
+
def supprimer(self):
self.viewmanager.handleSupprimer()
return res
+ def run(self):
+ index=self.myQtab.currentIndex()
+ if index < 0 : return
+ editor=self.dict_editors[index]
+ editor.run()
+
def handleCloseAll(self):
res=0
self.appliEficas.sauveRecents()
b_forme=BLOC( condition = "FORME == 'fichier'",
FORMAT = SIMP(statut = "o", typ='TXM', defaut="croissant", into=("croissant","decroissant")),
- FICHIER = SIMP ( statut = "o", typ = "Fichier", defaut="/local00/bin/MAP/modules/test_module/pygmee_v1/fuseau_1.txt"),
+ FICHIER = SIMP ( statut = "o", typ = "Fichier", defaut="/local/noyret/MAP/modules/polymers/s_poly_st_1/inclusion_size_distribution.txt"),
),
b_manuel=BLOC( condition = "FORME == 'manuel'",
- LFUSEAU = SIMP ( statut = "o", typ=Tuple(2),validators=VerifTypeTuple(('R','R')), max="**",) ,),),
+# LFUSEAU = SIMP ( statut = "o", typ=Tuple(2),validators=VerifTypeTuple(('R','R')), max="**",) ,),),
+ LFUSEAU = SIMP ( statut = "o", typ=Tuple(2), max="**",) ,),),
TAILLE=SIMP(statut = "o",fr="taille du VER", typ='R', defaut=50.),
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=1.0, val_min =0.),
- LANCEMENT=SIMP(statut = "o",fr="lancement de Code_Aster", typ='TXM', defaut="non", into=("oui","non")),
+ LANCEMENT=SIMP(statut = "o",fr="lancement de Code_Aster", typ='TXM', defaut="oui", into=("oui","non")),
+)
+
+GMSH= PROC(nom="GMSH",op=None,
+ fr='post-traitement',
+
+ LANCEMENT=SIMP(statut = "o",fr="lancement de GMSH", typ='TXM', defaut="oui", into=("oui","non")),
)
# (code,version,catalogue,formatIn)
#('Map','V0',os.path.join(rep_cata,'Map_Cata_V0.py'),'map'),
#('Map','V0',os.path.join(rep_cata,'Map1_Cata_V0.py'),'map'),
- ('Map','V1',os.path.join(rep_cata,'Map1_Cata_V1.py'),'map'),
+ ('MAP','V1',os.path.join(rep_cata,'Map1_Cata_V1.py'),'map'),
('Map2','V0',os.path.join(rep_cata,'Map2_Cata_V0.py'),'map'),
)
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
+<ui version="4.0" >
<class>Eficas</class>
- <widget class="QMainWindow" name="Eficas">
- <property name="geometry">
+ <widget class="QMainWindow" name="Eficas" >
+ <property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<height>811</height>
</rect>
</property>
- <property name="windowTitle">
+ <property name="windowTitle" >
<string>MainWindow</string>
</property>
- <widget class="QWidget" name="centralwidget"/>
- <widget class="QMenuBar" name="menubar">
- <property name="geometry">
+ <widget class="QWidget" name="centralwidget" />
+ <widget class="QMenuBar" name="menubar" >
+ <property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>1383</width>
- <height>26</height>
+ <height>32</height>
</rect>
</property>
- <widget class="QMenu" name="menuFichier">
- <property name="title">
+ <widget class="QMenu" name="menuFichier" >
+ <property name="title" >
<string>&Fichier</string>
</property>
- <addaction name="action_Nouveau"/>
- <addaction name="actionNouvel_Include"/>
- <addaction name="action_Ouvrir"/>
- <addaction name="separator"/>
- <addaction name="actionEnregistrer"/>
- <addaction name="actionEnregistrer_sous"/>
- <addaction name="actionFermer"/>
- <addaction name="actionFermer_tout"/>
- <addaction name="separator"/>
- <addaction name="actionQuitter"/>
+ <addaction name="action_Nouveau" />
+ <addaction name="actionNouvel_Include" />
+ <addaction name="action_Ouvrir" />
+ <addaction name="separator" />
+ <addaction name="actionEnregistrer" />
+ <addaction name="actionEnregistrer_sous" />
+ <addaction name="actionFermer" />
+ <addaction name="actionFermer_tout" />
+ <addaction name="separator" />
+ <addaction name="actionQuitter" />
+ <addaction name="actionEnregistrer_Python" />
</widget>
- <widget class="QMenu" name="menuEdition">
- <property name="title">
+ <widget class="QMenu" name="menuEdition" >
+ <property name="title" >
<string>Edition</string>
</property>
- <addaction name="actionCouper"/>
- <addaction name="actionCopier"/>
- <addaction name="actionColler"/>
- <addaction name="actionSupprimer"/>
+ <addaction name="actionCouper" />
+ <addaction name="actionCopier" />
+ <addaction name="actionColler" />
+ <addaction name="actionSupprimer" />
</widget>
- <widget class="QMenu" name="menuJdC">
- <property name="title">
+ <widget class="QMenu" name="menuJdC" >
+ <property name="title" >
<string>JdC</string>
</property>
- <addaction name="actionRapport_de_Validation"/>
- <addaction name="actionFichier_Source"/>
- <addaction name="actionFichier_Resultat"/>
+ <addaction name="actionRapport_de_Validation" />
+ <addaction name="actionFichier_Source" />
+ <addaction name="actionFichier_Resultat" />
+ <addaction name="actionExecution" />
</widget>
- <widget class="QMenu" name="menu_Aide">
- <property name="title">
+ <widget class="QMenu" name="menu_Aide" >
+ <property name="title" >
<string>&Aide</string>
</property>
- <addaction name="actionEficas"/>
- <addaction name="actionVersion"/>
+ <addaction name="actionEficas" />
+ <addaction name="actionVersion" />
</widget>
- <widget class="QMenu" name="menuOptions">
- <property name="title">
+ <widget class="QMenu" name="menuOptions" >
+ <property name="title" >
<string>Options</string>
</property>
- <addaction name="actionParametres_Eficas"/>
- <addaction name="actionLecteur_Pdf"/>
+ <addaction name="actionParametres_Eficas" />
+ <addaction name="actionLecteur_Pdf" />
</widget>
- <widget class="QMenu" name="menuPatrons">
- <property name="title">
+ <widget class="QMenu" name="menuPatrons" >
+ <property name="title" >
<string>Patrons</string>
</property>
</widget>
- <addaction name="menuFichier"/>
- <addaction name="menuEdition"/>
- <addaction name="menuJdC"/>
- <addaction name="menu_Aide"/>
- <addaction name="menuOptions"/>
- <addaction name="menuPatrons"/>
+ <addaction name="menuFichier" />
+ <addaction name="menuEdition" />
+ <addaction name="menuJdC" />
+ <addaction name="menu_Aide" />
+ <addaction name="menuOptions" />
+ <addaction name="menuPatrons" />
</widget>
- <widget class="QStatusBar" name="statusbar"/>
- <widget class="QToolBar" name="toolBar">
- <property name="windowTitle">
+ <widget class="QStatusBar" name="statusbar" />
+ <widget class="QToolBar" name="toolBar" >
+ <property name="windowTitle" >
<string>toolBar</string>
</property>
- <attribute name="toolBarArea">
+ <attribute name="toolBarArea" >
<enum>TopToolBarArea</enum>
</attribute>
- <attribute name="toolBarBreak">
+ <attribute name="toolBarBreak" >
<bool>false</bool>
</attribute>
- <addaction name="action_Nouveau"/>
- <addaction name="action_Ouvrir"/>
- <addaction name="actionEnregistrer"/>
- <addaction name="separator"/>
- <addaction name="actionCouper"/>
- <addaction name="actionCopier"/>
- <addaction name="actionColler"/>
+ <addaction name="action_Nouveau" />
+ <addaction name="action_Ouvrir" />
+ <addaction name="actionEnregistrer" />
+ <addaction name="separator" />
+ <addaction name="actionCouper" />
+ <addaction name="actionCopier" />
+ <addaction name="actionColler" />
+ <addaction name="actionExecution" />
</widget>
- <action name="action_Nouveau">
- <property name="icon">
+ <action name="action_Nouveau" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/New24.png</normaloff>../Editeur/icons/New24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>&Nouveau</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+N</string>
</property>
</action>
- <action name="actionNouvel_Include">
- <property name="text">
+ <action name="actionNouvel_Include" >
+ <property name="text" >
<string>Nouvel Include</string>
</property>
</action>
- <action name="action_Ouvrir">
- <property name="icon">
+ <action name="action_Ouvrir" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/Open24.png</normaloff>../Editeur/icons/Open24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>&Ouvrir</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+O</string>
</property>
</action>
- <action name="actionEnregistrer">
- <property name="icon">
+ <action name="actionEnregistrer" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/Save24.png</normaloff>../Editeur/icons/Save24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>Enregistrer</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+E</string>
</property>
</action>
- <action name="actionEnregistrer_sous">
- <property name="text">
+ <action name="actionEnregistrer_sous" >
+ <property name="text" >
<string>Enregistrer sous</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+Shift+E</string>
</property>
</action>
- <action name="actionFermer">
- <property name="text">
+ <action name="actionFermer" >
+ <property name="text" >
<string>Fermer </string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+W</string>
</property>
</action>
- <action name="actionFermer_tout">
- <property name="text">
+ <action name="actionFermer_tout" >
+ <property name="text" >
<string>Fermer tout</string>
</property>
</action>
- <action name="actionCouper">
- <property name="icon">
+ <action name="actionCouper" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/Cut24.png</normaloff>../Editeur/icons/Cut24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>Couper</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+X</string>
</property>
- <property name="shortcutContext">
+ <property name="shortcutContext" >
<enum>Qt::ApplicationShortcut</enum>
</property>
</action>
- <action name="actionCopier">
- <property name="icon">
+ <action name="actionCopier" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/Copy24.png</normaloff>../Editeur/icons/Copy24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>Copier</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+C</string>
</property>
- <property name="shortcutContext">
+ <property name="shortcutContext" >
<enum>Qt::ApplicationShortcut</enum>
</property>
</action>
- <action name="actionColler">
- <property name="icon">
+ <action name="actionColler" >
+ <property name="icon" >
<iconset>
<normaloff>../Editeur/icons/Paste24.png</normaloff>../Editeur/icons/Paste24.png</iconset>
</property>
- <property name="text">
+ <property name="text" >
<string>Coller</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+V</string>
</property>
- <property name="shortcutContext">
+ <property name="shortcutContext" >
<enum>Qt::ApplicationShortcut</enum>
</property>
</action>
- <action name="actionQuitter">
- <property name="text">
+ <action name="actionQuitter" >
+ <property name="text" >
<string>Quitter</string>
</property>
- <property name="shortcut">
+ <property name="shortcut" >
<string>Ctrl+Q</string>
</property>
</action>
- <action name="actionRapport_de_Validation">
- <property name="text">
+ <action name="actionRapport_de_Validation" >
+ <property name="text" >
<string>Rapport de Validation</string>
</property>
</action>
- <action name="actionFichier_Source">
- <property name="text">
+ <action name="actionFichier_Source" >
+ <property name="text" >
<string>Fichier Source</string>
</property>
</action>
- <action name="actionFichier_Resultat">
- <property name="text">
+ <action name="actionFichier_Resultat" >
+ <property name="text" >
<string>Fichier Résultat</string>
</property>
</action>
- <action name="actionParametres_Eficas">
- <property name="text">
+ <action name="actionParametres_Eficas" >
+ <property name="text" >
<string>Parametres Eficas</string>
</property>
</action>
- <action name="actionLecteur_Pdf">
- <property name="text">
+ <action name="actionLecteur_Pdf" >
+ <property name="text" >
<string>Lecteur Pdf</string>
</property>
</action>
- <action name="actionEficas">
- <property name="text">
+ <action name="actionEficas" >
+ <property name="text" >
<string>Eficas</string>
</property>
</action>
- <action name="actionVersion">
- <property name="text">
+ <action name="actionVersion" >
+ <property name="text" >
<string>Version</string>
</property>
</action>
- <action name="actionSupprimer">
- <property name="text">
+ <action name="actionSupprimer" >
+ <property name="text" >
<string>Supprimer</string>
</property>
</action>
+ <action name="actionExecution" >
+ <property name="icon" >
+ <iconset>
+ <normaloff>compute.png</normaloff>compute.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Execution</string>
+ </property>
+ </action>
+ <action name="actionSauve_Python" >
+ <property name="text" >
+ <string>Sauve Python</string>
+ </property>
+ </action>
+ <action name="actionEnregistrer_Python" >
+ <property name="text" >
+ <string>Enregistrer Python</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
self.listeMA=[]
self.listeNO=[]
- def gener(self,obj,format='brut',config=None):
+ def gener(self,obj,format='brut',configuration=None):
self.liste=[]
self.text=PythonGenerator.gener(self,obj,'brut',config=None)
return self.listeMA,self.listeNO
def generMCSIMP(self,obj) :
if 'grma' in repr(obj.definition.type) :
- self.listeMA.append(obj.valeur)
+ if not type(obj.valeur) in (list, tuple):
+ aTraiter=(obj.valeur,)
+ else :
+ aTraiter=obj.valeur
+ for group in aTraiter :
+ if group not in self.listeMA :
+ self.listeMA.append(group)
if 'grno' in repr(obj.definition.type) :
- self.listeNO.append(obj.valeur)
+ if not type(obj.valeur) in (list, tuple):
+ aTraiter=(obj.valeur,)
+ else :
+ aTraiter=obj.valeur
+ for group in aTraiter :
+ if group not in self.listeNO :
+ self.listeNO.append(group)
s=PythonGenerator.generMCSIMP(self,obj)
return s
}
+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():
"""
Retourne les informations necessaires pour le chargeur de plugins
def gener(self,obj,format='brut',configuration=None):
self.PATH_PYGMEE=configuration.PATH_PYGMEE
self.PATH_BENHUR=configuration.PATH_BENHUR
+ self.PATH_ASTER=configuration.PATH_ASTER
+ self.PATH_MODULE=configuration.PATH_MODULE
+ self.NAME_SCHEME=configuration.NAME_SCHEME
+ self.PATH_STUDY=configuration.PATH_STUDY
self.dictMCVal={}
self.listeTemp=[]
self.text=PythonGenerator.gener(self,obj,format)
self.generePythonMap()
return self.text
+ def generRUN(self,obj,format='brut',configuration=None):
+ self.PATH_PYGMEE=configuration.PATH_PYGMEE
+ self.PATH_BENHUR=configuration.PATH_BENHUR
+ self.PATH_ASTER=configuration.PATH_ASTER
+ self.PATH_MODULE=configuration.PATH_MODULE
+ self.NAME_SCHEME=configuration.NAME_SCHEME
+ self.PATH_STUDY=configuration.PATH_STUDY
+ self.dictMCVal={}
+ self.listeTemp=[]
+ self.text=PythonGenerator.gener(self,obj,format)
+ #self.generePythonMap()
+ dicoRun={}
+ for code in self.dictMCVal.keys():
+ listeTexte=apply(MapGenerator.__dict__[code],(self,))
+ dicoRun[code]=listeTexte
+ return dicoRun
+
+
def generePythonMap(self) :
'''
self.dictMCVal est un dictionnaire qui est indexe par le nom du code (exple PYGMEE)
'''
for code in self.dictMCVal.keys():
self.texte=apply(MapGenerator.__dict__[code],(self,))
- return 'a faire'
def generPROC_ETAPE(self,obj):
#print "PN: generPROC_ETAPE dans generatorMap"
txt=txt+PYGMEEDict[mot]+"\n"
txt=txt+str(dicoPygmee[mot])+"\n"
- monFichier=self.PATH_PYGMEE+"/pygmee_input.txt"
- if os.path.isfile(monFichier) :
- #print "je detruis pygmee_input.txt"
- commande="rm -rf " + monFichier
- os.system (commande)
- f=open(monFichier,'wb')
- f.write(txt)
- f.close()
if ('_PYGMEE_LANCEMENT' in dicoPygmee.keys()) and dicoPygmee['_PYGMEE_LANCEMENT'] == 'oui':
- commande="cd "+self.PATH_PYGMEE+";"
- commande=commande + "python "+self.PATH_PYGMEE+"/pygmee_v1.py"
- #print commande
- os.system(commande)
- else:
+ return txt
+ else :
return ""
def BENHUR(self) :
print "Generation de BENHUR"
dicoBenhur=self.dictMCVal["BENHUR"]
- nom_fichier_fuseau=self.PATH_BENHUR+"/benhur_input.txt"
+ finesse=str(dicoBenhur['_BENHUR_FINESSE'])
- nom_fichier_BHR=self.PATH_BENHUR+"/test_module.bhr"
- nom_BHR_Files=self.PATH_BENHUR+"/BHR_files.txt"
+ nom_fichier_BHR=self.PATH_STUDY+"/"+self.NAME_SCHEME+"_benhur_"+finesse+".bhr"
- finesse=str(dicoBenhur['_BENHUR_FINESSE'])
if ("PYGMEE" in self.dictMCVal.keys()) and '_PYGMEE_TAILLE' in self.dictMCVal['PYGMEE']:
taille_VER=self.dictMCVal["PYGMEE"]['_PYGMEE_TAILLE']
else :
taille_VER=0
print "Attention la variable Taille_VER non definie"
- nom_GMSH_in=self.PATH_BENHUR+"/regular_mesh_3D_i"+finesse+".msh"
- nom_etude=self.PATH_BENHUR+"/test_module_"+finesse
+
+ nom_etude=self.PATH_STUDY+"/"+self.NAME_SCHEME+"_benhur_"+finesse
+ nom_GMSH_in=self.PATH_BENHUR+"/regular_mesh_3D_"+finesse+".msh"
+ nom_GMSH_out=nom_etude+".msh"
+ nom_GMSH_in="regular_mesh_3D_"+finesse+".msh"
nom_GMSH_out=nom_etude+".msh"
nom_LOG=nom_etude+".log"
nom_BMP=nom_etude+".bmp"
nom_LOG=nom_etude+".log"
nom_BMP=nom_etude+".bmp"
nom_LEVELSET=nom_etude+"_levelset.txt"
- f=open(nom_BHR_Files,'wb')
- f.write(nom_fichier_BHR)
- f.write("\n")
- f.write("\n")
- f.write("\n")
- f.close()
- f=open(nom_fichier_BHR,'wb')
- f.write("3D BENHUR SCALE\n")
- f.write("I - Morphologie (MESSALA)\n")
- f.write("1) dimension du VER cubique [m] (entree)\n")
- f.write(str(taille_VER))
- f.write("\n2) fraction volumique seuil écrétant le fuseau (entree)\n")
- f.write(".11\n")
- f.write("3) fichier decrivant le fuseau granulaire descendant (entree)\n")
- f.write("-\n")
- f.write("4) fichier decrivant la position et la taille des boules (sortie)\n")
- f.write(nom_fichier_fuseau)
- f.write("\n5) fichier CAO de la morphologie (sortie)\n")
- f.write("-\n")
- f.write("6) facteur de correction de fraction volumique (entree)\n")
- f.write("1.0\n")
- f.write(" \n")
- f.write("II - Maillage (BENHUR)\n")
- f.write("1) fichier entree décrivant le maillage support (entree)\n")
- f.write(nom_GMSH_in);
- f.write("\n2) fichier sortie du maillage (sortie)\n")
- f.write(nom_GMSH_out);
- f.write("\n3) fichier commentaire sur les statistiques décrivant le maillage (sortie)\n")
- f.write(nom_LOG);
- f.write("\n4) fichier BMP décrivant une coupe binarisée du VER (sortie)\n")
- f.write(nom_BMP);
- f.write("\n5) fichier TXT donnant la level set du contour aux noeuds (sortie)\n")
- f.write(nom_LEVELSET)
- f.write("\n")
- f.write("\n")
- f.write("\n")
- f.close()
+ nom_fichier_fuseau=self.PATH_PYGMEE+"/benhur_input.txt"
+
+
+ txt="OPTIONS\n"
+ txt=txt+"3D BENHUR SCALE\n"
+ txt=txt+"I - Morphologie (MESSALA)\n"
+ txt=txt+"1) dimension du VER cubique [m] (entree)\n"
+ txt=txt+str(taille_VER)
+ txt=txt+"\n2) fraction volumique seuil écrétant le fuseau (entree)\n"
+ txt=txt+".11\n"
+ txt=txt+"3) fichier decrivant le fuseau granulaire descendant (entree)\n"
+ txt=txt+"-\n"
+ txt=txt+"4) fichier decrivant la position et la taille des boules (sortie)\n"
+ txt=txt+nom_fichier_fuseau
+ txt=txt+"\n5) fichier CAO de la morphologie (sortie)\n"
+ txt=txt+"-\n"
+ txt=txt+"6) facteur de correction de fraction volumique (entree)\n"
+ txt=txt+"1.0\n"
+ txt=txt+" \n"
+ txt=txt+"II - Maillage (BENHUR)\n"
+ txt=txt+"1) fichier entree décrivant le maillage support (entree)\n"
+ txt=txt+nom_GMSH_in
+ txt=txt+"\n2) fichier sortie du maillage (sortie)\n"
+ txt=txt+nom_GMSH_out
+ txt=txt+"\n3) fichier commentaire sur les statistiques décrivant le maillage (sortie)\n"
+ txt=txt+nom_LOG
+ txt=txt+"\n4) fichier BMP décrivant une coupe binarisée du VER (sortie)\n"
+ txt=txt+nom_BMP
+ txt=txt+"\n5) fichier TXT donnant la level set du contour aux noeuds (sortie)\n"
+ txt=txt+nom_LEVELSET
+ txt=txt+"\n\n\n"
if ('_BENHUR_LANCEMENT' in dicoBenhur.keys()) and dicoBenhur['_BENHUR_LANCEMENT'] == 'oui':
- commande="cd "+self.PATH_BENHUR+";"
- commande=commande + "./benhur"
- print commande
- os.system(commande)
+ return(nom_fichier_BHR,txt)
else:
return ""
def ASTER(self) :
- print "Generation de ASTER"
+ print "Generation de ASTER"
+ dicoAster=self.dictMCVal["ASTER"]
+ nom_racine=self.PATH_MODULE+"/"+self.NAME_SCHEME+"/"+self.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")
+ f.close()
+ if ('_ASTER_LANCEMENT' in dicoAster.keys()) and dicoAster['_ASTER_LANCEMENT'] == 'oui':
+ commande="cd "+self.PATH_MODULE+";"
+ commande=commande + self.PATH_ASTER + "/as_run "+self.PATH_MODULE+"/"+self.NAME_SCHEME+"/"+self.NAME_SCHEME+"_aster.export"
+ print commande
+ os.system(commande)
+ else:
+ return ""
+ def GMSH(self) :
+ print "Generation de GMSH"
+ dicoGmsh=self.dictMCVal["GMSH"]
+ if ('_GMSH_LANCEMENT' in dicoGmsh.keys()) and dicoGmsh['_GMSH_LANCEMENT'] == 'oui':
+ commande="cd "+self.PATH_MODULE+";"
+ commande=commande + "gmsh "+self.PATH_MODULE+"/"+self.NAME_SCHEME+"/"+self.NAME_SCHEME+"_aster.resu.msh"
+ print commande
+ os.system(commande)
+ else:
+ return ""
'''
'''
import sys
- sys.path.append("/home/noyret/PERFECT/perfect_platform")
+ sys.path.append("/local/noyret/PERFECT/perfect_platform")
print "avant import"
import PDM
import PMM
print ">>> Defining study '%s'" % ("my new study")
from PSM import PerfectStudy
a_study = PerfectStudy.PerfectStudy()
- a_study.set_study({'date': '12/11/09', 'description': 'no description', 'filename': '/home/noyret/PerfectStudy/studies/my_new_new_study.prf', 'name': 'my new study', 'author': 'gadjanor'})
+ a_study.set_study({'date': '12/11/09', 'description': 'no description', 'filename': '/local/noyret/PerfectStudy/studies/my_new_new_study.prf', 'name': 'my new study', 'author': 'gadjanor'})
# 3rd: write the study chain
print ">>> Setting the study chain"
# 4th: list and write all input data needed
print ">>> Defining the list of input data"
specter_path = PerfectFile()
- specter_path.path = '/home/noyret/PERFECT/perfect_platform/tools/bin/specter.exe_64'
+ specter_path.path = '/local/noyret/PERFECT/perfect_platform/tools/bin/specter.exe_64'
specter_path.format = ''
neutron_spectrum = NeutronSpectrum()
globals(), locals(), ['perfect_filtre']
)
setattr(parser_module, 'current_study', a_study)
- template_py_file = '/home/noyret/PERFECT/perfect_platform/PSM/script_tmpl.py'
+ template_py_file = '/local/noyret/PERFECT/perfect_platform/PSM/script_tmpl.py'
this_params = parser_module.analyse( template_py_file )
print "this_params ", this_params
- parser_module.perf_filter( this_params, "/home/noyret/new_script_eficas.py" )
+ parser_module.perf_filter( this_params, "/local/noyret/new_script_eficas.py" )
print "fin parser_module"