Salome HOME
Destruction d'un cas avec option de menage des maillages produits V7_2_1_BR V7_2_BR V7_2_0 V7_2_0_public V7_2_0p1 V7_2_0p2 V7_2_0rc2
authornicolas <nicolas>
Tue, 23 Apr 2013 14:44:22 +0000 (14:44 +0000)
committernicolas <nicolas>
Tue, 23 Apr 2013 14:44:22 +0000 (14:44 +0000)
13 files changed:
doc/tui_create_boundary.rst
doc/tui_create_case.rst
doc/tui_create_hypothese.rst
doc/tui_create_iteration.rst
doc/tui_create_zone.rst
idl/HOMARD_Cas.idl
idl/HOMARD_Gen.idl
src/HOMARDGUI/HOMARDGUI.cxx
src/HOMARD_I/HOMARD_Cas_i.cxx
src/HOMARD_I/HOMARD_Cas_i.hxx
src/HOMARD_I/HOMARD_Gen_i.cxx
src/HOMARD_I/HOMARD_Gen_i.hxx
tests/test_3.py

index 10dbc6249f7f3716cacd5a5d4b3944b5fc529934..a5ec233e4c4f5906160087c277cd7bbbcd606160 100644 (file)
@@ -141,7 +141,7 @@ M
 |     frontière dans l'ordre d'entrée dans le CreateBoundaryXXXX|
 |     associé                                                   |
 +---------------------------------------------------------------+
-| .. index:: single: Delete                                     |
+| .. module:: Delete                                            |
 |                                                               |
 | **Delete()**                                                  |
 |     Detruit la frontière.                                     |
index 3e34369e622d56e88bf53bc1eb644ab0b9f5de9e..30d6042384d26ec2fee23d6da7baedcbefabf9f8 100644 (file)
@@ -157,12 +157,17 @@ M
 |     - ``group`` : nom d'un groupe de faces placées sur la     |
 |       frontière                                               |
 +---------------------------------------------------------------+
-| .. index:: single: Delete                                     |
+| .. module:: Delete                                            |
 |                                                               |
-| **Delete()**                                                  |
-|     Detruit le cas et toutes les itérations associées ainsi   |
-|     que tous les maillages produits. Le fichier du maillage   |
-|     initial associé est conservé.                             |
+| **Delete(option)**                                            |
+|     Detruit le cas et toutes les itérations associées. Le     |
+|     fichier du maillage initial associé est conservé.         |
+|                                                               |
+|     - ``option`` : un entier précisant ce qui est fait des    |
+|       fichiers de maillage associés                           |
+|                                                               |
+|         * 0 : les fichiers sont conservés                     |
+|         * 1 : les fichiers sont détruits                      |
 |                                                               |
 |     Retourne un entier :                                      |
 |         * 0 : destruction réussie                             |
index d4e177f971db8430e35e96704d56dc9d7cca4a6a..22d09fabcbff6e3712a5b108055f9fdfb92f93c6 100644 (file)
@@ -86,7 +86,7 @@ G
 | **GetUnRefType()**                                            |
 |     Retourne le type de déraffinement                         |
 +---------------------------------------------------------------+
-| .. index:: single: Delete                                     |
+| .. module:: Delete                                            |
 |                                                               |
 | **Delete()**                                                  |
 |     Detruit l'hypothèse                                       |
index facb35fe951230b37a5bca3053ac58c16a5e1962..882c8e60432ac35cec828d61183379c813a97408 100644 (file)
@@ -77,7 +77,7 @@ G
 |                                                               |
 |  * le maillage produit a le même nom que l'itération          |
 +---------------------------------------------------------------+
-| .. index:: single: Compute                                    |
+| .. module:: Compute                                           |
 |                                                               |
 | **Compute(option1, option2)**                                 |
 |     Calcule le maillage correspondant à l'itération           |
@@ -169,7 +169,7 @@ G
 |     Retourne le nom du répertoire des résutats associé à      |
 |     l'itération                                               |
 +---------------------------------------------------------------+
-| .. index:: single: Delete                                     |
+| .. module:: Delete                                            |
 |                                                               |
 | **Delete(option)**                                            |
 |     Detruit l'itération et toutes ses filles éventuelles.     |
index 1441360e1a9184e518c2fd5ef8f1bce6823b5013..235639d10456a3c942002e5432a848596bd02c21 100644 (file)
@@ -172,7 +172,7 @@ M
 |     Retourne un tableau contenant les coordonnées de la zone  |
 |     dans l'ordre d'entrée dans le CreateZoneXXXX associé      |
 +---------------------------------------------------------------+
-| .. index:: single: Delete                                     |
+| .. module:: Delete                                            |
 |                                                               |
 | **Delete()**                                                  |
 |     Detruit la zone                                           |
index c8aa506cea6db591cfa1007e33d6db47df0f5043..d7a1220eb04d7de01abfb0111eba440e355a402d 100644 (file)
@@ -48,7 +48,7 @@ module HOMARD
     void     SetName(in string Name)                       raises (SALOME::SALOME_Exception);
     string   GetName()                                     raises (SALOME::SALOME_Exception);
 
