// 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;
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()) ;
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);
}
//=============================================================================
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;
#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()) ;
{
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);
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
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 ; }
}
}
#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 ) ) )
{
myHypothesis->SetNivMax(-1);
myHypothesis->SetDiamMin(-1.0);
myHypothesis->SetAdapInit(0);
- myHypothesis->SetLevelOutput(0);
+ myHypothesis->SetExtraOutput(1);
return HOMARD::HOMARD_Hypothesis::_duplicate(myHypothesis);
}
//=============================================================================
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 ) ;
// 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
// 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 )
{
}
}
}
- 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;
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 ;
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
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();
{
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
+ int codret = CHDIR(nomrep) ;
if ( codret != 0 )
{
SALOME::ExceptionStruct es;
{
// 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 ; }
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;
#ifndef WIN32
closedir(dp);
#else
- }
FindClose(hFind);
#endif
if ( !existe )
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() );
}
//=============================================================================
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);
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())
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 ; }
}
// 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 tests de convergence
// 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 );