From c5a52c7a4d32caa6aefc596763c88df47075b534 Mon Sep 17 00:00:00 2001 From: Charles Toulemonde Date: Tue, 16 Nov 2010 12:00:31 +0000 Subject: [PATCH] xml catalog created for s_polymers_st_1 scheme PYGMEEYACS node Ok --- MAP/cata_s_polymers_st_1.xml | 118 +++++++++++++++++++++++++++++++++++ generator/generator_map.py | 7 ++- generator/monCreateYacs.py | 33 ++++++---- 3 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 MAP/cata_s_polymers_st_1.xml diff --git a/MAP/cata_s_polymers_st_1.xml b/MAP/cata_s_polymers_st_1.xml new file mode 100644 index 00000000..153c3f8d --- /dev/null +++ b/MAP/cata_s_polymers_st_1.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + init pygmee_v2 + + init phase_number + pygmee_v2 phase_number + + + init rve_size + pygmee_v2 rve_size + + + init sieve_curve_in + pygmee_v2 sieve_curve_in + + + init repulsion_distance + pygmee_v2 repulsion_distance + + + init study_name + pygmee_v2 study_name + + + init sieve_curve_out + pygmee_v2 sieve_curve_out + + + init file_result_inclusions + pygmee_v2 file_result_inclusions + + + init file_result_rve + pygmee_v2 file_result_rve + + + + + diff --git a/generator/generator_map.py b/generator/generator_map.py index 94707549..b7989ed3 100644 --- a/generator/generator_map.py +++ b/generator/generator_map.py @@ -94,11 +94,12 @@ class MapGenerator(PythonGenerator): self.initialise(config) text=PythonGenerator.gener(self,obj,format) import sys - sys.path.append('/local/noyret/Salome_5.1.3/Install/YACS/lib/python2.5/site-packages/salome/') + sys.path.append(os.path.join(os.getenv("YACS_ROOT_DIR"),"lib/python2.4/site-packages/salome/")) + print sys.path self.verifie() import monCreateYacs self.monSchema=monCreateYacs.getSchema(config) - self.proc=self.monSchema.createProc() + self.proc=self.monSchema.createProc(self) for elt in self.listeCODE: code=elt.keys()[0] dico=elt[code] @@ -107,7 +108,9 @@ class MapGenerator(PythonGenerator): if hasattr(self.monSchema, codeYACS): fct=getattr(self.monSchema, codeYACS) fct(self.proc,dico) + nomFichier="/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/test_20101116.xml" self.monSchema.write_yacs_proc(self.proc,str(nomFichier)) + print "le fichier xml est : ",nomFichier def generePythonMap(self,execution) : ''' diff --git a/generator/monCreateYacs.py b/generator/monCreateYacs.py index 3773de24..ba7b060c 100755 --- a/generator/monCreateYacs.py +++ b/generator/monCreateYacs.py @@ -24,9 +24,11 @@ class CreeSchemaYacs : def addCatalog(self): try: - monCataFile= os.environ["EFICAS_ROOT_DIR"] - monCataFile=monCataFile+"/share/salome/resources/eficas/cata" - monCataFile=monCataFile+self.ssCode+".xml" + # modifs CTL+PN 20101116 for today + #monCataFile= os.environ["EFICAS_ROOT_DIR"] + #monCataFile=monCataFile+"/share/salome/resources/eficas/cata" + #monCataFile=monCataFile+self.ssCode+".xml" + monCataFile="/local00/bin/EficasV1/MAP/cata_s_polymers_st_1.xml" print monCataFile self.monCata = self.runtime.loadCatalog("proc",monCataFile) except: @@ -34,7 +36,8 @@ class CreeSchemaYacs : traceback.print_exc() sys.exit(1) - def createProc(self): + def createProc(self, generator): + self.generator=generator proc = self.runtime.createProc("proc") proc.setTypeCode("pyobj", self.runtime.getTypeCode("pyobj")) t_pyobj = proc.getTypeCode("pyobj") @@ -59,10 +62,16 @@ class s_polymers_st_1(CreeSchemaYacs) : def PYGMEEYACS(self,proc,dico): monFichierInput=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"/pygmee_input.txt" - factoryNode = self.monCata._nodeMap["pygmee"] - self.pygmeeNode = factoryNode.cloneNode("pygmee") - self.pygmeeNode.getInputPort("pathPygmee").edInitPy(self.config.PATH_PYGMEE) - self. pygmeeNode.getInputPort("fileInput").edInitPy(monFichierInput) + factoryNode = self.monCata._nodeMap["pygmee_v2"] + self.pygmeeNode = factoryNode.cloneNode("pygmee_v2") + self.pygmeeNode.getInputPort("rve_size").edInitPy(self.generator.size) + self.pygmeeNode.getInputPort("phase_number").edInitPy(1) + self.pygmeeNode.getInputPort("sieve_curve_in").edInitPy(self.generator.sieve_in) + self.pygmeeNode.getInputPort("sieve_curve_out").edInitPy(self.generator.sieve_out) + self.pygmeeNode.getInputPort("repulsion_distance").edInitPy(self.generator.distance) + self.pygmeeNode.getInputPort("study_name").edInitPy("s_polymers_st_1_20101116") + self.pygmeeNode.getInputPort("file_result_inclusions").edInitPy(self.generator.inclusion_name) + self.pygmeeNode.getInputPort("file_result_rve").edInitPy(self.generator.rve_name) proc.edAddChild(self.pygmeeNode) if self.nodeAvant != None : proc.edAddCFLink(self.nodeAvant,self.pygmeeNode) @@ -86,19 +95,19 @@ class s_polymers_st_1(CreeSchemaYacs) : def FDVGRIDYACS(self,proc,dico): print "iiiii" - def METHODEYACS(self,proc,dico) + def METHODEYACS(self,proc,dico): self.PYGMEEYACS(proc,dico) - if (self.CHOIX=="FD+grid") : self.FDVGRIDYACS(proc,dico) + if (self.generator.CHOIX=="FD+grid") : self.FDVGRIDYACS(proc,dico) -dictKlass={'s_poly_st_1':s_poly_st_1} +dictKlass={'s_polymers_st_1':s_polymers_st_1} def getSchema(config): schema=config.appli.ssCode return dictKlass[schema](config) if __name__ == "__main__": - monCreator=getSchema('s_poly_st_1') + monCreator=getSchema('s_polymers_st_1') proc=monCreator.createProc() monCreator.ajoutPygmee(proc) monCreator.ajoutBenhur(proc) -- 2.39.2