Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARD / YACSDriver.cxx
index 01b1f453ae7d6ae3b86b371be54c893c633fad77..3a559bcdc9fec98f80d96436b9755c7350367add 100644 (file)
@@ -1,11 +1,11 @@
 //  HOMARD HOMARD : implementation of HOMARD idl descriptions
 //
-// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // Pilote l'ecriture du fichier xml pour lancer un schema YACS
 
 #include <cstring>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 #include <sys/stat.h>
 
+#include "YACSDriver.hxx"
+#include "HOMARD.hxx"
 #include "Utils_SALOME_Exception.hxx"
 #include "utilities.h"
-#include "YACSDriver.hxx"
 
 //=============================================================================
 //=============================================================================
-YACSDriver::YACSDriver(const std::string XMLFile, const std::string DirName):
+YACSDriver::YACSDriver(const std::string XMLFile, const std::string DirName, const std::string LangueShort):
   _XMLFile( "" ), _DirName( "" ),
   _Texte( "" ),
   _Texte_parametres( "" ),
-  _noeud_1( "CreateHypothesis" ),
+  _noeud_1( "CreateCase" ),
+  _LangueShort( "" ),
   _bLu( false )
 {
   MESSAGE("XMLFile = "<<XMLFile<<", DirName ="<<DirName);
   _XMLFile = XMLFile;
   _DirName = DirName;
+  _LangueShort = LangueShort;
 }
 //=============================================================================
 //=============================================================================
@@ -99,7 +104,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" ) ;
 //
 }
 //===============================================================================
@@ -116,14 +121,23 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
 //
 // 1. Le nom du noeud
   std::string noeud_2 = methode + "_" + ZoneName ;
-  std::string node = "Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
+  std::string node ;
+  if ( _LangueShort == "fr" ) { node = "Boucle_de_convergence.Alternance_Calcul_HOMARD" ; }
+  else                        { node = "Convergence_Loop.Alternation_Computation_HOMARD" ; }
+  node += ".Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
   node += noeud_2 ;
-// 2. Texte de controle
-  std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
+// 2. Texte de controle : le noeud precedent est _noeud_1, le noeud courant noeud_2.
+//                        A la fin, on bascule le courant dans le precedent
+  std::string texte_control = Texte_control (_noeud_1, noeud_2, 1) ;
   _noeud_1 = noeud_2 ;
 // 3. Definition du service
+  std::string motcle ;
   _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
-  _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
+  INFOS("_LangueShort = "<<_LangueShort );
+  if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; }
+  else                        { motcle = "Study_Initialisation" ; }
+  INFOS("motcle = "<<motcle );
+  _Texte += "                              <node>" + motcle + ".UpdateStudy</node>\n" ;
   _Texte += "                              <method>" + methode + "</method>\n" ;
 // 4. Les inports
 // 4.1. Le nom de la zone
@@ -159,7 +173,7 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
 // La derniere valeur est toujours mise dans x8
   x8 = GetStringInTexte ( ligne, ")", 0 ) ;
   MESSAGE("coor = "<< x0<<","<<x1<< ","<< x2<< ","<< x3<<","<<x4<<","<<x5<<","<<x6<<","<<x7<<","<<x8);
-// 4.2. Cas du parallelepipede (2)
+// 4.2.2. Cas du parallelepipede (2)
   if ( ZoneType == 2 )
   {
     _Texte += Texte_inport( "double", "Xmini" ) ;
@@ -176,8 +190,8 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
     TexteParametre( node, "Zmaxi", "double", x8 ) ;
   }
 //
-// 4.2. Cas du rectangle (11, 12, 13)
-  else if ( ( ZoneType > 10 ) and ( ZoneType < 14 ) )
+// 4.2.3. Cas du rectangle (11, 12, 13)
+  else if ( ( ZoneType > 10 ) && ( ZoneType < 14 ) )
   {
     _Texte += Texte_inport( "double", "Umini" ) ;
     _Texte += Texte_inport( "double", "Umaxi" ) ;
@@ -191,8 +205,8 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
     TexteParametre( node, "Orient", "int", x8 ) ;
   }
 //
