Salome HOME
Prise en compte des instants dans les champs de pilotage pour l'écriture du schÃ...
authornicolas <nicolas>
Thu, 26 Sep 2013 14:55:08 +0000 (14:55 +0000)
committernicolas <nicolas>
Thu, 26 Sep 2013 14:55:08 +0000 (14:55 +0000)
doc/en/tui_create_hypothese.rst
doc/fr/tui_create_hypothese.rst
resources/yacs_01.en.xml
resources/yacs_01.fr.xml
src/HOMARD/YACSDriver.cxx
src/HOMARD/YACSDriver.hxx
src/HOMARD_I/HOMARD_Gen_i.cxx

index 2683b6f6efec02c49e2205cc0f80f508c5719e8b..146187a7056fe678cd5f39606dfbae829b488186 100644 (file)
@@ -182,6 +182,9 @@ The components of the field
 |     Add a component of the field                              |
 |                                                               |
 |     - ``comp_name``: name of a component to take into account |
+|                                                               |
+|     Note: if this method is not used, every component         |
+|     of the field is taken into account.                       |
 +---------------------------------------------------------------+
 | .. module:: SetUseComp                                        |
 |                                                               |
index 2778d342d8127e7787f06ee16b66fd6cb53c3c5c..f05480cabd90f0a937d190acc6f688a93a6e3655 100644 (file)
@@ -178,6 +178,9 @@ Les composantes du champ
 |                                                               |
 |     - ``comp_name`` : nom d'une composante à prendre en       |
 |       compte                                                  |
+|                                                               |
+|     Remarque : si cette méthode n'est pas appelée, par défaut |
+|     toutes les composantes seront retenues.                   |
 +---------------------------------------------------------------+
 | .. module:: SetUseComp                                        |
 |                                                               |
index 68b1d9a0bbaeb1f05301ccefcbc6e84ecbdf8f61..66641f438a4f073f32db4f3e1b56c99b7a865d21 100644 (file)
@@ -285,6 +285,8 @@ Iter.SetMeshFile(MeshFile)
 FileName = dico_resu["FileName"]
 Iter.SetFieldFile(FileName)
 #
+HOMARD_Exec_Iter_Options
+#
 # Calculation
 # ===========
 Error = Iter.Compute(1,1)
index d3e238ba9c168c41c64ff52564a276657ff22b25..6d0df606880644f556c66fd295551a7af38d7deb 100644 (file)
@@ -285,6 +285,8 @@ Iter.SetMeshFile(MeshFile)
 FileName = dico_resu["FileName"]
 Iter.SetFieldFile(FileName)
 #
+HOMARD_Exec_Iter_Options
+#
 # Calcul
 # ======
 Error = Iter.Compute(1,1)
index 01b1f453ae7d6ae3b86b371be54c893c633fad77..d3ac23f8c95d63738e94b901d31916da6be572e0 100644 (file)
@@ -99,7 +99,7 @@ void YACSDriver::Texte_Iter_1_Case_Options( const std::string pythonTexte )
   _Texte += "DirName = \"" + _DirName + "/HOMARD\"\n" ;
   _Texte += "Case.SetDirName(DirName)\n" ;
 
-  Texte_python( pythonTexte, 1, "Case" ) ;
+  Texte_python_1( pythonTexte, 1, "Case" ) ;
 //
 }
 //===============================================================================
@@ -485,14 +485,14 @@ void YACSDriver::Texte_HOMARD_Exec_MeshName( const std::string MeshName )
 //
 }
 //===============================================================================
-// Manipulation des instructions python
+// Manipulation des instructions python - 1
 // pythonTexte : le texte des instructions python a manipuler
 // indice : numero de la premiere ligne voulue
 // concept : nom du concept a inserer
 //===============================================================================
