From ca2d4da525577ff4b003a7b873c72e929f8b08d2 Mon Sep 17 00:00:00 2001 From: Gerald Nicolas Date: Thu, 20 Mar 2014 11:44:44 +0100 Subject: [PATCH] =?utf8?q?Suppression=20de=20la=20fonction=20SetAdapRefinU?= =?utf8?q?nRef=20et=20cr=C3=A9ation=20de=20la=20fonction=20SetUnifRefinUnR?= =?utf8?q?ef.=20Automatisation=20du=20d=C3=A9codage=20du=20type=20de=20raf?= =?utf8?q?finement/d=C3=A9raffinement?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/en/divers.rst | 8 ++-- doc/en/tui_create_hypothese.rst | 61 +++++++++++++++------------ doc/en/tutorials.rst | 8 ++-- doc/files/tutorial_1.py | 2 +- doc/files/tutorial_2.py | 4 +- doc/files/tutorial_3.py | 3 -- doc/files/tutorial_4.py | 4 +- doc/files/tutorial_5.py | 2 - doc/fr/divers.rst | 7 +-- doc/fr/tui_create_hypothese.rst | 58 +++++++++++++------------ doc/fr/tutorials.rst | 8 ++-- idl/HOMARD_Hypothesis.idl | 3 +- src/HOMARD/HOMARD_Hypothesis.cxx | 8 +++- src/HOMARDGUI/MonCreateHypothesis.cxx | 8 +++- src/HOMARD_I/HOMARD_Hypothesis_i.cxx | 40 ++++++++++++++++-- src/HOMARD_I/HOMARD_Hypothesis_i.hxx | 2 +- tests/test_1.py | 2 - tests/test_2.py | 4 +- tests/test_3.py | 4 +- 19 files changed, 143 insertions(+), 93 deletions(-) mode change 100644 => 100755 doc/files/tutorial_1.py mode change 100644 => 100755 doc/files/tutorial_2.py mode change 100644 => 100755 tests/test_1.py mode change 100644 => 100755 tests/test_2.py diff --git a/doc/en/divers.rst b/doc/en/divers.rst index 02656374..978bd7e3 100644 --- a/doc/en/divers.rst +++ b/doc/en/divers.rst @@ -58,6 +58,8 @@ SALOME VERSION 7.3: - If error occurs into the python instructions, the program stops. SALOME VERSION 7.4 : - - Scroll bar for the large windows - - The meshes are published only if requested - - The torus is a new possibility for the analytical boundary + - Scroll bar for the large windows. + - The meshes are published only if requested. + - The torus is a new possibility for the analytical boundary. + - The function ``SetAdapRefinUnRef(TypeAdap, TypeRaff, TypeDera)`` is suppressed. For an adaptation by a field or by zones, the mode refinement/unrefinement is automatically set from the other parameters of the hypothesis. For a uniform refinement, the function ``SetUnifRefinUnRef(TypeRaffDera)`` is now used (see :ref:`tui_create_hypothese`). + diff --git a/doc/en/tui_create_hypothese.rst b/doc/en/tui_create_hypothese.rst index 957eadf7..c4f73933 100644 --- a/doc/en/tui_create_hypothese.rst +++ b/doc/en/tui_create_hypothese.rst @@ -50,44 +50,30 @@ General methods | **GetName()** | | Returns the name of the hypothesis | +---------------------------------------------------------------+ -| .. module:: SetAdapRefinUnRef | -| | -| **SetAdapRefinUnRef(Adap, Refin, UnRef)** | -| Gives the type of adaptation to the hypothesis | +| .. module:: GetAdapType | | | -| - ``Adap``: integer that defines the type of adaptation | +| **GetAdapType()** | +| Returns the type of the adaptation | | | | * -1: uniform | | * 0: by zones | | * 1: by a field | -| | -| - ``Refin``: integer that informs if the refinement is | -| active or not | -| | -| * 0: unactive | -| * 1: active | -| | -| - ``UnRef``: integer that informs if the refinement is | -| active or not | -| | -| * 0: unactive | -| * 1: active | -| | -+---------------------------------------------------------------+ -| .. module:: GetAdapType | -| | -| **GetAdapType()** | -| Returns the type of the adaptation | +---------------------------------------------------------------+ | .. module:: GetRefinType | | | | **GetRefinType()** | | Returns the type of the refinement | +| | +| * 0: unactive | +| * 1: active | +---------------------------------------------------------------+ | .. module:: GetUnRefType | | | | **GetUnRefType()** | | Returns the type of the unrefinement | +| | +| * 0: unactive | +| * 1: active | +---------------------------------------------------------------+ | .. module:: Delete | | | @@ -99,8 +85,28 @@ General methods | * other value: problem | +---------------------------------------------------------------+ +Uniform adaptation +================== + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: SetUnifRefinUnRef | +| | +| **SetUnifRefinUnRef(RefinUnRef)** | +| Defines a type of adaptation for the whole mesh | +| | +| - ``RefinUnRef``: integer that defines the | +| type of adaptation | +| | +| * 1: refinement | +| * -1: unrefinement | ++---------------------------------------------------------------+ + +Adaptation by a field +===================== + The driving field and the thresholds -==================================== +------------------------------------ +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -172,7 +178,7 @@ The driving field and the thresholds The components of the driving field -=================================== +----------------------------------- +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -217,8 +223,8 @@ The components of the driving field +---------------------------------------------------------------+ -The zones -========= +Adaptation by zones +=================== +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -429,7 +435,6 @@ The creation of the object hypo_1 is done as follows: :: hypo_1 = homard.CreateHypothesis("HypoField") - hypo_1.SetAdapRefinUnRef(1, 1, 0) hypo_1.SetField("INDICATEUR") hypo_1.AddComp("INDX") hypo_1.AddComp("INDZ") diff --git a/doc/en/tutorials.rst b/doc/en/tutorials.rst index 4de3b77a..95dea101 100644 --- a/doc/en/tutorials.rst +++ b/doc/en/tutorials.rst @@ -50,10 +50,10 @@ Refinement by zones ******************* .. index:: single: zone -One proceeds here to refinement according to zones. To pass from the initial mesh to the mesh 'M_1', one uses a box framing the z=1 plane and a sphere centered on the origin with radius 1.05. Then to pass from the mesh 'M_1' to the mesh 'M_2', one replaces the sphere by a box framing the cube on side 0.5, pointing on the origin. It will be noted that the type of refinement was not specified; by default, it will be thus in conformity. +One proceeds here to refinement according to zones. To pass from the initial mesh to the mesh 'M_1', one uses a box framing the z=1 plane and a sphere centered on the origin with radius 1.05. Then to pass from the mesh 'M_1' to the mesh 'M_2', one replaces the sphere by a box framing the cube on side 0.5, pointing on the origin and the meshes in the very first zone are unrefined. .. literalinclude:: ../files/tutorial_2.py - :lines: 57-101 + :lines: 57-99 .. note:: Download the files @@ -70,7 +70,7 @@ One proceeds here to refinement according to a field. The hypotheses are used to To adapt the H_1 mesh resulting from the Iter_1 iteration, two alternatives are applied. In the first, Iter_2, the field is a scalar field of indicators of error and one cuts out the 1.5% of elements where the error is largest. In the second alternative, Iter_2_bis, one is based on a vector field and one examines the jump of this vector between an element and its neighbors: one will cut out where the infinite standard of this jump is higher than the absolute threshold of 0.0001. .. literalinclude:: ../files/tutorial_3.py - :lines: 57-131 + :lines: 57-128 .. note:: Download the files @@ -108,7 +108,7 @@ The instructions to adapt a 2D mesh are exactly identical to those necessary to In the case presented here, one for the first time refines all the elements contained in a bored disk, then in one second iteration, all the elements contained in a rectangle. One will note the use of the follow-up of the circular borders of the field. .. literalinclude:: ../files/tutorial_5.py - :lines: 57-101 + :lines: 57-99 .. note:: Download the files diff --git a/doc/files/tutorial_1.py b/doc/files/tutorial_1.py old mode 100644 new mode 100755 index b88dacb3..c67c1961 --- a/doc/files/tutorial_1.py +++ b/doc/files/tutorial_1.py @@ -57,7 +57,7 @@ homard.SetCurrentStudy(salome.myStudy) # Hypotheses # ========== Hypo_1 = homard.CreateHypothesis('Hypo_1') -Hypo_1.SetAdapRefinUnRef(-1, 1, 0) +Hypo_1.SetUnifRefinUnRef(1) # # Cas # === diff --git a/doc/files/tutorial_2.py b/doc/files/tutorial_2.py old mode 100644 new mode 100755 index a20e0ea6..bdcafbf7 --- a/doc/files/tutorial_2.py +++ b/doc/files/tutorial_2.py @@ -68,15 +68,13 @@ Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51) # Hypothese "Hypo_2" # ================== Hypo_2 = homard.CreateHypothesis('Hypo_2') -Hypo_2.SetAdapRefinUnRef(0, 1, 0) Hypo_2.AddZone('Zone_1', 1) Hypo_2.AddZone('Zone_0', 1) # # Hypothese "Hypo_2_bis" # ====================== Hypo_2_bis = homard.CreateHypothesis('Hypo_2_bis') -Hypo_2_bis.SetAdapRefinUnRef(0, 1, 0) -Hypo_2_bis.AddZone('Zone_0', 1) +Hypo_2_bis.AddZone('Zone_0', -1) Hypo_2_bis.AddZone('Zone_2', 1) # # Cas diff --git a/doc/files/tutorial_3.py b/doc/files/tutorial_3.py index d56d4ffb..922f65d0 100644 --- a/doc/files/tutorial_3.py +++ b/doc/files/tutorial_3.py @@ -57,7 +57,6 @@ homard.SetCurrentStudy(salome.myStudy) # Hypothese "Hypo_0vers1" # ======================= Hypo_0vers1 = homard.CreateHypothesis('Hypo_0vers1') -Hypo_0vers1.SetAdapRefinUnRef(1, 1, 0) # Characterization of the field Hypo_0vers1.SetField('SOLU_0__QIRE_ELEM_SIGM__________') Hypo_0vers1.SetUseComp(0) @@ -70,7 +69,6 @@ Hypo_0vers1.AddFieldInterp('SOLU_0__ERRE_ELEM_SIGM__________') # Hypothese "Hypo_1vers2" # ======================= Hypo_1vers2 = homard.CreateHypothesis('Hypo_1vers2') -Hypo_1vers2.SetAdapRefinUnRef(1, 1, 1) # Characterization of the field Hypo_1vers2.SetField('SOLU_1__QIRE_ELEM_SIGM__________') Hypo_1vers2.SetUseComp(0) @@ -84,7 +82,6 @@ Hypo_1vers2.AddFieldInterp('SOLU_1__QIRE_ELEM_SIGM__________') # Hypothese "Hypo_1vers2_bis" # =========================== Hypo_1vers2_bis = homard.CreateHypothesis('Hypo_1vers2_bis') -Hypo_1vers2_bis.SetAdapRefinUnRef(1, 1, 1) # Characterization of the field Hypo_1vers2_bis.SetField('SOLU_1__DEPL____________________') Hypo_1vers2_bis.SetUseComp(1) diff --git a/doc/files/tutorial_4.py b/doc/files/tutorial_4.py index 9da5d464..0ff9e741 100644 --- a/doc/files/tutorial_4.py +++ b/doc/files/tutorial_4.py @@ -70,13 +70,13 @@ Boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., # ========== # Creation of the hypothesis Hypo_4 Hypo_4 = homard.CreateHypothesis('Hypo_4') -Hypo_4.SetAdapRefinUnRef(-1, 1, 0) +Hypo_4.SetUnifRefinUnRef(1) Hypo_4.AddGroup('T1_INT_I') Hypo_4.AddGroup('T1_INT_O') Hypo_4.AddGroup('T2_INT') # Creation of the hypothesis Hypo_4_bis Hypo_4_bis = homard.CreateHypothesis('Hypo_4_bis') -Hypo_4_bis.SetAdapRefinUnRef(-1, 1, 0) +Hypo_4_bis.SetUnifRefinUnRef(1) Hypo_4_bis.AddGroup('T1_EXT_I') Hypo_4_bis.AddGroup('T1_EXT_O') Hypo_4_bis.AddGroup('T2_EXT') diff --git a/doc/files/tutorial_5.py b/doc/files/tutorial_5.py index aee1e608..494eec29 100644 --- a/doc/files/tutorial_5.py +++ b/doc/files/tutorial_5.py @@ -70,11 +70,9 @@ quart_sup = homard.CreateZoneBox2D( 'quart_sup', 0., 250., 0., 250., 1 ) # ========== # Creation of the hypothesis Hypo_5 Hypo_5 = homard.CreateHypothesis('Hypo_5') -Hypo_5.SetAdapRefinUnRef(0, 1, 0) Hypo_5.AddZone('enveloppe', 1) # Creation of the hypothesis Hypo_5_bis Hypo_5_bis = homard.CreateHypothesis('Hypo_5_bis') -Hypo_5_bis.SetAdapRefinUnRef(0, 1, 0) Hypo_5_bis.AddZone('quart_sup', 1) # # Cas diff --git a/doc/fr/divers.rst b/doc/fr/divers.rst index 55874d24..7f07ae9f 100644 --- a/doc/fr/divers.rst +++ b/doc/fr/divers.rst @@ -58,8 +58,9 @@ SALOME VERSION 7.3 : - Arrêt en cas d'erreur dans les données des instructions python SALOME VERSION 7.4 : - - Grandes fenêtres avec ascenseur - - Publication des maillages à la demande - - Suivi de frontière analytique torique + - Grandes fenêtres avec ascenseur. + - Publication des maillages à la demande. + - Suivi de frontière analytique torique. + - La fonction ``SetAdapRefinUnRef(TypeAdap, TypeRaff, TypeDera)`` est supprimée. Pour une adaptation selon un champ ou des zones, le mode raffinement/déraffinement est automatiquement déduit des autres paramètres de l'hypothèse. Pour un raffinement uniforme, on utilisera ``SetUnifRefinUnRef(TypeRaffDera)`` (voir :ref:`tui_create_hypothese`). diff --git a/doc/fr/tui_create_hypothese.rst b/doc/fr/tui_create_hypothese.rst index 2b5d0303..bfa4cf93 100644 --- a/doc/fr/tui_create_hypothese.rst +++ b/doc/fr/tui_create_hypothese.rst @@ -56,42 +56,30 @@ G | **GetName()** | | Retourne le nom de l'hypothèse | +---------------------------------------------------------------+ -| .. module:: SetAdapRefinUnRef | -| | -| **SetAdapRefinUnRef(Adap, Refin, UnRef)** | -| Affecte le mode d'adaptation associé à l'hypothèse | +| .. module:: GetAdapType | | | -| - ``Adap`` : entier précisant le type d'adaptation | +| **GetAdapType()** | +| Retourne le type d'adaptation | | | | * -1 : uniforme | | * 0 : selon des zones | | * 1 : selon un champ | -| | -| - ``Refin`` : entier précisant si le raffinement est actif| -| | -| * 0 : inactif | -| * 1 : actif | -| | -| - ``UnRef`` : entier précisant si déraffinement est actif | -| | -| * 0 : inactif | -| * 1 : actif | -| | -+---------------------------------------------------------------+ -| .. module:: GetAdapType | -| | -| **GetAdapType()** | -| Retourne le type d'adaptation | +---------------------------------------------------------------+ | .. module:: GetRefinType | | | | **GetRefinType()** | | Retourne le type de raffinement | +| | +| * 0 : inactif | +| * 1 : actif | +---------------------------------------------------------------+ | .. module:: GetUnRefType | | | | **GetUnRefType()** | | Retourne le type de déraffinement | +| | +| * 0 : inactif | +| * 1 : actif | +---------------------------------------------------------------+ | .. module:: Delete | | | @@ -103,8 +91,27 @@ G | * autre valeur : problème | +---------------------------------------------------------------+ +Adaptation uniforme +=================== + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: SetUnifRefinUnRef | +| | +| **SetUnifRefinUnRef(RefinUnRef)** | +| Définit un mode d'adaptation uniforme à tout le maillage | +| | +| - ``RefinUnRef`` : entier précisant le type d'adaptation | +| | +| * 1 : raffinement | +| * -1 : déraffinement | ++---------------------------------------------------------------+ + +Adaptation selon un champ +========================= + Le champ de pilotage de l'adaptation et les seuils -================================================== +-------------------------------------------------- +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -174,7 +181,7 @@ Le champ de pilotage de l'adaptation et les seuils Les composantes du champ de pilotage -==================================== +------------------------------------ +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -219,8 +226,8 @@ Les composantes du champ de pilotage +---------------------------------------------------------------+ -Les zones -========= +Adaptation selon des zones +========================== +---------------------------------------------------------------+ +---------------------------------------------------------------+ @@ -430,7 +437,6 @@ Exemple La création de l'objet hypo_1 se fait ainsi : :: hypo_1 = homard.CreateHypothesis("HypoField") - hypo_1.SetAdapRefinUnRef(1, 1, 0) hypo_1.SetField("INDICATEUR") hypo_1.AddComp("INDX") hypo_1.AddComp("INDZ") diff --git a/doc/fr/tutorials.rst b/doc/fr/tutorials.rst index 1f040f81..46ae9688 100644 --- a/doc/fr/tutorials.rst +++ b/doc/fr/tutorials.rst @@ -49,10 +49,10 @@ Raffinement par des zones ************************* .. index:: single: zone -On procède ici au raffinement selon des zones. Pour passer du maillage initial au maillage 'M_1', on utilise une boîte encadrant le plan z=1 et une sphère centrée sur l'origine de rayon 1.05. Puis pour passer du maillage 'M_1' au maillage 'M_2', on remplace la sphère par une boîte encadrant le cube de côté 0.5, pointant sur l'origine. On notera que le type de raffinement n'a pas été précisé ; par défaut, il sera donc conforme. +On procède ici au raffinement selon des zones. Pour passer du maillage initial au maillage 'M_1', on utilise une boîte encadrant le plan z=1 et une sphère centrée sur l'origine de rayon 1.05. Puis pour passer du maillage 'M_1' au maillage 'M_2', on remplace la sphère par une boîte encadrant le cube de côté 0.5, pointant sur l'origine et on déraffine les mailles contenues dans la toute première zone. .. literalinclude:: ../files/tutorial_2.py - :lines: 57-101 + :lines: 57-99 .. note:: Téléchargement des fichiers @@ -69,7 +69,7 @@ On proc Pour adapter le maillage H_1 issu de l'itération Iter_1, deux variantes sont appliquées. Dans la première, Iter_2, le champ est un champ scalaire d'indicateurs d'erreur et on découpe les 1.5% de mailles où l'erreur est la plus grande. Dans la seconde variante, Iter_2_bis, on se base sur un champ vectoriel et on examine le saut de ce vecteur entre une maille et ses voisines : on découpera là où la norme infinie de ce saut est supérieure au seuil absolu de 0.0001. .. literalinclude:: ../files/tutorial_3.py - :lines: 57-131 + :lines: 57-128 .. note:: Téléchargement des fichiers @@ -107,7 +107,7 @@ Les instructions pour adapter un maillage 2D sont exactement identiques Dans le cas présenté ici, on raffine une première fois toutes les mailles contenues dans un disque percé, puis dans une seconde itération, toutes les mailles contenues dans un rectangle. On notera l'utilisation du suivi des frontières circulaires du domaine. .. literalinclude:: ../files/tutorial_5.py - :lines: 57-101 + :lines: 57-99 .. note:: Téléchargement des fichiers diff --git a/idl/HOMARD_Hypothesis.idl b/idl/HOMARD_Hypothesis.idl index a9ec768d..daaf0ff2 100644 --- a/idl/HOMARD_Hypothesis.idl +++ b/idl/HOMARD_Hypothesis.idl @@ -66,8 +66,7 @@ module HOMARD string GetDumpPython() raises (SALOME::SALOME_Exception); // Caracteristiques - void SetAdapRefinUnRef(in long Adap, in long Raff, in long Dera) - raises (SALOME::SALOME_Exception); + void SetUnifRefinUnRef(in long RaffDera) raises (SALOME::SALOME_Exception); listeTypes GetAdapRefinUnRef() raises (SALOME::SALOME_Exception); long GetAdapType() raises (SALOME::SALOME_Exception); long GetRefinType() raises (SALOME::SALOME_Exception); diff --git a/src/HOMARD/HOMARD_Hypothesis.cxx b/src/HOMARD/HOMARD_Hypothesis.cxx index c7f6236a..8c0652d8 100644 --- a/src/HOMARD/HOMARD_Hypothesis.cxx +++ b/src/HOMARD/HOMARD_Hypothesis.cxx @@ -79,7 +79,13 @@ std::string HOMARD_Hypothesis::GetDumpPython() const std::ostringstream aScript; aScript << "\n# Creation of the hypothesis " << _Name << "\n" ; aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n"; - aScript << "\t" << _Name << ".SetAdapRefinUnRef(" << _TypeAdap << ", " << _TypeRaff << ", " << _TypeDera << ")\n"; + if ( _TypeAdap == -1 ) + { + int TypeRaffDera ; + if ( _TypeRaff == 1 ) { TypeRaffDera = 1 ; } + else { TypeRaffDera = -1 ; } + aScript << "\t" << _Name << ".SetUnifRefinUnRef(" << TypeRaffDera << ")\n"; + } // Raffinement selon des zones geometriques std::list::const_iterator it = _ListZone.begin(); diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index d0ec9295..8b63d9ab 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -165,7 +165,13 @@ bool MonCreateHypothesis::PushOnApply() } // Mise en place des attributs - aHypothesis->SetAdapRefinUnRef(_aTypeAdap,_aTypeRaff,_aTypeDera); + if ( _aTypeAdap == -1 ) + { + int TypeRaffDera ; + if ( _aTypeRaff == 1 ) { TypeRaffDera = 1 ; } + else { TypeRaffDera = -1 ; } + aHypothesis->SetUnifRefinUnRef(TypeRaffDera); + } aHypothesis->SetTypeFieldInterp(_TypeFieldInterp); aHypothesis->SetCaseCreation(_aCaseName.toStdString().c_str()); diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx index fe8123f6..f2dd9181 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.cxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.cxx @@ -113,10 +113,21 @@ bool HOMARD_Hypothesis_i::Restore( const std::string& stream ) // Caracteristiques //============================================================================= //============================================================================= -void HOMARD_Hypothesis_i::SetAdapRefinUnRef( CORBA::Long TypeAdap,CORBA::Long TypeRaff, CORBA::Long TypeDera ) +void HOMARD_Hypothesis_i::SetUnifRefinUnRef( CORBA::Long TypeRaffDera ) { ASSERT( myHomardHypothesis ); - myHomardHypothesis->SetAdapType( TypeAdap ); + int TypeRaff, TypeDera ; + if ( TypeRaffDera == 1 ) + { + TypeRaff = 1 ; + TypeDera = 0 ; + } + else + { + TypeRaff = 0 ; + TypeDera = 1 ; + } + myHomardHypothesis->SetAdapType( -1 ); myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); } //============================================================================= @@ -219,6 +230,9 @@ HOMARD::listeComposantsHypo* HOMARD_Hypothesis_i::GetComps() //============================================================================= void HOMARD_Hypothesis_i::SetRefinThr( CORBA::Long TypeThR, CORBA::Double ThreshR ) { + myHomardHypothesis->SetAdapType( 1 ); + int TypeDera = myHomardHypothesis->GetUnRefType() ; + myHomardHypothesis->SetRefinTypeDera( 1, TypeDera ); myHomardHypothesis->SetRefinThr( TypeThR, ThreshR ); } //============================================================================= @@ -230,6 +244,9 @@ CORBA::Long HOMARD_Hypothesis_i::GetRefinThrType() //============================================================================= void HOMARD_Hypothesis_i::SetUnRefThr( CORBA::Long TypeThC, CORBA::Double ThreshC ) { + myHomardHypothesis->SetAdapType( 1 ); + int TypeRaff = myHomardHypothesis->GetRefinType() ; + myHomardHypothesis->SetRefinTypeDera( TypeRaff, 1 ); myHomardHypothesis->SetUnRefThr( TypeThC, ThreshC ); } //============================================================================= @@ -415,8 +432,25 @@ HOMARD::listeIters* HOMARD_Hypothesis_i::GetIterations() //============================================================================= void HOMARD_Hypothesis_i::AddZone( const char* NomZone, CORBA::Long TypeUse ) { - MESSAGE ("Dans AddZone pour " << NomZone) ; + MESSAGE ("Dans AddZone pour " << NomZone << " et TypeUse = " << TypeUse ) ; ASSERT( myHomardHypothesis ); + myHomardHypothesis->SetAdapType( 0 ); + int TypeRaff, TypeDera ; + if ( TypeUse == 1 ) + { + TypeRaff = 1 ; + TypeDera = myHomardHypothesis->GetUnRefType() ; + } + else if ( TypeUse == -1 ) + { + TypeRaff = myHomardHypothesis->GetRefinType() ; + TypeDera = 1 ; + } + else + { + ASSERT( "TypeUse should be 1 or -1" == 0 ); + } + myHomardHypothesis->SetRefinTypeDera( TypeRaff, TypeDera ); char* NomHypo = GetName() ; return _gen_i->AssociateHypoZone(NomHypo, NomZone, TypeUse) ; } diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx index 34c7d846..d39a8912 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx @@ -66,7 +66,7 @@ public: bool Restore( const std::string& stream ); // Caracteristiques - void SetAdapRefinUnRef( CORBA::Long TypeAdap, CORBA::Long TypeRaff, CORBA::Long TypeDera ); + void SetUnifRefinUnRef( CORBA::Long TypeRaffDera ); HOMARD::listeTypes* GetAdapRefinUnRef(); CORBA::Long GetAdapType(); CORBA::Long GetRefinType(); diff --git a/tests/test_1.py b/tests/test_1.py old mode 100644 new mode 100755 index 067e3916..5b160bc6 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -75,7 +75,6 @@ Copyright EDF-R&D 2010, 2013 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') @@ -92,7 +91,6 @@ Copyright EDF-R&D 2010, 2013 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() diff --git a/tests/test_2.py b/tests/test_2.py old mode 100644 new mode 100755 index dfe9b1be..f4f5c248 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -72,7 +72,7 @@ Copyright EDF-R&D 2010, 2013 HypoName_1 = "Hypo_" + Test_Name + "_1" print "-------- Creation of the hypothesis", HypoName_1 Hypo_test_2_1 = homard.CreateHypothesis(HypoName_1) - Hypo_test_2_1.SetAdapRefinUnRef(-1, 1, 0) + Hypo_test_2_1.SetUnifRefinUnRef(1) Hypo_test_2_1.AddGroup('EG') Hypo_test_2_1.AddGroup('BANDE') print HypoName_1, " : zones utilisées :", Hypo_test_2_1.GetZones() @@ -85,7 +85,7 @@ Copyright EDF-R&D 2010, 2013 HypoName_2 = "Hypo_" + Test_Name + "_2" print "-------- Creation of the hypothesis", HypoName_2 Hypo_test_2_2 = homard.CreateHypothesis(HypoName_2) - Hypo_test_2_2.SetAdapRefinUnRef(-1, 1, 0) + Hypo_test_2_2.SetUnifRefinUnRef(1) Hypo_test_2_2.AddGroup('M_D') print HypoName_2, " : zones utilisées :", Hypo_test_2_2.GetZones() print HypoName_2, " : champ utilisé :", Hypo_test_2_2.GetFieldName() diff --git a/tests/test_3.py b/tests/test_3.py index 704ff448..3f55458e 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -85,7 +85,7 @@ Copyright EDF-R&D 2010, 2013 HypoName = "Hypo_" + Test_Name print "-------- Creation of the hypothesis", HypoName Hypo_test_3 = homard.CreateHypothesis(HypoName) - Hypo_test_3.SetAdapRefinUnRef(-1, 1, 0) + Hypo_test_3.SetUnifRefinUnRef(1) print HypoName, " : zones utilisées :", Hypo_test_3.GetZones() print HypoName, " : champ utilisé :", Hypo_test_3.GetFieldName() print HypoName, " : composantes utilisées :", Hypo_test_3.GetComps() @@ -183,7 +183,7 @@ Copyright EDF-R&D 2010, 2013 HypoName = "Hypo_test_3" print "-------- Creation of the hypothesis", HypoName Hypo_test_3 = homard.CreateHypothesis(HypoName) - Hypo_test_3.SetAdapRefinUnRef(-1, 1, 0) + Hypo_test_3.SetUnifRefinUnRef(1) # break # -- 2.30.2