Salome HOME
Suppression de composantes dans les hypothèses.
authornicolas <nicolas>
Wed, 25 Sep 2013 08:43:44 +0000 (08:43 +0000)
committernicolas <nicolas>
Wed, 25 Sep 2013 08:43:44 +0000 (08:43 +0000)
Informations sur les hypothèses.

14 files changed:
doc/en/tui_create_hypothese.rst
doc/files/yacs_script.py
doc/fr/tui_create_hypothese.rst
idl/HOMARD_Hypothesis.idl
src/HOMARD/HOMARD_DriverTools.cxx
src/HOMARD/HOMARD_Hypothesis.cxx
src/HOMARD/HOMARD_Hypothesis.hxx
src/HOMARDGUI/MonEditHypothesis.cxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Hypothesis_i.cxx
src/HOMARD_I/HOMARD_Hypothesis_i.hxx
tests/test_1.py
tests/test_2.py
tests/test_3.py

index eb67f2f22086f2565e4f74dc3c5b93e9830f220d..2683b6f6efec02c49e2205cc0f80f508c5719e8b 100644 (file)
@@ -195,11 +195,23 @@ The components of the field
 |        * 1: infinite norm                                     |
 |        * 2: relative value, if only one component             |
 +---------------------------------------------------------------+
-| .. module:: GetListComp                                       |
+| .. module:: GetComps                                          |
 |                                                               |
-| **GetListComp()**                                             |
+| **GetComps()**                                                |
 |     Returns the list of the used components                   |
 +---------------------------------------------------------------+
+| .. module:: SupprComp                                         |
+|                                                               |
+| **SupprComp(comp_name)**                                      |
+|     Eliminates a component of the field                       |
+|                                                               |
+|     - ``comp_name``: name of a component to eliminate         |
++---------------------------------------------------------------+
+| .. module:: SupprComps                                        |
+|                                                               |
+| **SupprComps()**                                              |
+|     Eliminates all the components of the field                |
++---------------------------------------------------------------+
 
 
 The zones
@@ -217,6 +229,27 @@ The zones
 |         * 1: refinement                                       |
 |         * -1: unrefinement                                    |
 +---------------------------------------------------------------+
+| .. module:: GetZones                                          |
+|                                                               |
+| **GetZones()**                                                |
+|     Returns the list of the used zones with their uses        |
+|     Warning: the use is stored as a string in the list and    |
+|     not as an integer.                                        |
+|                                                               |
+|     Example: ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1']    |
++---------------------------------------------------------------+
+| .. module:: SupprZone                                         |
+|                                                               |
+| **SupprZone(zone_name)**                                      |
+|     Eliminates a zone from the hypothesis                     |
+|                                                               |
+|     - ``zone_name``: name of a zone to eliminate              |
++---------------------------------------------------------------+
+| .. module:: SupprZones                                        |
+|                                                               |
+| **SupprZones()**                                              |
+|     Eliminates all the zones from the hypothesis              |
++---------------------------------------------------------------+
 
 
 The filtering by the groups
index fc742e32f5a6cae378115a0479512bb1e7438cc2..7a869d16e2aca2cb6c590c246b0fd103e3e36121 100755 (executable)
@@ -3,7 +3,7 @@
 """
 Lancement d'un calcul ASTER
 """
-__revision__ = "V5.4"
+__revision__ = "V5.5"
 #
 import sys
 import os
@@ -1177,11 +1177,11 @@ Affichage de resultats selon les cas
       erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
       if ( erreur > 0 ) :
         break
-      self.message_info += info[:-1]
 #
 # 1.2. Details
 #
       if ( erreur == 0 ) :
+        self.message_info += info[:-1]
         info = info.replace(chaine, " ")
         laux = info[:-1].split()
         aux = laux[0]
@@ -1190,6 +1190,7 @@ Affichage de resultats selon les cas
         dico_resu[chaine] = float(aux)
       else :
         erreur = 0
+        message_erreur = " "
 #
 # 2. Exploration du fichier mess
 # 2.1. Que chercher ?
