Salome HOME
Copyright update 2022
[modules/homard.git] / src / HOMARD / HomardDriver.cxx
index 4a9e7fd31ed5c97dde22deae7c8ffa3c64ec7a70..5c702f924f0b19b4cb5f8c56774f0028a77455d6 100644 (file)
@@ -1,6 +1,6 @@
 //  HOMARD HOMARD : implementation of HOMARD idl descriptions
 //
-// Copyright (C) 2011-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2011-2022  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
@@ -75,20 +75,23 @@ void HomardDriver::TexteInit( const std::string DirCompute, const std::string Lo
 //
 }
 //===============================================================================
-void HomardDriver::TexteAdap( )
+void HomardDriver::TexteAdap( int ExtType )
 {
   MESSAGE("TexteAdap");
 //
   _Texte += "Action   homa\n" ;
-  _Texte += "CCAssoci med\n" ;
+  if ( ExtType ==  0 )      { _Texte += "CCAssoci med\n" ; }
+  else if ( ExtType ==  1 ) { _Texte += "CCAssoci saturne\n" ; }
+  else                      { _Texte += "CCAssoci saturne_2d\n" ; }
   _Texte += "ModeHOMA 1\n" ;
   _Texte += "NumeIter " + _siter + "\n" ;
+  _modeHOMARD = 1 ;
 //
 }
 //===============================================================================
 void HomardDriver::TexteInfo( int TypeBila, int NumeIter )
 {
-  MESSAGE("TexteInit, TypeBila ="<<TypeBila);
+  MESSAGE("TexteInfo: TypeBila ="<<TypeBila<<", NumeIter ="<<NumeIter);
 //
   _Texte += "ModeHOMA 2\n" ;
   std::stringstream saux1 ;
@@ -107,6 +110,20 @@ void HomardDriver::TexteInfo( int TypeBila, int NumeIter )
     _Texte += "Action   info_ap\n" ;
     _Texte += "CCAssoci homard\n" ;
   }
+  _modeHOMARD = 2 ;
+//
+}
+//===============================================================================
+void HomardDriver::TexteMajCoords( int NumeIter )
+{
+  MESSAGE("TexteMajCoords: NumeIter ="<<NumeIter);
+//
+  _Texte += "ModeHOMA 5\n" ;
+  _Texte += "NumeIter " + _siterp1 + "\n" ;
+  _Texte += "Action   homa\n" ;
+  _Texte += "CCAssoci med\n" ;
+  _Texte += "EcriFiHO N_SANS_FRONTIERE\n" ;
+  _modeHOMARD = 5 ;
 //
 }
 //===============================================================================
@@ -151,29 +168,34 @@ void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff,
   std::string saux ;
   switch (ConfType)
   {
+    case -2: //
+    {
+      saux = "NON_CONFORME_1_ARETE" ;
+      break;
+    }
     case -1: //
     {
-      saux = "conforme_boites" ;
+      saux = "CONFORME_BOITES" ;
       break;
     }
-    case 1: //
+    case 0: //
     {
-      saux = "conforme" ;
+      saux = "CONFORME" ;
       break;
     }
-    case 2: //
+    case 1: //
     {
-      saux = "non_conforme_1_noeud" ;
+      saux = "NON_CONFORME" ;
       break;
     }
-    case 3: //
+    case 2: //
     {
-      saux = "non_conforme_1_arete" ;
+      saux = "NON_CONFORME_1_NOEUD" ;
       break;
     }
-    case 4: //
+    case 3: //
     {
-      saux = "non_conforme_indicateur" ;
+      saux = "NON_CONFORME_INDICATEUR" ;
       break;
     }
   }
@@ -224,10 +246,10 @@ void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff,
 //   MESSAGE("A la fin de HomardDriver::TexteConfRaffDera, _Texte ="<<_Texte);
 }
 //===============================================================================
