Salome HOME
Enrichissement des possibilités de sortie : niveau, diamètre et
[modules/homard.git] / src / HOMARD_I / HOMARD_Gen_i.cxx
index d38628bba389070adbdcb59905e32c5b39b0c0bc..6683369435315cf51105911da7724feec111820d 100755 (executable)
@@ -1,9 +1,9 @@
-// Copyright (C) 2011-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2014  CEA/DEN, EDF R&D
 //
 // 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
@@ -104,8 +104,8 @@ Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
   _tag_hypo = 0 ;
   _tag_yacs = 0 ;
   _tag_zone = 0 ;
-  _Langue = "Francais" ;
-  _LangueShort = "fr" ;
+
+  SetPreferences( ) ;
 }
 //=================================
 /*!
@@ -628,6 +628,7 @@ void HOMARD_Gen_i::InvalideIterOption(const char* nomIter, CORBA::Long Option)
       if (!so->FindAttribute(anAttr, "AttributeComment")) continue;
       SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr);
       std::string value (aCommentAttr->Value());
+      if(value == std::string("IterationHomard")) continue;
       if(value == std::string("HypoHomard")) continue;
       SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
       aStudyBuilder->RemoveObject(so);
@@ -721,6 +722,47 @@ void HOMARD_Gen_i::InvalideIterInfo(const char* nomIter)
   }
 }
 //=============================================================================
+void HOMARD_Gen_i::InvalideYACS(const char* YACSName)
+{
+  MESSAGE( "InvalideYACS : YACSName    = " << YACSName );
+  HOMARD::HOMARD_YACS_var myYACS = myContextMap[GetCurrentStudyID()]._mesYACSs[YACSName];
+  if (CORBA::is_nil(myYACS))
+  {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "Invalid schema YACS";
+      throw SALOME::SALOME_Exception(es);
+      return ;
+  };
+  //
+  SALOMEDS::SObject_var aYACSSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myYACS)));
+  SALOMEDS::ChildIterator_var  aYACS = myCurrentStudy->NewChildIterator(aYACSSO);
+  for (; aYACS->More(); aYACS->Next())
+  {
+    SALOMEDS::SObject_var so = aYACS->Value();
+    SALOMEDS::GenericAttribute_var anAttr;
+    if (!so->FindAttribute(anAttr, "AttributeComment")) continue;
+    SALOMEDS::AttributeComment_var aCommentAttr = SALOMEDS::AttributeComment::_narrow(anAttr);
+    std::string value (aCommentAttr->Value());
+    if( value == std::string("xml") )
+    {
+      SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+      aStudyBuilder->RemoveObject(so);
+    }
+  }
+  std::string nomFichier = myYACS->GetXMLFile();
+  std::string commande = "rm -rf " + std::string(nomFichier) ;
+  MESSAGE ( "commande = " << commande );
+  if ((system(commande.c_str())) != 0)
+  {
+    SALOME::ExceptionStruct es;
+    es.type = SALOME::BAD_PARAM;
+    es.text = "The XML file for the schema YACS cannot be removed." ;
+    throw SALOME::SALOME_Exception(es);
+    return ;
+  }
+}
+//=============================================================================
 void HOMARD_Gen_i::InvalideZone(const char* ZoneName)
 {
   MESSAGE( "InvalideZone : ZoneName    = " << ZoneName );
@@ -839,14 +881,11 @@ void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo)
   SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
   ASSERT(!CORBA::is_nil(aIterSO));
 
-  // Gestion de l'etude
+  // Gestion de l'arbre d'etudes
   SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
-
   aStudyBuilder->NewCommand();
-
   SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO);
   aStudyBuilder->Addreference(aSubSO, aHypoSO);
-
   aStudyBuilder->CommitCommand();
 
   // Liens reciproques
@@ -1088,7 +1127,9 @@ void HOMARD_Gen_i::MeshInfo(const char* nomCas, const char* MeshName, const char
   IsValidStudy () ;
 
 // Creation du cas
-  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, 1) ;
+  int option = 1 ;
+  if ( _PublisMeshIN != 0 ) option = 2 ;
+  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, 0, option) ;
   myCase->SetDirName(DirName) ;
 // Analyse
   myCase->MeshInfo(Qual, Diam, Conn, Tail, Inte) ;
@@ -1185,8 +1226,9 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char*
 {
   INFOS ( "CreateCase : nomCas = " << nomCas << ", MeshName = " << MeshName << ", MeshFile = " << MeshFile );
 
-  // Par defaut, on ne publie pas le maillage
-  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, 1) ;
+  int option = 1 ;
+  if ( _PublisMeshIN != 0 ) option = 2 ;
+  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 0, 0, option) ;
 
 // Valeurs par defaut des filtrages
   myCase->SetPyram(0);
@@ -1206,11 +1248,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
 
   // A. Decodage du point de reprise
   // A.1. Controle du repertoire de depart de l'iteration
-#ifndef WIN32
-  codret = chdir(DirNameStart) ;
-#else 
-  codret = _chdir(DirNameStart) ;
-#endif
+  codret = CHDIR(DirNameStart) ;
   if ( codret != 0 )
   {
     SALOME::ExceptionStruct es;
@@ -1241,7 +1279,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
     }
   }
   closedir(dp);
-#else 
+#else
   HANDLE hFind = INVALID_HANDLE_VALUE;
   WIN32_FIND_DATA ffd;
   hFind = FindFirstFile(DirNameStart, &ffd);
@@ -1259,7 +1297,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
       }
     }
     FindClose(hFind);
-  } 
+  }
 #endif
   MESSAGE ( "==> file_configuration   : " << file_configuration ) ;
   MESSAGE ( "==> file_maillage_homard : " << file_maillage_homard ) ;
@@ -1360,8 +1398,9 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
 
   // C. Creation effective du cas
 
-  // Par defaut, on ne publie pas le maillage
-  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, 1) ;
+  int option = 1 ;
+  if ( _PublisMeshIN != 0 ) option = 2 ;
+  HOMARD::HOMARD_Cas_ptr myCase = CreateCase0(nomCas, MeshName, MeshFile, 1, NumeIter, option) ;
 
   // D. Parametrages lus dans le fichier de configuration
 
@@ -1381,7 +1420,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
   nomDirIterTotal = std::string(nomDirCase) + "/" + std::string(nomDirIter) ;
 #ifndef WIN32
   if (mkdir(nomDirIterTotal.c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
-#else 
+#else
   if (_mkdir(nomDirIterTotal.c_str()) != 0)
 #endif
   {
@@ -1393,11 +1432,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
     throw SALOME::SALOME_Exception(es);
   }
   // E.3. Copie du maillage HOMARD au format MED
-#ifndef WIN32
-  codret = chdir(DirNameStart) ;
-#else
-  codret = _chdir(DirNameStart) ;
-#endif
+  codret = CHDIR(DirNameStart) ;
   std::string commande = "cp " + file_maillage_homard + " " + nomDirIterTotal ;
   MESSAGE ( "commande : " << commande ) ;
   codret = system(commande.c_str()) ;
@@ -1416,11 +1451,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCaseFromIteration(const char* nomCas,
   delete[] MeshName ;
   delete[] MeshFile ;
 
-#ifndef WIN32
-  chdir(nomDirWork.c_str());
-#else
-  _chdir(nomDirWork.c_str());
-#endif
+  CHDIR(nomDirWork.c_str());
   return HOMARD::HOMARD_Cas::_duplicate(myCase);
 }
 //=============================================================================
@@ -1479,11 +1510,7 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
   int NumeIterMax = -1 ;
 
   // A.1. Controle du repertoire de depart du cas
-#ifndef WIN32
-  codret = chdir(DirNameStart) ;
-#else
-  codret = _chdir(DirNameStart) ;
-#endif
+  codret = CHDIR(DirNameStart) ;
   if ( codret != 0 )
   {
     SALOME::ExceptionStruct es;
@@ -1513,11 +1540,11 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
 #endif
     if ( ( DirName_1 != "." ) && ( DirName_1 != ".." ) )
     {
-#ifndef WIN32
-      if ( chdir(DirName_1.c_str()) == 0 )
+      if ( CHDIR(DirName_1.c_str()) == 0 )
       {
 //      On cherche le fichier de configuration dans ce sous-repertoire
-        codret = chdir(DirNameStart);
+        codret = CHDIR(DirNameStart);
+#ifndef WIN32
         DIR *dp_1;
         struct dirent *dirp_1;
         dp_1  = opendir(DirName_1.c_str()) ;
@@ -1525,26 +1552,19 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
         {
           std::string file_name_1(dirp_1->d_name);
 #else
-     if ( _chdir(DirName_1.c_str()) == 0 )
-     {
-        codret = _chdir(DirNameStart);
         HANDLE hFind1 = INVALID_HANDLE_VALUE;
         WIN32_FIND_DATA ffd1;
         hFind1 = FindFirstFile(DirName_1.c_str(), &ffd1);
-        while (FindNextFile(hFind1, &ffd1) != 0) 
+        while (FindNextFile(hFind1, &ffd1) != 0)
         {
-          if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories          
+          if (ffd1.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
           std::string file_name_1(ffd1.cFileName);
-#endif          
+#endif
           int bilan = file_name_1.find("HOMARD.Configuration.") ;
           if ( bilan != string::npos )
           {
   // Decodage du fichier pour trouver le numero d'iteration
-#ifndef WIN32
-            chdir(DirName_1.c_str()) ;
-#else
-            _chdir(DirName_1.c_str()) ;
-#endif
+            CHDIR(DirName_1.c_str()) ;
 
             std::ifstream fichier( file_name_1.c_str() );
             if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
@@ -1591,11 +1611,7 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
               es.text = CORBA::string_dup(text.c_str());
               throw SALOME::SALOME_Exception(es);
             }
-#ifndef WIN32
-            chdir(DirNameStart) ;
-#else
-            _chdir(DirNameStart) ;
-#endif
+            CHDIR(DirNameStart) ;
           }
           if ( existe ) { break ; }
         }
@@ -1610,12 +1626,10 @@ std::string HOMARD_Gen_i::CreateCase1(const char* DirNameStart, CORBA::Long Numb
   }
 #ifndef WIN32
   closedir(dp);
-  chdir(nomDirWork.c_str());  
 #else
-    FindClose(hFind);
-  }
-  _chdir(nomDirWork.c_str());
+  FindClose(hFind);
 #endif
+  CHDIR(nomDirWork.c_str());
 
   if ( ( Number >= 0 && ( !existe ) ) || ( Number < 0 && ( NumeIterMax == -1 ) ) )
   {
@@ -1784,7 +1798,7 @@ HOMARD::HOMARD_Hypothesis_ptr HOMARD_Gen_i::CreateHypothesis(const char* nomHypo
   myHypothesis->SetNivMax(-1);
   myHypothesis->SetDiamMin(-1.0);
   myHypothesis->SetAdapInit(0);
-  myHypothesis->SetLevelOutput(0);
+  myHypothesis->SetExtraOutput(1);
 
   return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis);
 }
@@ -1877,6 +1891,14 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* NomIterat
 // Lien avec l'iteration precedente
   myIterationParent->LinkNextIteration(NomIteration);
   myIteration->SetIterParentName(nomIterParent);
+  // Gestion de l'arbre d'etudes
+  SALOMEDS::SObject_var aIterSOParent = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIterationParent)));
+  SALOMEDS::SObject_var aIterSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
+  aStudyBuilder->NewCommand();
+  SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aIterSO);
+  aStudyBuilder->Addreference(aSubSO, aIterSOParent);
+  aStudyBuilder->CommitCommand();
 
   return HOMARD::HOMARD_Iteration::_duplicate(myIteration);
 }
@@ -1911,7 +1933,7 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam
 //=============================================================================
 HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryDi(const char* BoundaryName, const char* MeshName, const char* MeshFile)
 {
-  INFOS ("CreateBoundaryDi : BoundaryName  = " << BoundaryName << "MeshName = " << MeshName );
+  INFOS ("CreateBoundaryDi : BoundaryName  = " << BoundaryName << "MeshName = " << MeshName );
   HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 0);
   myBoundary->SetMeshFile( MeshFile ) ;
   myBoundary->SetMeshName( MeshName ) ;
@@ -2032,6 +2054,35 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryConeR(const char* Bounda
   return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ;
 }
 //=============================================================================
+HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundaryTorus(const char* BoundaryName,
+                                      CORBA::Double Xcentre, CORBA::Double Ycentre, CORBA::Double Zcentre,
+                                      CORBA::Double Xaxe, CORBA::Double Yaxe, CORBA::Double Zaxe,
+                                      CORBA::Double RayonRev, CORBA::Double RayonPri)
+{
+  INFOS ("CreateBoundaryTorus : BoundaryName  = " << BoundaryName ) ;
+//
+  SALOME::ExceptionStruct es;
+  int error = 0 ;
+  if ( ( RayonRev <= 0.0 ) || ( RayonPri <= 0.0 ) )
+  { es.text = "The radius must be positive." ;
+    error = 1 ; }
+  double daux = fabs(Xaxe) + fabs(Yaxe) + fabs(Zaxe) ;
+  if ( daux < 0.0000001 )
+  { es.text = "The axis must be a non 0 vector." ;
+    error = 2 ; }
+  if ( error != 0 )
+  {
+    es.type = SALOME::BAD_PARAM;
+    throw SALOME::SALOME_Exception(es);
+    return 0;
+  };
+//
+  HOMARD::HOMARD_Boundary_var myBoundary = CreateBoundary(BoundaryName, 5) ;
+  myBoundary->SetTorus( Xcentre, Ycentre, Zcentre, Xaxe, Yaxe, Zaxe, RayonRev, RayonPri ) ;
+
+  return HOMARD::HOMARD_Boundary::_duplicate(myBoundary) ;
+}
+//=============================================================================
 HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Long ZoneType)
 {
   MESSAGE ("CreateZone : ZoneName  = " << ZoneName << ", ZoneType = " << ZoneType);
@@ -2361,7 +2412,44 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration];
   ASSERT(!CORBA::is_nil(myIteration));
 
-  // A.2. Numero de l'iteration
+  // A.2. Controle de la possibilite d'agir
+  // A.2.1. Etat de l'iteration
+  int etat = myIteration->GetState();
+  MESSAGE ( "etat = "<<etat );
+  // A.2.2. On ne calcule pas l'iteration initiale, ni une iteration deja calculee
+  if ( modeHOMARD == 1 )
+  {
+    if ( etat <= 0 )
+    {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "This iteration is the first of the case and cannot be computed.";
+      throw SALOME::SALOME_Exception(es);
+      return 1 ;
+    }
+    else if ( ( etat == 2 ) & ( modeHOMARD == 1 ) )
+    {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "This iteration is already computed.";
+      throw SALOME::SALOME_Exception(es);
+      return 1 ;
+    }
+  }
+  // A.2.3. On n'analyse pas une iteration non calculee
+  else
+  {
+    if ( etat == 1 )
+    {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "This iteration is not computed.";
+      throw SALOME::SALOME_Exception(es);
+      return 1 ;
+    }
+  }
+
+  // A.3. Numero de l'iteration
   //     siterp1 : numero de l'iteration a traiter
   //     Si adaptation :
   //        siter   : numero de l'iteration parent, ou 0 si deja au debut mais cela ne servira pas !
@@ -2386,7 +2474,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   else
   { siter = siterp1 ; }
 
-  // A.3. Le cas
+  // A.4. Le cas
   const char* nomCas = myIteration->GetCaseName();
   HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
   ASSERT(!CORBA::is_nil(myCase));
@@ -2419,11 +2507,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
 
    // D. On passe dans le repertoire de l'iteration a calculer
   MESSAGE ( ". On passe dans DirCompute = " << DirCompute );
-#ifndef WIN32
-  chdir(DirCompute);
-#else
-  _chdir(DirCompute);
-#endif
+  CHDIR(DirCompute);
 
   // E. Les donnees de l'execution HOMARD
   // E.1. L'objet du texte du fichier de configuration
@@ -2511,7 +2595,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   // H.3 Message d'erreur
     if (codretexec != 0)
     {
-      std::string text ;
+      std::string text = "" ;
       // Message d'erreur en cas de probleme en adaptation
       if ( modeHOMARD == 1 )
       {
@@ -2534,10 +2618,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
           }
         }
       }
-      else
-      {
-        text = "Voir le fichier Liste.log.\n" ;
-      }
+      text += "\n\nSee the file " + LogFile + "\n" ;
       INFOS ( text ) ;
       SALOME::ExceptionStruct es;
       es.type = SALOME::BAD_PARAM;
@@ -2554,12 +2635,8 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena
   {
     delete myDriver;
     MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork );
-    
-#ifndef WIN32
-    chdir(nomDirWork.c_str());
-#else
-    _chdir(nomDirWork.c_str());
-#endif
+
+    CHDIR(nomDirWork.c_str());
   }
 
   return codretexec ;
@@ -2574,8 +2651,6 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
   // A. Prealable
   // A.1. Bases
   int codret = 0;
-  // Etat de l'iteration
-  int etat = myIteration->GetState();
   // Numero de l'iteration
   int NumeIter = myIteration->GetNumber();
   std::stringstream saux0 ;
@@ -2583,18 +2658,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
   std::string siter = saux0.str() ;
   if (NumeIter < 11) { siter = "0" + siter ; }
 
-  // A.2. On ne calcule pas l iteration initiale
-  if ( etat <= 0 )
-  {
-    MESSAGE ( "etat = "<<etat );
-    SALOME::ExceptionStruct es;
-    es.type = SALOME::BAD_PARAM;
-    es.text = "This iteration is the first of the case and cannot be computed.";
-    throw SALOME::SALOME_Exception(es);
-    return 1;
-  };
-
-  // A.3. On verifie qu il y a une hypothese (erreur improbable);
+  // A.2. On verifie qu il y a une hypothese (erreur improbable);
   const char* nomHypo = myIteration->GetHypoName();
   if (std::string(nomHypo) == std::string(""))
   {
@@ -2676,6 +2740,7 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
   int TypeAdap = (*ListTypes)[0];
   int TypeRaff = (*ListTypes)[1];
   int TypeDera = (*ListTypes)[2];
+//   MESSAGE ( ". TypeAdap = " << TypeAdap << ", TypeRaff = " << TypeRaff << ", TypeDera = " << TypeDera  );
 
   // E. Texte du fichier de configuration
   // E.1. Incontournables du texte
@@ -2719,9 +2784,9 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
   MESSAGE ( ". DiamMin = " << DiamMin );
   int AdapInit = myHypo->GetAdapInit();
   MESSAGE ( ". AdapInit = " << AdapInit );
-  int LevelOutput = myHypo->GetLevelOutput();
-  MESSAGE ( ". LevelOutput = " << LevelOutput );
-  myDriver->TexteAdvanced(Pyram, NivMax, DiamMin, AdapInit, LevelOutput);
+  int ExtraOutput = myHypo->GetExtraOutput();
+  MESSAGE ( ". ExtraOutput = " << ExtraOutput );
+  myDriver->TexteAdvanced(Pyram, NivMax, DiamMin, AdapInit, ExtraOutput);
 
   // E.7. Ajout des informations sur le deroulement de l'execution
   int MessInfo = myIteration->GetInfoCompute();
@@ -2738,12 +2803,8 @@ CORBA::Long HOMARD_Gen_i::ComputeAdap(HOMARD::HOMARD_Cas_var myCase, HOMARD::HOM
 char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
 {
   MESSAGE ( "CreateDirNameIter : nomrep ="<< nomrep << ", num = "<<num);
-  // On verifie que le repertoire parent existe  
-#ifndef WIN32
-  int codret = chdir(nomrep) ;
-#else
-  int codret = _chdir(nomrep) ;
-#endif
+  // On verifie que le repertoire parent existe
+  int codret = CHDIR(nomrep) ;
   if ( codret != 0 )
   {
     SALOME::ExceptionStruct es;
@@ -2759,12 +2820,8 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
   while ( a_chercher )
   {
     // On passe dans le repertoire parent
-    
-#ifndef WIN32
-  chdir(nomrep);
-#else
-  _chdir(nomrep);
-#endif
+
+    CHDIR(nomrep);
     // On recherche un nom sous la forme Iabc, avec abc representant le numero
     int jaux ;
     if      ( num <    100 ) { jaux = 2 ; }
@@ -2778,13 +2835,8 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
     DirNameA << "I" << iaux.str();
     // Si on ne pas peut entrer dans le repertoire, on doit verifier
     // que c'est bien un probleme d'absence
-#ifndef WIN32
-    if ( chdir(DirNameA.str().c_str()) != 0 )
+    if ( CHDIR(DirNameA.str().c_str()) != 0 )
     {
-#else
-    if ( _chdir(DirNameA.str().c_str()) != 0 )
-    {
-#endif
       bool existe = false ;
 #ifndef WIN32
       DIR *dp;
@@ -2801,13 +2853,12 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
         while (FindNextFile(hFind, &ffd) != 0) {
          if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) continue; //skip directories
          std::string file_name(ffd.cFileName);
-#endif        
+#endif
         if ( file_name == DirNameA.str() ) { existe = true ; }
       }
 #ifndef WIN32
       closedir(dp);
-#else 
-      }
+#else
       FindClose(hFind);
 #endif
       if ( !existe )
@@ -2822,11 +2873,7 @@ char* HOMARD_Gen_i::CreateDirNameIter(const char* nomrep, CORBA::Long num )
 
   MESSAGE ( "==> DirName = " << DirName);
   MESSAGE ( ". On retourne dans nomDirActuel = " << nomDirActuel );
-#ifndef WIN32
-  chdir(nomDirActuel.c_str());
-#else
-  _chdir(nomDirActuel.c_str());
-#endif
+  CHDIR(nomDirActuel.c_str());
   return CORBA::string_dup( DirName.c_str() );
 }
 //=============================================================================
@@ -2853,19 +2900,14 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
   MESSAGE (". DirCompute = " << DirCompute.str() );
 
   // B.3.3. Si le sous-repertoire n'existe pas, on le cree
-#ifndef WIN32
-  if (chdir(DirCompute.str().c_str()) != 0)
+  if (CHDIR(DirCompute.str().c_str()) != 0)
   {
-//  Creation du repertoire car il n'existe pas :
+#ifndef WIN32
     if (mkdir(DirCompute.str().c_str(), S_IRWXU|S_IRGRP|S_IXGRP) != 0)
-    {
 #else
-  if (_chdir(DirCompute.str().c_str()) != 0)
-  {
-//  Creation du repertoire car il n'existe pas :
     if (_mkdir(DirCompute.str().c_str()) != 0)
-    {
 #endif
+    {
        // GERALD -- QMESSAGE BOX
        std::cerr << "Pb Creation du repertoire DirCompute = " << DirCompute.str() << std::endl;
        VERIFICATION("Pb a la creation du repertoire" == 0);
@@ -2921,7 +2963,7 @@ char* HOMARD_Gen_i::ComputeDirManagement(HOMARD::HOMARD_Cas_var myCase, HOMARD::
         {
           SALOME::ExceptionStruct es;
           es.type = SALOME::BAD_PARAM;
-          std::string text = "Directory : " + DirCompute.str() + "is not empty";
+          std::string text = "Directory : " + DirCompute.str() + " is not empty";
           es.text = CORBA::string_dup(text.c_str());
           throw SALOME::SALOME_Exception(es);
           VERIFICATION("Directory is not empty" == 0);
@@ -3063,7 +3105,7 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
     std::string BoundaryName = std::string((*ListBoundaryGroupType)[NumBoundary]);
     MESSAGE ( "... BoundaryName = " << BoundaryName);
     // 2.1. La frontiere a-t-elle deja ete ecrite ?
-    //      Cela arrive quand elle estliéé a plusieurs groupes. Il ne faut l'ecrire que la premiere fois
+    //      Cela arrive quand elle est liee a plusieurs groupes. Il ne faut l'ecrire que la premiere fois
     int A_faire = 1 ;
     std::list<std::string>::const_iterator it = ListeBoundaryTraitees.begin();
     while (it != ListeBoundaryTraitees.end())
@@ -3085,7 +3127,9 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
       if (BoundaryType == 0)
       {
         const char* MeshName = myBoundary->GetMeshName() ;
+        MESSAGE ( ". MeshName = " << MeshName );
         const char* MeshFile = myBoundary->GetMeshFile() ;
+        MESSAGE ( ". MeshFile = " << MeshFile );
         myDriver->TexteBoundaryDi( MeshName, MeshFile);
         if ( BoundaryOption % 2 != 0 ) { BoundaryOption = BoundaryOption*2 ; }
       }
@@ -3114,6 +3158,11 @@ void HOMARD_Gen_i::DriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase, HomardDriv
           myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]);
           if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; }
         }
+        else if (BoundaryType == 5) // Cas d un tore
+        {
+          myDriver->TexteBoundaryAn(BoundaryName, NumBoundaryAnalytical, BoundaryType, (*coor)[0], (*coor)[1], (*coor)[2], (*coor)[3], (*coor)[4], (*coor)[5], (*coor)[6], (*coor)[7]);
+          if ( BoundaryOption % 3 != 0 ) { BoundaryOption = BoundaryOption*3 ; }
+        }
       }
       // 2.2.3. Memorisation du traitement
       ListeBoundaryTraitees.push_back( BoundaryName );
@@ -3363,6 +3412,11 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t
       icone = "conedxyz.png" ;
       break;
     }
+    case 5 :
+    { value = "BoundaryAnHomard" ;
+      icone = "toruspointvector.png" ;
+      break;
+    }
   }
   aResultSO = aStudyBuilder->NewObject(aSObject);
   PublishInStudyAttr(aStudyBuilder, aResultSO, theName, value.c_str(), icone.c_str(), _orb->object_to_string(theObject));
@@ -3635,6 +3689,7 @@ void HOMARD_Gen_i::PublishBoundaryUnderCase(const char* CaseName, const char* Bo
 
   SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aCaseSO);
   aStudyBuilder->Addreference(aSubSO, aBoundarySO);
+//   aStudyBuilder->RemoveReference(aSubSO);
 
   aStudyBuilder->CommitCommand();
 
@@ -3698,10 +3753,7 @@ void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long Option)
         {
           MESSAGE ( "PublishResultInSmesh : le fichier " << NomFich << " est deja publie." );
           // Pour un fichier importe, on ne republie pas
-          if ( Option == 0 )
-          {
-            return;
-          }
+          if ( Option == 0 ) { return; }
           // Pour un fichier calcule, on commence par faire la depublication
           else
           {
@@ -3794,6 +3846,37 @@ void HOMARD_Gen_i::DeleteResultInSmesh(std::string NomFich, std::string MeshName
   return ;
 }
 //=============================================================================
+void HOMARD_Gen_i::PublishMeshIterInSmesh(const char* NomIter)
+{
+  MESSAGE( "PublishMeshIterInSmesh " << NomIter);
+  HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIter];
+
+  SALOMEDS::SObject_var aIterSO=SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myIteration)));
+  if (CORBA::is_nil(myIteration))
+  {
+      SALOME::ExceptionStruct es;
+      es.type = SALOME::BAD_PARAM;
+      es.text = "Invalid iterationStudy Object";
+      throw SALOME::SALOME_Exception(es);
+      return ;
+  };
+  const char* MeshFile = myIteration->GetMeshFile() ;
+  const char* MeshName = myIteration->GetMeshName() ;
+  CORBA::Long Option = -1 ;
+  int etat = myIteration->GetState();
+// Iteration initiale
+  if ( etat <= 0 )      { Option = 0 ; }
+// ou iteration calculee
+  else if ( etat == 2 ) { Option = 1 ; }
+// Publication effective apres menage eventuel
+  if ( Option >= 0 )
+  {
+    DeleteResultInSmesh(MeshFile, MeshName) ;
+    PublishResultInSmesh(MeshFile, Option) ;
+  }
+
+}
+//=============================================================================
 void HOMARD_Gen_i::PublishFileUnderIteration(const char* NomIter, const char* NomFich, const char* Commentaire)
 {
 //   MESSAGE ("PublishFileUnderIteration pour l'iteration " << NomIter << " du fichier " << NomFich << " avec le commentaire " << Commentaire );
@@ -3912,9 +3995,17 @@ HOMARD::HOMARD_YACS_ptr HOMARD_Gen_i::CreateYACSSchema (const char* nomYACS, con
   myYACS->SetScriptFile( ScriptFile ) ;
   myYACS->SetCaseName( nomCas ) ;
   // D.2. Defaut
+  int defaut_i ;
   // D.2.1. Type constant
   myYACS->SetType( 1 ) ;
-  // D.2.2. Fichier de sauvegarde dans le repertoire du cas
+  // D.2.2. Convergence
+  defaut_i = GetYACSMaxIter() ;
+  myYACS->SetMaxIter( defaut_i ) ;
+  defaut_i = GetYACSMaxNode() ;
+  myYACS->SetMaxNode( defaut_i ) ;
+  defaut_i = GetYACSMaxElem() ;
+  myYACS->SetMaxElem( defaut_i ) ;
+  // D.3. Fichier de sauvegarde dans le repertoire du cas
   HOMARD::HOMARD_Cas_ptr caseyacs = GetCase(nomCas) ;
   std::string dirnamecase = caseyacs->GetDirName() ;
   std::string XMLFile ;
@@ -3958,6 +4049,10 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
   std::string DirName = myYACS->GetDirName() ;
   std::string MeshFile = myYACS->GetMeshFile() ;
   std::string ScriptFile = myYACS->GetScriptFile() ;
+  // B.3. Les caracteristiques de convergence
+  int MaxIter = myYACS->GetMaxIter() ;
+  int MaxNode = myYACS->GetMaxNode() ;
+  int MaxElem = myYACS->GetMaxElem() ;
 
   // C. Le cas
   // C.1. L'objet cas
@@ -4069,15 +4164,20 @@ CORBA::Long HOMARD_Gen_i::YACSWriteOnFile(const char* nomYACS, const char* XMLFi
       // 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
+      // G.1.9. a. Creation eventuelles des zones et frontieres
+      //        b. Enchainement
       else if ( mot_cle == "Iter_1" )
       {
-        std::string texte_control = myDriver->Texte_Iter_1_control() ;
+        std::string texte_control = "" ;
         if ( TypeAdap == 0 ) { texte_control += YACSDriverTexteZone( myHypo, myDriver ) ; }
         texte_control += YACSDriverTexteBoundary( myCase, myDriver ) ;
+        texte_control += myDriver->Texte_Iter_1_control() ;
         myDriver->TexteAdd(texte_control);
       }
-      // G.1.10. Les parametres
+      // G.1.10. Les tests de convergence
+      else if ( mot_cle == "Analyse_Test_Convergence" )
+      { myDriver->TexteAnalyse_Test_Convergence(MaxIter, MaxNode, MaxElem); }
+      // G.1.11. Les parametres
       else if ( mot_cle == "PARAMETRES" )
       { myDriver->TexteAddParametres(); }
       // G.1.n. La ligne est recopiee telle quelle
@@ -4146,7 +4246,7 @@ std::string HOMARD_Gen_i::YACSDriverTexteZone(HOMARD::HOMARD_Hypothesis_var myHy
     texte_control_0 = myDriver->Texte_Iter_1_Zone(ZoneType, pythonStructure, methode, ZoneName );
     texte_control += texte_control_0 ;
     // 5. Decalage
-    iaux += 1 ;
+    iaux ++ ;
   }
 
   return texte_control ;
@@ -4201,8 +4301,17 @@ std::string HOMARD_Gen_i::YACSDriverTexteBoundary(HOMARD::HOMARD_Cas_var myCase,
       // 4. Mise en place des instructions
       int BoundaryType = myBoundary->GetType();
       MESSAGE ( "... BoundaryType = " << BoundaryType);
+      const char* MeshName ;
+      const char* MeshFile ;
+      if (BoundaryType == 0)
+      {
+        MeshName = myBoundary->GetMeshName() ;
+        MESSAGE ( ". MeshName = " << MeshName );
+        MeshFile = myBoundary->GetMeshFile() ;
+        MESSAGE ( ". MeshFile = " << MeshFile );
+      }
       std::string texte_control_0 ;
-      texte_control_0 = myDriver->Texte_Iter_1_Boundary(BoundaryType, pythonStructure, methode, BoundaryName );
+      texte_control_0 = myDriver->Texte_Iter_1_Boundary(BoundaryType, pythonStructure, methode, BoundaryName, MeshName, MeshFile );
       texte_control += texte_control_0 ;
       // 5. Memorisation du traitement
       ListeBoundaryTraitees.push_back( BoundaryName );
@@ -4421,7 +4530,7 @@ CORBA::Boolean HOMARD_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
     }
     else if (line.substr(0, iterSignature.size()) == iterSignature) {
       // re-create iteration
-      MESSAGE ("Recreation de l iteration" );
+      MESSAGE ("Recreation de l'iteration" );
       HOMARD::HOMARD_Iteration_var aIter = newIteration();
       PortableServer::ServantBase_var aServant = GetServant(aIter);
       HOMARD_Iteration_i* aIterServant = dynamic_cast<HOMARD_Iteration_i*>(aServant.in());
@@ -4639,7 +4748,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy,
 
    std::string aScript = "\"\"\"\n";
    aScript += "Python script for HOMARD\n";
-   aScript += "Copyright EDF-R&D 2013\n";
+   aScript += "Copyright EDF-R&D 1996, 2011, 2014\n";
    aScript += "\"\"\"\n";
    aScript += "__revision__ = \"V1.2\"\n";
    aScript += "import HOMARD\n";
@@ -4852,30 +4961,179 @@ char* HOMARD_Gen_i::getVersion()
 #endif
 }
 //===============================================================================
-// Recuperation de la chaine de caracteres par rapport a l'apparition d'un texte
+// Recuperation de la chaine de caracteres par rapport a l'apparition d'un caractere
 // ligne : la ligne a manipuler
-// texte : le texte a reperer
-// option : 0 : la chaine avant le texte
-//          1 : la chaine apres le texte
-// Si le texte est absent, on retourne la chaine totale
+// caractere : le caractere a reperer
+// option : 0 : la chaine avant la premiere apparition du caractere
+//          1 : la chaine apres la premiere apparition du caractere
+//          2 : la chaine avant la derniere apparition du caractere
+//          3 : la chaine apres la derniere apparition du caractere
+// Si le caractere est absent, on retourne la chaine totale
 //===============================================================================
-std::string HOMARD_Gen_i::GetStringInTexte( const std::string ligne, const std::string texte, int option )
+std::string HOMARD_Gen_i::GetStringInTexte( const std::string ligne, const std::string caractere, int option )
 {
-//   MESSAGE("GetStringInTexte, recherche de '"<<texte<<"' dans '"<<ligne<<"'"<<", option = "<<option);
+//   MESSAGE("GetStringInTexte, recherche de '"<<caractere<<"' dans '"<<ligne<<"'"<<", option = "<<option);
 //
   std::string chaine = ligne ;
-  int position = ligne.find_first_of( texte ) ;
-  if ( position > 0 )
+  int position ;
+  if ( option < 2 ) { position = ligne.find_first_of( caractere ) ; }
+  else              { position = ligne.find_last_of( caractere ) ; }
+//   MESSAGE("position = "<<position);
+//   MESSAGE("a = "<<ligne.substr( 0, position ).c_str());
+//   MESSAGE("b = "<<ligne.substr( position+1 ).c_str());
+//
+  if ( position != std::string::npos )
   {
-    if ( option == 0 ) { chaine = ligne.substr( 0, position ) ; }
-    else               { chaine = ligne.substr( position+1 ) ; }
+    if ( ( option == 0 ) || ( option == 2 ) ) { chaine = ligne.substr( 0, position ) ; }
+    else                                      { chaine = ligne.substr( position+1 ) ; }
   }
   return chaine ;
 //
 }
-// //===============================================================================
-// // Langue de SALOME
-// //===============================================================================
+//=============================================================================
+//=============================================================================
+// Gestion des preferences
+//=============================================================================
+//=============================================================================
+// Decodage du fichier d'arcihvage des preferences
+//
+void HOMARD_Gen_i::SetPreferences( )
+{
+  MESSAGE ( "SetPreferences" );
+
+  std::string ligne, mot_cle, salome_version ;
+  bool ok = true ;
+
+  // A. Les valeurs par defaut ; elles doivent etre coherentes
+  std::string LanguageShort = "en" ;
+  int PublisMeshIN = 0 ;
+  int PublisMeshOUT = 0 ;
+  int YACSMaxIter = 0 ;
+  int YACSMaxNode = 0 ;
+  int YACSMaxElem = 0 ;
+  std::string YACSTypeTestchaine = "None" ;
+
+  // B. La version de salome
+  // Cela se presente sous la forme :
+  // [SALOME KERNEL] : 7.3.0
+  std::string File ;
+  File  = getenv("KERNEL_ROOT_DIR") ;
+  File += "/bin/salome/VERSION" ;
+  MESSAGE ( "File = "<<File ) ;
+  std::ifstream fichier0( File.c_str() ) ;
+  if ( fichier0 ) // ce test échoue si le fichier n'est pas ouvert
+  {
+    std::string ligne; // variable contenant chaque ligne lue
+    while ( std::getline( fichier0, ligne ) )
+    {
+      std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux
+      ligne_bis >> mot_cle ;
+      if ( mot_cle == "[SALOME" )
+      {
+        salome_version = GetStringInTexte ( ligne, " ", 3 ) ;
+//         MESSAGE ( "salome_version = "<<salome_version<<"|||");
+        break ;
+      }
+    }
+  }
+  else { ok = false ; }
+
+  // B. Decodage du fichier de preferences
+  if ( ok )
+  {
+    std::string PrefFile ;
+    PrefFile  = getenv("HOME") ;
+    PrefFile += "/.config/salome/SalomeApprc." + salome_version ;
+    MESSAGE ( "PrefFile = "<<PrefFile ) ;
+
+    std::ifstream fichier( PrefFile.c_str() );
+    if ( fichier ) // ce test échoue si le fichier n'est pas ouvert
+    {
+      bool section_langue = false ;
+      bool section_homard = false ;
+      while ( std::getline( fichier, ligne ) )
+      {
+        std::string chaine ;
+        // 1. Pour la ligne courante, on identifie le premier mot : le mot-cle eventuel
+        std::istringstream ligne_bis(ligne); // variable contenant chaque ligne sous forme de flux
+        ligne_bis >> mot_cle ;
+
+        // 2. Les sections
+        // 2.1. Debut d'une section
+  //       MESSAGE(mot_cle);
+        if ( mot_cle == "<section" )
+        { /*MESSAGE ( "Debut de la section : "<< ligne);*/
+          ligne_bis >> mot_cle ;
+          chaine = GetStringInTexte ( mot_cle, "\"", 1 ) ;
+          chaine = GetStringInTexte ( chaine,  "\"", 0 ) ;
+          if ( chaine == "language" ) { section_langue = true ; }
+          if ( chaine == "HOMARD" )   { section_homard = true ; }
+  //         MESSAGE ( "section_langue = "<<section_langue<<", section_homard = "<<section_homard);
+        }
+        // 2.2. Fin d'une section
+        else if ( mot_cle == "</section>" )
+        { /*MESSAGE ( "Fin de la section : "<< ligne<<", section_langue = "<<section_langue<<", section_homard = "<<section_homard);*/
+          section_langue = false ;
+          section_homard = false ; }
+
+        // 3. Parametres
+        // 3.1. La langue
+        else if ( section_langue || section_homard )
+        { MESSAGE ( "a decoder : "<< ligne);
+//        La valeur : entre les deux premieres quotes
+          chaine = GetStringInTexte ( ligne, "\"", 1 ) ;
+//           MESSAGE("chaine 1 = |"<<chaine<<"|");
+          chaine = GetStringInTexte ( chaine,  "\"", 0 ) ;
+//           MESSAGE("chaine = |"<<chaine<<"|");
+//        Le mot_cle : entre les deux dernieres quotes
+          std::string chaine2 = GetStringInTexte ( ligne, "\"", 2 ) ;
+//           MESSAGE("chaine2 1 = |"<<chaine2<<"|");
+          chaine2 = GetStringInTexte ( chaine2,  "\"", 3 ) ;
+//           MESSAGE("chaine2 = |"<<chaine2<<"|");
+          // 3.1. La langue
+          if ( section_langue )
+          { if ( chaine2 == "language" ) { LanguageShort = chaine ; } }
+          // 3.2. HOMARD
+          if ( section_homard )
+          {
+            std::istringstream chainebis( chaine ) ;
+            // 3.2.1. Les publications
+            if ( chaine2 == "publish_mesh_in" )  { chainebis >> PublisMeshIN ; }
+            if ( chaine2 == "publish_mesh_out" ) { chainebis >> PublisMeshOUT ; }
+            // 3.2.2. Les maximum pour YACS
+            if ( chaine2 == "yacs_max_iter" ) { chainebis >> YACSMaxIter ; }
+            if ( chaine2 == "yacs_max_node" ) { chainebis >> YACSMaxNode ; }
+            if ( chaine2 == "yacs_max_elem" ) { chainebis >> YACSMaxElem ; }
+            if ( chaine2 == "yacs_type_test" ) { YACSTypeTestchaine = chaine ; }
+          }
+        }
+      }
+    }
+  }
+
+  // C. Enregistrements
+  MESSAGE ("Enregistrement de LanguageShort = " << LanguageShort );
+  SetLanguageShort( LanguageShort.c_str() ) ;
+
+  MESSAGE ("Enregistrement de PublisMeshIN = " << PublisMeshIN<<", PublisMeshOUT = "<< PublisMeshOUT);
+  SetPublisMesh(PublisMeshIN, PublisMeshOUT) ;
+
+  MESSAGE ("Enregistrement de YACSMaxIter = " << YACSMaxIter<<", YACSMaxNode = "<< YACSMaxNode<<", YACSMaxElem = "<< YACSMaxElem);
+  SetYACSMaximum(YACSMaxIter, YACSMaxNode, YACSMaxElem) ;
+
+  MESSAGE ("Enregistrement de TypeTest = " << YACSTypeTestchaine.c_str() );
+  int YACSTypeTest ;
+  if ( ( YACSTypeTestchaine == "VTest > VRef" ) || ( YACSTypeTestchaine == "VTest &gt; VRef" ) )      { YACSTypeTest = 1 ; }
+  else if ( ( YACSTypeTestchaine == "VTest < VRef" ) || ( YACSTypeTestchaine == "VTest &lt; VRef" ) ) { YACSTypeTest = 2 ; }
+  else                                                                                                { YACSTypeTest = 0 ; }
+  MESSAGE ("==> TypeTest = " << YACSTypeTest );
+  SetYACSConvergenceType( YACSTypeTest ) ;
+
+  return ;
+}
+//===============================================================================
+// Langue de SALOME
+//===============================================================================
 void HOMARD_Gen_i::SetLanguageShort(const char* LanguageShort)
 {
 //   MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort );
@@ -4889,6 +5147,54 @@ char* HOMARD_Gen_i::GetLanguageShort()
 //   MESSAGE ("GetLanguageShort");
   return CORBA::string_dup( _LangueShort.c_str() );
 }
