// Pilote l'ecriture du fichier de configuration pour lancer l'execution de HOMARD
#include <cstring>
+#ifndef WIN32
#include <unistd.h>
+#endif
#include <sys/stat.h>
+#include "HomardDriver.hxx"
#include "Utils_SALOME_Exception.hxx"
#include "utilities.h"
-#include "HomardDriver.hxx"
//=============================================================================
//=============================================================================
{
}
//===============================================================================
+// A. Generalites
+//===============================================================================
void HomardDriver::TexteInit( const std::string DirCompute, const std::string LogFile, const std::string Langue )
{
MESSAGE("TexteInit, DirCompute ="<<DirCompute<<", LogFile ="<<LogFile);
}
//
}
-
+//===============================================================================
+// B. Les maillages en entree et en sortie
//===============================================================================
void HomardDriver::TexteMaillage( const std::string NomMesh, const std::string MeshFile, int apres )
{
_Texte += "HOMaiN" + saux + " Mai" + liter + " \"" + Dir + "/maill." + liter + ".hom.med\"\n" ;
}
+//===============================================================================
+// C. Le pilotage de l'adaptation
//===============================================================================
void HomardDriver::TexteConfRaffDera( int ConfType, int TypeAdap, int TypeRaff, int TypeDera )
{
std::string saux ;
switch (ConfType)
{
+ case -1: //
+ {
+ saux = "conforme_boites" ;
+ break;
+ }
case 1: //
{
saux = "conforme" ;
// <0 signifie que l'on deraffinera
//
int ZoneTypeHOMARD ;
- if ( ZoneType >= 11 and ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
- else if ( ZoneType >= 31 and ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
- else if ( ZoneType >= 61 and ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
+ if ( ZoneType >= 11 && ZoneType <= 13 ) { ZoneTypeHOMARD = 1 ; }
+ else if ( ZoneType >= 31 && ZoneType <= 33 ) { ZoneTypeHOMARD = 3 ; }
+ else if ( ZoneType >= 61 && ZoneType <= 63 ) { ZoneTypeHOMARD = 6 ; }
else { ZoneTypeHOMARD = ZoneType ; }
//
if ( TypeUse < 0 ) { ZoneTypeHOMARD = -ZoneTypeHOMARD ; }
//
// Cas du disque
//
- else if ( ZoneType == 31 or ZoneType == 61 )
+ else if ( ZoneType == 31 || ZoneType == 61 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
saux += "ZoRaRayI " + saux1.str() + "\n" ;
}
}
- else if ( ZoneType == 32 or ZoneType == 62 )
+ else if ( ZoneType == 32 || ZoneType == 62 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
saux += "ZoRaRayI " + saux1.str() + "\n" ;
}
}
- else if ( ZoneType == 33 or ZoneType == 63 )
+ else if ( ZoneType == 33 || ZoneType == 63 )
{
saux += "# Sphere\n" ;
{ std::stringstream saux1 ;
//
// Cas du cylindre ou du tuyau
//
- else if ( ZoneType == 5 or ZoneType == 7 )
+ else if ( ZoneType == 5 || ZoneType == 7 )
{
if ( ZoneType == 5 ) { saux += "# Cylindre\n" ; }
else { saux += "# Tuyau\n" ; }
saux2 = saux1.str() ;
_Texte += "CCNumPTI " + saux2 + "\n" ;
}
+ if ( Rank >= 0 )
{
std::stringstream saux1 ;
saux1 << Rank ;
//
}
//===============================================================================
+// D. Les frontieres
+//===============================================================================
void HomardDriver::TexteBoundaryOption( int BoundaryOption )
{
MESSAGE("TexteBoundaryOption, BoundaryOption = "<<BoundaryOption);
{ saux += "# Cylindre\n" ; }
if ( BoundaryType == 2 )
{ saux += "# Sphere\n" ; }
- if ( BoundaryType == 3 or BoundaryType == 4 )
+ if ( BoundaryType == 3 || BoundaryType == 4 )
{ saux += "# Cone\n" ; }
+ if ( BoundaryType == 5 )
+ { saux += "# Tore\n" ; }
//
// Le nom de la frontiere
//
saux += "FARayon2 " + saux1.str() + "\n" ;
}
}
+//
+// Cas du tore
+//
+ if ( BoundaryType == 5 )
+ {
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x0 ;
+ saux2 = saux1.str() ;
+ saux += "FAXCen " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x1 ;
+ saux += "FAYCen " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x2 ;
+ saux += "FAZCen " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x3 ;
+ saux += "FAXAxe " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x4 ;
+ saux += "FAYAxe " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x5 ;
+ saux += "FAZAxe " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x6 ;
+ saux += "FARayon " + saux1.str() + "\n" ;
+ }
+ { std::stringstream saux1 ;
+ saux1 << NumeBoundary << " " << x7 ;
+ saux += "FARayon2 " + saux1.str() + "\n" ;
+ }
+ }
//
_Texte += saux + "#\n" ;
//
//
}
//===============================================================================
-void HomardDriver::TexteFieldInterp( int TypeFieldInterp, const std::string FieldFile, const std::string MeshFile, int TimeStep, int Rank )
+// E. Les interpolations
+//===============================================================================
+// Les fichiers d'entree et de sortie des champs a interpoler
+void HomardDriver::TexteFieldInterp( const std::string FieldFile, const std::string MeshFile )
{
- MESSAGE("TexteFieldInterp, TypeFieldInterp = "<<TypeFieldInterp);
MESSAGE("TexteFieldInterp, FieldFile = "<<FieldFile<<", MeshFile = "<<MeshFile);
- MESSAGE("TexteFieldInterp, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
//
-// Type d'interpolation
+ _Texte += "#\n# Interpolations des champs\n" ;
//
- _Texte += "# Interpolations des champs\n" ;
+// Fichier en entree
_Texte += "CCSolN__ \"" + FieldFile + "\"\n" ;
+// Fichier en sortie
_Texte += "CCSolNP1 \"" + MeshFile + "\"\n" ;
- if ( TypeFieldInterp == 1 )
- {
- _Texte += "CCChaTou oui\n" ;
- }
-//
- _TimeStep = TimeStep ;
- _Rank = Rank ;
//
// std::cerr << "A la fin de TexteFieldInterp _Texte ="<<_Texte << std::endl;
}
//===============================================================================
-void HomardDriver::TexteFieldInterpName( int NumeChamp, const std::string FieldName)
+// Tous les champs sont a interpoler
+void HomardDriver::TexteFieldInterpAll( )
+{
+ MESSAGE("TexteFieldInterpAll");
+//
+ _Texte += "CCChaTou oui\n" ;
+}
+//===============================================================================
+// Ecrit les caracteristiques de chaque interpolation sous la forme :
+// CCChaNom 1 "DEPL" ! Nom du 1er champ a interpoler
+// CCChaTIn 1 0 ! Mode d'interpolation : automatique
+// CCChaNom 2 "VOLUME" ! Nom du 2nd champ a interpoler
+// CCChaTIn 2 1 ! Mode d'interpolation : une variable extensive
+// CCChaPdT 2 14 ! Pas de temps 14
+// CCChaNuO 2 14 ! Numero d'ordre 14
+// etc.
+//
+// NumeChamp : numero d'ordre du champ a interpoler
+// FieldName : nom du champ
+// TypeInterp : type d'interpolation
+// TimeStep : pas de temps retenu (>0 si pas de precision)
+// Rank : numero d'ordre retenu
+//
+void HomardDriver::TexteFieldInterpNameType( int NumeChamp, const std::string FieldName, const std::string TypeInterp, int TimeStep, int Rank)
{
- MESSAGE("TexteFieldInterpName, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName);
+ MESSAGE("TexteFieldInterpNameType, NumeChamp = "<<NumeChamp<<", FieldName = "<<FieldName<<", TypeInterp = "<<TypeInterp);
+ MESSAGE("TexteFieldInterpNameType, TimeStep = "<<TimeStep<<", Rank = "<<Rank);
+// Numero d'ordre du champ a interpoler
std::stringstream saux1 ;
- saux1 << NumeChamp+1 ;
+ saux1 << NumeChamp ;
std::string saux = saux1.str() ;
+// Nom du champ
_Texte +="CCChaNom " + saux + " \"" + FieldName + "\"\n" ;
+// Type d'interpolation pour le champ
+ _Texte +="CCChaTIn " + saux + " " + TypeInterp + "\n" ;
//
- MESSAGE("TexteFieldInterpName, _TimeStep = "<<_TimeStep<<", _Rank = "<<_Rank);
- if ( _TimeStep >= 0 )
+ if ( TimeStep >= 0 )
{
{
std::stringstream saux1 ;
- saux1 << _TimeStep ;
+ saux1 << TimeStep ;
_Texte += "CCChaPdT " + saux + " " + saux1.str() + "\n" ;
}
{
std::stringstream saux1 ;
- saux1 << _Rank ;
+ saux1 << Rank ;
_Texte += "CCChaNuO " + saux + " " + saux1.str() + "\n" ;
}
}
}
//===============================================================================
+// F. Les options avancees
+//===============================================================================
void HomardDriver::TexteAdvanced( int Pyram, int NivMax, double DiamMin, int AdapInit, int LevelOutput )
{
MESSAGE("TexteAdvanced, Pyram ="<<Pyram<<", NivMax ="<<NivMax<<", DiamMin ="<<DiamMin<<", AdapInit ="<<AdapInit<<", LevelOutput ="<<LevelOutput);
}
}
//===============================================================================
+// G. Les messages
+//===============================================================================
void HomardDriver::TexteInfoCompute( int MessInfo )
{
MESSAGE("TexteAdvanced, MessInfo ="<<MessInfo);