]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
aster and gmsh YACS nodes for s_polymers_st_1
authorCharles Toulemonde <charles.toulemonde@edf.fr>
Thu, 25 Nov 2010 08:21:11 +0000 (08:21 +0000)
committerCharles Toulemonde <charles.toulemonde@edf.fr>
Thu, 25 Nov 2010 08:21:11 +0000 (08:21 +0000)
MAP/Templates/s_polymers_st_1/cata_s_polymers_st_1.xml
MAP/Templates/s_polymers_st_1/s_polymers_st_1_YACS_nodes.py
generator/generator_s_polymers_st_1.py

index f29c1d3e7459ed74fce8a7280da24bdb6e60bf5d..9646652130a1896053b0138c28a63c06095ce391 100644 (file)
@@ -22,7 +22,7 @@
       <script><code><![CDATA[import sys
 import os
 
-sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'../EficasV1/MAP/Templates/s_polymers_st_1'))
+sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'),'MAP/Templates/s_polymers_st_1'))
 
 print sys.path
 from s_polymers_st_1_YACS_nodes import *
@@ -74,7 +74,7 @@ lambda_M=1.
       <script><code><![CDATA[import sys
 import os
 
-sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'../EficasV1/MAP/Templates/s_polymers_st_1'))
+sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'),'MAP/Templates/s_polymers_st_1'))
 
 from s_polymers_st_1_YACS_nodes import *
 