-// 4.2. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63)
-  else if ( ( ( ZoneType > 30 ) and ( ZoneType < 34 ) ) or ( ( ZoneType > 60 ) and ( ZoneType < 64 ) ) )
+// 4.2.4. Cas du disque (31, 32, 33) ou du disque perce (61, 62, 63)
+  else if ( ( ( ZoneType > 30 ) && ( ZoneType < 34 ) ) || ( ( ZoneType > 60 ) && ( ZoneType < 64 ) ) )
   {
     _Texte += Texte_inport( "double", "Ucentre" ) ;
     _Texte += Texte_inport( "double", "Vcentre" ) ;
@@ -209,7 +223,7 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
     TexteParametre( node, "Orient", "int", x8 ) ;
   }
 //
-// 4.2. Cas de la sphere (4)
+// 4.2.5. Cas de la sphere (4)
   else if ( ZoneType == 4 )
   {
     _Texte += Texte_inport( "double", "Xcentre" ) ;
@@ -222,8 +236,8 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
     TexteParametre( node, "Radius", "double", x8 ) ;
   }
 //
-// 4.2. Cas du cylindre (5) ou du tuyau (7)
-  else if ( ZoneType == 5 or ZoneType == 7 )
+// 4.2.6. Cas du cylindre (5) ou du tuyau (7)
+  else if ( ZoneType == 5 || ZoneType == 7 )
   {
     _Texte += Texte_inport( "double", "Xcentre" ) ;
     _Texte += Texte_inport( "double", "Ycentre" ) ;
@@ -252,9 +266,9 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
     }
   }
 //
-// 4.2. Erreur
+// 4.2.7. Erreur
   else
-  { ASSERT("Type de zone inconnu." == 0); }
+  { VERIFICATION("Type de zone inconnu." == 0); }
 
 //
 // 5. La fin