+//===============================================================================
+// Options de publications
+//===============================================================================
+void HOMARD_Gen_i::SetPublisMesh(CORBA::Long PublisMeshIN, CORBA::Long PublisMeshOUT)
+{
+  _PublisMeshIN  = PublisMeshIN  ;
+  _PublisMeshOUT = PublisMeshOUT ;
+  return ;
+}
+CORBA::Long HOMARD_Gen_i::GetPublisMeshIN()
+{
+  return _PublisMeshIN ;
+}
+CORBA::Long HOMARD_Gen_i::GetPublisMeshOUT()
+{
+  return _PublisMeshOUT ;
+}
+//===============================================================================
+// YACS - test de convergence
+//===============================================================================
+void HOMARD_Gen_i::SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem)
+{
+  _YACSMaxIter = YACSMaxIter ;
+  _YACSMaxNode = YACSMaxNode ;
+  _YACSMaxElem = YACSMaxElem ;
+  return ;
+}
+CORBA::Long HOMARD_Gen_i::GetYACSMaxIter()
+{
+  return _YACSMaxIter ;
+}
+CORBA::Long HOMARD_Gen_i::GetYACSMaxNode()
+{
+  return _YACSMaxNode ;
+}
+CORBA::Long HOMARD_Gen_i::GetYACSMaxElem()
+{
+  return _YACSMaxElem ;
+}
+void HOMARD_Gen_i::SetYACSConvergenceType(CORBA::Long YACSTypeTest)
+{
+  _YACSTypeTest = YACSTypeTest ;
+  return ;
+}
+CORBA::Long HOMARD_Gen_i::GetYACSConvergenceType()
+{
+  return _YACSTypeTest ;
+}
 
 //=============================================================================
 extern "C"