-void YACSDriver::Texte_python( const std::string pythonTexte, int indice, const std::string concept )
+void YACSDriver::Texte_python_1( const std::string pythonTexte, int indice, const std::string concept )
 {
-  MESSAGE("Texte_python, pythonTexte\n"<<pythonTexte);
+  MESSAGE("Texte_python_1, pythonTexte\n"<<pythonTexte);
   MESSAGE("indice = "<<indice<<", concept = "<<concept);
 //
 // Conversion de type
@@ -520,6 +520,39 @@ void YACSDriver::Texte_python( const std::string pythonTexte, int indice, const
 //
 }
 //===============================================================================
+// Manipulation des instructions python - 2
+// pythonTexte : le texte des instructions python a manipuler
+// mot_cle : mot-cle dans les lignes a inserer
+// concept : nom du concept a inserer
+//===============================================================================
+void YACSDriver::Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept )
+{
+  MESSAGE("Texte_python_2, pythonTexte\n"<<pythonTexte);
+  MESSAGE("mot_cle = "<<mot_cle<<", concept = "<<concept);
+//
+// Conversion de type
+  std::istringstream tout (pythonTexte) ;
+//   MESSAGE("\ntout :"<<tout);
+  std::string ligne; // variable contenant chaque ligne de python
+  std::string ligne_bis ; // variable contenant la portion de ligne de python apres '.'
+  while ( std::getline( tout, ligne ) )
+  {
+    int reperage = ligne.find( mot_cle ) ;
+    if ( reperage > 0 )
+    {
+      int position = ligne.find_first_of( "." ) ;
+//       MESSAGE("\nposition : "<< position);
+      if ( position > 0 )
+      {
+        ligne_bis = ligne.substr( position );
+//         MESSAGE("\nligne_bis : "<< ligne_bis);
+        _Texte += concept + ligne_bis + "\n" ;
+      }
+    }
+  }
+//
+}
+//===============================================================================
 // Creation d'un parametre
 //===============================================================================
 void YACSDriver::TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value )
index 57dfa53e9111adaa877433c026f90c9197c7fe55..7f2aa161edc3de536dbb33e2fa83d75e945c445b 100644 (file)
@@ -42,7 +42,8 @@ public:
   std::string Texte_inport( const std::string inport_type, const std::string inport_nom ) ;
   void        Texte_HOMARD_Exec_DirName( ) ;
   void        Texte_HOMARD_Exec_MeshName( const std::string MeshName ) ;
-  void        Texte_python( const std::string pythonTexte, int indice, const std::string concept ) ;
+  void        Texte_python_1( const std::string pythonTexte, int indice, const std::string concept ) ;
+  void        Texte_python_2( const std::string pythonTexte, const std::string mot_cle, const std::string concept ) ;
   void        TexteParametre( const std::string node, const std::string port, const std::string type_value, const std::string value ) ;
   void        TexteAddParametres( ) ;
   void        CreeFichier() ;
index 21aeee1882e47f685aaa9dbae60b9c5d2920423f..2b65286b3cd34e5606b93c4def87617de1e59a6b 100755 (executable)
@@ -3746,6 +3746,10 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
   std::string Iter1Name = std::string((*maListe)[0]);
   MESSAGE ("... Iter1Name = " << Iter1Name);
   HOMARD::HOMARD_Iteration_var Iter1 = GetIteration(Iter1Name.c_str()) ;
+  // D.3. Les instructions python associees a l'iteration
+  CORBA::String_var dumpCorbaIter = Iter1->GetDumpPython();
+  std::string pythonIter = dumpCorbaIter.in();
+  MESSAGE ("pythonIter :\n"<<pythonIter<<"\n");
 
   // E. L'hypothese pour passer de l'iteration initiale a la suivante
   // E.1. La structure
@@ -3815,8 +3819,11 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
       }
       // G.1.7. Execution de HOMARD : les options de l'hypothese
       else if ( mot_cle == "HOMARD_Exec_Hypo_Options" )
-      { myDriver->Texte_python( pythonHypo, 3, "Hypo" ) ;  }
-      // G.1.8. Zones et frontieres : les creations
+      { myDriver->Texte_python_1( pythonHypo, 3, "Hypo" ) ;  }
+      // G.1.8. Execution de HOMARD : les options de l'iteration
+      else if ( mot_cle == "HOMARD_Exec_Iter_Options" )
+      { myDriver->Texte_python_2( pythonIter, "TimeStep", "Iter" ) ;  }
+      // G.1.9. Zones et frontieres : les creations
       else if ( mot_cle == "Iter_1" )
       {
         std::string texte_control = myDriver->Texte_Iter_1_control() ;
@@ -3824,7 +3831,7 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
         texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ;
         myDriver->TexteAdd(texte_control);
       }
-      // G.1.9. Les parametres
+      // G.1.10. Les parametres
       else if ( mot_cle == "PARAMETRES" )
       { myDriver->TexteAddParametres(); }
       // G.1.n. La ligne est recopiee telle quelle