]> SALOME platform Git repositories - modules/eficas.git/commitdiff
Salome HOME
xml catalog created for s_polymers_st_1 scheme
authorCharles Toulemonde <charles.toulemonde@edf.fr>
Tue, 16 Nov 2010 12:00:31 +0000 (12:00 +0000)
committerCharles Toulemonde <charles.toulemonde@edf.fr>
Tue, 16 Nov 2010 12:00:31 +0000 (12:00 +0000)
PYGMEEYACS node Ok

MAP/cata_s_polymers_st_1.xml [new file with mode: 0644]
generator/generator_map.py
generator/monCreateYacs.py

diff --git a/MAP/cata_s_polymers_st_1.xml b/MAP/cata_s_polymers_st_1.xml
new file mode 100644 (file)
index 0000000..153c3f8
--- /dev/null
@@ -0,0 +1,118 @@
+<?xml version='1.0' encoding='iso-8859-1' ?>
+<proc name="newSchema_1">
+   <property name="DefaultStudyID" value="1"/>
+   <type name="string" kind="string"/>
+   <struct name="Engines/dataref">
+      <member name="ref" type="string"/>
+   </struct>
+   <type name="bool" kind="bool"/>
+   <sequence name="boolvec" content="bool"/>
+   <type name="double" kind="double"/>
+   <sequence name="dblevec" content="double"/>
+   <objref name="file" id="file"/>
+   <type name="int" kind="int"/>
+   <sequence name="intvec" content="int"/>
+   <objref name="pyobj" id="python:obj:1.0"/>
+   <sequence name="stringvec" content="string"/>
+   <container name="DefaultContainer">
+      <property name="container_name" value="FactoryServer"/>
+      <property name="hostname" value="localhost"/>
+   </container>
+   <inline name="pygmee_v2">
+      <script><code><![CDATA[import sys
+import os
+
+sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'classes/python/'))
+from class_MAP_parameters import *
+
+print "pygmee_v2 for YACS - BEGIN"
+composant="pygmee_v2"
+parameter=MAP_parameters()
+parameter.add_component(composant)
+parameter.add_parameter(composant, 'rve_size', rve_size)
+parameter.add_parameter(composant, 'phase_number', phase_number)
+parameter.add_parameter(composant, 'sieve_curve_in', sieve_curve_in)
+parameter.add_parameter(composant, 'sieve_curve_out',  sieve_curve_out)
+parameter.add_parameter(composant, 'repulsion_distance', repulsion_distance)
+parameter.add_parameter(composant, 'study_name', study_name)
+parameter.add_parameter(composant, 'file_result_inclusions', file_result_inclusions)
+parameter.add_parameter(composant, 'file_result_rve', file_result_rve)
+#print parameter
+
+pygmee_v2_input = "/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/pygmee_v2_for_YACS_20101116.input"
+
+commande=parameter.write_for_shell(pygmee_v2_input)
+os.system(commande)
+
+commande= "cd /local00/bin/MAP/components/pygmee_v2/src;"
+commande+= "python pygmee_v2.py -i "+pygmee_v2_input+";\n"
+os.system(commande)
+
+print "pygmee_v2 for YACS - END"
+]]></code></script>
+      <inport name="phase_number" type="int"/>
+      <inport name="rve_size" type="double"/>
+      <inport name="sieve_curve_in" type="string"/>
+      <inport name="sieve_curve_out" type="string"/>
+      <inport name="repulsion_distance" type="double"/>
+      <inport name="study_name" type="string"/>
+      <inport name="file_result_inclusions" type="string"/>
+      <inport name="file_result_rve" type="string"/>
+   </inline>
+   <inline name="init">
+      <script><code><![CDATA[phase_number=1
+rve_size=50.0
+sieve_curve_in="pygmee_v2_test_1.sieve_in"
+sieve_curve_out="pygmee_v2_test_1.sieve_out"
+repulsion_distance=0.1
+study_name="test YACS"
+file_result_inclusions="inclusions.txt"
+file_result_rve="rve.txt"
+
+]]></code></script>
+      <outport name="phase_number" type="int"/>
+      <outport name="rve_size" type="double"/>
+      <outport name="sieve_curve_in" type="string"/>
+      <outport name="repulsion_distance" type="double"/>
+      <outport name="study_name" type="string"/>
+      <outport name="sieve_curve_out" type="string"/>
+      <outport name="file_result_inclusions" type="string"/>
+      <outport name="file_result_rve" type="string"/>
+   </inline>
+   <control> <fromnode>init</fromnode> <tonode>pygmee_v2</tonode> </control>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>phase_number</fromport>
+      <tonode>pygmee_v2</tonode> <toport>phase_number</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>rve_size</fromport>
+      <tonode>pygmee_v2</tonode> <toport>rve_size</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>sieve_curve_in</fromport>
+      <tonode>pygmee_v2</tonode> <toport>sieve_curve_in</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>repulsion_distance</fromport>
+      <tonode>pygmee_v2</tonode> <toport>repulsion_distance</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>study_name</fromport>
+      <tonode>pygmee_v2</tonode> <toport>study_name</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>sieve_curve_out</fromport>
+      <tonode>pygmee_v2</tonode> <toport>sieve_curve_out</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>file_result_inclusions</fromport>
+      <tonode>pygmee_v2</tonode> <toport>file_result_inclusions</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>file_result_rve</fromport>
+      <tonode>pygmee_v2</tonode> <toport>file_result_rve</toport>
+   </datalink>
+   <presentation name="init" x="89.4918" y="103" width="273.5" height="313"/>
+   <presentation name="pygmee_v2" x="558" y="219.5" width="223" height="313"/>
+   <presentation name="__ROOT__" x="0" y="0" width="790" height="541.5"/>
+</proc>
index 9470754944a4553ea4f29fd1016cfc3162718128..b7989ed3f1f9081b42e117927b7df00ef3890dfd 100644 (file)
@@ -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) :
       '''
index 3773de244ee071f1ee4bfa980a6128f7e7755f9a..ba7b060cfe7bd0fcf29a9d00c7ad57715f7891cc 100755 (executable)
@@ -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)