@@ -270,142 +284,174 @@ std::string YACSDriver::Texte_Iter_1_Zone( int ZoneType, const std::string pytho
 // pythonStructure : le python correspondant a la frontiere
 // methode : methode associee a la creation de la frontiere
 // BoundaryName : nom de la frontiere
+// MeshName : nom du maillage dans le cas d'une frontiere discrete
+// MeshFile : nom du fichier du maillage dans le cas d'une frontiere discrete
 //===============================================================================
-std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName )
+std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::string pythonStructure, const std::string methode, const std::string BoundaryName, const std::string MeshName, const std::string MeshFile )
 {
   MESSAGE("Texte_Iter_1_Boundary, BoundaryType = "<<BoundaryType<<", pythonStructure = "<<pythonStructure);
   MESSAGE("methode = "<<methode<<", BoundaryName = "<<BoundaryName );
+  if (BoundaryType == 0) { MESSAGE("MeshName = "<<MeshName<<", MeshFile = "<<MeshFile ); }
 //
 // 1. Le nom du noeud
   std::string noeud_2 = methode + "_" + BoundaryName ;
-  std::string node = "Boucle_de_convergence.Alternance_Calcul_HOMARD.Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
+  std::string node ;
+  if ( _LangueShort == "fr" ) { node = "Boucle_de_convergence.Alternance_Calcul_HOMARD" ; }
+  else                        { node = "Convergence_Loop.Alternation_Computation_HOMARD" ; }
+  node += ".Adaptation.p0_Adaptation_HOMARD.HOMARD_Initialisation.p1_Iter_1." ;
   node += noeud_2 ;
-// 2. Texte de controle
-  std::string texte_control = Texte_control (_noeud_1, noeud_2) ;
+// 2. Texte de controle : le noeud precedent est _noeud_1, le noeud courant noeud_2.
+//                        A la fin, on bascule le courant dans le precedent
+  std::string texte_control = Texte_control (_noeud_1, noeud_2, 1) ;
   _noeud_1 = noeud_2 ;
 // 3. Definition du service
+  std::string motcle ;
   _Texte += "                           <service name=\"" + noeud_2 + "\">\n" ;
-  _Texte += "                              <node>Etude_Initialisation.SetCurrentStudy</node>\n" ;
+  if ( _LangueShort == "fr" ) { motcle = "Etude_Initialisation" ; }
+  else                        { motcle = "Study_Initialisation" ; }
+  _Texte += "                              <node>" + motcle + ".UpdateStudy</node>\n" ;
   _Texte += "                              <method>" + methode + "</method>\n" ;
 // 4. Les inports
-// 4.1. Le nom de la zone
+//    ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
+// 4.1. Le nom de la frontiere
   _Texte += Texte_inport( "string", "BoundaryName" ) ;
   TexteParametre( node, "BoundaryName", "string", BoundaryName ) ;
-// 4.2. Les valeurs numeriques
-//      ATTENTION : les noms doivent etre les memes que dans Gen.xml, donc HOMARD_Gen.idl
-// 4.2.1. Decodage des valeurs
+// 4.2. Cas d une frontiere discrete
+  if (BoundaryType == 0)
+  {
+    _Texte += Texte_inport( "string", "MeshName" ) ;
+    TexteParametre( node, "MeshName", "string", MeshName ) ;
+    _Texte += Texte_inport( "string", "FileName" ) ;
+    TexteParametre( node, "FileName", "string", MeshFile ) ;
+  }
+// 4.3. Cas d'une frontiere analytique : les valeurs numeriques
+  else
+  {
+// 4.3.1. Decodage des valeurs
 // La chaine pythonStructure est de ce genre :
 //   CreateBoundaryCylinder('cyl_2', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
 //   CreateBoundaryDi("intersection", "PIQUAGE", "/scratch/D68518/Salome/script/sfr_2d_piquage.fr.med")
-  std::string ligne = pythonStructure ;
+    std::string ligne = pythonStructure ;
 // On commence par ne garder que ce qui suit la premiere virgule
-  ligne = GetStringInTexte( ligne, ",", 1 );
+    ligne = GetStringInTexte( ligne, ",", 1 );
 // On boucle pour isoler toutes les chaines dans les virgules
-  std::string lignebis ;
-  std::string x0, x1, x2, x3, x4, x5, x6, x7  ;
-  int iaux = 0  ;
-  while ( ligne != lignebis )
-  {
-    lignebis = GetStringInTexte ( ligne, ",", 0 ) ;
+    std::string lignebis ;
+    std::string x0, x1, x2, x3, x4, x5, x6, x7  ;
+    int iaux = 0  ;
+    while ( ligne != lignebis )
+    {
+      lignebis = GetStringInTexte ( ligne, ",", 0 ) ;
 //     MESSAGE("lignebis = "<<lignebis );
-    if      ( iaux == 0 ) { x0 = lignebis ; }
-    else if ( iaux == 1 ) { x1 = lignebis ; }
-    else if ( iaux == 2 ) { x2 = lignebis ; }
-    else if ( iaux == 3 ) { x3 = lignebis ; }
-    else if ( iaux == 4 ) { x4 = lignebis ; }
-    else if ( iaux == 5 ) { x5 = lignebis ; }
-    else if ( iaux == 6 ) { x6 = lignebis ; }
-    ligne = GetStringInTexte( ligne, ",", 1 );
-    iaux += 1 ;
-  }
+      if      ( iaux == 0 ) { x0 = lignebis ; }
+      else if ( iaux == 1 ) { x1 = lignebis ; }
+      else if ( iaux == 2 ) { x2 = lignebis ; }
+      else if ( iaux == 3 ) { x3 = lignebis ; }
+      else if ( iaux == 4 ) { x4 = lignebis ; }
+      else if ( iaux == 5 ) { x5 = lignebis ; }
+      else if ( iaux == 6 ) { x6 = lignebis ; }
+      ligne = GetStringInTexte( ligne, ",", 1 );
+      iaux += 1 ;
+    }
 // La derniere valeur est toujours mise dans x7
-  x7 = GetStringInTexte ( ligne, ")", 0 ) ;
-  MESSAGE("Valeurs = "<< x0<<", "<<x1<< ", "<< x2<< ", "<< x3<<", "<<x4<<", "<<x5<<", "<<x6<<", x7"<<x7);
+    x7 = GetStringInTexte ( ligne, ")", 0 ) ;
+    MESSAGE("Valeurs = "<< x0<<", "<<x1<< ", "<< x2<< ", "<< x3<<", "<<x4<<", "<<x5<<", "<<x6<<", x7"<<x7);
 //
-// 4.2. Cas d une frontiere discrete (0)
-  if (BoundaryType == 0) // Cas d une frontiere discrete
-  {
-    _Texte += Texte_inport( "string", "MeshName" ) ;
-    TexteParametre( node, "MeshName", "string", x0 ) ;
-    _Texte += Texte_inport( "string", "FileName" ) ;
-    TexteParametre( node, "FileName", "string", x7 ) ;
-  }
-// 4.2. Cas du cylindre (1)
-  else if ( BoundaryType == 1 )
-  {
-    _Texte += Texte_inport( "double", "Xcentre" ) ;
-    _Texte += Texte_inport( "double", "Ycentre" ) ;
-    _Texte += Texte_inport( "double", "Zcentre" ) ;
-    _Texte += Texte_inport( "double", "Xaxis" ) ;
-    _Texte += Texte_inport( "double", "Yaxis" ) ;
-    _Texte += Texte_inport( "double", "Zaxis" ) ;
-    _Texte += Texte_inport( "double", "Radius" ) ;
-    TexteParametre( node, "Xcentre", "double", x0 ) ;
-    TexteParametre( node, "Ycentre", "double", x1 ) ;
-    TexteParametre( node, "Zcentre", "double", x2 ) ;
-    TexteParametre( node, "Xaxis", "double", x3 ) ;
-    TexteParametre( node, "Yaxis", "double", x4 ) ;
-    TexteParametre( node, "Zaxis", "double", x5 ) ;
-    TexteParametre( node, "Radius", "double", x7 ) ;
-  }
+// 4.3.2. Cas du cylindre (1)
+    if ( BoundaryType == 1 )
+    {
+      _Texte += Texte_inport( "double", "Xcentre" ) ;
+      _Texte += Texte_inport( "double", "Ycentre" ) ;
+      _Texte += Texte_inport( "double", "Zcentre" ) ;
+      _Texte += Texte_inport( "double", "Xaxis" ) ;
+      _Texte += Texte_inport( "double", "Yaxis" ) ;
+      _Texte += Texte_inport( "double", "Zaxis" ) ;
+      _Texte += Texte_inport( "double", "Radius" ) ;
+      TexteParametre( node, "Xcentre", "double", x0 ) ;
+      TexteParametre( node, "Ycentre", "double", x1 ) ;
+      TexteParametre( node, "Zcentre", "double", x2 ) ;
+      TexteParametre( node, "Xaxis", "double", x3 ) ;
+      TexteParametre( node, "Yaxis", "double", x4 ) ;
+      TexteParametre( node, "Zaxis", "double", x5 ) ;
+      TexteParametre( node, "Radius", "double", x7 ) ;
+    }
 //
-// 4.2. Cas de la sphere (2)
-  else if ( BoundaryType == 2 )
-  {
-    _Texte += Texte_inport( "double", "Xcentre" ) ;
-    _Texte += Texte_inport( "double", "Ycentre" ) ;
-    _Texte += Texte_inport( "double", "Zcentre" ) ;
-    _Texte += Texte_inport( "double", "Radius" ) ;
-    TexteParametre( node, "Xcentre", "double", x0 ) ;
-    TexteParametre( node, "Ycentre", "double", x1 ) ;
-    TexteParametre( node, "Zcentre", "double", x2 ) ;
-    TexteParametre( node, "Radius", "double", x7 ) ;
-  }
+// 4.3.3. Cas de la sphere (2)
+    else if ( BoundaryType == 2 )
+    {
+      _Texte += Texte_inport( "double", "Xcentre" ) ;
+      _Texte += Texte_inport( "double", "Ycentre" ) ;
+      _Texte += Texte_inport( "double", "Zcentre" ) ;
+      _Texte += Texte_inport( "double", "Radius" ) ;
+      TexteParametre( node, "Xcentre", "double", x0 ) ;
+      TexteParametre( node, "Ycentre", "double", x1 ) ;
+      TexteParametre( node, "Zcentre", "double", x2 ) ;
+      TexteParametre( node, "Radius", "double", x7 ) ;
+    }
 //
-// 4.2. Cas d un cone defini par un axe et un angle
-  else if ( BoundaryType == 3 )
-  {
-    _Texte += Texte_inport( "double", "Xaxis" ) ;
-    _Texte += Texte_inport( "double", "Yaxis" ) ;
-    _Texte += Texte_inport( "double", "Zaxis" ) ;
-    _Texte += Texte_inport( "double", "Angle" ) ;
-    _Texte += Texte_inport( "double", "Xcentre" ) ;
-    _Texte += Texte_inport( "double", "Ycentre" ) ;
-    _Texte += Texte_inport( "double", "Zcentre" ) ;
-    TexteParametre( node, "Xaxis", "double", x0 ) ;
-    TexteParametre( node, "Yaxis", "double", x1 ) ;
-    TexteParametre( node, "Zaxis", "double", x2 ) ;
-    TexteParametre( node, "Angle", "double", x3 ) ;
-    TexteParametre( node, "Xcentre", "double", x4 ) ;
-    TexteParametre( node, "Ycentre", "double", x5 ) ;
-    TexteParametre( node, "Zcentre", "double", x7 ) ;
-  }
+// 4.3.4. Cas d un cone defini par un axe et un angle
+    else if ( BoundaryType == 3 )
+    {
+      _Texte += Texte_inport( "double", "Xaxis" ) ;
+      _Texte += Texte_inport( "double", "Yaxis" ) ;
+      _Texte += Texte_inport( "double", "Zaxis" ) ;
+      _Texte += Texte_inport( "double", "Angle" ) ;
+      _Texte += Texte_inport( "double", "Xcentre" ) ;
+      _Texte += Texte_inport( "double", "Ycentre" ) ;
+      _Texte += Texte_inport( "double", "Zcentre" ) ;
+      TexteParametre( node, "Xaxis", "double", x0 ) ;
+      TexteParametre( node, "Yaxis", "double", x1 ) ;
+      TexteParametre( node, "Zaxis", "double", x2 ) ;
+      TexteParametre( node, "Angle", "double", x3 ) ;
+      TexteParametre( node, "Xcentre", "double", x4 ) ;
+      TexteParametre( node, "Ycentre", "double", x5 ) ;
+      TexteParametre( node, "Zcentre", "double", x7 ) ;
+    }
 //
-// 4.2. Cas d un cone defini par les 2 rayons
-  else if ( BoundaryType == 4 )
-  {
-    _Texte += Texte_inport( "double", "Xcentre1" ) ;
-    _Texte += Texte_inport( "double", "Ycentre1" ) ;
-    _Texte += Texte_inport( "double", "Zcentre1" ) ;
-    _Texte += Texte_inport( "double", "Radius1" ) ;
-    _Texte += Texte_inport( "double", "Xcentre2" ) ;
-    _Texte += Texte_inport( "double", "Ycentre2" ) ;
-    _Texte += Texte_inport( "double", "Zcentre2" ) ;
-    _Texte += Texte_inport( "double", "Radius2" ) ;
-    TexteParametre( node, "Xcentre1", "double", x0 ) ;
-    TexteParametre( node, "Ycentre1", "double", x1 ) ;
-    TexteParametre( node, "Zcentre1", "double", x2 ) ;
-    TexteParametre( node, "Radius1", "double", x3 ) ;
-    TexteParametre( node, "Xcentre2", "double", x4 ) ;
-    TexteParametre( node, "Ycentre2", "double", x5 ) ;
-    TexteParametre( node, "Zcentre2", "double", x6 ) ;
-    TexteParametre( node, "Radius2", "double", x7 ) ;
-  }
+// 4.3.5. Cas d un cone defini par les 2 rayons
+    else if ( BoundaryType == 4 )
+    {
+      _Texte += Texte_inport( "double", "Xcentre1" ) ;
+      _Texte += Texte_inport( "double", "Ycentre1" ) ;
+      _Texte += Texte_inport( "double", "Zcentre1" ) ;
+      _Texte += Texte_inport( "double", "Radius1" ) ;
+      _Texte += Texte_inport( "double", "Xcentre2" ) ;
+      _Texte += Texte_inport( "double", "Ycentre2" ) ;
+      _Texte += Texte_inport( "double", "Zcentre2" ) ;
+      _Texte += Texte_inport( "double", "Radius2" ) ;
+      TexteParametre( node, "Xcentre1", "double", x0 ) ;
+      TexteParametre( node, "Ycentre1", "double", x1 ) ;
+      TexteParametre( node, "Zcentre1", "double", x2 ) ;
+      TexteParametre( node, "Radius1", "double", x3 ) ;
+      TexteParametre( node, "Xcentre2", "double", x4 ) ;
+      TexteParametre( node, "Ycentre2", "double", x5 ) ;
+      TexteParametre( node, "Zcentre2", "double", x6 ) ;
+      TexteParametre( node, "Radius2", "double", x7 ) ;
+    }
+// 4.3.6. Cas du tore (5)
+    else if ( BoundaryType == 5 )
+    {
+      _Texte += Texte_inport( "double", "Xcentre" ) ;
+      _Texte += Texte_inport( "double", "Ycentre" ) ;
+      _Texte += Texte_inport( "double", "Zcentre" ) ;
+      _Texte += Texte_inport( "double", "Xaxis" ) ;
+      _Texte += Texte_inport( "double", "Yaxis" ) ;
+      _Texte += Texte_inport( "double", "Zaxis" ) ;
+      _Texte += Texte_inport( "double", "RRev" ) ;
+      _Texte += Texte_inport( "double", "RPri" ) ;
+      TexteParametre( node, "Xcentre", "double", x0 ) ;
+      TexteParametre( node, "Ycentre", "double", x1 ) ;
+      TexteParametre( node, "Zcentre", "double", x2 ) ;
+      TexteParametre( node, "Xaxis", "double", x3 ) ;
+      TexteParametre( node, "Yaxis", "double", x4 ) ;
+      TexteParametre( node, "Zaxis", "double", x5 ) ;
+      TexteParametre( node, "RRev", "double", x6 ) ;
+      TexteParametre( node, "RPri", "double", x7 ) ;
+    }
 //
-// 4.2. Erreur
-  else
-  { ASSERT("Type de frontiere inconnu." == 0); }
-
+// 4.3.7. Erreur
+    else
+    { VERIFICATION("Type de frontiere inconnu." == 0); }
+  }
 //
 // 5. La fin
   _Texte += "                              <outport name=\"return\" type=\"HOMARD_Boundary\"/>\n" ;
@@ -415,15 +461,15 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri
 //
 }
 //===============================================================================
