]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
debug for pygmee_v2 and fdvgrid with new interface
authorCharles Toulemonde <charles.toulemonde@edf.fr>
Fri, 7 Jan 2011 10:26:16 +0000 (10:26 +0000)
committerCharles Toulemonde <charles.toulemonde@edf.fr>
Fri, 7 Jan 2011 10:26:16 +0000 (10:26 +0000)
InterfaceQT4/editor.py
MAP/Templates/s_polymers_st_1/s_polymers_st_1_YACS_nodes.py

index 6c5b7173131a1bb874f973b175199f3192d3faa7..a39202a4fd46b26b9a7e59c2da3bf8daaec58e82 100644 (file)
@@ -527,8 +527,9 @@ class JDCEditor(QSplitter):
          # Le generateur existe on l'utilise
          self.generator=generator.plugins[format]()
          self.textePython =self.generator.generRUN(self.jdc,format='beautifie',config=self.appliEficas.CONFIGURATION)
+      command="python -c "+self.textePython
       if execution=="oui" :
-         os.system(self.textePython)
+         os.system(command)
       else:
          return self.textePython
 
@@ -607,7 +608,7 @@ class JDCEditor(QSplitter):
 
         bOK, fn=self.determineNomFichier(path,extension)
         if fn == "" : return
-        self.runYACS(execution="non",nomFichier=self.fichierYACS)
+        self.runYACS(execution="non",nomFichier=fn)
 
       
     #-----------------------------------------#
index e4230768384c3eaa302d7beb1f409eed3070b4d0..aa3dafaca66c605b6ef5c11e86f34b8c8c431c43 100644 (file)
@@ -48,7 +48,7 @@ class component_pygmee_v2:
       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)
-      parameter.write_for_shell(pygmee_v2_input)
+      parameter.write(pygmee_v2_input)
 
       commponent_dir= os.path.join(os.getenv('MAP_DIRECTORY'),'components/pygmee_v2/src')
       commande= "cd "+ commponent_dir +";"
@@ -81,12 +81,38 @@ class component_fdvgrid:
       if (finesse < 32): finesse=32
 
       fdvgrid_path=os.path.join(os.getenv('MAP_DIRECTORY'),'components/fdvgrid/bin')
-      commande = "cd "+fdvgrid_path+";\n"
-      commande+= "cp " + file_inclusions+" "+"inclusions.input"+";\n"
-      commande+= "./fdvgrid 3D 1.0 0.0 0.0 v t "+str(finesse)+" cross 1e-6 "+";\n"
+
+      lambda_output='/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/lambda_x.output'
+      string='[fdvgrid]\n'
+      file_inclusions='/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/pygmee_v2_test_1.inclusions'
+      string+='        microstructure_file="'+file_inclusions+'";\n'
+      string+='        rve_size='+str(rve_size)+';\n'
+      string+='        grid_size='+str(finesse)+';\n'
+      string+='        contrast='+str(contrast)+';\n'
+      string+='        method_type="v";\n'
+      string+='        BC_type="t";\n'
+      string+='        lambda_output="'+lambda_output+'"\n'
+      print "***********************"
+      print "MAP_parameters input"
+      print string
+      print "***********************"                                      
+
+
+      fdvgrid_input='/local00/bin/MAP/studies/demonstrateur_s_polymers_st_1/fdvgrid.input'
+      fd = open(fdvgrid_input, 'w')
+      fd.write(string)
+      fd.close()
+    
+      fdvgrid_path="/local00/bin/MAP/components/fdvgrid/bin"
+
+      print "***********************"
+      commande= "cd "+fdvgrid_path+";\n"
+      commande+= "./fdvgrid "+fdvgrid_input
+      print "commande=", commande
+      
       os.system(commande)
 
-      fd = open(fdvgrid_path+"/"+"lambda_x.output", 'r')
+      fd = open(lambda_output, 'r')
       line=fd.readline()
       self.lambda_x=float(line)
       fd.close()