@@ -1206,11 +1207,11 @@ Affichage de resultats selon les cas
         erreur, message_erreur, info = self.post_aster_1 ( nomfic, chaine, nuocc )
         if ( erreur > 0 ) :
           break
-        self.message_info += info[:-1]
 #
 # 2.3. Details
 #
         if ( erreur == 0 ) :
+          self.message_info += info[:-1]
           if chaine == "INSTANT" :
             l_aux = info[:-1].split()
             lg_aux = len(l_aux)
@@ -1228,6 +1229,7 @@ Affichage de resultats selon les cas
             dico_resu[chaine] = int(l_aux[1])
         else :
           erreur = 0
+          message_erreur = " "
 #
       if erreur :
         break
@@ -1275,9 +1277,10 @@ info = la ou les lignes recherchees
     nom_fonction = __name__ + "/post_aster_1"
     blabla = "\nDans " + nom_fonction + " :"
     if self.verbose_max :
-      print blabla, "chaine =", chaine, ", nuocc =", nuocc
+      print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
 #
-    erreur = -1
+    trouve = False
+    erreur = 0
     message_erreur = " "
     info = ""
 #
@@ -1305,19 +1308,23 @@ info = la ou les lignes recherchees
 #
       else :
 #
-        self.message_info += "\n"
         iaux = 0
         for ligne in les_lignes :
           if chaine in ligne :
             iaux += 1
             if ( ( nuocc == 0 ) or ( iaux == nuocc ) ) :
               info += ligne
-              erreur = 0
+              if ( not trouve ) :
+                self.message_info += "\n"
+                trouve = True
 #
       break
+#
+    if ( not trouve ) :
+      erreur = -1
 #
     if ( self.verbose_max or ( erreur>0 ) ) :
-      print blabla, "chaine =", chaine, ", nuocc =", nuocc
+      print blabla, "nomfic =", nomfic, "chaine =", chaine, ", nuocc =", nuocc
       print ". erreur =", erreur
 #
     if erreur :
index 2960ee2b3a47fa2cf1e0f70979bc7801a90ff9c1..2778d342d8127e7787f06ee16b66fd6cb53c3c5c 100644 (file)
@@ -190,11 +190,23 @@ Les composantes du champ
 |        * 1 : norme infinie                                    |
 |        * 2 : valeur relative, si une seule composante         |
 +---------------------------------------------------------------+
-| .. module:: GetListComp                                       |
+| .. module:: GetComps                                          |
 |                                                               |
-| **GetListComp()**                                             |
+| **GetComps()**                                                |
 |     Retourne la liste des composantes utilisées               |
 +---------------------------------------------------------------+
+| .. module:: SupprComp                                         |
+|                                                               |
+| **SupprComp(comp_name)**                                      |
+|     Supprime une composante du champ à considérer             |
+|                                                               |
+|     - ``comp_name`` : nom de la composante à supprimer        |
++---------------------------------------------------------------+
+| .. module:: SupprComps                                        |
+|                                                               |
+| **SupprComps()**                                              |
+|     Supprime toutes les composantes du champ à considérer     |
++---------------------------------------------------------------+
 
 
 Les zones
@@ -212,6 +224,27 @@ Les zones
 |         * 1 : raffinement                                     |
 |         * -1 : déraffinement                                  |
 +---------------------------------------------------------------+
+| .. module:: GetZones                                          |
+|                                                               |
+| **GetZones()**                                                |
+|     Retourne la liste des zones utilisées avec leur usage.    |
+|     Attention, l'usage est stocké sous forme de chaîne de     |
+|     caractères et non pas d'entier dans la liste.             |
+|                                                               |
+|     Exemple : ['Zone_A', '1', 'Zone_B', '1', 'Zone_C', '1']   |
++---------------------------------------------------------------+
+| .. module:: SupprZone                                         |
+|                                                               |
+| **SupprZone(zone_name)**                                      |
+|     Supprime une zone de l'hypothèse                          |
+|                                                               |
+|     - ``zone_name`` : nom de la zone à supprimer              |
++---------------------------------------------------------------+
+| .. module:: SupprZones                                        |
+|                                                               |
+| **SupprZones()**                                              |
+|     Supprime toutes les zones de l'hypothèse                  |
++---------------------------------------------------------------+
 
 
 Le filtrage par les groupes