-    long     Delete()                                      raises (SALOME::SALOME_Exception);
+    long     Delete(in long Option)                        raises (SALOME::SALOME_Exception);
 
     string   GetDumpPython()                               raises (SALOME::SALOME_Exception);
 
index a931cca37788af107c93f643aaa6fc5754771061..1252ae19fbbe5f7b7d29c09eb4a1cb078360df60 100644 (file)
@@ -149,7 +149,8 @@ module HOMARD
     void InvalideZone (in string ZoneName)                 raises (SALOME::SALOME_Exception);
 
     long DeleteBoundary (in string BoundaryName)           raises (SALOME::SALOME_Exception);
-    long DeleteCase(in string CaseName)                    raises (SALOME::SALOME_Exception);
+    long DeleteCase(in string CaseName, in long Option)
+                                                           raises (SALOME::SALOME_Exception);
     long DeleteHypo(in string HypoName)                    raises (SALOME::SALOME_Exception);
     long DeleteIteration(in string IterName, in long Option)
                                                            raises (SALOME::SALOME_Exception);
index addf6adf80c1cf1cf18f7635d9c8fd105684e358..c1bf1f33f7208782977eee0f5a00a23af9c2aa5b 100644 (file)
@@ -377,7 +377,7 @@ bool HOMARDGUI::OnGUIEvent (int theCommandID)
         if (HOMARD_UTILS::isCase(obj))
         {
           try
-          { homardGen->DeleteCase(_ObjectName.toStdString().c_str()); }
+          { homardGen->DeleteCase(_ObjectName.toStdString().c_str(), 1); }
           catch( SALOME::SALOME_Exception& S_ex )
           {
             QMessageBox::critical( 0, QObject::tr("HOM_ERROR"),
index 3660bfc3e98625b20fab9a62e668f4232b7ecfbf..8cb0b7b4bdcbea95f84e58001288c05cf3225e10 100755 (executable)
@@ -85,12 +85,12 @@ char* HOMARD_Cas_i::GetName()
   return CORBA::string_dup( myHomardCas->GetName().c_str() );
 }
 //=============================================================================
-CORBA::Long  HOMARD_Cas_i::Delete()
+CORBA::Long  HOMARD_Cas_i::Delete( CORBA::Long Option )
 {
   ASSERT( myHomardCas );
   char* CaseName = GetName() ;
-  MESSAGE ( "Delete : destruction du cas " << CaseName );
-  return _gen_i->DeleteCase(CaseName) ;
+  MESSAGE ( "Delete : destruction du cas " << CaseName << ", Option = " << Option );
+  return _gen_i->DeleteCase(CaseName, Option) ;
 }
 //=============================================================================
 char* HOMARD_Cas_i::GetDumpPython()
index 5d2526adf49393776e0b364e06f591a82f6e524d..8f729be8c1f8261e4f40d9dfa6a66168bf9341ce 100644 (file)
@@ -56,7 +56,7 @@ public:
   void                   SetName( const char* Name );
   char*                  GetName();
 
-  CORBA::Long            Delete();
+  CORBA::Long            Delete( CORBA::Long Option );
 
   char*                  GetDumpPython();
 
index 20242f2454fb1a729a4bf40851acbaf6ad44bba0..02407cd15c09f02bd4cf67781372e995fdd7ad16 100755 (executable)
@@ -260,10 +260,10 @@ CORBA::Long HOMARD_Gen_i::DeleteBoundary(const char* BoundaryName)
   return 0 ;
 }
 //=============================================================================
-CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas)
+CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas, CORBA::Long Option)
 {
   // Pour detruire un cas
-  MESSAGE ( "DeleteCase : nomCas = " << nomCas );
+  MESSAGE ( "DeleteCase : nomCas = " << nomCas << ", avec option = " << Option );
   HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas];
   if (CORBA::is_nil(myCase))
   {
@@ -276,8 +276,7 @@ CORBA::Long HOMARD_Gen_i::DeleteCase(const char* nomCas)
   // On commence par detruire toutes les iterations en partant de l'initiale et y compris elle
   CORBA::String_var nomIter = myCase->GetIter0Name();
   CORBA::Long Option1 = 0 ;
-  CORBA::Long Option2 = 1 ;
-  if ( DeleteIterationOption(nomIter, Option1, Option2) != 0 )
+  if ( DeleteIterationOption(nomIter, Option1, Option) != 0 )
   {
     return 2;
   };
@@ -343,7 +342,6 @@ CORBA::Long HOMARD_Gen_i::DeleteIteration(const char* nomIter, CORBA::Long Optio
 {
   //  Option = 0 : On ne supprime pas le fichier du maillage associe
   //  Option = 1 : On supprime le fichier du maillage associe
-  //  Option = 2 : On supprime le fichier du maillage associe, sauf si c'est la derniere iteration
   // Pour detruire une iteration courante
   MESSAGE ( "DeleteIteration : nomIter = " << nomIter << ", avec option = " << Option );
   CORBA::Long Option1 = 1 ;
@@ -392,8 +390,11 @@ CORBA::Long HOMARD_Gen_i::DeleteIterationOption(const char* nomIter, CORBA::Long
   // On arrive ici pour une iteration sans fille
   MESSAGE ( "Destruction effective de " << nomIter );
   // On commence par invalider l'iteration pour faire le menage des dependances
-  // et eventeullement du maillage associe
-  InvalideIterOption(nomIter, Option2) ;
+  // et eventuellement du maillage associe
+  int option ;
+  if ( numero == 0 ) { option = 0 ; }
+  else               { option = Option2 ; }
+  InvalideIterOption(nomIter, option) ;
 
   // Retrait dans la descendance de l'iteration parent
   if ( numero > 0 )
index 3fcf18a1bfdeb110a3f38e0bb1e57ce735b8f479..517629c0d292661beaf9006bc154acf77458c3fb 100644 (file)
@@ -145,7 +145,7 @@ public:
   void                            InvalideZone(const char* nomZone);
 
   CORBA::Long                     DeleteBoundary(const char* nomBoundary);
-  CORBA::Long                     DeleteCase(const char* nomCas);
+  CORBA::Long                     DeleteCase(const char* nomCas, CORBA::Long Option);
   CORBA::Long                     DeleteHypo(const char* nomHypothesis);
   CORBA::Long                     DeleteIteration(const char* nomIter, CORBA::Long Option);
   CORBA::Long                     DeleteIterationOption(const char* nomIter, CORBA::Long Option1, CORBA::Long Option2);
index 0d7bd3d402af66766a473ce1deaa961b247bb334..390d35e30d0f8d213fa76d0163feb622b5cb7ba1 100644 (file)
@@ -22,7 +22,7 @@ Python script for HOMARD
 Copyright EDF-R&D 2011, 2013
 Test test_3
 """
-__revision__ = "V1.6"
+__revision__ = "V1.7"
 
 #========================================================================
 Test_Name = "test_3"
@@ -99,22 +99,22 @@ Copyright EDF-R&D 2010, 2013
     Hypo = homard.CreateHypothesis('Hypo')
     Hypo.SetAdapRefinUnRef(-1, 1, 0)
 #
-# Creation of the cases
-# =====================
+    for iaux in range (n_boucle+1) :
+#
 # Creation of the case Case_1
-    Case_1 = homard.CreateCase('Case_1', 'MOYEU', os.path.join(Rep_Test, Test_Name + '.00.med'))
-    Case_1.SetDirName(Rep_Test_Resu)
-    Case_1.SetConfType(1)
-    Case_1.AddBoundaryGroup('courbes', '')
-    Case_1.AddBoundaryGroup('cyl_ext', 'EXT')
-    Case_1.AddBoundaryGroup('cyl_int', 'INT')
-    Case_1.AddBoundaryGroup('sphere_1', 'END_1')
-    Case_1.AddBoundaryGroup('sphere_2', 'END_2')
+# ===========================
+      if ( iaux <= 1 ) :
+        Case_1 = homard.CreateCase('Case_1', 'MOYEU', os.path.join(Rep_Test, Test_Name + '.00.med'))
+        Case_1.SetDirName(Rep_Test_Resu)
+        Case_1.SetConfType(1)
+        Case_1.AddBoundaryGroup('courbes', '')
+        Case_1.AddBoundaryGroup('cyl_ext', 'EXT')
+        Case_1.AddBoundaryGroup('cyl_int', 'INT')
+        Case_1.AddBoundaryGroup('sphere_1', 'END_1')
+        Case_1.AddBoundaryGroup('sphere_2', 'END_2')
 #
 # Creation and destruction of the iterations
 # ==========================================
-#
-    for iaux in range (n_boucle+1) :
 #
   # Creation of the iteration Iter_1
       Iter_1 = Case_1.NextIteration('Iter_1')
@@ -137,7 +137,13 @@ Copyright EDF-R&D 2010, 2013
         break
 
   # Destruction
-      if ( iaux < n_boucle ) :
+  # After the first loop, the case is deleted, except the final mesh files
+      if ( iaux == 0 ) :
+        error = Case_1.Delete(0)
+        if error :
+          break
+  # After the second loop, the iterations are deleted, with the final mesh files
+      elif ( iaux == 1 ) :
   # Recursive destruction of the iterations
         error = Iter_1.Delete(1)
         if error :
@@ -175,7 +181,7 @@ except Exception, e:
 # Test of the result
 #
 test_file_suff = "apad.%02d.bilan" % n_iter_test_file
-rep_test_file = "I%02d" % (n_iter_test_file*(n_boucle+1))
+rep_test_file = "I%02d" % (n_iter_test_file*n_boucle)
 #
 test_file = os.path.join(Rep_Test, Test_Name + "." + test_file_suff)
 mess_error_ref = "\nReference file: " + test_file