-void HomardDriver::TexteCompo( int NumeComp, const std::string NompCompo)
+void HomardDriver::TexteCompo( int NumeComp, const std::string NomCompo)
 {
-  MESSAGE("TexteCompo, NumeComp = "<<NumeComp<<", NompCompo = "<<NompCompo);
-  _Texte +="CCCoChaI \"" + NompCompo + "\"\n" ;
+  MESSAGE("TexteCompo, NumeComp = "<<NumeComp<<", NomCompo = "<<NomCompo);
+  _Texte +="CCCoChaI \"" + NomCompo + "\"\n" ;
 }
 //===============================================================================
 void HomardDriver::TexteZone( int NumeZone, int ZoneType, int TypeUse, double x0, double x1, double x2, double x3, double x4, double x5, double x6, double x7, double x8 )
@@ -618,7 +640,15 @@ void HomardDriver::TexteBoundaryOption( int BoundaryOption )
   std::string saux = saux1.str() ;
   _Texte += "SuivFron " + saux + "\n" ;
 //
+}//===============================================================================
+void HomardDriver::TexteBoundaryCAOGr(  const std::string GroupName )
+{
+  MESSAGE("TexteBoundaryCAOGr, GroupName  = "<<GroupName);
+//
+  _Texte += "GrFroCAO \"" + GroupName + "\"\n" ;
+//
 }
+
 //===============================================================================
 void HomardDriver::TexteBoundaryDi(  const std::string MeshName, const std::string MeshFile )
 {
@@ -940,9 +970,9 @@ void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string Fi
 //===============================================================================
 // F. Les options avancees
 //===============================================================================
-void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput )
+void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int ExtraOutput )
 {
-  MESSAGE("TexteAdvanced, Pyram ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", LevelOutput ="<<LevelOutput);
+  MESSAGE("TexteAdvanced, Pyram ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", ExtraOutput ="<<ExtraOutput);
 
   if ( Pyram > 0 )
   {
@@ -977,11 +1007,31 @@ void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int Ada
       _Texte += "AdapInit " + saux1.str() + "\n" ;
     }
   }
-  if ( LevelOutput != 0 )
+  if ( ExtraOutput % 2 == 0 )
   {
     _Texte += "# Sortie des niveaux de raffinement\n" ;
     _Texte += "NCNiveau NIVEAU\n" ;
   }
+  if ( ExtraOutput % 3 == 0 )
+  {
+    _Texte += "# Sortie des qualités des mailles\n" ;
+    _Texte += "NCQualit QUAL\n" ;
+  }
+  if ( ExtraOutput % 5 == 0 )
+  {
+    _Texte += "# Sortie des diamètres des mailles\n" ;
+    _Texte += "NCDiamet DIAM\n" ;
+  }
+  if ( ExtraOutput % 7 == 0 )
+  {
+    _Texte += "# Sortie des parents des mailles\n" ;
+    _Texte += "NCParent PARENT\n" ;
+  }
+  if ( ExtraOutput % 11 == 0 )
+  {
+    _Texte += "# Volumes voisins par recollement\n" ;
+    _Texte += "NCVoisRc Voisin-Recollement\n" ;
+  }
 }
 //===============================================================================
 // G. Les messages
@@ -1003,10 +1053,12 @@ void HomardDriver::TexteInfoCompute( int MessInfo )
 void HomardDriver::CreeFichier( )
 {
 //
-  if ( _siter != _siterp1 )
+  if ( _modeHOMARD == 1 )
   { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".vers." + _siterp1 ; }
-  else
+  else if ( _modeHOMARD == 2 )
   { _NomFichierConf = _NomFichierConfBase + "." + _siter + ".info" ; }
+  else if ( _modeHOMARD == 5 )
+  { _NomFichierConf = _NomFichierConfBase + ".majc" ; }
 //
   std::ofstream Fic(_NomFichierConf.c_str(), std::ios::out ) ;
   if (Fic.is_open() == true) { Fic << _Texte << std::endl ; }