index 8c42085c5b2534c2d5ecc298f54d67017a114124..2137fd8034db89093abb61b982bb4cbfb3f95b7a 100644 (file)
@@ -75,12 +75,13 @@ module HOMARD
     void     SetField(in string FieldName)                 raises (SALOME::SALOME_Exception);
     string   GetFieldName()                                raises (SALOME::SALOME_Exception);
     void     SetUseField(in long UsField)                  raises (SALOME::SALOME_Exception);
-    InfosHypo GetField()                                  raises (SALOME::SALOME_Exception);
+    InfosHypo GetField()                                   raises (SALOME::SALOME_Exception);
 
     void     SetUseComp(in long UsCmpI)                    raises (SALOME::SALOME_Exception);
-    void     AddComp(in string NomComposant)               raises (SALOME::SALOME_Exception);
-    void     SupprComp()                                   raises (SALOME::SALOME_Exception);
-    listeComposantsHypo GetListComp()                      raises (SALOME::SALOME_Exception);
+    void     AddComp(in string NomComp)                    raises (SALOME::SALOME_Exception);
+    void     SupprComp(in string NomComp)                  raises (SALOME::SALOME_Exception);
+    void     SupprComps()                                  raises (SALOME::SALOME_Exception);
+    listeComposantsHypo GetComps()                         raises (SALOME::SALOME_Exception);
 
     void     SetRefinThr(in long TypeThR, in double ThreshR)
                                                            raises (SALOME::SALOME_Exception);
@@ -122,6 +123,7 @@ module HOMARD
     void     AddZone(in string NomZone, in long TypeUse)   raises (SALOME::SALOME_Exception);
     void     AddZone0(in string NomZone, in long TypeUse)  raises (SALOME::SALOME_Exception);
     void     SupprZone(in string NomZone)                  raises (SALOME::SALOME_Exception);
+    void     SupprZones()                                  raises (SALOME::SALOME_Exception);
     listeZonesHypo GetZones()                              raises (SALOME::SALOME_Exception);
 
   };
index 187970ae35e46fccfa6350399c150bccc6bb1100..6f1c9a3b8bb7d5a95b7c8b671cc360f7f68535e7 100644 (file)
@@ -220,7 +220,7 @@ namespace HOMARD
     for ( it = ListString.begin(); it != ListString.end(); ++it )
           os << separator() << *it;
 
-    ListString = hypothesis.GetListComp();
+    ListString = hypothesis.GetComps();
     os << separator() << ListString.size();
     for ( it = ListString.begin(); it != ListString.end(); ++it )
          os << separator() << *it;
index a3ca10fe7abceb1238e578d67203178eb8faa7cf..e5640d6fc1bdb15f826b5d9fc1a096662e96eab6 100644 (file)
@@ -99,8 +99,8 @@ std::string HOMARD_Hypothesis::GetDumpPython() const
     aScript << "\t" << _Name << ".SetField(\"" << _Field << "\")\n";
     aScript << "\t" << _Name << ".SetUseField(" << _UsField << ")\n";
     aScript << "\t" << _Name << ".SetUseComp(" << _UsCmpI << ")\n";
-    std::list<std::string>::const_iterator it_comp = _ListComposant.begin();
-    while(it_comp != _ListComposant.end())
+    std::list<std::string>::const_iterator it_comp = _ListComp.begin();
+    while(it_comp != _ListComp.end())
     {
       aScript << "\t" << _Name << ".AddComp(\"" << *it_comp << "\")\n";
       it_comp++;
@@ -216,20 +216,31 @@ int HOMARD_Hypothesis::GetUseComp() const
   return _UsCmpI;
 }
 //=============================================================================