-// Controle des enchainements de noeud dans le noeud Iter_1
+// Fin du controle des enchainements de noeud dans le noeud Iter_1
 //===============================================================================
   std::string YACSDriver::Texte_Iter_1_control()
 {
   MESSAGE("Texte_Iter_1_control");
 //
   std::string texte ;
-  texte  = Texte_control ("CreateCase", "Case_Options") ;
-  texte += Texte_control ("Case_Options", "CreateHypothesis") ;
+  texte  = Texte_control (_noeud_1, "CreateHypothesis", 1) ;
+  texte += Texte_control ("CreateHypothesis", "Case_Options", 0) ;
 //
   return texte ;
 //
@@ -432,16 +478,19 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri
 // Controle des enchainements de noeuds
 // noeud_1 : noeud de depart
 // noeud_2 : noeud d'arrivee
+// option : 0 : sans caractere de saut de ligne a la fin
+//          1 : avec caractere de saut de ligne a la fin
 //===============================================================================
-  std::string YACSDriver::Texte_control( const std::string noeud_1, const std::string noeud_2 )
+  std::string YACSDriver::Texte_control( const std::string noeud_1, const std::string noeud_2, int option )
 {
-  MESSAGE("Texte_control, noeud_1 = "<<noeud_1<<", noeud_2 = "<<noeud_2);
+  MESSAGE("Texte_control, noeud_1 = "<<noeud_1<<", noeud_2 = "<<noeud_2<<", option = "<<option);
 //
   std::string texte ;
   texte  = "                           <control> " ;
   texte += "<fromnode>" + noeud_1 + "</fromnode>" ;
   texte += " <tonode>"  + noeud_2 + "</tonode>" ;
-  texte += " </control>\n" ;
+  texte += " </control>" ;
+  if ( option == 1 ) { texte += "\n" ; }
 
   return texte ;
 //
@@ -453,7 +502,7 @@ std::string YACSDriver::Texte_Iter_1_Boundary( int BoundaryType, const std::stri
 //===============================================================================
   std::string YACSDriver::Texte_inport( const std::string inport_type, const std::string inport_nom )
 {
-//   MESSAGE("Texte_control, inport_type = "<<inport_type<<", inport_nom = "<<inport_nom);
+//   MESSAGE("Texte_inport, inport_type = "<<inport_type<<", inport_nom = "<<inport_nom);
 //
   std::string texte ;
   texte  = "                              <inport " ;
@@ -485,14 +534,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
@@ -507,6 +556,40 @@ void YACSDriver::Texte_python( const std::string pythonTexte, int indice, const
     if ( cptr > indice )
     {
       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" ;
+      }
+    }
+    cptr += 1 ;
+  }
+//
+}
+//===============================================================================
+// 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 )
       {
@@ -515,11 +598,32 @@ void YACSDriver::Texte_python( const std::string pythonTexte, int indice, const
         _Texte += concept + ligne_bis + "\n" ;
       }
     }
-    cptr += 1 ;
   }
 //
 }
 //===============================================================================
+// Parametres de tests de convergence
+//===============================================================================
+void YACSDriver::TexteAnalyse_Test_Convergence( int MaxIter, int MaxNode, int MaxElem )
+{
+//
+//   MESSAGE("TexteAnalyse_Test_Convergence");
+  std::string chaine ;
+  std::ostringstream oss1;
+  oss1 << MaxIter;
+  chaine = oss1.str();
+  _Texte += "MaxIter = " + chaine + "\n" ;
+  std::ostringstream oss2;
+  oss2 << MaxNode;
+  chaine = oss2.str();
+  _Texte += "MaxNode = " + chaine + "\n" ;
+  std::ostringstream oss3;
+  oss3 << MaxElem;
+  chaine = oss3.str();
+  _Texte += "MaxElem = " + chaine + "\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 )