From: nicolas Date: Mon, 18 Feb 2013 13:14:35 +0000 (+0000) Subject: Selection of the last time step; Back to the current directory after a computation... X-Git-Tag: V7_1_0b1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;ds=inline;h=a796c0cbadf7951b35e24255027a82107ae2c190;p=modules%2Fhomard.git Selection of the last time step; Back to the current directory after a computation; New documentation. --- diff --git a/doc/images/create_hypothese_1.png b/doc/images/create_hypothese_1.png index 7c6eb197..73b7d548 100644 Binary files a/doc/images/create_hypothese_1.png and b/doc/images/create_hypothese_1.png differ diff --git a/doc/images/intro_35.png b/doc/images/intro_35.png index 72871479..73b7d548 100644 Binary files a/doc/images/intro_35.png and b/doc/images/intro_35.png differ diff --git a/doc/images/intro_36.png b/doc/images/intro_36.png index 2d363dad..36a77bf4 100644 Binary files a/doc/images/intro_36.png and b/doc/images/intro_36.png differ diff --git a/doc/intro.rst b/doc/intro.rst index a40df798..c1337911 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -137,7 +137,7 @@ A ce stade, on va utiliser ce nouveau maillage pour un deuxi .. image:: images/intro_38.png :align: center -Comme on continue l'adaptation avec le même critére de saut de température entre noeuds voisins, on garde l'hypothèse "*Hypo_1*". Il suffit de désigner le fichier issu du calcul que l'on vient de faire et qui contient le nouveau champ de température. +Comme on continue l'adaptation avec le même critère de saut de température entre noeuds voisins, on garde l'hypothèse "*Hypo_1*". Il suffit de désigner le fichier issu du calcul que l'on vient de faire et qui contient le nouveau champ de température. .. image:: images/intro_39.png :align: center @@ -148,3 +148,36 @@ Comme pr :align: center On peut alors lancer un nouveau calcul sur ce nouveau maillage et poursuiver cette alternance calcul/adaptation jusqu'à l'obtention du résultat attendu. + + +Evolutions du module +"""""""""""""""""""" +.. index:: single: évolution + +On trouvera ici les principales évolutions de HOMARD à partir de la première version livrée dans SALOME 6.5. + +SALOME VERSION 6.6 : + - Interfaçage avec med 3.0.6 + - Valeurs par défaut des instants + - Acceptation des mailles de type TRIA7 et QUAD9 + - Option de sortie dans le fichier MED du niveau de raffinement atteint dans chaque maille + +SALOME VERSION 7.1 : + - Correction d'une anomalie sur le filtrage du raffinement par les groupes + - Pilotage de l'adaptation par un seuil basé sur la moyenne et l'écart-type (voir :ref:`tui_create_hypothese`) + - En TUI, choix du dernier instant comme instant de pilotage par SetTimeStepRankLast (voir :ref:`tui_create_iteration`) + - Possibilité de détruire les objets (GUI et TUI) + - Modification des fonctions TUI pour qu'elles agissent sur les objets et non plus sur les noms : + homard.AssociateIterHypo(iter_name,hypo_name) devient iter.AssociateHypo(hypo_name) + + homard.AssociateHypoZone(hypo_name,zone_name,type_use) devient hypo.AssociateHypo(zone_name,type_use) + + homard.CreateIteration(iter_name,iter_parent_name) devient iter.NextIteration(iter_name) ou case.NextIteration(iter_name) + - Ajout de fonctions : + cas.LastIteration() : retourne la dernière itération de la descendance du cas (voir :ref:`tui_create_iteration`) + + + + + + diff --git a/doc/tui_create_hypothese.rst b/doc/tui_create_hypothese.rst index 93cfc15c..d4e177f9 100644 --- a/doc/tui_create_hypothese.rst +++ b/doc/tui_create_hypothese.rst @@ -136,7 +136,8 @@ Le champ et les seuils | * 3 : fraction des mailles en % | | * 4 : moyenne + n fois l'écart-type | | | -| - ``threshold`` : valeur du seuil | +| - ``threshold`` : valeur numérique entrant dans la | +| définition du seuil | +---------------------------------------------------------------+ | .. module:: GetRefinThrType | | | diff --git a/doc/tui_create_iteration.rst b/doc/tui_create_iteration.rst index 4f4234bd..9a9a1bd8 100644 --- a/doc/tui_create_iteration.rst +++ b/doc/tui_create_iteration.rst @@ -203,11 +203,20 @@ Informations sur le champ | **SetTimeStepRank(TimeStep, Rank)** | | Définit les instants pour le champ | | | +| Si un seul instant est défini pour le champ, il est pris | +| par défaut. | +| | | Inutile si aucun instant n'est défini pour le champ | | | | - ``TimeStep`` : l'instant où est pris le champ | | - ``Rank`` : le numéro d'ordre où est pris le champ | +---------------------------------------------------------------+ +| .. module:: SetTimeStepRankLast | +| | +| **SetTimeStepRankLast()** | +| Précise que le dernier instant enregistré pour le champ | +| est utilisé | ++---------------------------------------------------------------+ | .. module:: GetFieldFileName | | | | **GetFieldFileName()** | diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index ad9703eb..a41739d6 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -67,6 +67,7 @@ module HOMARD string GetFieldFile() raises (SALOME::SALOME_Exception); void SetTimeStepRank(in long TimeStep, in long Rank) raises (SALOME::SALOME_Exception); + void SetTimeStepRankLast() raises (SALOME::SALOME_Exception); long GetTimeStep() raises (SALOME::SALOME_Exception); long GetRank() raises (SALOME::SALOME_Exception); diff --git a/src/HOMARD/HOMARD_Iteration.cxx b/src/HOMARD/HOMARD_Iteration.cxx index c65ad823..922a5a2a 100644 --- a/src/HOMARD/HOMARD_Iteration.cxx +++ b/src/HOMARD/HOMARD_Iteration.cxx @@ -98,8 +98,14 @@ std::string HOMARD_Iteration::GetDumpPython() const // Le fichier des champs, avec l'instant eventuel if ( _FieldFile != "" ) { aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n"; - if ( ( _TimeStep != -1 ) and ( _Rank != -1 ) ) { - aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; + if ( _TimeStep == -2 ) { + aScript << "\t" << _Name << ".SetTimeStepRankLast()\n"; + } + else + { + if ( ( _TimeStep != -1 ) and ( _Rank != -1 ) ) { + aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; + } } } @@ -189,6 +195,11 @@ void HOMARD_Iteration::SetTimeStepRank( int TimeStep, int Rank ) _Rank = Rank; } //============================================================================= +void HOMARD_Iteration::SetTimeStepRankLast() +{ + _TimeStep = -2; +} +//============================================================================= int HOMARD_Iteration::GetTimeStep() const { return _TimeStep; diff --git a/src/HOMARD/HOMARD_Iteration.hxx b/src/HOMARD/HOMARD_Iteration.hxx index 78d1b270..542da90a 100644 --- a/src/HOMARD/HOMARD_Iteration.hxx +++ b/src/HOMARD/HOMARD_Iteration.hxx @@ -68,6 +68,7 @@ public: void SetFieldFile( const char* FieldFile ); std::string GetFieldFile() const; void SetTimeStepRank( int TimeStep, int Rank ); + void SetTimeStepRankLast(); int GetTimeStep() const; int GetRank() const; diff --git a/src/HOMARD/HomardDriver.cxx b/src/HOMARD/HomardDriver.cxx index 76396541..ac6d4ca5 100644 --- a/src/HOMARD/HomardDriver.cxx +++ b/src/HOMARD/HomardDriver.cxx @@ -73,6 +73,7 @@ void HomardDriver::TexteInit( const std::string DirCompute, const std::string Di _Texte += "HOMaiN__ Mai" + _siter + " \"" + DirComputePa + "/maill." + _siter + ".hom.med\"\n" ; _Texte += "HOMaiNP1 Mai" + _siterp1 + " \"" + DirCompute + "/maill." + _siterp1 + ".hom.med\"\n" ; _Texte += "RepeTrav \"" + DirCompute + "\"\n" ; + _Texte += "RepeInfo \"" + DirCompute + "\"\n" ; // } diff --git a/src/HOMARDGUI/MonCreateIteration.cxx b/src/HOMARDGUI/MonCreateIteration.cxx index 09df846a..b5da354d 100644 --- a/src/HOMARDGUI/MonCreateIteration.cxx +++ b/src/HOMARDGUI/MonCreateIteration.cxx @@ -170,10 +170,11 @@ bool MonCreateIteration::PushOnApply() if ( LEFieldFile->text().trimmed() != QString("")) { QString FieldFile=LEFieldFile->text().trimmed(); + aIter->SetFieldFile(CORBA::string_dup(FieldFile.toStdString().c_str())); int rank = SpinBox_Rank->value(); int step = SpinBox_TimeStep->value(); - aIter->SetFieldFile(CORBA::string_dup(FieldFile.toStdString().c_str())); - aIter->SetTimeStepRank(step,rank); + if ( step == -2 ) { aIter->SetTimeStepRankLast(); } + else { aIter->SetTimeStepRank(step,rank); } } _myHomardGen->AssociateIterHypo (IterName, monHypoName.toStdString().c_str()); aIter->SetMeshName(CORBA::string_dup(aMeshName_np1.toStdString().c_str())); diff --git a/src/HOMARDGUI/MonEditIteration.cxx b/src/HOMARDGUI/MonEditIteration.cxx index 1b57c583..b212cb4d 100644 --- a/src/HOMARDGUI/MonEditIteration.cxx +++ b/src/HOMARDGUI/MonEditIteration.cxx @@ -172,10 +172,11 @@ bool MonEditIteration::PushOnApply() ( _step != SpinBox_TimeStep->value())) { _FieldFile = LEFieldFile->text().trimmed(); + aIter->SetFieldFile(CORBA::string_dup(_FieldFile.toStdString().c_str())); _rank = SpinBox_Rank->value(); _step = SpinBox_TimeStep->value(); - aIter->SetFieldFile(CORBA::string_dup(_FieldFile.toStdString().c_str())); - aIter->SetTimeStepRank(_step, _rank); + if ( _step == -2 ) { aIter->SetTimeStepRankLast(); } + else { aIter->SetTimeStepRank(_step, _rank); } _myHomardGen->InvalideIter(_IterationName.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); } diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 9b53284b..3f54b8d5 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -1420,10 +1420,12 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena { MESSAGE ( "Compute : calcul de " << NomIteration ); +// A. Prealable +// A.1. La base HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[NomIteration]; ASSERT(!CORBA::is_nil(myIteration)); -// on ne calcule pas l iteration 0 +// A.2. On ne calcule pas l iteration 0 int NumeIter = myIteration->GetNumber(); if ( NumeIter == 0 ) { @@ -1434,7 +1436,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena return 1; }; -// on verifie qu il y a une hypothese (erreur improbable); +// A.3. On verifie qu il y a une hypothese (erreur improbable); const char* nomHypo = myIteration->GetHypoName(); if (std::string(nomHypo) == std::string("")) { @@ -1461,10 +1463,12 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena } }; + // A.5. Le cas const char* nomCas = myIteration->GetCaseName(); HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; ASSERT(!CORBA::is_nil(myCase)); + // A.6. Les numeros d'iterations int codret = 0; std::stringstream saux0 ; saux0 << NumeIter - 1 ; @@ -1477,20 +1481,22 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena if (NumeIter < 10) { siterp1 = "0" + siterp1 ; } // B. Les repertoires - // B.1. Le repertoire du cas + // B.1. Le repertoire courant + char* nomDirWork = getenv("PWD") ; + // B.2. Le repertoire du cas const char* nomDirCase = myCase->GetDirName(); MESSAGE ( ". nomDirCase = " << nomDirCase ); - // B.2. Le sous-repertoire de l'iteration a calculer, puis le repertoire complet a creer - // B.2.1. Le nom du sous-repertoire + // B.3. Le sous-repertoire de l'iteration a calculer, puis le repertoire complet a creer + // B.3.1. Le nom du sous-repertoire const char* nomDirIt = myIteration->GetDirName(); - // B.2.2. Le nom complet du sous-repertoire + // B.3.2. Le nom complet du sous-repertoire std::stringstream DirCompute ; DirCompute << nomDirCase << "/" << nomDirIt; MESSAGE (". DirCompute = " << DirCompute.str() ); - // B.2.3. Si le sous-repertoire n'existe pas, on le cree + // B.3.3. Si le sous-repertoire n'existe pas, on le cree // Si le sous-repertoire existe : // etatMenage = 0 : on sort en erreur si le repertoire n'est pas vide // etatMenage = 1 : on fait le menage du repertoire @@ -1506,7 +1512,8 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena } else { -// Le repertoire existe et on fait le menage de son contenu : +// Le repertoire existe +// On demande de faire le menage de son contenu : if (etatMenage != 0) { MESSAGE (". Menage du repertoire DirCompute = " << DirCompute.str()); @@ -1519,9 +1526,9 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena ASSERT("Pb au menage du repertoire de calcul" == 0); } } +// On n'a pas demande de faire le menage de son contenu : on sort en erreur : else { -// Le repertoire existe et s'il n'est pas vide, on sort en erreur : DIR *dp; struct dirent *dirp; dp = opendir(DirCompute.str().c_str()); @@ -1544,7 +1551,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena } } - // B.3. Le sous-repertoire de l'iteration precedente + // B.4. Le sous-repertoire de l'iteration precedente const char* nomDirItPa ; std::stringstream DirComputePa ; if (NumeIter == 1) @@ -1560,13 +1567,13 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena MESSAGE( ". nomDirItPa = " << nomDirItPa); MESSAGE( ". DirComputePa = " << DirComputePa.str() ); - // B.4. Le fichier des messages - chdir(DirCompute.str().c_str()) ; + // B.5. Le fichier des messages std::string MessFile = DirCompute.str() + "/Liste." + siter + ".vers." + siterp1 ; MESSAGE (". MessFile = " << MessFile); myIteration->SetMessFile(MessFile.c_str()); // C. On passe dans le repertoire de l'iteration a calculer + MESSAGE ( ". On passe dans DirCompute = " << DirCompute.str() ); chdir(DirCompute.str().c_str()) ; // D. Les donnees du calcul HOMARD @@ -1626,7 +1633,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena int TypeRaff = (*ListTypes)[1]; int TypeDera = (*ListTypes)[2]; - // D.6. L'option d'interpolation des champs + // D.5. L'option d'interpolation des champs int TypeFieldInterp = myHypo->GetTypeFieldInterp(); // E. Texte du fichier de configuration @@ -1935,7 +1942,8 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* NomIteration, CORBA::Long etatMena if (codret == 0) { delete myDriver; - chdir(nomDirCase); + MESSAGE ( ". On retourne dans nomDirWork = " << nomDirWork ); + chdir(nomDirWork); } return codretexec ; diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index 295aacca..a29d2b3a 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -192,6 +192,12 @@ void HOMARD_Iteration_i::SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank myHomardIteration->SetTimeStepRank( TimeStep, Rank ); } //============================================================================= +void HOMARD_Iteration_i::SetTimeStepRankLast() +{ + ASSERT( myHomardIteration ); + myHomardIteration->SetTimeStepRankLast(); +} +//============================================================================= CORBA::Long HOMARD_Iteration_i::GetTimeStep() { ASSERT( myHomardIteration ); diff --git a/src/HOMARD_I/HOMARD_Iteration_i.hxx b/src/HOMARD_I/HOMARD_Iteration_i.hxx index 0b9b807b..91ce9fdc 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.hxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.hxx @@ -83,6 +83,7 @@ public: void SetFieldFile( const char* FieldFile ); char* GetFieldFile(); void SetTimeStepRank( CORBA::Long TimeStep, CORBA::Long Rank ); + void SetTimeStepRankLast(); CORBA::Long GetTimeStep(); CORBA::Long GetRank();