-void HOMARD_Hypothesis::AddComp( const char* NomComposant )
+void HOMARD_Hypothesis::AddComp( const char* NomComp )
 {
-  _ListComposant.push_back( std::string( NomComposant ) );
+// On commence par la supprimer au cas ou elle aurait deja ete inseree
+// Cela peut se produire dans un schema YACS quand on repasse plusieurs fois par la
+// definition de l'hypothese
+  SupprComp( NomComp ) ;
+// Insertion veritable
+  _ListComp.push_back( std::string( NomComp ) );
+}
+//=============================================================================
+void HOMARD_Hypothesis::SupprComp( const char* NomComp )
+{
+  MESSAGE ("SupprComp pour "<<NomComp) ;
+  std::list<std::string>::iterator it = find( _ListComp.begin(), _ListComp.end(), NomComp );
+  if ( it != _ListComp.end() ) { it = _ListComp.erase( it ); }
 }
 //=============================================================================
-void HOMARD_Hypothesis::SupprComp()
+void HOMARD_Hypothesis::SupprComps()
 {
-  MESSAGE ("SupprComp") ;
-  _ListComposant.clear();
+  _ListComp.clear();
 }
 //=============================================================================
-const std::list<std::string>& HOMARD_Hypothesis::GetListComp() const
+const std::list<std::string>& HOMARD_Hypothesis::GetComps() const
 {
-  return _ListComposant;
+  return _ListComp;
 }
 //=============================================================================
 void HOMARD_Hypothesis::SetRefinThr( int TypeThR, double ThreshR )
index 995ac7704f318ca3c453b8535f8d89a5a13c72c3..439d43e9c661ee7bc80aefadad8d8900cbcca0db 100644 (file)
@@ -63,9 +63,10 @@ public:
 
   void                          SetUseComp( int UsCmpI );
   int                           GetUseComp()    const;
-  void                          AddComp( const char* NomComposant );
-  void                          SupprComp();
-  const std::list<std::string>& GetListComp() const;
+  void                          AddComp( const char* NomComp );
+  void                          SupprComp( const char* NomComp );
+  void                          SupprComps();
+  const std::list<std::string>& GetComps() const;
 
   void                          SetRefinThr( int TypeThR, double ThreshR );
   int                           GetRefinThrType()   const;
@@ -138,7 +139,7 @@ private:
 
   std::list<std::string>        _ListIter;
   std::list<std::string>        _ListZone;
-  std::list<std::string>        _ListComposant;
+  std::list<std::string>        _ListComp;
   std::list<std::string>        _ListGroupSelected;
   std::list<std::string>        _ListFieldInterp;
 };
index c3a27b7d4921015690ecddc158721fde1a3206ed..c1452e511de8f2bd9c442200a755d8be20965a4b 100644 (file)
@@ -260,7 +260,7 @@ void MonEditHypothesis::InitAdaptChamps()
     CBFieldName->setEnabled(false);
     //SetFieldName(Qt::Unchecked);
 
-    HOMARD::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetListComp();
+    HOMARD::listeComposantsHypo_var mesComposantsAvant = aHypothesis->GetComps();
     TWCMP->clear();
     TWCMP->setRowCount(0);
     TWCMP->resizeRowsToContents();
index f075f85bd585ed85f12f9886ff7a62c1cf775717..21aeee1882e47f685aaa9dbae60b9c5d2920423f 100755 (executable)
@@ -2839,7 +2839,7 @@ void HOMARD_Gen_i::DriverTexteField(HOMARD::HOMARD_Iteration_var myIteration, HO
   myDriver->TexteField(FieldName, FieldFile, TimeStep, Rank, TypeThR, ThreshR, TypeThC, ThreshC, UsField, UsCmpI);
 //
 //  Les composantes
-  HOMARD::listeComposantsHypo* mescompo = myHypo->GetListComp();
+  HOMARD::listeComposantsHypo* mescompo = myHypo->GetComps();
   int numberOfCompos = mescompo->length();
   MESSAGE( ". numberOfCompos = " << numberOfCompos );
   for (int NumeComp = 0; NumeComp< numberOfCompos; NumeComp++)
@@ -4620,7 +4620,7 @@ std::string HOMARD_Gen_i::GetStringInTexte( const std::string ligne, const std::
 // //===============================================================================
 void HOMARD_Gen_i::SetLanguageShort(const char* LanguageShort)
 {
-  MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort );
+//   MESSAGE ("SetLanguageShort pour LanguageShort = " << LanguageShort );
   _LangueShort = LanguageShort ;
   if ( _LangueShort == "fr" ) { _Langue = "Francais" ; }
   else                        { _Langue = "English" ; }
index d90d4215d21778f57844e2e631c9150a52766e77..b22af469440b7f40291bb98bcffd1cf816f19b10 100644 (file)
@@ -183,22 +183,28 @@ void HOMARD_Hypothesis_i::SetUseComp( CORBA::Long UsCmpI )
   myHomardHypothesis->SetUseComp( UsCmpI );
 }
 //=============================================================================
-void HOMARD_Hypothesis_i::AddComp( const char* NomComposant )
+void HOMARD_Hypothesis_i::AddComp( const char* NomComp )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->AddComp( NomComposant );
+  myHomardHypothesis->AddComp( NomComp );
 }
 //=============================================================================