@@ -93,11 +93,12 @@ lambda_x=component_fdvgrid(lambda_I, lambda_M, rve_size, file_inclusions, finess
       <script><code><![CDATA[import sys
 import os
 
-sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'),'../EficasV1/MAP/Templates/s_polymers_st_1'))
+
+sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'),'MAP/Templates/s_polymers_st_1'))
 
 from s_polymers_st_1_YACS_nodes import *
 
-component_benhur(finesse, rve_size, file_inclusions, study_name, study_path)
+(result_mesh, result_log)=component_benhur(finesse, rve_size, file_inclusions, study_name, study_path)
 
 ]]></code></script>
       <inport name="rve_size" type="double"/>
@@ -105,30 +106,73 @@ component_benhur(finesse, rve_size, file_inclusions, study_name, study_path)
       <inport name="file_inclusions" type="string"/>
       <inport name="study_name" type="string"/>
       <inport name="study_path" type="string"/>
+      <outport name="result_mesh" type="string"/>
+      <outport name="result_log" type="string"/>
    </inline>
    <inline name="env">
       <script><code><![CDATA[study_path="/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/"
 study_name="test YACS"
+aster_path="/local00/aster/bin/"
 ]]></code></script>
       <outport name="study_name" type="string"/>
       <outport name="study_path" type="string"/>
+      <outport name="aster_path" type="string"/>
+   </inline>
+   <inline name="aster_s_polymers_st_1">
+      <script><code><![CDATA[import sys
+import os
+
+
+sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'),'MAP/Templates/s_polymers_st_1'))
+
+from s_polymers_st_1_YACS_nodes import *
+
+result_gmsh=component_aster_s_polymers_st_1(rve_size, finesse, lambda_I, lambda_M, study_name, study_path, aster_path)
+
+]]></code></script>
+      <inport name="lambda_I" type="double"/>
+      <inport name="lambda_M" type="double"/>
+      <inport name="study_name" type="string"/>
+      <inport name="study_path" type="string"/>
+      <inport name="rve_size" type="double"/>
+      <inport name="finesse" type="int"/>
+      <inport name="mesh" type="string"/>
+      <inport name="aster_path" type="string"/>
+      <outport name="result_gmsh" type="string"/>
+   </inline>
+   <inline name="gmsh_post">
+      <script><code><![CDATA[import sys
+import os
+
+
+sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'),'MAP/Templates/s_polymers_st_1'))
+
+from s_polymers_st_1_YACS_nodes import *
+
+component_gmsh_post(result_gmsh)
+]]></code></script>
+      <inport name="result_gmsh" type="string"/>
    </inline>
-   <control> <fromnode>pygmee_v2</fromnode> <tonode>benhur</tonode> </control>
    <control> <fromnode>pygmee_v2</fromnode> <tonode>fdvgrid</tonode> </control>
-   <control> <fromnode>init</fromnode> <tonode>benhur</tonode> </control>
+   <control> <fromnode>pygmee_v2</fromnode> <tonode>benhur</tonode> </control>
    <control> <fromnode>init</fromnode> <tonode>fdvgrid</tonode> </control>
+   <control> <fromnode>init</fromnode> <tonode>aster_s_polymers_st_1</tonode> </control>
+   <control> <fromnode>init</fromnode> <tonode>benhur</tonode> </control>
    <control> <fromnode>init</fromnode> <tonode>pygmee_v2</tonode> </control>
-   <control> <fromnode>env</fromnode> <tonode>init</tonode> </control>
-   <control> <fromnode>env</fromnode> <tonode>benhur</tonode> </control>
+   <control> <fromnode>benhur</fromnode> <tonode>aster_s_polymers_st_1</tonode> </control>
    <control> <fromnode>env</fromnode> <tonode>fdvgrid</tonode> </control>
+   <control> <fromnode>env</fromnode> <tonode>aster_s_polymers_st_1</tonode> </control>
+   <control> <fromnode>env</fromnode> <tonode>benhur</tonode> </control>
+   <control> <fromnode>env</fromnode> <tonode>init</tonode> </control>
    <control> <fromnode>env</fromnode> <tonode>pygmee_v2</tonode> </control>
+   <control> <fromnode>aster_s_polymers_st_1</fromnode> <tonode>gmsh_post</tonode> </control>
    <datalink control="false">
       <fromnode>pygmee_v2</fromnode> <fromport>result_inclusions</fromport>
-      <tonode>benhur</tonode> <toport>file_inclusions</toport>
+      <tonode>fdvgrid</tonode> <toport>file_inclusions</toport>
    </datalink>
    <datalink control="false">
       <fromnode>pygmee_v2</fromnode> <fromport>result_inclusions</fromport>
-      <tonode>fdvgrid</tonode> <toport>file_inclusions</toport>
+      <tonode>benhur</tonode> <toport>file_inclusions</toport>
    </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>phase_number</fromport>
@@ -154,6 +198,10 @@ study_name="test YACS"
       <fromnode>init</fromnode> <fromport>file_result_rve</fromport>
       <tonode>pygmee_v2</tonode> <toport>file_result_rve</toport>
    </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>rve_size</fromport>
+      <tonode>fdvgrid</tonode> <toport>rve_size</toport>
+   </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>rve_size</fromport>
       <tonode>benhur</tonode> <toport>rve_size</toport>
@@ -164,7 +212,11 @@ study_name="test YACS"
    </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>rve_size</fromport>
-      <tonode>fdvgrid</tonode> <toport>rve_size</toport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>rve_size</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>finesse</fromport>
+      <tonode>benhur</tonode> <toport>finesse</toport>
    </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>finesse</fromport>
@@ -172,16 +224,32 @@ study_name="test YACS"
    </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>finesse</fromport>
-      <tonode>benhur</tonode> <toport>finesse</toport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>finesse</toport>
    </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>lambda_I</fromport>
       <tonode>fdvgrid</tonode> <toport>lambda_I</toport>
    </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>lambda_I</fromport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>lambda_I</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>init</fromnode> <fromport>lambda_M</fromport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>lambda_M</toport>
+   </datalink>
    <datalink control="false">
       <fromnode>init</fromnode> <fromport>lambda_M</fromport>
       <tonode>fdvgrid</tonode> <toport>lambda_M</toport>
    </datalink>
+   <datalink control="false">
+      <fromnode>benhur</fromnode> <fromport>result_mesh</fromport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>mesh</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>env</fromnode> <fromport>study_name</fromport>
+      <tonode>pygmee_v2</tonode> <toport>study_name</toport>
+   </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_name</fromport>
       <tonode>fdvgrid</tonode> <toport>study_name</toport>
@@ -192,7 +260,7 @@ study_name="test YACS"
    </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_name</fromport>
-      <tonode>pygmee_v2</tonode> <toport>study_name</toport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>study_name</toport>
    </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_name</fromport>
@@ -200,11 +268,11 @@ study_name="test YACS"
    </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_path</fromport>
-      <tonode>fdvgrid</tonode> <toport>study_path</toport>
+      <tonode>benhur</tonode> <toport>study_path</toport>
    </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_path</fromport>
-      <tonode>benhur</tonode> <toport>study_path</toport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>study_path</toport>
    </datalink>
    <datalink control="false">
       <fromnode>env</fromnode> <fromport>study_path</fromport>
@@ -214,14 +282,28 @@ study_name="test YACS"
       <fromnode>env</fromnode> <fromport>study_path</fromport>
       <tonode>pygmee_v2</tonode> <toport>study_path</toport>
    </datalink>
+   <datalink control="false">
+      <fromnode>env</fromnode> <fromport>study_path</fromport>
+      <tonode>fdvgrid</tonode> <toport>study_path</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>env</fromnode> <fromport>aster_path</fromport>
+      <tonode>aster_s_polymers_st_1</tonode> <toport>aster_path</toport>
+   </datalink>
+   <datalink control="false">
+      <fromnode>aster_s_polymers_st_1</fromnode> <fromport>result_gmsh</fromport>
+      <tonode>gmsh_post</tonode> <toport>result_gmsh</toport>
+   </datalink>
    <parameter>
       <tonode>benhur</tonode><toport>file_inclusions</toport>
       <value><string></string></value>
    </parameter>
-   <presentation name="env" x="518.009" y="574.447" width="227.5" height="139"/>
-   <presentation name="init" x="9" y="422.773" width="273.5" height="371"/>
-   <presentation name="benhur" x="948.69" y="94.3462" width="223" height="226"/>
-   <presentation name="fdvgrid" x="888.902" y="551.141" width="227.5" height="284"/>
-   <presentation name="pygmee_v2" x="390.897" y="87.3212" width="249.5" height="342"/>
-   <presentation name="__ROOT__" x="0" y="0" width="1181.19" height="844.141"/>
+   <presentation name="fdvgrid" x="869" y="80.25" width="227.5" height="284"/>
+   <presentation name="aster_s_polymers_st_1" x="1133" y="271.75" width="227.5" height="313"/>
+   <presentation name="env" x="9" y="301.25" width="227.5" height="168"/>
+   <presentation name="benhur" x="869" y="510.25" width="227.5" height="226"/>
+   <presentation name="init" x="273" y="199.75" width="273.5" height="371"/>
+   <presentation name="gmsh_post" x="1397.25" y="373.25" width="223" height="110"/>
+   <presentation name="pygmee_v2" x="583" y="470.25" width="249.5" height="342"/>
+   <presentation name="__ROOT__" x="0" y="0" width="1629.75" height="821.25"/>
 </proc>
index dd48f3ae61a2e4488be6cf109890773166ff59b4..abd910b4db516c09c5f3ce67c8734ce56bed17b6 100644 (file)
@@ -79,11 +79,12 @@ def remplaceDICO(chaine,dico) :
 def component_benhur(finesse, rve_size, inclusion_name, study_name, study_path):
     print "benhur for YACS - BEGIN"
 
+    finesse=int(finesse)
+
     Template_path=os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/')
     monFichierInput=Template_path+"benhur_template.txt"
     monFichierOutput=Template_path+"s_polymers_st_1_benhur_"+str(finesse)+".bhr"
 
-
     benhur_path=os.path.join(os.getenv('MAP_DIRECTORY'), 'components/benhur/')
 
     f = file(monFichierInput)
@@ -107,7 +108,78 @@ def component_benhur(finesse, rve_size, inclusion_name, study_name, study_path):
     commande="cd "+benhur_path+"/bin;\n"
     commande+="./benhur -i "+monFichierOutput+";\n"
     os.system(commande)
-    print "benhur_input", string_1
-    print "benhur_command", commande
+
+    result_mesh=study_path+'/'+study_name+'_benhur_'+str(finesse)+'.msh'
+    result_log=study_path+'/'+study_name+'_benhur_'+str(finesse)+'.log'
+
+    print 'result_mesh =', result_mesh
+    print 'result_log =', result_log
 
     print "benhur for YACS - END"
+
+    return (result_mesh, result_log)
+
+def component_aster_s_polymers_st_1(rve_size, finesse, lambda_I, lambda_M, study_name, study_path, aster_path):
+    print "aster_s_polymers_st_1 for YACS - BEGIN"
+
+    finesse=int(finesse)
+    
+    Template_path=os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/')
+    monFichierCommInput=Template_path+"s_polymers_st_1_aster_template.comm"
+    monFichierExportInput=Template_path+"s_polymers_st_1_aster_template.export"
+
+    monFichierCommOutput=study_path+"/s_polymers_st_1_aster.comm"
+    monFichierExportOutput=study_path+"/s_polymers_st_1_aster.export"
+    # Lecture du fichier a trous a pour le fichier export
+    f = file(monFichierExportInput)
+    string_0 = f.read()  
+    f.close()         
+    # find and replace with CODE_ASTER dictionnary
+    dicoAster=dict()
+    dicoAster["_MESH_SIZE"]=str(finesse)
+    dicoAster["_ASTER_VERSION"]="STA10"
+    dicoAster["_NAME_STUDY"]="s_polymers_st_1"
+    dicoAster["_PATH_STUDY"]=study_path
+    dicoAster["_CONDUCTIVITE_I"]=str(lambda_I)
+    dicoAster["_CONDUCTIVITE_M"]=str(lambda_M)
+    string_1=remplaceDICO(string_0,dicoAster)
+    # write into output file
+    f=open(monFichierExportOutput,'wb')
+    f.write(string_1)
+    f.close()
+
+    # Lecture du fichier a trous a pour le fichier comm
+    f = file(monFichierCommInput)
+    string_0 = f.read()  
+    f.close()   
+    # find and replace with CODE_ASTER dictionnary
+    # find and replace with CODE_ASTER dictionnary
+    dicoAster=dict()
+    dicoAster["_RVE_SIZE"]=str(rve_size)
+    dicoAster["_CONDUCTIVITE_I"]=str(lambda_I)
+    dicoAster["_CONDUCTIVITE_M"]=str(lambda_M)
+    string_1=remplaceDICO(string_0,dicoAster)
+    # write into output file
+    f=open(monFichierCommOutput,'wb')
+    f.write(string_1)
+    f.close()
+    
+    # launch of CODE_ASTER on the study
+    commande="cd "+study_path+";"
+    commande+=commande + aster_path + "/as_run "+monFichierExportOutput +";\n"
+    os.system(commande)
+    
+    print "aster_s_polymers_st_1 for YACS - END"
+
+    result_gmsh=study_path+"/s_polymers_st_1_aster.resu.msh"
+
+    return result_gmsh
+
+def component_gmsh_post(result_gmsh):
+    print "gmsh_post for YACS - BEGIN"
+    commande="gmsh "+result_gmsh+";"
+    os.system(commande)
+    
+    print "gmsh_post for YACS - END"
+
+    return
index 5749f80b7a0211eb27e7532914c381e9075d46e5..d16107026018b80a08dc193a21a5e40076ccdc83 100644 (file)
@@ -127,10 +127,51 @@ class s_poly_st_1Generator(MapGenerator):
       SchemaYacs.nodeAvant=SchemaYacs.benhurNode
       print "BENHURYACS node Ok"
 
+   def ASTERYACS(self, SchemaYacs, proc):
+      factoryNode = SchemaYacs.monCata._nodeMap["aster_s_polymers_st_1"]
+      SchemaYacs.aster_s_polymers_st_1Node = factoryNode.cloneNode("aster_s_polymers_st_1")
+
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("lambda_I").edInitPy(self.lambda_I)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("lambda_M").edInitPy(self.lambda_M)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("study_name").edInitPy(self.study_name)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("study_path").edInitPy(self.study_path)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("rve_size").edInitPy(self.rve_size)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("finesse").edInitPy(self.finesse)
+      SchemaYacs.aster_s_polymers_st_1Node.getInputPort("aster_path").edInitPy(self.config.PATH_ASTER)
+      
+      proc.edAddChild(SchemaYacs.aster_s_polymers_st_1Node)
+      pout=SchemaYacs.benhurNode.getOutputPort("result_mesh")
+      pin=SchemaYacs.aster_s_polymers_st_1Node.getInputPort("mesh")
+      proc.edAddLink(pout,pin)
+         
+      if SchemaYacs.nodeAvant != None :
+         proc.edAddCFLink(SchemaYacs.nodeAvant,SchemaYacs.aster_s_polymers_st_1Node)
+      SchemaYacs.nodeAvant=SchemaYacs.aster_s_polymers_st_1Node
+      print "ASTERYACS node Ok"
+
+      
+   def GMSHYACS(self, SchemaYacs, proc):
+      factoryNode = SchemaYacs.monCata._nodeMap["gmsh_post"]
+      SchemaYacs.gmsh_postNode = factoryNode.cloneNode("gmsh_post")
+      
+      proc.edAddChild(SchemaYacs.gmsh_postNode)
+      pout=SchemaYacs.aster_s_polymers_st_1Node.getOutputPort("result_gmsh")
+      pin=SchemaYacs.gmsh_postNode.getInputPort("result_gmsh")
+      proc.edAddLink(pout,pin)
+         
+      if SchemaYacs.nodeAvant != None :
+         proc.edAddCFLink(SchemaYacs.nodeAvant,SchemaYacs.gmsh_postNode)
+      SchemaYacs.nodeAvant=SchemaYacs.gmsh_postNode
+      print "GMSHYACS node Ok"
+
    def METHODEYACS(self, SchemaYacs, proc):
       self.PYGMEEYACS(SchemaYacs, proc)
-      if (self.CHOIX=="FD+grid") : self.FDVGRIDYACS(SchemaYacs,proc)
-      if (self.CHOIX=="FEM+mesh") : self.BENHURYACS(SchemaYacs,proc)
+      if (self.CHOIX=="FD+grid") :
+         self.FDVGRIDYACS(SchemaYacs,proc)
+      if (self.CHOIX=="FEM+mesh") :
+         self.BENHURYACS(SchemaYacs,proc)
+         self.ASTERYACS(SchemaYacs,proc)
+         self.GMSHYACS(SchemaYacs,proc)
 
 # II - shell functions
    def ETUDE(self,execution) :
@@ -177,107 +218,47 @@ class s_poly_st_1Generator(MapGenerator):
       elif (self.CHOIX=="FEM+mesh") :
           print "option Code_Aster"
           commande+= self.BENHUR()
-          commande+= self.ASTER()
+          commande+= self.ASTER_s_polymers_st_1()
           commande+= self.GMSH()
           return commande
 
 # III - code and component functions
    def PYGMEE(self) :
       commande_python="import os,sys;\n"
-      commande_python+="sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'), '../EficasV1/MAP/Templates/s_polymers_st_1'));\n"
+      commande_python+="sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/'));\n"
       commande_python+="from s_polymers_st_1_YACS_nodes import *;\n"
       commande_python+="volume_fraction=component_pygmee_v2("+str(self.rve_size)+",1,"+str(self.sieve_curve_in)+","+str(self.sieve_curve_out)+","+str(self.repulsion_distance)+","+str(self.study_name)+","+str(self.study_path)+","+str(self.inclusion_name)+","+str(self.rve_name)+");\n"
       return 'python -c "'+commande_python+'"\n'
 
    def FDVGRID(self):
       commande_python="import os,sys;\n"
-      commande_python+="sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'), '../EficasV1/MAP/Templates/s_polymers_st_1'));\n"
+      commande_python+="sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/'));\n"
       commande_python+="from s_polymers_st_1_YACS_nodes import *;\n"
       commande_python+="lambda_x=component_fdvgrid("+str(self.lambda_I)+","+str(self.lambda_M)+","+str(self.rve_size)+",'"+str(self.inclusion_name)+"',"+str(self.finesse)+");\n"
       return 'python -c "'+commande_python+'"\n'
 
    def BENHUR(self):
       commande_python="import os,sys;\n"
-      commande_python+="sys.path.append(os.path.join(os.getenv('MAP_DIRECTORY'), '../EficasV1/MAP/Templates/s_polymers_st_1'));\n"
+      commande_python+="sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/'));\n"
       commande_python+="from s_polymers_st_1_YACS_nodes import *;\n"
-      commande_python+="component_benhur("+str(self.finesse)+","+str(self.rve_size)+","+str(self.inclusion_name)+",'"+str(self.study_name)+"',"+str(self.study_path)+");\n"
+      commande_python+="component_benhur("+str(self.finesse)+","+str(self.rve_size)+",'"+str(self.inclusion_name)+"','"+str(self.study_name)+"','"+str(self.study_path)+"');\n"
       return 'python -c "'+commande_python+'"\n'
-   
-##       commande="echo 'execution de BENHUR';\n"
-##       #Lecture du fichier a trous
-##       print "name_SCHEME =", self.config.NAME_SCHEME
-##       monFichierInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/benhur_template.txt"
-##       monFichierOutput=self.config.PATH_STUDY+"/"+self.config.NAME_SCHEME+"_benhur_"+str(finesse)+".bhr"
 
-##       f = file(monFichierInput)
-##       string_0 = f.read()  
-##       f.close()
-##       # find and replace with CONFIG idctionnary
-##       string_1=self.remplaceCONFIG(string_0,CONFIGliste)
-##       dicoBenhur=dict()
-##       dicoBenhur["_RVE_SIZE"]=self.size
-##       dicoBenhur["_MESH_SIZE"]=finesse
-##       dicoBenhur["_INCLUSION_FILE"]=self.inclusion_name
-##       # find and replace with BENHUR dictionnary
-##       string_2=self.remplaceDICO(string_1,dicoBenhur)
-##       # write into ouput file
-##       f=open(monFichierOutput,'wb')
-##       f.write(string_2)
-##       f.close()
-##       # launch of BENHUR on the previous file
-##       commande=commande + "cd "+self.config.PATH_BENHUR+"/bin;\n"
-##       commande=commande + "./benhur -i "+monFichierOutput+";\n"
-##       commande=commande + "echo 'fin execution de BENHUR';\n"
-##       return commande
-
-   def ASTER(self) :
-      commande="echo 'execution de CODE_ASTER';\n"
-      monFichierCommInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.comm"
-      monFichierExportInput=self.config.INSTALLDIR+"/MAP/Templates/"+self.config.NAME_SCHEME+"/s_polymers_st_1_aster_template.export"
-
-      monFichierCommOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.comm"
-      monFichierExportOutput=self.config.PATH_STUDY+"/s_polymers_st_1_aster.export"
-      # Lecture du fichier a trous a pour le fichier export
-      f = file(monFichierExportInput)
-      string_0 = f.read()  
-      f.close()
-      # find and replace with CONFIG dictionnary
-      string_1=self.remplaceCONFIG(string_0,CONFIGliste)            
-      # find and replace with CODE_ASTER dictionnary
-      dicoAster=dict()
-      dicoAster["_MESH_SIZE"]=self.finesse
-      dicoAster["_ASTER_VERSION"]="STA10"
-      dicoAster["_NAME_STUDY"]="s_polymers_st_1"
-      string_2=self.remplaceDICO(string_1,dicoAster)
-      # write into output file
-      f=open(monFichierExportOutput,'wb')
-      f.write(string_2)
-      f.close()
-
-      # Lecture du fichier a trous a pour le fichier comm
-      f = file(monFichierCommInput)
-      string_0 = f.read()  
-      f.close()
-      # find and replace with CONFIG dictionnary
-      string_1=self.remplaceCONFIG(string_0,CONFIGliste)       
-      # find and replace with CODE_ASTER dictionnary
-      dicoAster=dict()
-      dicoAster["_RVE_SIZE"]=self.rve_size
-      dicoAster["_CONDUCTIVITE_I"]=self.lambda_I
-      dicoAster["_CONDUCTIVITE_M"]=self.lambda_M
-      string_2=self.remplaceDICO(string_1,dicoAster)
-      # write into output file
-      f=open(monFichierCommOutput,'wb')
-      f.write(string_2)
-      f.close()
-      # launch of CODE_ASTER on the study
-      commande=commande + "cd "+self.config.PATH_STUDY+";"
-      commande=commande + self.config.PATH_ASTER + "/as_run "+monFichierExportOutput +";\n"
-      commande=commande + "echo 'fin execution de CODE_ASTER';\n"
-      return commande
+   def ASTER_s_polymers_st_1(self) :
+      commande_python="import os,sys;\n"
+      commande_python+="sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/'));\n"
+      commande_python+="from s_polymers_st_1_YACS_nodes import *;\n"
+      commande_python+="component_aster_s_polymers_st_1("+str(self.rve_size)+","+str(self.finesse)+","+str(self.lambda_I)+","+str(self.lambda_M)+",'"+str(self.study_name)+"','"+str(self.study_path)+"','"+self.config.PATH_ASTER+"');\n"
+      return 'python -c "'+commande_python+'"\n'
 
    def GMSH(self) :
-      commande="echo 'execution de GMSH';\n"
-      commande+= "gmsh "+self.config.PATH_STUDY+"/s_polymers_st_1_aster.resu.msh;\n"
-      commande+= "echo 'fin execution de GMSH';\n"
-      return commande
+      commande_python="import os,sys;\n"
+      commande_python+="sys.path.append(os.path.join(os.getenv('EFICAS_ROOT'), 'MAP/Templates/s_polymers_st_1/'));\n"
+      commande_python+="from s_polymers_st_1_YACS_nodes import *;\n"
+      commande_python+="component_gmsh_post('"+str(self.study_path+"/s_polymers_st_1_aster.resu.msh")+"');\n"
+      return 'python -c "'+commande_python+'"\n'
+
+##       commande="echo 'execution de GMSH';\n"
+##       commande+= "gmsh "+self.config.PATH_STUDY+"/s_polymers_st_1_aster.resu.msh;\n"
+##       commande+= "echo 'fin execution de GMSH';\n"
+##       return commande