From 32c6d90220179a749436d9f4e5e88dfeeaa2dc00 Mon Sep 17 00:00:00 2001 From: nicolas Date: Wed, 22 Jan 2014 09:22:55 +0000 Subject: [PATCH] =?utf8?q?Pr=C3=83=C2=A9f=C3=83=C2=A9rences=20pour=20le=20?= =?utf8?q?type=20de=20test=20de=20convergence=20des=20sch=C3=83=C2=A9mas?= =?utf8?q?=20YACS?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- idl/HOMARD_Gen.idl | 2 ++ idl/HOMARD_YACS.idl | 5 ++++ src/HOMARD/HOMARD_YACS.cxx | 23 ++++++++++++++++- src/HOMARD/HOMARD_YACS.hxx | 6 +++++ src/HOMARDGUI/HOMARDGUI.cxx | 27 ++++++++++++++++++- src/HOMARDGUI/HOMARDGUI.h | 1 + src/HOMARDGUI/HOMARD_msg_en.ts | 8 ++++++ src/HOMARDGUI/HOMARD_msg_fr.ts | 8 ++++++ src/HOMARD_I/HOMARD_Gen_i.cxx | 47 +++++++++++++++++++++++++--------- src/HOMARD_I/HOMARD_Gen_i.hxx | 3 +++ src/HOMARD_I/HOMARD_YACS_i.cxx | 26 +++++++++++++++++++ src/HOMARD_I/HOMARD_YACS_i.hxx | 4 +++ 12 files changed, 146 insertions(+), 14 deletions(-) diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl index f929875d..305ada9c 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/HOMARD_Gen.idl @@ -221,6 +221,8 @@ module HOMARD long GetYACSMaxIter() raises (SALOME::SALOME_Exception); long GetYACSMaxNode() raises (SALOME::SALOME_Exception); long GetYACSMaxElem() raises (SALOME::SALOME_Exception); + void SetYACSConvergenceType(in long TypeTest) raises (SALOME::SALOME_Exception); + long GetYACSConvergenceType() raises (SALOME::SALOME_Exception); }; }; diff --git a/idl/HOMARD_YACS.idl b/idl/HOMARD_YACS.idl index e98f6ac6..363b7674 100644 --- a/idl/HOMARD_YACS.idl +++ b/idl/HOMARD_YACS.idl @@ -56,6 +56,11 @@ module HOMARD void SetMaxElem (in long MaxElem) raises (SALOME::SALOME_Exception); long GetMaxElem() raises (SALOME::SALOME_Exception); + void SetTestConvergence (in long TypeTest, in double VRef) + raises (SALOME::SALOME_Exception); + long GetTestConvergenceType() raises (SALOME::SALOME_Exception); + double GetTestConvergenceVRef() raises (SALOME::SALOME_Exception); + void SetDirName(in string NomDir) raises (SALOME::SALOME_Exception); string GetDirName() raises (SALOME::SALOME_Exception); diff --git a/src/HOMARD/HOMARD_YACS.cxx b/src/HOMARD/HOMARD_YACS.cxx index aeb2b209..4870853f 100644 --- a/src/HOMARD/HOMARD_YACS.cxx +++ b/src/HOMARD/HOMARD_YACS.cxx @@ -95,7 +95,7 @@ std::string HOMARD_YACS::GetDumpPython() const } //============================================================================= //============================================================================= -// Caracteristiques +// Caracteristiques de la convergence //============================================================================= //============================================================================= void HOMARD_YACS::SetType( int Type ) @@ -138,6 +138,27 @@ int HOMARD_YACS::GetMaxElem() const return _MaxElem; } //============================================================================= +void HOMARD_YACS::SetTestConvergence( int TypeTest, double VRef ) +{ + _TypeTest = TypeTest; + _VRef = VRef; +} +//============================================================================= +int HOMARD_YACS::GetTestConvergenceType() const +{ + return _TypeTest; +} +//============================================================================= +double HOMARD_YACS::GetTestConvergenceVRef() const +{ + return _VRef; +} +//============================================================================= +//============================================================================= +// Repertoire et fichiers +//============================================================================= +//============================================================================= +//============================================================================= void HOMARD_YACS::SetDirName( const char* NomDir ) { _NomDir = std::string( NomDir ); diff --git a/src/HOMARD/HOMARD_YACS.hxx b/src/HOMARD/HOMARD_YACS.hxx index a513c23a..65733282 100644 --- a/src/HOMARD/HOMARD_YACS.hxx +++ b/src/HOMARD/HOMARD_YACS.hxx @@ -62,6 +62,10 @@ public: void SetMaxElem( int MaxElem ); int GetMaxElem() const; + void SetTestConvergence( int TypeTest, double VRef ); + int GetTestConvergenceType() const; + double GetTestConvergenceVRef() const; + void SetDirName( const char* NomDir ); std::string GetDirName() const; @@ -91,6 +95,8 @@ private: int _MaxIter; int _MaxNode; int _MaxElem; + int _TypeTest; + double _VRef; std::string _XMLFile; }; diff --git a/src/HOMARDGUI/HOMARDGUI.cxx b/src/HOMARDGUI/HOMARDGUI.cxx index f5f5004c..1a3b34f3 100644 --- a/src/HOMARDGUI/HOMARDGUI.cxx +++ b/src/HOMARDGUI/HOMARDGUI.cxx @@ -213,6 +213,16 @@ void HOMARDGUI::createPreferences() setPreferenceProperty( Pref, "min", 0 ); setPreferenceProperty( Pref, "max", 100000000 ); setPreferenceProperty( Pref, "step", 1000 ); + + Bloc = addPreference( tr( "PREF_YACS_CONVERGENCE" ), Onglet ); + setPreferenceProperty( Bloc, "columns", 1 ); + + Pref = addPreference( tr( "PREF_YACS_TYPE_TEST" ), Bloc, LightApp_Preferences::Selector, "HOMARD", "yacs_type_test" ); + QStringList aListOfTypeTest; + aListOfTypeTest << "None"; + aListOfTypeTest << "VTest > VRef"; + aListOfTypeTest << "VTest < VRef"; + setPreferenceProperty( Pref, "strings", aListOfTypeTest ); } @@ -266,13 +276,14 @@ void HOMARDGUI::recupPreferences() HOMARD::HOMARD_Gen_var homardGen = HOMARDGUI::InitHOMARDGen(app); int defaut_i ; std::string defaut_s ; + QString QString_v ; // // B. Les valeurs // B.1. La langue // defaut_s = homardGen->GetLanguageShort(); SUIT_ResourceMgr* resMgr = getApp()->resourceMgr(); - _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str())); + _LanguageShort = resMgr->stringValue("language", "language", QString(defaut_s.c_str()) ); // // B.2. Les publications bool publish_mesh ; @@ -302,15 +313,29 @@ void HOMARDGUI::recupPreferences() defaut_i = homardGen->GetYACSMaxElem(); _YACSMaxElem = resMgr->integerValue("HOMARD", "yacs_max_elem", defaut_i ); // +// B.4. La convergence pour YACS +// + defaut_i = homardGen->GetYACSConvergenceType(); + if ( defaut_i == 1 ) { QString_v = tr("VTest > VRef") ; } + else if ( defaut_i == 2 ) { QString_v = tr("VTest < VRef") ; } + else { QString_v = tr("None") ; } + QString_v = resMgr->stringValue ( "HOMARD", "yacs_type_test", QString_v ); + if ( ( QString_v == "VTest > VRef" ) || ( QString_v == "VTest > VRef" ) ) { _YACSTypeTest = 1 ; } + else if ( ( QString_v == "VTest < VRef" ) || ( QString_v == "VTest < VRef" ) ) { _YACSTypeTest = 2 ; } + else { _YACSTypeTest = 0 ; } +// // C. Enregistrement dans l'objet general // MESSAGE ("Enregistrement de LanguageShort = " << _LanguageShort.toStdString().c_str() ); MESSAGE ("Enregistrement de PublisMeshIN = " << _PublisMeshIN<<", PublisMeshOUT = "<< _PublisMeshOUT); MESSAGE ("Enregistrement de YACSMaxIter = " << _YACSMaxIter<<", YACSMaxNode = "<< _YACSMaxNode<<", YACSMaxElem = "<< _YACSMaxElem); + MESSAGE ("Enregistrement de YACSTypeTest = " << _YACSTypeTest); // homardGen->SetLanguageShort(_LanguageShort.toStdString().c_str()); homardGen->SetPublisMesh(_PublisMeshIN, _PublisMeshOUT); homardGen->SetYACSMaximum(_YACSMaxIter, _YACSMaxNode, _YACSMaxElem); +// + homardGen->SetYACSConvergenceType(_YACSTypeTest); } //================================================ diff --git a/src/HOMARDGUI/HOMARDGUI.h b/src/HOMARDGUI/HOMARDGUI.h index 8689ac6d..49a18027 100644 --- a/src/HOMARDGUI/HOMARDGUI.h +++ b/src/HOMARDGUI/HOMARDGUI.h @@ -100,6 +100,7 @@ private: int _YACSMaxIter ; int _YACSMaxNode ; int _YACSMaxElem ; + int _YACSTypeTest ; }; #endif diff --git a/src/HOMARDGUI/HOMARD_msg_en.ts b/src/HOMARDGUI/HOMARD_msg_en.ts index cb8bde0d..b95385fd 100644 --- a/src/HOMARDGUI/HOMARD_msg_en.ts +++ b/src/HOMARDGUI/HOMARD_msg_en.ts @@ -435,5 +435,13 @@ PREF_YACS_MAX_ELEM Elements + + PREF_YACS_CONVERGENCE + Convergence + + + PREF_YACS_TYPE_TEST + Test type + diff --git a/src/HOMARDGUI/HOMARD_msg_fr.ts b/src/HOMARDGUI/HOMARD_msg_fr.ts index 28b90c82..b248bc59 100644 --- a/src/HOMARDGUI/HOMARD_msg_fr.ts +++ b/src/HOMARDGUI/HOMARD_msg_fr.ts @@ -1111,5 +1111,13 @@ PREF_YACS_MAX_ELEM Eléments + + PREF_YACS_CONVERGENCE + Convergence + + + PREF_YACS_TYPE_TEST + Type de test + diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index 1d44d673..e7f1679a 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -5060,6 +5060,7 @@ void HOMARD_Gen_i::SetPreferences( ) int YACSMaxIter = 0 ; int YACSMaxNode = 0 ; int YACSMaxElem = 0 ; + std::string YACSTypeTestchaine = "None" ; // B. La version de salome // Cela se presente sous la forme : @@ -5127,15 +5128,17 @@ void HOMARD_Gen_i::SetPreferences( ) // 3. Parametres // 3.1. La langue else if ( section_langue || section_homard ) - { /*MESSAGE ( "a decoder : "<< ligne);*/ - ligne_bis >> mot_cle ; - chaine = GetStringInTexte ( mot_cle, "\"", 1 ) ; + { MESSAGE ( "a decoder : "<< ligne); +// La valeur : entre les deux premieres quotes + chaine = GetStringInTexte ( ligne, "\"", 1 ) ; +// MESSAGE("chaine 1 = |"<> mot_cle ; - std::string chaine2 = GetStringInTexte ( mot_cle, "\"", 1 ) ; - chaine2 = GetStringInTexte ( chaine2, "\"", 0 ) ; - MESSAGE("chaine2 = "<> YACSMaxIter ; } if ( chaine2 == "yacs_max_node" ) { chainebis >> YACSMaxNode ; } if ( chaine2 == "yacs_max_elem" ) { chainebis >> YACSMaxElem ; } + if ( chaine2 == "yacs_type_test" ) { YACSTypeTestchaine = chaine ; } } } } } } - // C. Enregistrement + // C. Enregistrements MESSAGE ("Enregistrement de LanguageShort = " << LanguageShort ); - MESSAGE ("Enregistrement de PublisMeshIN = " << PublisMeshIN<<", PublisMeshOUT = "<< PublisMeshOUT); - MESSAGE ("Enregistrement de YACSMaxIter = " << YACSMaxIter<<", YACSMaxNode = "<< YACSMaxNode<<", YACSMaxElem = "<< YACSMaxElem); 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 > VRef" ) ) { YACSTypeTest = 1 ; } + else if ( ( YACSTypeTestchaine == "VTest < VRef" ) || ( YACSTypeTestchaine == "VTest < VRef" ) ) { YACSTypeTest = 2 ; } + else { YACSTypeTest = 0 ; } + MESSAGE ("==> TypeTest = " << YACSTypeTest ); + SetYACSConvergenceType( YACSTypeTest ) ; + return ; } //=============================================================================== @@ -5200,7 +5214,7 @@ CORBA::Long HOMARD_Gen_i::GetPublisMeshOUT() return _PublisMeshOUT ; } //=============================================================================== -// YACS - maximum +// YACS - test de convergence //=============================================================================== void HOMARD_Gen_i::SetYACSMaximum(CORBA::Long YACSMaxIter, CORBA::Long YACSMaxNode, CORBA::Long YACSMaxElem) { @@ -5221,6 +5235,15 @@ 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" diff --git a/src/HOMARD_I/HOMARD_Gen_i.hxx b/src/HOMARD_I/HOMARD_Gen_i.hxx index 84af738e..d1fed9c2 100644 --- a/src/HOMARD_I/HOMARD_Gen_i.hxx +++ b/src/HOMARD_I/HOMARD_Gen_i.hxx @@ -212,6 +212,8 @@ public: CORBA::Long GetYACSMaxIter(); CORBA::Long GetYACSMaxNode(); CORBA::Long GetYACSMaxElem(); + void SetYACSConvergenceType(CORBA::Long YACSTypeTest); + CORBA::Long GetYACSConvergenceType(); // --------------------------------------------------------------- @@ -339,6 +341,7 @@ private: int _YACSMaxIter ; int _YACSMaxNode ; int _YACSMaxElem ; + int _YACSTypeTest ; ; }; diff --git a/src/HOMARD_I/HOMARD_YACS_i.cxx b/src/HOMARD_I/HOMARD_YACS_i.cxx index b5dcb425..cd5bb13f 100644 --- a/src/HOMARD_I/HOMARD_YACS_i.cxx +++ b/src/HOMARD_I/HOMARD_YACS_i.cxx @@ -124,6 +124,10 @@ CORBA::Long HOMARD_YACS_i::GetType() return CORBA::Long( myHomardYACS->GetType() ); } //============================================================================= +//============================================================================= +// Caracteristiques de la convergence +//============================================================================= +//============================================================================= void HOMARD_YACS_i::SetMaxIter( CORBA::Long MaxIter ) { ASSERT( myHomardYACS ); @@ -160,6 +164,28 @@ CORBA::Long HOMARD_YACS_i::GetMaxElem() return CORBA::Long( myHomardYACS->GetMaxElem() ); } //============================================================================= +void HOMARD_YACS_i::SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef) +{ + ASSERT( myHomardYACS ); + myHomardYACS->SetTestConvergence( TypeTest, VRef ); +} +//============================================================================= +CORBA::Long HOMARD_YACS_i::GetTestConvergenceType() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetTestConvergenceType() ); +} +//============================================================================= +CORBA::Double HOMARD_YACS_i::GetTestConvergenceVRef() +{ + ASSERT( myHomardYACS ); + return CORBA::Long( myHomardYACS->GetTestConvergenceVRef() ); +} +//============================================================================= +//============================================================================= +// Repertoire et fichiers +//============================================================================= +//============================================================================= void HOMARD_YACS_i::SetDirName( const char* NomDir ) { ASSERT( myHomardYACS ); diff --git a/src/HOMARD_I/HOMARD_YACS_i.hxx b/src/HOMARD_I/HOMARD_YACS_i.hxx index f429e94b..5ddf4845 100644 --- a/src/HOMARD_I/HOMARD_YACS_i.hxx +++ b/src/HOMARD_I/HOMARD_YACS_i.hxx @@ -76,6 +76,10 @@ public: void SetMaxElem( CORBA::Long MaxElem ); CORBA::Long GetMaxElem(); + void SetTestConvergence( CORBA::Long TypeTest, CORBA::Double VRef ); + CORBA::Long GetTestConvergenceType(); + CORBA::Double GetTestConvergenceVRef(); + void SetDirName( const char* NomDir ); char* GetDirName(); -- 2.30.2