-void HOMARD_Hypothesis_i::SupprComp()
+void HOMARD_Hypothesis_i::SupprComp( const char* NomComp )
 {
   ASSERT( myHomardHypothesis );
-  myHomardHypothesis->SupprComp();
+  myHomardHypothesis->SupprComp(NomComp);
 }
 //=============================================================================
-HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetListComp()
+void HOMARD_Hypothesis_i::SupprComps()
 {
   ASSERT( myHomardHypothesis );
-  const std::list<std::string>& ListString = myHomardHypothesis->GetListComp();
+  myHomardHypothesis->SupprComps();
+}
+//=============================================================================
+HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps()
+{
+  ASSERT( myHomardHypothesis );
+  const std::list<std::string>& ListString = myHomardHypothesis->GetComps();
   HOMARD::listeComposantsHypo_var aResult = new HOMARD::listeComposantsHypo;
   aResult->length( ListString.size() );
   std::list<std::string>::const_iterator it;
@@ -415,6 +421,12 @@ void  HOMARD_Hypothesis_i::SupprZone(const char * NomZone)
   myHomardHypothesis->SupprZone( NomZone);
 }
 //=============================================================================
+void  HOMARD_Hypothesis_i::SupprZones()
+{
+  ASSERT(myHomardHypothesis);
+  myHomardHypothesis->SupprZones();
+}
+//=============================================================================
 HOMARD::listeZonesHypo* HOMARD_Hypothesis_i::GetZones()
 {
   ASSERT(myHomardHypothesis);
index 6a55310eb398956b22d6db30c0d92984e8d99e56..5bc2fad3ececb53d5bef07685334d840ea619373 100644 (file)
@@ -76,9 +76,10 @@ public:
   HOMARD::InfosHypo*     GetField();
 
   void                   SetUseComp(CORBA::Long UsCmpI);
-  void                   AddComp( const char* NomComposant );
-  void                   SupprComp();
-  HOMARD::listeComposantsHypo* GetListComp();
+  void                   AddComp( const char* NomComp );
+  void                   SupprComp( const char* NomComp );
+  void                   SupprComps();
+  HOMARD::listeComposantsHypo* GetComps();
 
   void                   SetRefinThr(CORBA::Long TypeThR, CORBA::Double ThreshR);
   CORBA::Long            GetRefinThrType();
@@ -118,6 +119,7 @@ public:
   void                   AddZone( const char* NomZone, CORBA::Long TypeUse );
   void                   AddZone0( const char* NomZone, CORBA::Long TypeUse );
   void                   SupprZone( const char* NomZone );
+  void                   SupprZones();
   HOMARD::listeZonesHypo* GetZones();
 
 private:
index c48aeb70de352c81266005c4affcfe164ebc935e..2cbc34dee380b57e96ae564352cd3673738304eb 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2010, 2013
 Test test_1
 """
-__revision__ = "V1.11"
+__revision__ = "V1.12"
 
 #========================================================================
 Test_Name = "test_1"
@@ -86,20 +86,34 @@ Copyright EDF-R&D 2010, 2013
   # Creation of the hypotheses
   # ==========================
   # Creation of the hypothesis a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM = homard.CreateHypothesis('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM')
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetAdapRefinUnRef(1, 1, 0)
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetField('RESU____ERRE_ELEM_SIGM__________')
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetUseComp(0)
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddComp('ERREST')
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetRefinThr(3, 10.1)
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.SetTypeFieldInterp(2)
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____DEPL____________________')
-    a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________')
+    HypoName_1 = "a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM"
+    print "-------- Creation of the hypothesis", HypoName_1
+    Hypo_1_1 = homard.CreateHypothesis(HypoName_1)
+    Hypo_1_1.SetAdapRefinUnRef(1, 1, 0)
+    Hypo_1_1.SetField('RESU____ERRE_ELEM_SIGM__________')
+    Hypo_1_1.SetUseComp(0)
+    Hypo_1_1.AddComp('ERREST')
+    Hypo_1_1.SetRefinThr(3, 10.1)
+    Hypo_1_1.SetTypeFieldInterp(2)
+    Hypo_1_1.AddFieldInterp('RESU____DEPL____________________')
+    Hypo_1_1.AddFieldInterp('RESU____ERRE_ELEM_SIGM__________')
+    print HypoName_1, " : zones utilisées :", Hypo_1_1.GetZones()
+    print HypoName_1, " : champ utilisé :", Hypo_1_1.GetFieldName()
+    print HypoName_1, " : composantes utilisées :", Hypo_1_1.GetComps()
+    if ( len (Hypo_1_1.GetFieldName()) > 0 ) :
+      print ".. caractéristiques de l'adaptation :", Hypo_1_1.GetField()
   # Creation of the hypothesis Zones_1_et_2
-    Zones_1_et_2 = homard.CreateHypothesis('Zones_1_et_2')
+    HypoName_2 = "Zones_1_et_2"
+    print "-------- Creation of the hypothesis", HypoName_2
+    Zones_1_et_2 = homard.CreateHypothesis(HypoName_2)
     Zones_1_et_2.SetAdapRefinUnRef(0, 1, 0)
     Zones_1_et_2.AddZone('Zone_1_1', 1)
     Zones_1_et_2.AddZone('Zone_1_2', 1)
+    print HypoName_2, " : zones utilisées :", Zones_1_et_2.GetZones()
+    print HypoName_2, " : champ utilisé :", Zones_1_et_2.GetFieldName()
+    print HypoName_2, " : composantes utilisées :", Zones_1_et_2.GetComps()
+    if ( len (Zones_1_et_2.GetFieldName()) > 0 ) :
+      print ".. caractéristiques de l'adaptation :", Zones_1_et_2.GetField()
   #
   # Creation of the cases
   # =====================
@@ -117,7 +131,7 @@ Copyright EDF-R&D 2010, 2013
     I1_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
     I1_1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med'))
     I1_1.SetTimeStepRank(1, 1)
-    I1_1.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM')
+    I1_1.AssociateHypo(HypoName_1)
     error = I1_1.Compute(1, 1)
     if error :
       error = 1
@@ -129,7 +143,7 @@ Copyright EDF-R&D 2010, 2013
     I1_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
     I1_2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med'))
     I1_2.SetTimeStepRank(1, 1)
-    I1_2.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM')
+    I1_2.AssociateHypo(HypoName_1)
     error = I1_2.Compute(1, 1)
     if error :
       error = 2
@@ -139,7 +153,7 @@ Copyright EDF-R&D 2010, 2013
     I1_3 = I1_2.NextIteration('I1_3')
     I1_3.SetMeshName('M3')
     I1_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med'))
-    I1_3.AssociateHypo('Zones_1_et_2')
+    I1_3.AssociateHypo(HypoName_2)
     error = I1_3.Compute(1, 1)
     if error :
       error = 3
index 1f6dae839987c65799a8d713f6b8f3dc926dda70..e8371e46bfb7f8eed305b89ff54090ef31be19dc 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2010, 2013
 Test test_2
 """
-__revision__ = "V1.10"
+__revision__ = "V1.11"
 
 #========================================================================
 Test_Name = "test_2"
@@ -83,15 +83,29 @@ Copyright EDF-R&D 2010, 2013
   # Creation of the hypotheses
   # ==========================
   # Creation of the hypothesis Hypo_2_1
-    Hypo_2_1 = homard.CreateHypothesis('Hypo_2_1')
+    HypoName_1 = "Hypo_2_1"
+    print "-------- Creation of the hypothesis", HypoName_1
+    Hypo_2_1 = homard.CreateHypothesis(HypoName_1)
     Hypo_2_1.SetAdapRefinUnRef(-1, 1, 0)
     Hypo_2_1.AddGroup('EG')
     Hypo_2_1.AddGroup('BANDE')
+    print HypoName_1, " : zones utilisées :", Hypo_2_1.GetZones()
+    print HypoName_1, " : champ utilisé :", Hypo_2_1.GetFieldName()
+    print HypoName_1, " : composantes utilisées :", Hypo_2_1.GetComps()
+    if ( len (Hypo_2_1.GetFieldName()) > 0 ) :
+      print ".. caractéristiques de l'adaptation :", Hypo_2_1.GetField()
 
   # Creation of the hypothesis Hypo_2_2
-    Hypo_2_2 = homard.CreateHypothesis('Hypo_2_2')
+    HypoName_2 = "Hypo_2_2"
+    print "-------- Creation of the hypothesis", HypoName_2
+    Hypo_2_2 = homard.CreateHypothesis(HypoName_2)
     Hypo_2_2.SetAdapRefinUnRef(-1, 1, 0)
     Hypo_2_2.AddGroup('M_D')
+    print HypoName_2, " : zones utilisées :", Hypo_2_2.GetZones()
+    print HypoName_2, " : champ utilisé :", Hypo_2_2.GetFieldName()
+    print HypoName_2, " : composantes utilisées :", Hypo_2_2.GetComps()
+    if ( len (Hypo_2_2.GetFieldName()) > 0 ) :
+      print ".. caractéristiques de l'adaptation :", Hypo_2_2.GetField()
   #
   # Creation of the cases
   # =====================
@@ -108,7 +122,7 @@ Copyright EDF-R&D 2010, 2013
     Iter_2_1 = Case_2.NextIteration('Iter_2_1')
     Iter_2_1.SetMeshName('PLAQUE_1')
     Iter_2_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med'))
-    Iter_2_1.AssociateHypo('Hypo_2_1')
+    Iter_2_1.AssociateHypo(HypoName_1)
     error = Iter_2_1.Compute(1, 1)
     if error :
       error = 1
@@ -118,7 +132,7 @@ Copyright EDF-R&D 2010, 2013
     Iter_2_2 = Iter_2_1.NextIteration('Iter_2_2')
     Iter_2_2.SetMeshName('PLAQUE_2')
     Iter_2_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med'))
-    Iter_2_2.AssociateHypo('Hypo_2_1')
+    Iter_2_2.AssociateHypo(HypoName_1)
     error = Iter_2_2.Compute(1, 1)
     if error :
       error = 2
@@ -128,7 +142,7 @@ Copyright EDF-R&D 2010, 2013
     Iter_2_3 = Iter_2_2.NextIteration('Iter_2_3')
     Iter_2_3.SetMeshName('PLAQUE_3')
     Iter_2_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med'))
-    Iter_2_3.AssociateHypo('Hypo_2_2')
+    Iter_2_3.AssociateHypo(HypoName_2)
     error = Iter_2_3.Compute(1, 1)
     if error :
       error = 3
index cb73983cd0dd893c554b900228ecd947dd8bcac4..b8583acdc2ac6d4756b1342de07f29d022b82afe 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2011, 2013
 Test test_3
 """
-__revision__ = "V1.10"
+__revision__ = "V1.11"
 
 #========================================================================
 Test_Name = "test_3"
@@ -100,6 +100,9 @@ Copyright EDF-R&D 2010, 2013
     print "-------- Creation of the hypothesis", HypoName
     Hypo_3 = homard.CreateHypothesis(HypoName)
     Hypo_3.SetAdapRefinUnRef(-1, 1, 0)
+    print HypoName, " : zones utilisées :", Hypo_3.GetZones()
+    print HypoName, " : champ utilisé :", Hypo_3.GetFieldName()
+    print HypoName, " : composantes utilisées :", Hypo_3.GetComps()
 #
     for num in range (n_boucle+1) :
 #