From 376361b76f3823b13f8f8d39f23326fc3bad2ff7 Mon Sep 17 00:00:00 2001 From: rnc Date: Fri, 11 Jan 2013 09:38:28 +0000 Subject: [PATCH] =?utf8?q?integration=20of=20modifications=20from=20G?= =?utf8?q?=C3=83=C2=A9rald=20Nicolas?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- doc/Makefile.am | 8 + doc/files/tutorial_1.py | 23 +-- doc/files/tutorial_2.py | 27 +-- doc/files/tutorial_3.py | 29 ++-- doc/files/tutorial_4.py | 21 ++- doc/files/tutorial_5.py | 24 +-- doc/tui_create_boundary.rst | 237 +++++++++++--------------- doc/tui_create_case.rst | 14 +- doc/tui_create_hypothese.rst | 33 ++-- doc/tui_create_iteration.rst | 75 ++++---- doc/tui_create_zone.rst | 8 +- doc/tutorials.rst | 87 +++++----- idl/Gen.xml | 126 ++------------ idl/HOMARD_Boundary.idl | 6 +- idl/HOMARD_Cas.idl | 8 +- idl/HOMARD_Gen.idl | 37 ++-- idl/HOMARD_Iteration.idl | 9 +- idl/HOMARD_Zone.idl | 6 +- resources/HOMARDCatalog.xml.in | 105 +----------- src/HOMARD/HOMARD_Boundary.cxx | 36 ++-- src/HOMARD/HOMARD_Boundary.hxx | 10 +- src/HOMARD/HOMARD_Cas.cxx | 18 +- src/HOMARD/HOMARD_Cas.hxx | 4 +- src/HOMARD/HOMARD_DriverTools.cxx | 52 +++--- src/HOMARD/HOMARD_Hypothesis.cxx | 42 ++--- src/HOMARD/HOMARD_Hypothesis.hxx | 4 +- src/HOMARD/HOMARD_Iteration.cxx | 40 +++-- src/HOMARD/HOMARD_Iteration.hxx | 8 +- src/HOMARD/HOMARD_Zone.cxx | 70 ++++---- src/HOMARD/HOMARD_Zone.hxx | 10 +- src/HOMARDGUI/MonCreateBoundaryAn.cxx | 30 ++-- src/HOMARDGUI/MonCreateBoundaryAn.h | 4 +- src/HOMARDGUI/MonCreateBoundaryDi.cxx | 2 +- src/HOMARDGUI/MonCreateCase.cxx | 8 +- src/HOMARDGUI/MonCreateHypothesis.cxx | 6 +- src/HOMARDGUI/MonCreateIteration.cxx | 7 +- src/HOMARDGUI/MonCreateListGroup.cxx | 2 +- src/HOMARDGUI/MonCreateZone.cxx | 46 ++--- src/HOMARDGUI/MonCreateZone.h | 2 +- src/HOMARDGUI/MonEditBoundaryAn.cxx | 24 +-- src/HOMARDGUI/MonEditBoundaryDi.cxx | 2 +- src/HOMARDGUI/MonEditCase.cxx | 4 +- src/HOMARDGUI/MonEditIteration.cxx | 2 +- src/HOMARDGUI/MonEditZone.cxx | 36 ++-- src/HOMARD_I/HOMARD_Boundary_i.cxx | 12 +- src/HOMARD_I/HOMARD_Boundary_i.hxx | 6 +- src/HOMARD_I/HOMARD_Cas_i.cxx | 34 +++- src/HOMARD_I/HOMARD_Cas_i.hxx | 8 +- src/HOMARD_I/HOMARD_Gen_i.cxx | 148 ++++++---------- src/HOMARD_I/HOMARD_Gen_i.hxx | 18 +- src/HOMARD_I/HOMARD_Hypothesis_i.cxx | 4 +- src/HOMARD_I/HOMARD_Hypothesis_i.hxx | 2 +- src/HOMARD_I/HOMARD_Iteration_i.cxx | 70 ++++++-- src/HOMARD_I/HOMARD_Iteration_i.hxx | 16 +- src/HOMARD_I/HOMARD_Zone_i.cxx | 12 +- src/HOMARD_I/HOMARD_Zone_i.hxx | 6 +- tests/test_1.py | 53 ++++-- tests/test_2.py | 49 ++++-- tests/test_3.py | 45 +++-- 59 files changed, 882 insertions(+), 953 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 9c9af87b..5c5c24e9 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -28,6 +28,7 @@ if SPHINX_IS_OK homarddoc_DATA=html/index.html html/index.html:$(RSTFILES) make htm + make latex endif @@ -45,6 +46,13 @@ htm: @echo @echo "Build finished. The HTML pages are in html." +latex: + mkdir -p latex doctrees + $(SPHINXBUILD) -c $(top_builddir)/doc -b latex $(ALLSPHINXOPTS) latex + @echo + @echo "Build finished. The pages are in latex." + @echo "Go into latex and apply twice : pdflatex HOMARD.tex to produce HOMARD.pdf" + RSTFILES= \ glossaire.rst \ gui_create_boundary.rst \ diff --git a/doc/files/tutorial_1.py b/doc/files/tutorial_1.py index eaebabc2..dd941e76 100644 --- a/doc/files/tutorial_1.py +++ b/doc/files/tutorial_1.py @@ -22,16 +22,19 @@ """ Exemple de couplage HOMARD-Salome -Copyright EDF-R&D 1996, 2010 +Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.2" +__revision__ = "V1.3" # # ================================== # Repertoire a personnaliser -# Ce repertoire contient les fichiers de donnees : tutorial_1.00.med # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med, maill.03.med dircase = "/tmp" # ================================== +import os +# Ce repertoire contient les fichiers de donnees : tutorial_1.00.med +pathHomard = os.getenv('HOMARD_ROOT_DIR') +data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") # import salome salome.salome_init() @@ -48,31 +51,31 @@ Hypo_0.SetAdapRefinUnRef(-1, 1, 0) # # Case "Case_1" # ============= -Case_1 = homard.CreateCase('Case_1', 'MAILL', dircase+'/tutorial_1.00.med') +Case_1 = homard.CreateCase('Case_1', 'MAILL', data_dir+'/tutorial_1.00.med') Case_1.SetDirName(dircase) Case_1.SetConfType(1) # # Iterations # ========== # Iteration "Iter_0" -Iter_0 = homard.CreateIteration('Iter_0', Case_1.GetIter0Name()) +Iter_0 = Case_1.NextIteration('Iter_0') Iter_0.SetMeshName('MESH') Iter_0.SetMeshFile(dircase+'/maill.01.med') -homard.AssociateIterHypo('Iter_0', 'Hypo_0') +Iter_0.AssociateHypo('Hypo_0') codret = Iter_0.Compute(1) # Iteration "Iter_1" -Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0') +Iter_1 = Iter_0.NextIteration('Iter_1') Iter_1.SetMeshName('MESH') Iter_1.SetMeshFile(dircase+'/maill.02.med') -homard.AssociateIterHypo('Iter_1', 'Hypo_0') +Iter_1.AssociateHypo('Hypo_0') codret = Iter_1.Compute(1) # Iteration "Iter_2" -Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') +Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('MESH') Iter_2.SetMeshFile(dircase+'/maill.03.med') -homard.AssociateIterHypo('Iter_2', 'Hypo_0') +Iter_2.AssociateHypo('Hypo_0') codret = Iter_2.Compute(1) if salome.sg.hasDesktop(): diff --git a/doc/files/tutorial_2.py b/doc/files/tutorial_2.py index 6f4ec233..8560506a 100644 --- a/doc/files/tutorial_2.py +++ b/doc/files/tutorial_2.py @@ -22,16 +22,19 @@ """ Exemple de couplage HOMARD-Salome -Copyright EDF-R&D 1996, 2010 +Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.3" +__revision__ = "V1.4" # # ================================== # Repertoire a personnaliser -# Ce repertoire contient les fichiers de donnees : tutorial_2.00.med # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med dircase = "/tmp" # ================================== +import os +# Ce repertoire contient les fichiers de donnees : tutorial_2.00.med +pathHomard = os.getenv('HOMARD_ROOT_DIR') +data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") # import salome salome.salome_init() @@ -56,35 +59,35 @@ Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51) # =================== Hypo_0 = homard.CreateHypothesis('Hypo_0') Hypo_0.SetAdapRefinUnRef(0, 1, 0) -homard.AssociateHypoZone('Zone_1', 'Hypo_0') -homard.AssociateHypoZone('Zone_0', 'Hypo_0') +Hypo_0.AddZone('Zone_1', 1) +Hypo_0.AddZone('Zone_0', 1) # # Hypothesis "Hypo_1" # =================== Hypo_1 = homard.CreateHypothesis('Hypo_1') Hypo_1.SetAdapRefinUnRef(0, 1, 0) -homard.AssociateHypoZone('Zone_0', 'Hypo_1') -homard.AssociateHypoZone('Zone_2', 'Hypo_1') +Hypo_1.AddZone('Zone_0', 1) +Hypo_1.AddZone('Zone_2', 1) # # Case "Case_1" # ============= -Case_1 = homard.CreateCase('Case_1', 'MZERO', dircase+'/tutorial_2.00.med') +Case_1 = homard.CreateCase('Case_1', 'MZERO', data_dir+'/tutorial_2.00.med') Case_1.SetDirName(dircase) # # Iteration "Iter_0" # ================== -Iter_0 = homard.CreateIteration('Iter_0', Case_1.GetIter0Name()) +Iter_0 = Case_1.NextIteration('Iter_0') Iter_0.SetMeshName('M_1') Iter_0.SetMeshFile(dircase+'/maill.01.med') -homard.AssociateIterHypo('Iter_0', 'Hypo_0') +Iter_0.AssociateHypo('Hypo_0') codret = Iter_0.Compute(1) # # Iteration "Iter_1" # ================== -Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0') +Iter_1 = Iter_0.NextIteration('Iter_1') Iter_1.SetMeshName('M_2') Iter_1.SetMeshFile(dircase+'/maill.02.med') -homard.AssociateIterHypo('Iter_1', 'Hypo_1') +Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) if salome.sg.hasDesktop(): diff --git a/doc/files/tutorial_3.py b/doc/files/tutorial_3.py index c0aaeb5c..a66c2aa1 100644 --- a/doc/files/tutorial_3.py +++ b/doc/files/tutorial_3.py @@ -22,16 +22,19 @@ """ Exemple de couplage HOMARD-Salome -Copyright EDF-R&D 1996, 2010 +Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.3" +__revision__ = "V1.4" # # ================================== # Repertoire a personnaliser -# Ce repertoire contient les fichiers de donnees : tutorial_3.00.med, tutorial_3.01.med # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med dircase = "/tmp" # ================================== +import os +# Ce repertoire contient les fichiers de donnees : tutorial_3.00.med, tutorial_3.01.med +pathHomard = os.getenv('HOMARD_ROOT_DIR') +data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") # import salome salome.salome_init() @@ -84,37 +87,37 @@ Hypo_1vers2_bis.SetTypeFieldInterp(0) # # Case "Case_1" # ============= -Case_1 = homard.CreateCase('Case_1', 'G_0', dircase+'/tutorial_3.00.med') +Case_1 = homard.CreateCase('Case_1', 'G_0', data_dir+'/tutorial_3.00.med') Case_1.SetDirName(dircase) # # Iteration "Iter_1" # ================== -Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name()) +Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('H_1') Iter_1.SetMeshFile(dircase+'/maill.01.med') -Iter_1.SetFieldFile(dircase+'/tutorial_3.00.med') +Iter_1.SetFieldFile(data_dir+'/tutorial_3.00.med') Iter_1.SetTimeStepRank( 1, 1) -homard.AssociateIterHypo('Iter_1', 'Hypo_0vers1') +Iter_1.AssociateHypo('Hypo_0vers1') codret = Iter_1.Compute(1) # # Iteration "Iter_2" # ================== -Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') +Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('H_2') Iter_2.SetMeshFile(dircase+'/maill.02.med') -Iter_2.SetFieldFile(dircase+'/tutorial_3.01.med') +Iter_2.SetFieldFile(data_dir+'/tutorial_3.01.med') Iter_2.SetTimeStepRank(1, 1) -homard.AssociateIterHypo('Iter_2', 'Hypo_1vers2') +Iter_2.AssociateHypo('Hypo_1vers2') codret = Iter_2.Compute(1) # # Iteration "Iter_2_bis" # ====================== -Iter_2_bis = homard.CreateIteration('Iter_2_bis', 'Iter_1') +Iter_2_bis = Iter_1.NextIteration('Iter_2_bis') Iter_2_bis.SetMeshName('H_2_bis') Iter_2_bis.SetMeshFile(dircase+'/maill.02.bis.med') -Iter_2_bis.SetFieldFile(dircase+'/tutorial_3.01.med') +Iter_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med') Iter_2_bis.SetTimeStepRank(1, 1) -homard.AssociateIterHypo('Iter_2_bis', 'Hypo_1vers2_bis') +Iter_2_bis.AssociateHypo('Hypo_1vers2_bis') codret = Iter_2_bis.Compute(1) # if salome.sg.hasDesktop(): diff --git a/doc/files/tutorial_4.py b/doc/files/tutorial_4.py index c3aa70ff..6f8a27fd 100644 --- a/doc/files/tutorial_4.py +++ b/doc/files/tutorial_4.py @@ -22,16 +22,19 @@ """ Exemple de couplage HOMARD-Salome -Copyright EDF-R&D 1996, 2011 +Copyright EDF-R&D 1996, 2011, 2013 """ -__revision__ = "V1.3" +__revision__ = "V1.4" # # ================================== # Repertoire a personnaliser -# Ce repertoire contient les fichiers de donnees : tutorial_4.00.med, tutorial_4.fr.med # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med dircase = "/tmp" # ================================== +import os +# Ce repertoire contient les fichiers de donnees : tutorial_4.00.med, tutorial_4.fr.med +pathHomard = os.getenv('HOMARD_ROOT_DIR') +data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") # import salome salome.salome_init() @@ -43,7 +46,7 @@ homard.SetCurrentStudy(salome.myStudy) # # Creation of the boundaries # ========================== -Boundary_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', dircase+'/tutorial_4.fr.med') +Boundary_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med') # Boundary_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.) # @@ -70,7 +73,7 @@ Hypo_2.AddGroup('T2_EXT') # # Case "Case" # ============= -Case = homard.CreateCase('Case', 'PIQUAGE', dircase+'/tutorial_4.00.med') +Case = homard.CreateCase('Case', 'PIQUAGE', data_dir+'/tutorial_4.00.med') Case.SetDirName(dircase) Case.AddBoundaryGroup( 'intersection', '' ) Case.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' ) @@ -83,16 +86,16 @@ Case.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' ) # Creation of the iterations # ========================== # Creation of the iteration Iter_1 -Iter_1 = homard.CreateIteration('Iter_1', Case.GetIter0Name() ) +Iter_1 = Case.NextIteration('Iter_1') Iter_1.SetMeshName('PIQUAGE_1') Iter_1.SetMeshFile(dircase+'/maill.01.med') -homard.AssociateIterHypo('Iter_1', 'Hypo_1') +Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) # Creation of the iteration Iter_2 -Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1' ) +Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('PIQUAGE_2') Iter_2.SetMeshFile(dircase+'/maill.02.med') -homard.AssociateIterHypo('Iter_2', 'Hypo_2') +Iter_2.AssociateHypo('Hypo_2') codret = Iter_2.Compute(1) if salome.sg.hasDesktop(): diff --git a/doc/files/tutorial_5.py b/doc/files/tutorial_5.py index a876501b..48f0fcff 100644 --- a/doc/files/tutorial_5.py +++ b/doc/files/tutorial_5.py @@ -22,9 +22,9 @@ """ Exemple de couplage HOMARD-Salome -Copyright EDF-R&D 1996, 2010 +Copyright EDF-R&D 1996, 2010, 2013 """ -__revision__ = "V1.2" +__revision__ = "V1.3" # # ================================== # Repertoire a personnaliser @@ -32,6 +32,10 @@ __revision__ = "V1.2" # Ce repertoire contiendra les fichiers de resultats : maill.01.med, maill.02.med dircase = "/tmp" # ================================== +import os +# Ce repertoire contient les fichiers de donnees : tutorial_5.00.med, tutorial_5.fr.med +pathHomard = os.getenv('HOMARD_ROOT_DIR') +data_dir = os.path.join(pathHomard, "share/doc/salome/gui/HOMARD/_downloads") # import salome salome.salome_init() @@ -44,7 +48,7 @@ homard.SetCurrentStudy(salome.myStudy) # Creation of the boundaries # ========================== # Creation of the discrete boundary Boun_1 -Boun_1 = homard.CreateBoundaryDi('Boun_1', 'MAIL_EXT', dircase+'/tutorial_5.fr.med') +Boun_1 = homard.CreateBoundaryDi('Boun_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med') # # Creation of the zones # ===================== @@ -58,33 +62,33 @@ quart_sup = homard.CreateZoneBox2D( 'quart_sup', 0., 250., 0., 250., 1 ) # Creation of the hypothesis Hypo_1 Hypo_1 = homard.CreateHypothesis('Hypo_1') Hypo_1.SetAdapRefinUnRef(0, 1, 0) -homard.AssociateHypoZone('enveloppe', 'Hypo_1') +Hypo_1.AddZone('enveloppe', 1) # Creation of the hypothesis Hypo_2 Hypo_2 = homard.CreateHypothesis('Hypo_2') Hypo_2.SetAdapRefinUnRef(0, 1, 0) -homard.AssociateHypoZone('quart_sup', 'Hypo_2') +Hypo_2.AddZone('quart_sup', 1) # # Case "Case_1" # ============= -Case_1 = homard.CreateCase('Case_1', 'COEUR_2D', dircase+'/tutorial_5.00.med') +Case_1 = homard.CreateCase('Case_1', 'COEUR_2D', data_dir+'/tutorial_5.00.med') Case_1.SetDirName(dircase) Case_1.SetConfType(3) Case_1.AddBoundaryGroup('Boun_1', '') # # Iteration "Iter_1" # ================== -Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name()) +Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('COEUR_2D_01') Iter_1.SetMeshFile(dircase+'/maill.01.med') -homard.AssociateIterHypo('Iter_1', 'Hypo_1') +Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) # # Iteration "Iter_2" # ================== -Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') +Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('COEUR_2D_02') Iter_2.SetMeshFile(dircase+'/maill.02.med') -homard.AssociateIterHypo('Iter_2', 'Hypo_2') +Iter_2.AssociateHypo('Hypo_2') codret = Iter_2.Compute(1) diff --git a/doc/tui_create_boundary.rst b/doc/tui_create_boundary.rst index 73bf0cdd..092bd711 100644 --- a/doc/tui_create_boundary.rst +++ b/doc/tui_create_boundary.rst @@ -1,138 +1,105 @@ .. _tui_create_boundary: -L'hypothèse -=========== -.. index:: single: hypothèse - -L'hypothèse contient toutes les paramètres de pilotage d'une adaptation d'un maillage. Cette opération permet de réaliser l'itération à laquelle elle est attachée. - -Il existe trois classes d'hypothèses : - - - Uniforme sur tout le maillage, - - Selon un champ, - - En fonction de zone géométrique. - -.. image:: images/create_hypothese_1.png - :align: center - - -Nom de l'hypothèse -"""""""""""""""""" -Un nom de l'hypothèse est proposé automatiquement : Hypo_1, Hypo_2, etc. Ce nom peut être modifié. Il ne doit pas avoir été utilisé pour une hypothèse précédente. - -Adaptation uniforme -""""""""""""""""""" -Par défaut on propose un raffinement uniforme. Quand on part d'un maillage qui a déjà été raffiné, l'option de déraffinement supprimera les mailles produites. - -Adaptation selon un champ -""""""""""""""""""""""""" - -.. note:: - Pour pouvoir adapter le maillage selon un champ il faut avoir au préalable désigné le fichier med contenant le champ. Cela se fait dans la fenêtre de construction de l'itération (voir :ref:`gui_create_iteration`). Le nom du fichier qui a été sélectionné est affiché sans modification possible ici : - -.. image:: images/create_hypothese_ch_1.png - :align: center - -Le champ voulu est à choisir dans la liste des champs contenus dans le fichier. -Une fois ce champ choisi, la liste des ses composantes s'affiche. Il suffit de désigner la (ou les) composantes désirées. - -Si l'on choisit une seule composante, par défaut, c'est sa valeur absolue qui sera utilisée, mais il est possible d'utiliser la valeur relative. Dans le cas de plusieurs composantes, par défaut HOMARD utilisera la norme L2 (euclidienne). On peut toutefois choisir d'utiliser la norme infinie (le max des valeurs absolues des composantes). - -On peut choisir de ne pas utiliser directement le champ, mais sa variation d'un élément à ses voisins. Pour cela, on activera le bouton "*Saut entre éléments*". - -.. image:: images/create_hypothese_ch_2.png - :align: center - - -Le raffinement se fait selon un seuil qui définit un critère haut de raffinement. Toutes les mailles pour lesquelles l'indicateur est supérieur à ce critère seront raffinées. -Pour le choix du critère, trois variantes sont possible : - - - selon un pourcentage de mailles à raffiner, nombre réel compris entre 0 et 100 ; HOMARD raffinera les x% des mailles qui ont la plus grande valeur du champ. - - selon une valeur relative du champ, nombre compris entre 0 et 100 ; HOMARD raffinera les mailles où le champ est supérieur à x% de l'intervalle [mini,maxi]. - - selon une valeur absolue ; toutes les mailles avec une valeur de champ supérieure à cette valeur seront raffinées. - -La même convention s'applique au déraffinement, en remplaçant supérieur par inférieur. On peut inactiver une des fonctions (raffinement ou déraffinement) en cochant le bouton ad_hoc. - -.. image:: images/create_hypothese_ch_3.png - :align: center - - -Adaptation selon une zone -""""""""""""""""""""""""" -.. index:: single: zone - -Au démarrage, il faut créer une première zone par activation du bouton "*Nouveau*" (voir :ref:`gui_create_zone`) : - -.. image:: images/create_hypothese_zo_1.png - :align: center - -Lorsque des zones ont déjà été créées, la liste apparaît dans la fenêtre, ce qui permet de sélectionner les zones voulues. On doit alors préciser si une zone est utilisée pour raffiner toutes les mailles dont une arête est contenue dans la zone, ou si la zone est utilisée pour déraffiner les mailles intérieures à la zone. Si aucun choix n'est fait, la zone est ignorée dans cette hypothèse. - -.. image:: images/create_hypothese_zo_2.png - :align: center - - -Filtrage par les groupes -"""""""""""""""""""""""" -.. index:: single: groupe - -On peut restreindre l'application de l'hypothèse d'adaptation à des groupes. Ainsi les mailles n'appartenant pas à ces groupes ne seront pas modidiées, sauf par contamination ultérieure du raffinement pour assurer la conformité du maillage final. -On coche le bouton associé : - -.. image:: images/create_hypothese_gr_1.png - :align: center - -La liste des groupes de mailles présents dans le maillage est affichée. Il suffit de cocher ceux voulus pour restreindre l'hypothèse d'adaptation. - -.. image:: images/create_hypothese_gr_2.png - :align: center - - -Interpolation de champs -""""""""""""""""""""""" -.. index:: single: interpolation - -.. note:: - Pour pouvoir interpoler un champ de l'ancien vers le nouveau maillage, il faut avoir au préalable désigné le fichier med contenant le champ. Cela se fait dans la fenêtre de construction de l'itération (voir :ref:`gui_create_iteration`). - -Par défaut, aucun champ n'est interpolé. A contrario, on peut demander l'interpolation de tous les champs présents dans le fichier fourni : - -.. image:: images/create_hypothese_ch_4.png - :align: center - -Si on veut choisir les champs à interpoler, il faut les cocher dans la liste de tous les champs présents dans le fichier fourni : - -.. image:: images/create_hypothese_ch_5.png - :align: center - - -Les options avancées -"""""""""""""""""""" -Si la case "Options avancées" n'est pas cochée, aucune contrainte supplémentaire n'est définie. -Si la case est cochée, on définira les options avancées. - -Une première série d'options portent sur la finesse maximale de maillage que l'on ne veut pas dépasser. Deux directives sont possibles, séparément ou ensemble. On peut imposer une taille de maille minimale : une maille dont le diamètre est inférieur à cette limite ne sera plus découpée. Par défaut, on propose un diamètre minimal nul, ce qui revient à ne rien imposer. On peut imposer un niveau de raffinement maximal. Par défaut, le maximum est à 99, ce qui équivaut en général à ne rien imposer. - -La deuxième série d'options n'a d'intérêt que dans le cas où l'adaptation est piloté par un champ et que ce champ n'est pas défini partout dans le maillage. Cela arrive par exemple quand on construit un champ basé sur une distance dans un plan alors que le domaine est 3D : le champ ne sera pas défini sur les noeuds hors du plan. Pour de tels champs, cette option permet de préciser le comportement que l'on souhaite dans les régions où le champ n'est pas défini. Par défaut, il ne se passe rien : les mailles sont gardées telles quelles. On peut choisir les deux autres variantes : raffiner, toutes les mailles seront a priori coupées, ou déraffiner, toutes les mailles seront candidates au déraffinement. - -Le dernier choix porte sur une sortie supplémentaire de l'adaptation. Si la case est cochée, le fichier MED en sortie contiendra un champ contenant le niveau de raffinement de chaque maille. La convention est celle de HOMARD : une maille du maillage initial est de niveau 0, une maille issue d'un raffinement d'une maille initiale porte le niveau 1, etc. Les mailles de transition qui sont produites entre deux mailles de niveau différents, n et n+1, sont affectées du demi-niveau n+0,5. Par défaut, la case n'est pas cochée et le champ n'est pas produit. - -.. image:: images/create_hypothese_av_1.png - :align: center - -.. index:: single: arbre d'étude - -L'arbre d'étude -""""""""""""""" -.. index:: single: arbre d'étude - -L'arbre d'études contient les hypothèses créées et les itérations qui les utilisent. La description des zones qui leur sont éventuellement attachées est présente. - -.. image:: images/create_hypothese_2.png - :align: center - - - -Méthodes python correspondantes +La frontière +============ + +.. index:: single: boundary +.. index:: single: frontière +.. index:: single: cylindre +.. index:: single: sphere + +Les variables sont décrites dans :ref:`gui_create_boundary`. + +Méthodes de la classe homard +"""""""""""""""""""""""""""" +Ces méthodes retournent une instance de la classe boundary. + ++----------------------------------------------------------------------------------------+ ++----------------------------------------------------------------------------------------+ +| .. module:: CreateBoundaryDi | +| | +| **CreateBoundaryDi(boundary_name, mesh_name, mesh_file)** | +| Retourne une instance de la classe ``boundary`` de type discret après sa création | +| | +| - ``boundary_name`` : le nom de la frontière discrète | +| - ``mesh_name`` : le nom du maillage de la frontière | +| - ``mesh_file`` : le nom du fichier contenant ce maillage | ++----------------------------------------------------------------------------------------+ +| .. module:: CreateBoundaryCylinder | +| | +| **CreateBoundaryCylinder(boundary_name, Xcen, Ycen, Zcen, Xaxe, Yaxe, Zaxe, R)** | +| Retourne une instance de la classe ``boundary`` analytique de type cylindrique | +| après sa création | +| | +| - ``boundary_name`` : le nom de la frontière analytique basée sur un cylindre | +| - ``Xcen``, ``Ycen``, ``Zcen`` : coordonnées d'un point sur l'axe du cylindre | +| - ``Xaxe``, ``Yaxe``, ``Zaxe`` : vecteur de l'axe | +| - ``R`` : rayon du cylindre | ++----------------------------------------------------------------------------------------+ +| .. module:: CreateBoundarySphere | +| | +| **CreateBoundarySphere(boundary_name, Xcen, Ycen, Zcen, R)** | +| Retourne une instance de la classe ``boundary`` analytique de type sphérique | +| après sa création | +| | +| - ``boundary_name`` : le nom de la frontière analytique basée sur une sphere | +| - ``Xcen``, ``Ycen``, ``Zcen`` : coordonnées du centre de la sphère | +| - ``R`` : rayon de la sphère | ++----------------------------------------------------------------------------------------+ + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: GetBoundary | +| | +| **GetBoundary(boundary_name)** | +| Retourne l'instance de la classe ``boundary`` connue par | +| son nom | +| | +| - ``boundary_name`` : le nom de la frontière | ++---------------------------------------------------------------+ +| .. module:: GetAllBoundarysName | +| | +| **GetAllBoundarysName()** | +| Retourne la liste des noms de toutes les frontières créées| +| | ++---------------------------------------------------------------+ + +Méthodes de la classe boundary +"""""""""""""""""""""""""""""" + ++-------------------------------------------------------------------+ ++-------------------------------------------------------------------+ +| .. module:: GetName | +| | +| **GetName()** | +| Retourne le nom de la frontière | ++-------------------------------------------------------------------+ +| .. module:: GetType | +| | +| **GetType()** | +| Retourne le type de la frontière : | +| | +| * 0 : discrète | +| * 1 : cylindre | +| * 2 : sphère | ++-------------------------------------------------------------------+ +| .. module:: GetCoords | +| | +| **GetCoords()** | +| Retourne un tableau contenant les coordonnées de la frontière | +| dans l'ordre d'entrée dans le CreateBoundaryXXXX associé | ++-------------------------------------------------------------------+ + + +Exemple +""""""" +Création d'une frontière discrète, d'une frontière sphèrique, puis d'une frontière cylindrique : :: + + inter = homard.CreateBoundaryDi("INTERSECTION", 'PIQUAGE', dircase+'/tutorial_4.fr.med') + fron_1 = homard.CreateBoundarySphere("FRON_1", 12.3, 3.4, .56, 6.5) + fron_2 = homard.CreateBoundaryCylinder('CYL_1', 0.0, 25., -25., 25., 50., 75., 100.) + + +Saisie graphique correspondante """"""""""""""""""""""""""""""" -Consulter :ref:`tui_create_hypothese` +Consulter :ref:`gui_create_boundary` diff --git a/doc/tui_create_case.rst b/doc/tui_create_case.rst index f7ec7473..420d1e90 100644 --- a/doc/tui_create_case.rst +++ b/doc/tui_create_case.rst @@ -36,9 +36,9 @@ M | | | - ``case_name`` : le nom du cas | +---------------------------------------------------------------+ -| .. module:: GetAllCases | +| .. module:: GetAllCasesName | | | -| **GetAllCases()** | +| **GetAllCasesName()** | | Retourne la liste des noms de tous les cas créés | | | +---------------------------------------------------------------+ @@ -83,12 +83,12 @@ M | **GetConfType()** | | Retourne le type de conformité | +---------------------------------------------------------------+ -| .. module:: GetIter0Name | +| .. module:: GetIter0 | | | -| **GetIter0Name()** | -| Retourne le nom de l'itération 0, associée au maillage | -| initial. Ce nom est créé automatiquement par le module | -| HOMARD et doit être utilisé pour enchaîner les adaptations| +| **GetIter0()** | +| Retourne l'itération 0, associée au maillage initial. | +| Cette itération est créée automatiquement par le module | +| HOMARD et est utilisée pour enchaîner les adaptations. | +---------------------------------------------------------------+ | .. module:: AddBoundaryGroup | | | diff --git a/doc/tui_create_hypothese.rst b/doc/tui_create_hypothese.rst index 1f0396f3..71663fc4 100644 --- a/doc/tui_create_hypothese.rst +++ b/doc/tui_create_hypothese.rst @@ -21,17 +21,6 @@ M | | | - ``hypo_name`` : le nom de l'hypothèse | +---------------------------------------------------------------+ -| .. module:: AssociateHypoZone | -| | -| **AssociateHypoZone(hypo_name, zone_name, type_use)** | -| | -| - ``hypo_name`` : le nom de l'hypothèse | -| - ``zone_name`` : le nom de la zone à associer | -| - ``type_use`` : entier précisant l'usage de la zone | -| | -| * 1 : raffinement | -| * -1 : déraffinement | -+---------------------------------------------------------------+ | .. module:: GetHypothesis | | | | **GetHypothesis(hypo_name)** | @@ -40,9 +29,9 @@ M | | | - ``hypo_name`` : le nom de l'hypothèse | +---------------------------------------------------------------+ -| .. module:: GetAllHypotheses | +| .. module:: GetAllHypothesesName | | | -| **GetAllHypotheses()** | +| **GetAllHypothesesName()** | | Retourne la liste des noms de toutes les hypothèses créées| | | +---------------------------------------------------------------+ @@ -195,6 +184,24 @@ Les composantes du champ | Retourne la liste des composantes utilisées | +---------------------------------------------------------------+ + +Les zones +^^^^^^^^^ + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: AddZone | +| | +| **AddZone(zone_name, type_use)** | +| | +| - ``zone_name`` : le nom de la zone à ajouter | +| - ``type_use`` : entier précisant l'usage de la zone | +| | +| * 1 : raffinement | +| * -1 : déraffinement | ++---------------------------------------------------------------+ + + Le filtrage par les groupes ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/tui_create_iteration.rst b/doc/tui_create_iteration.rst index 855cf6e1..d09ab686 100644 --- a/doc/tui_create_iteration.rst +++ b/doc/tui_create_iteration.rst @@ -14,40 +14,38 @@ M +---------------------------------------------------------------+ +---------------------------------------------------------------+ -| .. module:: CreateIteration | +| .. module:: GetIteration | | | -| **CreateIteration(iter_name, iter_parent_name)** | -| Retourne une instance de la classe ``iteration`` après | -| sa création | +| **GetIteration(iter_name)** | +| Retourne l'instance de la classe ``iteration`` connue par | +| son nom | | | | - ``iter_name`` : le nom de l'itération | -| - ``iter_parent_name`` : le nom de l'itération mère | -| | -| Par défaut : | -| | -| * le maillage produit a le même nom que l'itération | +---------------------------------------------------------------+ -| .. module:: AssociateIterHypo | +| .. module:: GetAllIterationsName | | | -| **AssociateIterHypo(iter_name, hypo_name)** | -| Associe une hypothèse à une itération | +| **GetAllIterationsName()** | +| Retourne la liste des noms de toutes les itérations créées| | | -| - ``iter_name`` : le nom de l'itération | -| - ``hypo_name`` : le nom de l'hypothèse à associer | +---------------------------------------------------------------+ -| .. module:: GetIteration | + +Méthodes de la classe cas +""""""""""""""""""""""""" + ++---------------------------------------------------------------+ ++---------------------------------------------------------------+ +| .. module:: NextIteration | | | -| **GetIteration(iter_name)** | -| Retourne l'instance de la classe ``iteration`` connue par | -| son nom | +| **NextIteration(iter_name)** | +| Retourne une instance de la classe ``iteration`` après | +| sa création : celle qui suit immédiatement l'itération | +| initiale, correspondant au maillage définissant le cas | | | | - ``iter_name`` : le nom de l'itération | -+---------------------------------------------------------------+ -| .. module:: GetAllIterations | | | -| **GetAllIterations()** | -| Retourne la liste des noms de toutes les itérations créées| +| Par défaut : | | | +| * le maillage produit a le même nom que l'itération | +---------------------------------------------------------------+ Méthodes de la classe iteration @@ -58,6 +56,18 @@ G +---------------------------------------------------------------+ +---------------------------------------------------------------+ +| .. module:: NextIteration | +| | +| **NextIteration(iter_name)** | +| Retourne une instance de la classe ``iteration`` qui suit | +| l'itération courante | +| | +| - ``iter_name`` : le nom de l'itération | +| | +| Par défaut : | +| | +| * le maillage produit a le même nom que l'itération | ++---------------------------------------------------------------+ | .. index:: single: Compute | | | | **Compute(option)** | @@ -90,7 +100,14 @@ G | .. module:: GetIterParent | | | | **GetIterParent()** | -| Retourne le nom de l'itération mère | +| Retourne l'itération mère | ++---------------------------------------------------------------+ +| .. module:: AssociateHypo | +| | +| **AssociateHypo(hypo_name)** | +| Associe une hypothèse à l'itération | +| | +| - ``hypo_name`` : le nom de l'hypothèse à associer | +---------------------------------------------------------------+ | .. module:: GetHypoName | | | @@ -177,26 +194,26 @@ Exemple """"""" .. index:: single: maillage;initial -Pour la création de la première itération, il faut récupérer le nom qui a été donné à celle qui correspond au maillage initial. Ce nom s'obtient avec la méthode ``GetIter0Name`` appliquée au cas. :: +Pour la création de la première itération, on part de celle qui correspond au maillage initial. C'est celle contenue dans le cas. :: iter_name = "Iteration_1" - iter_1 = homard.CreateIteration(iter_name, case_1.GetIter0Name()) + iter_1 = case_1.NextIteration(iter_name) iter_1.SetField(field_file) iter_1.SetTimeStepRank( 0, 0) iter_1.SetMeshName("maill_01") iter_1.SetMeshFile("/local00/M.01.med") - homard.AssociateIterHypo(iter_name, "HypoField") + iter_1.AssociateHypo("HypoField") codret = iter_1.Compute(1) -Pour la création d'une itération suivante, on donnera le nom de l'itération parent de laquelle on part. :: +Ensuite, on crée une itération suivante à l'itération parent de laquelle on part. :: iter_name = "Iteration_2" - iter_2 = homard.CreateIteration(iter_name, "Iteration_1") + iter_2 = iter_1.NextIteration(iter_name) iter_2.SetField(field_file) iter_2.SetTimeStepRank( 1, 1) iter_2.SetMeshName("maill_02") iter_2.SetMeshFile("/local00/M.02.med") - homard.AssociateIterHypo(iter_name, "HypoField") + iter_2.AssociateHypo("HypoField") codret = iter_2.Compute(1) diff --git a/doc/tui_create_zone.rst b/doc/tui_create_zone.rst index ea36905d..dccbe8c9 100644 --- a/doc/tui_create_zone.rst +++ b/doc/tui_create_zone.rst @@ -135,9 +135,9 @@ Ces m | | | - ``zone_name`` : le nom de la zone | +---------------------------------------------------------------+ -| .. module:: GetAllZones | +| .. module:: GetAllZonesName | | | -| **GetAllZones()** | +| **GetAllZonesName()** | | Retourne la liste des noms de toutes les zones créées | | | +---------------------------------------------------------------+ @@ -153,9 +153,9 @@ M | **GetName()** | | Retourne le nom de la zone | +---------------------------------------------------------------+ -| .. module:: GetZoneType | +| .. module:: GetType | | | -| **GetZoneType()** | +| **GetType()** | | Retourne le type de la zone | | | | * 2 : parallélépipède | diff --git a/doc/tutorials.rst b/doc/tutorials.rst index 3662308e..72976ac3 100644 --- a/doc/tutorials.rst +++ b/doc/tutorials.rst @@ -3,7 +3,7 @@ Exemples .. index:: single: exemple .. index:: single: python -On trouvera ici les instructions python pour quelques configurations caractéristiques. Les fichiers de données associés sont téléchargeables. Il faut penser à modifier le contenu de la variable ``dircase`` : c'est le répertoire dans lequel les fichiers med auront été enregistrés. C'est dans ce répertoire que seront écrits les fichiers résultant des adaptations successives. +On trouvera ici les instructions python pour quelques configurations caractéristiques. Les fichiers de données associés sont téléchargeables. Il faut penser à adapter la valeur de la variable ``data_dir`` : c'est le répertoire dans lequel les fichiers med auront été enregistrés. C'est dans ce répertoire ``dircase`` que seront écrits les fichiers résultant des adaptations successives. Raffinement uniforme """""""""""""""""""" @@ -15,7 +15,6 @@ On fera ici trois raffinements uniformes successifs du maillage contenu dans le :: - dircase = "/tmp" # # Hypothesis "Hypo_0" # =================== @@ -24,31 +23,31 @@ On fera ici trois raffinements uniformes successifs du maillage contenu dans le # # Case "Case_1" # ============= - Case_1 = homard.CreateCase('Case_1', 'MAILL', dircase+'/tutorial_1.00.med') + Case_1 = homard.CreateCase('Case_1', 'MAILL', data_dir+'/tutorial_1.00.med') Case_1.SetDirName(dircase) Case_1.SetConfType(1) # # Iterations # ========== # Iteration "Iter_0" - Iter_0 = homard.CreateIteration('Iter_0', Case_1.GetIter0Name()) + Iter_0 = Case_1.NextIteration('Iter_0') Iter_0.SetMeshName('MESH') Iter_0.SetMeshFile(dircase+'/maill.01.med') - homard.AssociateIterHypo('Iter_0', 'Hypo_0') + Iter_0.AssociateHypo('Hypo_0') codret = Iter_0.Compute(1) # Iteration "Iter_1" - Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0') + Iter_1 = Iter_0.NextIteration('Iter_1') Iter_1.SetMeshName('MESH') Iter_1.SetMeshFile(dircase+'/maill.02.med') - homard.AssociateIterHypo('Iter_1', 'Hypo_0') + Iter_1.AssociateHypo('Hypo_0') codret = Iter_1.Compute(1) # Iteration "Iter_2" - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('MESH') Iter_2.SetMeshFile(dircase+'/maill.03.med') - homard.AssociateIterHypo('Iter_2', 'Hypo_0') + Iter_2.AssociateHypo('Hypo_0') codret = Iter_2.Compute(1) .. note:: @@ -65,7 +64,6 @@ Raffinement par des zones 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. :: - dircase = "/tmp" # # Creation of the zones # ===================== @@ -82,35 +80,35 @@ On proc # =================== Hypo_0 = homard.CreateHypothesis('Hypo_0') Hypo_0.SetAdapRefinUnRef(0, 1, 0) - homard.AssociateHypoZone('Zone_1', 'Hypo_0') - homard.AssociateHypoZone('Zone_0', 'Hypo_0') + Hypo_0.AddZone('Zone_1', 1) + Hypo_0.AddZone('Zone_0', 1) # # Hypothesis "Hypo_1" # =================== Hypo_1 = homard.CreateHypothesis('Hypo_1') Hypo_1.SetAdapRefinUnRef(0, 1, 0) - homard.AssociateHypoZone('Zone_0', 'Hypo_1') - homard.AssociateHypoZone('Zone_2', 'Hypo_1') + Hypo_1.AddZone('Zone_0', 1) + Hypo_1.AddZone('Zone_2', 1) # # Case "Case_1" # ============= - Case_1 = homard.CreateCase('Case_1', 'MZERO', dircase+'/tutorial_2.00.med') + Case_1 = homard.CreateCase('Case_1', 'MZERO', data_dir+'/tutorial_2.00.med') Case_1.SetDirName(dircase) # # Iteration "Iter_0" # ================== - Iter_0 = homard.CreateIteration('Iter_0', Case_1.GetIter0Name()) + Iter_0 = Case_1.NextIteration('Iter_0') Iter_0.SetMeshName('M_1') Iter_0.SetMeshFile(dircase+'/maill.01.med') - homard.AssociateIterHypo('Iter_0', 'Hypo_0') + Iter_0.AssociateHypo('Hypo_0') codret = Iter_0.Compute(1) # # Iteration "Iter_1" # ================== - Iter_1 = homard.CreateIteration('Iter_1', 'Iter_0') + Iter_1 = Iter_0.NextIteration('Iter_1') Iter_1.SetMeshName('M_2') Iter_1.SetMeshFile(dircase+'/maill.02.med') - homard.AssociateIterHypo('Iter_1', 'Hypo_1') + Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) .. note:: @@ -128,7 +126,6 @@ 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. :: - dircase = "/tmp" # # Hypothesis "Hypo_0vers1" # ======================== @@ -173,37 +170,37 @@ Pour adapter le maillage H_1 issu de l'it # # Case "Case_1" # ============= - Case_1 = homard.CreateCase('Case_1', 'G_0', dircase+'/tutorial_3.00.med') + Case_1 = homard.CreateCase('Case_1', 'G_0', data_dir+'/tutorial_3.00.med') Case_1.SetDirName(dircase) # # Iteration "Iter_1" # ================== - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name()) + Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('H_1') Iter_1.SetMeshFile(dircase+'/maill.01.med') - Iter_1.SetFieldFile(dircase+'/tutorial_3.00.med') + Iter_1.SetFieldFile(data_dir+'/tutorial_3.00.med') Iter_1.SetTimeStepRank( 1, 1) - homard.AssociateIterHypo('Iter_1', 'Hypo_0vers1') + Iter_1.AssociateHypo('Hypo_0vers1') codret = Iter_1.Compute(1) # # Iteration "Iter_2" # ================== - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('H_2') Iter_2.SetMeshFile(dircase+'/maill.02.med') - Iter_2.SetFieldFile(dircase+'/tutorial_3.01.med') + Iter_2.SetFieldFile(data_dir+'/tutorial_3.01.med') Iter_2.SetTimeStepRank(1, 1) - homard.AssociateIterHypo('Iter_2', 'Hypo_1vers2') + Iter_2.AssociateHypo('Hypo_1vers2') codret = Iter_2.Compute(1) # # Iteration "Iter_2_bis" # ====================== - Iter_2_bis = homard.CreateIteration('Iter_2_bis', 'Iter_1') + Iter_2_bis = Iter_1.NextIteration('Iter_2_bis') Iter_2_bis.SetMeshName('H_2_bis') Iter_2_bis.SetMeshFile(dircase+'/maill.02.bis.med') - Iter_2_bis.SetFieldFile(dircase+'/tutorial_3.01.med') + Iter_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med') Iter_2_bis.SetTimeStepRank(1, 1) - homard.AssociateIterHypo('Iter_2_bis', 'Hypo_1vers2_bis') + Iter_2_bis.AssociateHypo('Hypo_1vers2_bis') codret = Iter_2_bis.Compute(1) .. note:: @@ -221,11 +218,10 @@ Suivi de fronti On teste ici le suivi des frontières courbes : des frontières analytiques pour décrire les différentes surfaces des tuyaux et une frontière discrète pour décrire les lignes d'intersection des deux tuyaux. Le pilotage du raffinement est le suivant : raffinement uniforme de toutes les mailles contenues dans des groupes désignés. :: - dircase = "/tmp" # # Creation of the boundaries # ========================== - Boundary_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', dircase+'/tutorial_4.fr.med') + Boundary_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med') # Boundary_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.) # @@ -252,7 +248,7 @@ On teste ici le suivi des fronti # # Case "Case" # ============= - Case = homard.CreateCase('Case', 'PIQUAGE', dircase+'/tutorial_4.00.med') + Case = homard.CreateCase('Case', 'PIQUAGE', data_dir+'/tutorial_4.00.med') Case.SetDirName(dircase) Case.AddBoundaryGroup( 'intersection', '' ) Case.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' ) @@ -265,16 +261,16 @@ On teste ici le suivi des fronti # Creation of the iterations # ========================== # Creation of the iteration Iter_1 - Iter_1 = homard.CreateIteration('Iter_1', Case.GetIter0Name() ) + Iter_1 = Case.NextIteration('Iter_1') Iter_1.SetMeshName('PIQUAGE_1') Iter_1.SetMeshFile(dircase+'/maill.01.med') - homard.AssociateIterHypo('Iter_1', 'Hypo_1') + Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) # Creation of the iteration Iter_2 - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1' ) + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('PIQUAGE_2') Iter_2.SetMeshFile(dircase+'/maill.02.med') - homard.AssociateIterHypo('Iter_2', 'Hypo_2') + Iter_2.AssociateHypo('Hypo_2') codret = Iter_2.Compute(1) .. note:: @@ -293,12 +289,11 @@ 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. :: - dircase = "/tmp" # # Creation of the boundaries # ========================== # Creation of the discrete boundary Boun_1 - Boun_1 = homard.CreateBoundaryDi('Boun_1', 'MAIL_EXT', dircase+'/tutorial_5.fr.med') + Boun_1 = homard.CreateBoundaryDi('Boun_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med') # # Creation of the zones # ===================== @@ -312,33 +307,33 @@ Dans le cas pr # Creation of the hypothesis Hypo_1 Hypo_1 = homard.CreateHypothesis('Hypo_1') Hypo_1.SetAdapRefinUnRef(0, 1, 0) - homard.AssociateHypoZone('enveloppe', 'Hypo_1') + Hypo_1.AddZone('enveloppe', 1) # Creation of the hypothesis Hypo_2 Hypo_2 = homard.CreateHypothesis('Hypo_2') Hypo_2.SetAdapRefinUnRef(0, 1, 0) - homard.AssociateHypoZone('quart_sup', 'Hypo_2') + Hypo_2.AddZone('quart_sup', 1) # # Case "Case_1" # ============= - Case_1 = homard.CreateCase('Case_1', 'COEUR_2D', dircase+'/tutorial_5.00.med') + Case_1 = homard.CreateCase('Case_1', 'COEUR_2D', data_dir+'/tutorial_5.00.med') Case_1.SetDirName(dircase) Case_1.SetConfType(3) Case_1.AddBoundaryGroup('Boun_1', '') # # Iteration "Iter_1" # ================== - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name()) + Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('COEUR_2D_01') Iter_1.SetMeshFile(dircase+'/maill.01.med') - homard.AssociateIterHypo('Iter_1', 'Hypo_1') + Iter_1.AssociateHypo('Hypo_1') codret = Iter_1.Compute(1) # # Iteration "Iter_2" # ================== - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('COEUR_2D_02') Iter_2.SetMeshFile(dircase+'/maill.02.med') - homard.AssociateIterHypo('Iter_2', 'Hypo_2') + Iter_2.AssociateHypo('Hypo_2') codret = Iter_2.Compute(1) .. note:: diff --git a/idl/Gen.xml b/idl/Gen.xml index 4902bdf5..d18a7f28 100644 --- a/idl/Gen.xml +++ b/idl/Gen.xml @@ -15,14 +15,14 @@ HOMARD OTHER HOMARD team - EDF RD - 1.1 + 1.2 unknown 1 1 HOMARD_2.png - HOMARD + HOMARD_Gen unknown @@ -597,71 +597,7 @@ - AssociateIterHypo - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - HypoName - string - unknown - - - - - - - AssociateHypoZone - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - ZoneName - string - unknown - - - HypoName - string - unknown - - - - - - - GetCaseName - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - - - return - string - unknown - - - - - - GetCas + GetCase HOMARD team - EDF RD 1.1 unknown @@ -771,7 +707,7 @@ - GetAllCases + GetAllCasesName HOMARD team - EDF RD 1.1 unknown @@ -787,7 +723,7 @@ - GetAllBoundarys + GetAllBoundarysName HOMARD team - EDF RD 1.1 unknown @@ -803,7 +739,7 @@ - GetAllHypotheses + GetAllHypothesesName HOMARD team - EDF RD 1.1 unknown @@ -819,7 +755,7 @@ - GetAllZones + GetAllZonesName HOMARD team - EDF RD 1.1 unknown @@ -835,7 +771,7 @@ - GetAllIterations + GetAllIterationsName HOMARD team - EDF RD 1.1 unknown @@ -866,48 +802,6 @@ - - AssociateIterIter - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - PreviousIterName - string - unknown - - - IterName - string - unknown - - - - - - - DissociateHypoZone - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - ZoneName - string - unknown - - - HypoName - string - unknown - - - - - InvalideBoundary HOMARD team - EDF RD @@ -975,7 +869,7 @@ Compute HOMARD team - EDF RD - 1.1 + 1.2 unknown 0 @@ -993,7 +887,7 @@ return - boolean + long unknown diff --git a/idl/HOMARD_Boundary.idl b/idl/HOMARD_Boundary.idl index 79131c7b..61d9d85d 100644 --- a/idl/HOMARD_Boundary.idl +++ b/idl/HOMARD_Boundary.idl @@ -33,11 +33,11 @@ module HOMARD interface HOMARD_Boundary : Engines::EngineComponent { - void SetName (in string NomBoundary) raises (SALOME::SALOME_Exception); + void SetName (in string Name) raises (SALOME::SALOME_Exception); string GetName () raises (SALOME::SALOME_Exception); - void SetBoundaryType (in long BoundaryType) raises (SALOME::SALOME_Exception); - long GetBoundaryType() raises (SALOME::SALOME_Exception); + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); void SetMeshFile(in string MeshFile) raises (SALOME::SALOME_Exception); string GetMeshFile() raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Cas.idl b/idl/HOMARD_Cas.idl index d79354bc..46909503 100644 --- a/idl/HOMARD_Cas.idl +++ b/idl/HOMARD_Cas.idl @@ -24,6 +24,8 @@ #include "SALOME_Exception.idl" #include "SALOMEDS.idl" +#include "HOMARD_Iteration.idl" + module HOMARD { typedef sequence extrema ; @@ -43,9 +45,13 @@ module HOMARD void SetConfType(in long ConfType) raises (SALOME::SALOME_Exception); long GetConfType() raises (SALOME::SALOME_Exception); - void AddIteration (in string NomIteration) raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIter0 () raises (SALOME::SALOME_Exception); string GetIter0Name () raises (SALOME::SALOME_Exception); + HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + + void AddIteration (in string NomIteration) raises (SALOME::SALOME_Exception); + extrema GetBoundingBox() raises (SALOME::SALOME_Exception); void SetBoundingBox(in extrema LesExtremes) raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Gen.idl b/idl/HOMARD_Gen.idl index 49f7180f..baff2571 100644 --- a/idl/HOMARD_Gen.idl +++ b/idl/HOMARD_Gen.idl @@ -51,8 +51,6 @@ module HOMARD raises (SALOME::SALOME_Exception); HOMARD_Hypothesis CreateHypothesis(in string HypoName ) raises (SALOME::SALOME_Exception); - HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName ) - raises (SALOME::SALOME_Exception); HOMARD_Zone CreateZoneBox (in string ZoneName, in double Xmini, in double Xmaxi, in double Ymini, in double Ymaxi, @@ -98,36 +96,34 @@ module HOMARD in double Radius) raises (SALOME::SALOME_Exception); // -// A.2. Les associations -// - void AssociateIterHypo(in string IterName, in string HypoName) - raises (SALOME::SALOME_Exception); - void AssociateHypoZone(in string HypoName, in string ZoneName, in long TypeUse) - raises (SALOME::SALOME_Exception); -// -// A.3. Les informations +// A.2. Les informations // - string GetCaseName(in string IterName) raises (SALOME::SALOME_Exception); - HOMARD_Cas GetCas(in string CaseName) raises (SALOME::SALOME_Exception); + HOMARD_Cas GetCase(in string CaseName) raises (SALOME::SALOME_Exception); HOMARD_Boundary GetBoundary(in string BounName) raises (SALOME::SALOME_Exception); HOMARD_Zone GetZone(in string ZoneName) raises (SALOME::SALOME_Exception); HOMARD_Hypothesis GetHypothesis(in string HypoName) raises (SALOME::SALOME_Exception); HOMARD_Iteration GetIteration(in string IterName) raises (SALOME::SALOME_Exception); - listeCases GetAllCases() raises (SALOME::SALOME_Exception); - listeBoundarys GetAllBoundarys() raises (SALOME::SALOME_Exception); - listeHypotheses GetAllHypotheses() raises (SALOME::SALOME_Exception); - listeZones GetAllZones() raises (SALOME::SALOME_Exception); - listeIterations GetAllIterations() raises (SALOME::SALOME_Exception); + + listeCases GetAllCasesName() raises (SALOME::SALOME_Exception); + listeBoundarys GetAllBoundarysName() raises (SALOME::SALOME_Exception); + listeHypotheses GetAllHypothesesName() raises (SALOME::SALOME_Exception); + listeZones GetAllZonesName() raises (SALOME::SALOME_Exception); + listeIterations GetAllIterationsName() raises (SALOME::SALOME_Exception); // -// A.4. L'etude +// A.3. L'etude // void SetCurrentStudy(in SALOMEDS::Study theStudy) raises (SALOME::SALOME_Exception); // // B. Les methodes qui suivent n'apparaissent pas dans le composant HOMARD dans YACS // L'utilisateur ne devrait pas les connaitre (ni s'en servir, a fortiori) // - void AssociateIterIter(in string PreviousIterName, in string IterName) + HOMARD_Iteration CreateIteration(in string IterName, in string PreviousIterName ) + raises (SALOME::SALOME_Exception); +// + void AssociateIterHypo(in string IterName, in string HypoName) raises (SALOME::SALOME_Exception); + +// void DissociateHypoZone(in string ZoneName, in string HypoName) raises (SALOME::SALOME_Exception); @@ -136,8 +132,7 @@ module HOMARD void InvalideHypo (in string HypoName) raises (SALOME::SALOME_Exception); void InvalideIter (in string IterName) raises (SALOME::SALOME_Exception); - long Compute (in string IterName, in long etatMenage) - raises (SALOME::SALOME_Exception); + long Compute (in string IterName, in long etatMenage) raises (SALOME::SALOME_Exception); boolean VerifieDir (in string IterName) raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Iteration.idl b/idl/HOMARD_Iteration.idl index 12612c05..61d38e56 100644 --- a/idl/HOMARD_Iteration.idl +++ b/idl/HOMARD_Iteration.idl @@ -33,6 +33,8 @@ module HOMARD void SetName(in string NomIter) raises (SALOME::SALOME_Exception); string GetName() raises (SALOME::SALOME_Exception); + HOMARD_Iteration NextIteration(in string NomIter) raises (SALOME::SALOME_Exception); + void SetEtat(in boolean State) raises (SALOME::SALOME_Exception); boolean GetEtat() raises (SALOME::SALOME_Exception); @@ -51,11 +53,14 @@ module HOMARD long GetTimeStep() raises (SALOME::SALOME_Exception); long GetRank() raises (SALOME::SALOME_Exception); - void SetIterParent(in string NomIterParent) raises (SALOME::SALOME_Exception); - string GetIterParent() raises (SALOME::SALOME_Exception); + void SetIterParentName(in string NomIterParent) raises (SALOME::SALOME_Exception); + string GetIterParentName() raises (SALOME::SALOME_Exception); + HOMARD_Iteration GetIterParent() raises (SALOME::SALOME_Exception); void AddIteration(in string NomIter) raises (SALOME::SALOME_Exception); + void AssociateHypo(in string NomHypo) raises (SALOME::SALOME_Exception); + void SetHypoName(in string NomHypo) raises (SALOME::SALOME_Exception); string GetHypoName() raises (SALOME::SALOME_Exception); diff --git a/idl/HOMARD_Zone.idl b/idl/HOMARD_Zone.idl index 1ae7aaec..b40cc945 100644 --- a/idl/HOMARD_Zone.idl +++ b/idl/HOMARD_Zone.idl @@ -32,11 +32,11 @@ module HOMARD interface HOMARD_Zone : Engines::EngineComponent { - void SetName (in string NomZone) raises (SALOME::SALOME_Exception); + void SetName (in string Name) raises (SALOME::SALOME_Exception); string GetName () raises (SALOME::SALOME_Exception); - void SetZoneType (in long ZoneType) raises (SALOME::SALOME_Exception); - long GetZoneType() raises (SALOME::SALOME_Exception); + void SetType (in long Type) raises (SALOME::SALOME_Exception); + long GetType() raises (SALOME::SALOME_Exception); void SetBox (in double Xmini, in double Xmaxi, in double Ymini, in double Ymaxi, in double Zmini, in double Zmaxi) diff --git a/resources/HOMARDCatalog.xml.in b/resources/HOMARDCatalog.xml.in index 6aee5c2f..dd73aff4 100644 --- a/resources/HOMARDCatalog.xml.in +++ b/resources/HOMARDCatalog.xml.in @@ -52,7 +52,7 @@ HOMARD OTHER HOMARD team - EDF RD - 1.0 + 1.1 unknown 1 1 @@ -116,33 +116,6 @@ - - CreateIteration - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - PreviousIterName - string - unknown - - - - - return - HOMARD_Iteration - unknown - - - - CreateZoneBox HOMARD team - EDF RD @@ -634,71 +607,7 @@ - AssociateIterHypo - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - HypoName - string - unknown - - - - - - - AssociateHypoZone - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - ZoneName - string - unknown - - - HypoName - string - unknown - - - - - - - GetCaseName - HOMARD team - EDF RD - 1.1 - unknown - 0 - - - IterName - string - unknown - - - - - return - string - unknown - - - - - - GetCas + GetCase HOMARD team - EDF RD 1.1 unknown @@ -808,7 +717,7 @@ - GetAllCases + GetAllCasesName HOMARD team - EDF RD 1.1 unknown @@ -824,7 +733,7 @@ - GetAllBoundarys + GetAllBoundarysName HOMARD team - EDF RD 1.1 unknown @@ -840,7 +749,7 @@ - GetAllHypotheses + GetAllHypothesesName HOMARD team - EDF RD 1.1 unknown @@ -856,7 +765,7 @@ - GetAllZones + GetAllZonesName HOMARD team - EDF RD 1.1 unknown @@ -872,7 +781,7 @@ - GetAllIterations + GetAllIterationsName HOMARD team - EDF RD 1.1 unknown diff --git a/src/HOMARD/HOMARD_Boundary.cxx b/src/HOMARD/HOMARD_Boundary.cxx index 6414f6bc..596d3699 100644 --- a/src/HOMARD/HOMARD_Boundary.cxx +++ b/src/HOMARD/HOMARD_Boundary.cxx @@ -31,7 +31,7 @@ */ //============================================================================= HOMARD_Boundary::HOMARD_Boundary(): - _NomBoundary( "" ),_BoundaryType( 1 ), + _Name( "" ),_Type( 1 ), _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ), _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _rayon( 0 ), @@ -47,16 +47,15 @@ HOMARD_Boundary::~HOMARD_Boundary() } //============================================================================= -void HOMARD_Boundary::SetName( const char* NomBoundary ) +void HOMARD_Boundary::SetName( const char* Name ) { - MESSAGE("SetName = "<::const_iterator it = _ListBoundaryGroup.begin(); while(it != _ListBoundaryGroup.end()) { - aScript << "\t" <<_NomCas << ".AddBoundaryGroup(\""; + aScript << "\t" <<_Name << ".AddBoundaryGroup(\""; aScript << *it << "\", \""; it++; aScript << *it << "\")\n"; @@ -108,7 +108,7 @@ std::string HOMARD_Cas::GetDumpPython() const } if ( _Pyram > 0 ) { - aScript << "\t" <<_NomCas << ".SetPyram("; + aScript << "\t" <<_Name << ".SetPyram("; aScript << _Pyram << ")\n"; } @@ -237,13 +237,11 @@ void HOMARD_Cas::SupprBoundaryGroup() void HOMARD_Cas::SetPyram( int Pyram ) //============================================================================= { - MESSAGE ("SetPyram, Pyram = " << Pyram ); _Pyram = Pyram; } //============================================================================= const int HOMARD_Cas::GetPyram() const //============================================================================= { - MESSAGE ("GetPyram, Pyram = " << _Pyram ); return _Pyram; } diff --git a/src/HOMARD/HOMARD_Cas.hxx b/src/HOMARD/HOMARD_Cas.hxx index 30dda077..8c00114d 100644 --- a/src/HOMARD/HOMARD_Cas.hxx +++ b/src/HOMARD/HOMARD_Cas.hxx @@ -35,7 +35,7 @@ public: HOMARD_Cas(); ~HOMARD_Cas(); - void SetName( const char* NomCas ); + void SetName( const char* Name ); std::string GetName() const; void SetDirName( const char* NomDir ); @@ -71,7 +71,7 @@ public: const int GetPyram() const; private: - std::string _NomCas; + std::string _Name; std::string _NomDir; int _ConfType; diff --git a/src/HOMARD/HOMARD_DriverTools.cxx b/src/HOMARD/HOMARD_DriverTools.cxx index ee9264b4..8a262942 100644 --- a/src/HOMARD/HOMARD_DriverTools.cxx +++ b/src/HOMARD/HOMARD_DriverTools.cxx @@ -104,8 +104,9 @@ namespace HOMARD std::string Dump( const HOMARD_Cas& cas ) { std::stringstream os; + std::string saux ; // ... - MESSAGE( ". Dump du cas "< ListString = iteration.GetIterations(); os << separator() << ListString.size(); @@ -170,8 +173,9 @@ namespace HOMARD os << separator() << iteration.GetCaseName(); os << separator() << iteration.GetDirName(); -// MESSAGE( ". Fin avec "< coords = zone.GetCoords(); for ( int i = 0; i < coords.size(); i++ ) @@ -264,8 +271,9 @@ namespace HOMARD for ( it = hypos.begin(); it != hypos.end(); ++it ) os << separator() << *it; -// MESSAGE( ". Fin avec "< coords; int lgcoords ; @@ -685,7 +695,7 @@ namespace HOMARD chunk = getNextChunk( stream, start, ok ); if ( !ok ) return false; int BoundaryType = atoi( chunk.c_str() ) ; - boundary.SetBoundaryType( BoundaryType ); + boundary.SetType( BoundaryType ); chunk = getNextChunk( stream, start, ok ); if ( !ok ) return false; diff --git a/src/HOMARD/HOMARD_Hypothesis.cxx b/src/HOMARD/HOMARD_Hypothesis.cxx index a1845b10..da278216 100644 --- a/src/HOMARD/HOMARD_Hypothesis.cxx +++ b/src/HOMARD/HOMARD_Hypothesis.cxx @@ -31,7 +31,7 @@ */ //============================================================================= HOMARD_Hypothesis::HOMARD_Hypothesis(): - _NomHypo(""), _NomCasCreation(""), + _Name(""), _NomCasCreation(""), _TypeAdap(-1), _TypeRaff(0), _TypeDera(0), _Field(""), _TypeThR(0), _ThreshR(0), @@ -71,9 +71,9 @@ std::string HOMARD_Hypothesis::GetCaseCreation() const /*! */ //============================================================================= -void HOMARD_Hypothesis::SetName( const char* NomHypo ) +void HOMARD_Hypothesis::SetName( const char* Name ) { - _NomHypo = std::string( NomHypo ); + _Name = std::string( Name ); } //============================================================================= @@ -82,22 +82,22 @@ void HOMARD_Hypothesis::SetName( const char* NomHypo ) //============================================================================= std::string HOMARD_Hypothesis::GetName() const { - return _NomHypo; + return _Name; } //============================================================================= std::string HOMARD_Hypothesis::GetDumpPython() const { std::ostringstream aScript; - aScript << "\n# Creation of the hypothesis " << _NomHypo << "\n" ; - aScript << "\t" << _NomHypo << " = homard.CreateHypothesis(\"" << _NomHypo << "\")\n"; - aScript << "\t" << _NomHypo << ".SetAdapRefinUnRef(" << _TypeAdap << ", " << _TypeRaff << ", " << _TypeDera << ")\n"; + aScript << "\n# Creation of the hypothesis " << _Name << "\n" ; + aScript << "\t" << _Name << " = homard.CreateHypothesis(\"" << _Name << "\")\n"; + aScript << "\t" << _Name << ".SetAdapRefinUnRef(" << _TypeAdap << ", " << _TypeRaff << ", " << _TypeDera << ")\n"; // Raffinement selon des zones geometriques std::list::const_iterator it = _ListZone.begin(); int TypeUse ; while(it != _ListZone.end()) { - aScript << "\thomard.AssociateHypoZone(\""<< _NomHypo << "\", \"" << *it; + aScript << "\t" << _Name << ".AddZone(\"" << *it; it++; if ( *it == "1" ) { TypeUse = 1 ; } else { TypeUse = -1 ; } @@ -108,55 +108,55 @@ std::string HOMARD_Hypothesis::GetDumpPython() const // Raffinement selon un champ if ( _TypeAdap == 1 ) { - aScript << "\t" << _NomHypo << ".SetField(\"" << _Field << "\")\n"; - aScript << "\t" << _NomHypo << ".SetUseField(" << _UsField << ")\n"; - aScript << "\t" << _NomHypo << ".SetUseComp(" << _UsCmpI << ")\n"; + aScript << "\t" << _Name << ".SetField(\"" << _Field << "\")\n"; + aScript << "\t" << _Name << ".SetUseField(" << _UsField << ")\n"; + aScript << "\t" << _Name << ".SetUseComp(" << _UsCmpI << ")\n"; std::list::const_iterator it_comp = _ListComposant.begin(); while(it_comp != _ListComposant.end()) { - aScript << "\t" << _NomHypo << ".AddComp(\"" << *it_comp << "\")\n"; + aScript << "\t" << _Name << ".AddComp(\"" << *it_comp << "\")\n"; it_comp++; } if ( _TypeRaff == 1 ) { - aScript << "\t" << _NomHypo << ".SetRefinThr(" << _TypeThR << ", " << _ThreshR << ")\n"; + aScript << "\t" << _Name << ".SetRefinThr(" << _TypeThR << ", " << _ThreshR << ")\n"; } if ( _TypeDera == 1 ) { - aScript << "\t" << _NomHypo << ".SetUnRefThr(" << _TypeThC << ", " << _ThreshC << ")\n"; + aScript << "\t" << _Name << ".SetUnRefThr(" << _TypeThC << ", " << _ThreshC << ")\n"; } } // Filtrage du raffinement par des groupes for ( it=_ListGroupSelected.begin(); it!=_ListGroupSelected.end();it++) - aScript << "\t" << _NomHypo << ".AddGroup(\"" << (*it) << "\")\n" ; + aScript << "\t" << _Name << ".AddGroup(\"" << (*it) << "\")\n" ; // Interpolation champ - aScript << "\t" << _NomHypo << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n"; + aScript << "\t" << _Name << ".SetTypeFieldInterp(" << _TypeFieldInterp << ")\n"; if ( _TypeFieldInterp == 2 ) { std::list::const_iterator it_champ = _ListFieldInterp.begin(); while(it_champ != _ListFieldInterp.end()) { - aScript << "\t" << _NomHypo << ".AddFieldInterp(\"" << *it_champ << "\")\n"; + aScript << "\t" << _Name << ".AddFieldInterp(\"" << *it_champ << "\")\n"; it_champ++; } } if ( _NivMax > 0 ) { - aScript << "\t" <<_NomHypo << ".SetNivMax(" << _NivMax << ")\n"; + aScript << "\t" <<_Name << ".SetNivMax(" << _NivMax << ")\n"; } if ( _DiamMin > 0 ) { - aScript << "\t" <<_NomHypo << ".SetDiamMin(" << _DiamMin << ")\n"; + aScript << "\t" <<_Name << ".SetDiamMin(" << _DiamMin << ")\n"; } if ( _AdapInit != 0 ) { - aScript << "\t" <<_NomHypo << ".SetAdapInit(" << _AdapInit << ")\n"; + aScript << "\t" <<_Name << ".SetAdapInit(" << _AdapInit << ")\n"; } if ( _LevelOutput != 0 ) { - aScript << "\t" <<_NomHypo << ".SetLevelOutput(" << _LevelOutput << ")\n"; + aScript << "\t" <<_Name << ".SetLevelOutput(" << _LevelOutput << ")\n"; } return aScript.str(); diff --git a/src/HOMARD/HOMARD_Hypothesis.hxx b/src/HOMARD/HOMARD_Hypothesis.hxx index 22cc1ce2..fef6a2d4 100644 --- a/src/HOMARD/HOMARD_Hypothesis.hxx +++ b/src/HOMARD/HOMARD_Hypothesis.hxx @@ -34,7 +34,7 @@ public: HOMARD_Hypothesis(); ~HOMARD_Hypothesis(); - void SetName( const char* NomHypo ); + void SetName( const char* Name ); std::string GetName() const; void SetCaseCreation( const char* NomCasCreation ); std::string GetCaseCreation() const; @@ -94,7 +94,7 @@ public: private: - std::string _NomHypo; + std::string _Name; std::string _NomCasCreation; int _TypeAdap; // -1 pour une adapation Uniforme, diff --git a/src/HOMARD/HOMARD_Iteration.cxx b/src/HOMARD/HOMARD_Iteration.cxx index 3c0cd552..2633b4b1 100644 --- a/src/HOMARD/HOMARD_Iteration.cxx +++ b/src/HOMARD/HOMARD_Iteration.cxx @@ -31,7 +31,7 @@ */ //============================================================================= HOMARD_Iteration::HOMARD_Iteration(): - _NomIter( "" ), _Etat( false ), + _Name( "" ), _Etat( false ), _NumIter( -1 ), _NomMesh( "" ), _MeshFile( "" ), _FieldFile( "" ), _TimeStep( -1 ), _Rank( -1 ), @@ -56,9 +56,9 @@ HOMARD_Iteration::~HOMARD_Iteration() /*! */ //============================================================================= -void HOMARD_Iteration::SetName( const char* NomIter ) +void HOMARD_Iteration::SetName( const char* Name ) { - _NomIter = std::string( NomIter ); + _Name = std::string( Name ); } //============================================================================= @@ -67,7 +67,7 @@ void HOMARD_Iteration::SetName( const char* NomIter ) //============================================================================= std::string HOMARD_Iteration::GetName() const { - return _NomIter; + return _Name; } //============================================================================= @@ -78,39 +78,42 @@ std::string HOMARD_Iteration::GetDumpPython() const { if (_IterParent == "") return std::string(" ") ; // Pas de creation explicite de iteration 0"; + MESSAGE (". Ecriture de l iteration " << _Name ); std::ostringstream aScript; - aScript << "\n# Creation of the iteration " << _NomIter << "\n"; + aScript << "\n# Creation of the iteration " << _Name << "\n"; if( _NumIter == 1 ) { - aScript << "\t" << _NomIter << " = homard.CreateIteration(\""; - aScript << _NomIter << "\", "<< _NomCas << ".GetIter0Name() )\n"; + aScript << "\t" << _Name << " = " << _NomCas << ".NextIteration(\"" << _Name << "\")\n"; } else { - aScript << "\t" << _NomIter << " = homard.CreateIteration(\""; - aScript << _NomIter << "\", \"" << _IterParent << "\")\n"; + aScript << "\t" << _Name << " = " << _IterParent << ".NextIteration(\"" << _Name << "\")\n"; } // Le nom du maillage produit - aScript << "\t" << _NomIter << ".SetMeshName(\"" << _NomMesh << "\")\n" ; +// MESSAGE (".. maillage produit " << _NomMesh ); + aScript << "\t" << _Name << ".SetMeshName(\"" << _NomMesh << "\")\n" ; // Le fichier du maillage produit - aScript << "\t" << _NomIter << ".SetMeshFile(\"" << _MeshFile << "\")\n"; + aScript << "\t" << _Name << ".SetMeshFile(\"" << _MeshFile << "\")\n"; // Le fichier des champs, avec l'instant eventuel if ( _FieldFile != "" ) { - aScript << "\t" << _NomIter << ".SetFieldFile(\"" << _FieldFile << "\")\n"; + aScript << "\t" << _Name << ".SetFieldFile(\"" << _FieldFile << "\")\n"; if ( ( _TimeStep != -1 ) and ( _Rank != -1 ) ) { - aScript << "\t" << _NomIter << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; + aScript << "\t" << _Name << ".SetTimeStepRank( " << _TimeStep << ", " << _Rank << " )\n"; } } - aScript << "\thomard.AssociateIterHypo(\"" <<_NomIter << "\", \"" << _NomHypo << "\")\n"; +// MESSAGE (".. Hypothese " << _NomHypo ); + aScript << "\t" << _Name << ".AssociateHypo(\"" << _NomHypo << "\")\n"; + if (_Etat == true) { - aScript << "\tcodret = " <<_NomIter << ".Compute(1)\n"; + aScript << "\tcodret = " <<_Name << ".Compute(1)\n"; } else { - aScript << "\t#codret = " <<_NomIter << ".Compute(1)\n"; + aScript << "\t#codret = " <<_Name << ".Compute(1)\n"; } +// MESSAGE (". Fin de l ecriture de l iteration " << _Name ); return aScript.str(); } @@ -172,7 +175,7 @@ std::string HOMARD_Iteration::GetMeshName() const /*! */ //============================================================================= -void HOMARD_Iteration::SetIterParent( const char* IterParent ) +void HOMARD_Iteration::SetIterParentName( const char* IterParent ) { _IterParent = IterParent; } @@ -181,7 +184,7 @@ void HOMARD_Iteration::SetIterParent( const char* IterParent ) /*! */ //============================================================================= -std::string HOMARD_Iteration::GetIterParent() const +std::string HOMARD_Iteration::GetIterParentName() const { return _IterParent; } @@ -213,6 +216,7 @@ void HOMARD_Iteration::SupprIterations() _mesIterFilles.clear(); } + //============================================================================= /*! */ diff --git a/src/HOMARD/HOMARD_Iteration.hxx b/src/HOMARD/HOMARD_Iteration.hxx index 8e579371..a8521263 100644 --- a/src/HOMARD/HOMARD_Iteration.hxx +++ b/src/HOMARD/HOMARD_Iteration.hxx @@ -34,7 +34,7 @@ public: HOMARD_Iteration(); ~HOMARD_Iteration(); - void SetName( const char* NomIter ); + void SetName( const char* Name ); std::string GetName() const; std::string GetDumpPython() const; @@ -56,8 +56,8 @@ public: int GetTimeStep() const; int GetRank() const; - void SetIterParent( const char* iterParent ); - std::string GetIterParent() const; + void SetIterParentName( const char* iterParent ); + std::string GetIterParentName() const; void AddIteration( const char* iter ); const std::list& GetIterations() const; @@ -76,7 +76,7 @@ public: std::string GetMessFile() const; private: - std::string _NomIter; + std::string _Name; bool _Etat; int _NumIter; std::string _NomMesh; diff --git a/src/HOMARD/HOMARD_Zone.cxx b/src/HOMARD/HOMARD_Zone.cxx index 0b23732d..6e8473be 100644 --- a/src/HOMARD/HOMARD_Zone.cxx +++ b/src/HOMARD/HOMARD_Zone.cxx @@ -31,7 +31,7 @@ */ //============================================================================= HOMARD_Zone::HOMARD_Zone(): - _NomZone( "" ),_ZoneType( 2 ), + _Name( "" ),_Type( 2 ), _Xmin( 0 ), _Xmax( 0 ), _Ymin( 0 ), _Ymax( 0 ), _Zmin( 0 ), _Zmax( 0 ), _Xcentre( 0 ), _Ycentre( 0 ), _Zcentre( 0 ), _Rayon( 0 ), _Xaxe( 0 ), _Yaxe( 0 ), _Zaxe( 0 ), _Haut( 0 ), @@ -47,90 +47,90 @@ HOMARD_Zone::~HOMARD_Zone() } //============================================================================= -void HOMARD_Zone::SetName( const char* NomZone ) +void HOMARD_Zone::SetName( const char* Name ) { - _NomZone = std::string( NomZone ) ; + _Name = std::string( Name ) ; } //============================================================================= std::string HOMARD_Zone::GetName() const { - return _NomZone; + return _Name; } //============================================================================= std::string HOMARD_Zone::GetDumpPython() const { -// MESSAGE("GetDumpPython avec _ZoneType " << _ZoneType) ; -// MESSAGE("GetDumpPython avec _NomZone " << _NomZone) ; +// MESSAGE("GetDumpPython avec _Type " << _Type) ; +// MESSAGE("GetDumpPython avec _Name " << _Name) ; std::ostringstream aScript; aScript << "\n# Creation of the "; - if ( _ZoneType >= 11 and _ZoneType <= 13 ) { aScript << "rectangle " ; } - else if ( _ZoneType == 2 ) { aScript << "box " ;} - else if ( _ZoneType >= 31 and _ZoneType <= 33 ) { aScript << "disk " ;} - else if ( _ZoneType == 4 ) { aScript << "sphere " ; } - else if ( _ZoneType == 5 ) { aScript << "cylinder " ; } - else if ( _ZoneType >= 61 and _ZoneType <= 63 ) { aScript << "disk with hole " ;} - else if ( _ZoneType == 7 ) { aScript << "pipe " ; } - aScript << _NomZone << "\n" ; + if ( _Type >= 11 and _Type <= 13 ) { aScript << "rectangle " ; } + else if ( _Type == 2 ) { aScript << "box " ;} + else if ( _Type >= 31 and _Type <= 33 ) { aScript << "disk " ;} + else if ( _Type == 4 ) { aScript << "sphere " ; } + else if ( _Type == 5 ) { aScript << "cylinder " ; } + else if ( _Type >= 61 and _Type <= 63 ) { aScript << "disk with hole " ;} + else if ( _Type == 7 ) { aScript << "pipe " ; } + aScript << _Name << "\n" ; // - aScript << "\t" << _NomZone << " = homard.CreateZone" ; + aScript << "\t" << _Name << " = homard.CreateZone" ; // - switch (_ZoneType) + switch (_Type) { case 11: - { aScript << "Box2D( \"" << _NomZone << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", 1 )\n"; + { aScript << "Box2D( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", 1 )\n"; break ; } case 12: - { aScript << "Box2D( \"" << _NomZone << "\", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ", 2 )\n"; + { aScript << "Box2D( \"" << _Name << "\", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ", 2 )\n"; break ; } case 13: - { aScript << "Box2D( \"" << _NomZone << "\", " << _Zmin << ", " << _Zmax << ", " << _Xmin << ", " << _Xmax << ", 3 )\n"; + { aScript << "Box2D( \"" << _Name << "\", " << _Zmin << ", " << _Zmax << ", " << _Xmin << ", " << _Xmax << ", 3 )\n"; break ; } case 2: - { aScript << "Box( \"" << _NomZone << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ")\n"; + { aScript << "Box( \"" << _Name << "\", " << _Xmin << ", " << _Xmax << ", " << _Ymin << ", " << _Ymax << ", " << _Zmin << ", " << _Zmax << ")\n"; break ; } case 4: - { aScript << "Sphere( \"" << _NomZone << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ")\n"; + { aScript << "Sphere( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ")\n"; break ; } case 31: - { aScript << "Disk( \"" << _NomZone << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", 1 )\n"; + { aScript << "Disk( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", 1 )\n"; break ; } case 32: - { aScript << "Disk( \"" << _NomZone << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", 2 )\n"; + { aScript << "Disk( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", 2 )\n"; break ; } case 33: - { aScript << "Disk( \"" << _NomZone << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", 3 )\n"; + { aScript << "Disk( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", 3 )\n"; break ; } case 5: - { aScript << "Cylinder( \"" << _NomZone << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ")\n"; + { aScript << "Cylinder( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ")\n"; break ; } case 61: - { aScript << "DiskWithHole( \"" << _NomZone << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", " << _Rayonint << ", 1 )\n"; + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Rayon << ", " << _Rayonint << ", 1 )\n"; break ; } case 62: - { aScript << "DiskWithHole( \"" << _NomZone << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", " << _Rayonint << ", 2 )\n"; + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Ycentre << ", " << _Zcentre << ", " << _Rayon << ", " << _Rayonint << ", 2 )\n"; break ; } case 63: - { aScript << "DiskWithHole( \"" << _NomZone << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", " << _Rayonint << ", 3 )\n"; + { aScript << "DiskWithHole( \"" << _Name << "\", " << _Zcentre << ", " << _Xcentre << ", " << _Rayon << ", " << _Rayonint << ", 3 )\n"; break ; } case 7: - { aScript << "Pipe( \"" << _NomZone << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ", " << _Rayonint << ")\n"; + { aScript << "Pipe( \"" << _Name << "\", " << _Xcentre << ", " << _Ycentre << ", " << _Zcentre << ", " << _Xaxe << ", " << _Yaxe << ", " << _Zaxe << ", " << _Rayon << ", " << _Haut << ", " << _Rayonint << ")\n"; break ; } } @@ -139,15 +139,15 @@ std::string HOMARD_Zone::GetDumpPython() const } //============================================================================= -void HOMARD_Zone::SetZoneType( int ZoneType ) +void HOMARD_Zone::SetType( int Type ) { - _ZoneType = ZoneType; + _Type = Type; } //============================================================================= -int HOMARD_Zone::GetZoneType() const +int HOMARD_Zone::GetType() const { - return _ZoneType; + return _Type; } //====================================================================== @@ -215,7 +215,7 @@ std::vector HOMARD_Zone::GetCoords() const { std::vector mesCoor; // - switch (_ZoneType) + switch (_Type) { // Rectangle ou parallelepipede case 11: @@ -282,7 +282,7 @@ std::vector HOMARD_Zone::GetCoords() const mesCoor.push_back( _Rayonint ) ; break ; } - ASSERT ( _ZoneType == -1 ) ; + ASSERT ( _Type == -1 ) ; } return mesCoor; } diff --git a/src/HOMARD/HOMARD_Zone.hxx b/src/HOMARD/HOMARD_Zone.hxx index e8906bb2..d38492c9 100644 --- a/src/HOMARD/HOMARD_Zone.hxx +++ b/src/HOMARD/HOMARD_Zone.hxx @@ -35,7 +35,7 @@ public: HOMARD_Zone(); ~HOMARD_Zone(); - void SetName( const char* NomZone ); + void SetName( const char* Name ); std::string GetName() const; std::string GetDumpPython() const; @@ -53,8 +53,8 @@ public: void SetLimit( double X0, double X1, double X2 ); std::vector GetLimit() const; - void SetZoneType( int ZoneType ); - int GetZoneType() const; + void SetType( int Type ); + int GetType() const; void AddHypo( const char* NomHypo ); void SupprHypo( const char* NomHypo ); @@ -62,8 +62,8 @@ public: void SupprHypos(); private: - std::string _NomZone; - int _ZoneType; + std::string _Name; + int _Type; std::list _ListHypo; double _Xmin, _Xmax, _Ymin, _Ymax, _Zmin, _Zmax; double _Xcentre, _Ycentre, _Zcentre, _Rayon, _Rayonint; diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.cxx b/src/HOMARDGUI/MonCreateBoundaryAn.cxx index 925e6978..fb3238f4 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryAn.cxx @@ -47,9 +47,9 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, bool modal, */ QDialog(0), Ui_CreateBoundaryAn(), _parent(parent), - _aBoundaryAnName (""), + _aName (""), _aCaseName(caseName), - _BoundaryType(1), + _Type(1), _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), @@ -87,9 +87,9 @@ MonCreateBoundaryAn::MonCreateBoundaryAn(MonCreateCase* parent, QDialog(0), Ui_CreateBoundaryAn(), _myHomardGen(myHomardGen), _parent(parent), - _aBoundaryAnName (""), + _aName (""), _aCaseName(caseName), - _BoundaryType(1), + _Type(1), _BoundaryAnXcentre(0), _BoundaryAnYcentre(0), _BoundaryAnZcentre(0), _BoundaryAnRayon(0), _BoundaryAnXaxis(0), _BoundaryAnYaxis(0), _BoundaryAnZaxis(0), // Pour affichage lors de l edition d une BoundaryAn sans nom de Cas @@ -136,7 +136,7 @@ void MonCreateBoundaryAn::InitValBoundaryAn() // if (_aCaseName == QString("")) { return; } - HOMARD::HOMARD_Cas_var aCas = _myHomardGen->GetCas(_aCaseName.toStdString().c_str()); + HOMARD::HOMARD_Cas_var aCas = _myHomardGen->GetCase(_aCaseName.toStdString().c_str()); HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox(); int num = MesExtremes->length() ; ASSERT(num == 10); @@ -193,7 +193,7 @@ bool MonCreateBoundaryAn::PushOnApply() return false; } - switch (_BoundaryType) + switch (_Type) { case 1 : // il s agit d un cylindre { @@ -250,25 +250,25 @@ bool MonCreateBoundaryAn:: CreateOrUpdateBoundaryAn() //---------------------------------------------------- // Creation de l'objet boundary { - if (_aBoundaryAnName != LEBoundaryName->text().trimmed()) + if (_aName != LEBoundaryName->text().trimmed()) { - _aBoundaryAnName = LEBoundaryName->text().trimmed(); - switch (_BoundaryType) + _aName = LEBoundaryName->text().trimmed(); + switch (_Type) { case 1 : // il s agit d un cylindre { - aBoundaryAn = _myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_aBoundaryAnName.toStdString().c_str()), \ + aBoundaryAn = _myHomardGen->CreateBoundaryCylinder(CORBA::string_dup(_aName.toStdString().c_str()), \ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis, _BoundaryAnRayon ); break; } case 2 : // il s agit d une sphere { - aBoundaryAn = _myHomardGen->CreateBoundarySphere(CORBA::string_dup(_aBoundaryAnName.toStdString().c_str()), \ + aBoundaryAn = _myHomardGen->CreateBoundarySphere(CORBA::string_dup(_aName.toStdString().c_str()), \ _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon); break; } } - _parent->addBoundaryAn(_aBoundaryAnName); + _parent->addBoundaryAn(_aName); } // Mise en place des attributs aBoundaryAn->SetLimit(_Xincr, _Yincr, _Zincr); @@ -295,7 +295,7 @@ void MonCreateBoundaryAn::SetNewBoundaryAnName() { // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeBoundarys_var MyBoundaryAns = _myHomardGen->GetAllBoundarys(); + HOMARD::listeBoundarys_var MyBoundaryAns = _myHomardGen->GetAllBoundarysName(); int num = 0; QString aBoundaryAnName=""; while (aBoundaryAnName=="" ) { @@ -322,7 +322,7 @@ void MonCreateBoundaryAn::SetCylinder() gBCylindre->setVisible(1); gBSphere->setVisible(0); adjustSize(); - _BoundaryType=1; + _Type=1; SpinBox_Xcent->setValue(_Xcentre); SpinBox_Xaxis->setValue(0.); SpinBox_Ycent->setValue(_Ycentre); @@ -340,7 +340,7 @@ void MonCreateBoundaryAn::SetSphere() gBCylindre->setVisible(0); gBSphere->setVisible(1); adjustSize(); - _BoundaryType=2; + _Type=2; SpinBox_Xcentre->setValue(_Xcentre); SpinBox_Ycentre->setValue(_Ycentre); SpinBox_Zcentre->setValue(_Zcentre); diff --git a/src/HOMARDGUI/MonCreateBoundaryAn.h b/src/HOMARDGUI/MonCreateBoundaryAn.h index 7c0c22b8..f9c9f22d 100644 --- a/src/HOMARDGUI/MonCreateBoundaryAn.h +++ b/src/HOMARDGUI/MonCreateBoundaryAn.h @@ -49,10 +49,10 @@ protected : MonCreateCase * _parent; - QString _aBoundaryAnName; + QString _aName; QString _aCaseName; - int _BoundaryType; + int _Type; double _BoundaryAnXcentre, _BoundaryAnYcentre, _BoundaryAnZcentre, _BoundaryAnRayon; double _BoundaryAnXaxis, _BoundaryAnYaxis, _BoundaryAnZaxis; double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr, _DMax ; diff --git a/src/HOMARDGUI/MonCreateBoundaryDi.cxx b/src/HOMARDGUI/MonCreateBoundaryDi.cxx index fde36eff..d969f210 100644 --- a/src/HOMARDGUI/MonCreateBoundaryDi.cxx +++ b/src/HOMARDGUI/MonCreateBoundaryDi.cxx @@ -160,7 +160,7 @@ void MonCreateBoundaryDi::SetNewBoundaryName() // -------------------------------------------------- { - HOMARD::listeBoundarys_var MyBoundarys = _myHomardGen->GetAllBoundarys(); + HOMARD::listeBoundarys_var MyBoundarys = _myHomardGen->GetAllBoundarysName(); int num = 0; QString aBoundaryName=""; while (aBoundaryName == QString("") ) { diff --git a/src/HOMARDGUI/MonCreateCase.cxx b/src/HOMARDGUI/MonCreateCase.cxx index 2aaa85a1..eb6f1504 100644 --- a/src/HOMARDGUI/MonCreateCase.cxx +++ b/src/HOMARDGUI/MonCreateCase.cxx @@ -117,12 +117,12 @@ void MonCreateCase::InitBoundarys() // Pour les frontieres discretes : la liste a saisir // Pour les frontieres analytiques : les colonnes de chaque frontiere HOMARD::HOMARD_Boundary_var myBoundary ; - HOMARD::listeBoundarys_var mesBoundarys = _myHomardGen->GetAllBoundarys(); + HOMARD::listeBoundarys_var mesBoundarys = _myHomardGen->GetAllBoundarysName(); // MESSAGE("Nombre de frontieres enregistrees : "<length()); for (int i=0; ilength(); i++) { myBoundary = _myHomardGen->GetBoundary(mesBoundarys[i]); - int type_obj = myBoundary->GetBoundaryType() ; + int type_obj = myBoundary->GetType() ; if ( type_obj==0 ) { CBBoundaryDi->addItem(QString(mesBoundarys[i])); } else { addBoundaryAn(QString(mesBoundarys[i])); } } @@ -227,7 +227,7 @@ bool MonCreateCase::PushOnApply() QString(CORBA::string_dup(S_ex.details.text)) ); try { - aCase = _myHomardGen->GetCas(_aCaseName.toStdString().c_str()); + aCase = _myHomardGen->GetCase(_aCaseName.toStdString().c_str()); string iter0 = aCase->GetIter0Name(); HOMARD::HOMARD_Iteration_var aIter = _myHomardGen->GetIteration(iter0.c_str()); QString aFileName = aIter->GetMeshFile(); @@ -307,7 +307,7 @@ void MonCreateCase::PushOnHelp() void MonCreateCase::SetNewCaseName() // ------------------------------ { - HOMARD::listeCases_var MyCases = _myHomardGen->GetAllCases(); + HOMARD::listeCases_var MyCases = _myHomardGen->GetAllCasesName(); int num = 0; QString aCaseName=""; while (aCaseName=="" ) { diff --git a/src/HOMARDGUI/MonCreateHypothesis.cxx b/src/HOMARDGUI/MonCreateHypothesis.cxx index 9e5673a8..ec15ee04 100644 --- a/src/HOMARDGUI/MonCreateHypothesis.cxx +++ b/src/HOMARDGUI/MonCreateHypothesis.cxx @@ -207,7 +207,7 @@ void MonCreateHypothesis::SetNewHypothesisName() // -------------------------------------------------- { - HOMARD::listeHypotheses_var MyHypos = _myHomardGen->GetAllHypotheses(); + HOMARD::listeHypotheses_var MyHypos = _myHomardGen->GetAllHypothesesName(); int num = 0;// QString aHypothesisName=""; while (aHypothesisName=="" ) @@ -328,7 +328,7 @@ void MonCreateHypothesis::GetAllZones() // Par defaut, aucune n'est selectionnee { MESSAGE("Debut de GetAllZones") ; - HOMARD::listeZones_var mesZones = _myHomardGen->GetAllZones(); + HOMARD::listeZones_var mesZones = _myHomardGen->GetAllZonesName(); int nbrow=TWZone->rowCount(); for ( int row=0; row< nbrow; row++) { @@ -700,7 +700,7 @@ void MonCreateHypothesis::AssocieLesZones() for ( int i=0 ; i< _aListeZone.count() ; i++ ) { if ( _aListeZone[i+1] == Raff ) { TypeUse = 1 ; } else { TypeUse = -1 ; } - _myHomardGen->AssociateHypoZone(_aHypothesisName.toStdString().c_str(), _aListeZone[i].toStdString().c_str(), TypeUse); + _aHypothesis->AddZone(_aListeZone[i].toStdString().c_str(), TypeUse); i += 1 ; } MESSAGE( "Fin de AssocieLesZones" ); diff --git a/src/HOMARDGUI/MonCreateIteration.cxx b/src/HOMARDGUI/MonCreateIteration.cxx index e71dc955..09df846a 100644 --- a/src/HOMARDGUI/MonCreateIteration.cxx +++ b/src/HOMARDGUI/MonCreateIteration.cxx @@ -88,7 +88,7 @@ void MonCreateIteration::InitConnect() void MonCreateIteration::GetHypotheses() // ------------------------------------------------------------------------ { - HOMARD::listeHypotheses_var mesHypotheses = _myHomardGen->GetAllHypotheses(); + HOMARD::listeHypotheses_var mesHypotheses = _myHomardGen->GetAllHypothesesName(); for (int i=0; ilength(); i++) { CBHypothese->addItem(QString(mesHypotheses[i])); @@ -222,7 +222,7 @@ void MonCreateIteration::SetNewIterationName() { // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeIterations_var myIters=_myHomardGen->GetAllIterations(); + HOMARD::listeIterations_var myIters=_myHomardGen->GetAllIterationsName(); int num = 0;// QString aIterationName=""; while (aIterationName=="" ) @@ -280,7 +280,8 @@ void MonCreateIteration::PushHypoNew() } if ( _CaseName == QString("")) { - _CaseName = _myHomardGen->GetCaseName(CORBA::string_dup(_IterParentName.toStdString().c_str())); + HOMARD::HOMARD_Iteration_var aIterParent = _myHomardGen->GetIteration(_IterParentName.toStdString().c_str()) ; + _CaseName = aIterParent->GetCaseName(); } QString aFieldFile=LEFieldFile->text().trimmed(); MonCreateHypothesis *HypoDlg = new MonCreateHypothesis(this,TRUE,HOMARD::HOMARD_Gen::_duplicate(_myHomardGen),QString(""),_CaseName, aFieldFile) ; diff --git a/src/HOMARDGUI/MonCreateListGroup.cxx b/src/HOMARDGUI/MonCreateListGroup.cxx index 53ee6629..f76bde9e 100644 --- a/src/HOMARDGUI/MonCreateListGroup.cxx +++ b/src/HOMARDGUI/MonCreateListGroup.cxx @@ -126,7 +126,7 @@ void MonCreateListGroup::InitGroupes() TWGroupe->removeRow(row); TWGroupe->setRowCount(0); if (_aCaseName == QString("")) { return; }; - HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCas(_aCaseName.toStdString().c_str()); + HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCase(_aCaseName.toStdString().c_str()); HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); for ( int i = 0; i < _listeGroupesCas->length(); i++ ) { diff --git a/src/HOMARDGUI/MonCreateZone.cxx b/src/HOMARDGUI/MonCreateZone.cxx index 86c71d9e..1445a8a0 100644 --- a/src/HOMARDGUI/MonCreateZone.cxx +++ b/src/HOMARDGUI/MonCreateZone.cxx @@ -50,7 +50,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, bool modal, _aZoneName (""), _aCaseName(caseName), _Orient(0), - _ZoneType(2), + _Type(2), _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), _Xmin(0), _Xmax(0), _Xincr(0), _Ymin(0), _Ymax(0), _Yincr(0), _Zmin(0), _Zmax(0), _Zincr(0), @@ -85,7 +85,7 @@ MonCreateZone::MonCreateZone(MonCreateHypothesis* parent, _aZoneName (""), _aCaseName(caseName), _Orient(0), - _ZoneType(2), + _Type(2), _Xcentre(0), _Ycentre(0), _Zcentre(0), _Rayon(0), _ZoneXcentre(0), _ZoneYcentre(0), _ZoneZcentre(0), _ZoneRayon(0), _ZoneXmin(0), _ZoneXmax(0), _ZoneYmin(0), _ZoneYmax(0), _ZoneZmin(0), _ZoneZmax(0), @@ -131,7 +131,7 @@ void MonCreateZone::InitValZone() // if (_aCaseName == QString("")) { return; } - HOMARD::HOMARD_Cas_var aCas = _myHomardGen->GetCas(_aCaseName.toStdString().c_str()) ; + HOMARD::HOMARD_Cas_var aCas = _myHomardGen->GetCase(_aCaseName.toStdString().c_str()) ; HOMARD::extrema_var MesExtremes = aCas->GetBoundingBox() ; int num = MesExtremes->length() ; ASSERT(num == 10) ; @@ -335,7 +335,7 @@ bool MonCreateZone::PushOnApply() return false; } - switch (_ZoneType) + switch (_Type) { case 11 : // il s agit d un rectangle { } @@ -438,7 +438,7 @@ bool MonCreateZone::PushOnApply() // Controles // Pour un rectangle ou un parallelepipede : - if ( ( _ZoneType >= 11 and _ZoneType <= 13 ) or _ZoneType == 2 ) + if ( ( _Type >= 11 and _Type <= 13 ) or _Type == 2 ) { if ((_ZoneXmin >= _ZoneXmax) and (_Xincr > 0)) { QMessageBox::critical( 0, QObject::tr("HOM_ERROR"), @@ -456,7 +456,7 @@ bool MonCreateZone::PushOnApply() return false; } } // L'axe pour un cylindre ou un tuyau : - if ( _ZoneType == 5 or _ZoneType == 7 ) + if ( _Type == 5 or _Type == 7 ) { double daux = _ZoneXaxis*_ZoneXaxis + _ZoneYaxis*_ZoneYaxis + _ZoneZaxis*_ZoneZaxis ; if ( daux < 0.0000001 ) @@ -467,7 +467,7 @@ bool MonCreateZone::PushOnApply() } } // Rayons pour disque avec trou ou un tuyau : - if ( ( _ZoneType >= 61 and _ZoneType <= 63 ) or _ZoneType == 7 ) + if ( ( _Type >= 61 and _Type <= 63 ) or _Type == 7 ) { if ( _ZoneRayonInt >= _ZoneRayon ) { @@ -485,11 +485,11 @@ bool MonCreateZone:: CreateOrUpdateZone() //---------------------------------------------------- // Creation de la zone { - MESSAGE("CreateOrUpdateZone _ZoneType ="<<_ZoneType); + MESSAGE("CreateOrUpdateZone _Type ="<<_Type); if (_aZoneName != LEZoneName->text().trimmed()) { _aZoneName = LEZoneName->text().trimmed() ; - switch (_ZoneType) + switch (_Type) { case 11 : // il s agit d un rectangle { aZone = _myHomardGen->CreateZoneBox2D(CORBA::string_dup(_aZoneName.toStdString().c_str()), \ @@ -584,7 +584,7 @@ void MonCreateZone::SetNewZoneName() { // Recherche d'un nom par defaut qui n'existe pas encore - HOMARD::listeZones_var MyZones = _myHomardGen->GetAllZones() ; + HOMARD::listeZones_var MyZones = _myHomardGen->GetAllZonesName() ; int num = 0; QString aZoneName=""; while (aZoneName=="" ) { @@ -612,18 +612,18 @@ void MonCreateZone::SetBox() gBCylindre->setVisible(0) ; gBPipe->setVisible(0) ; adjustSize() ; - _ZoneType=2; + _Type=2; // Sachant que l'increment est le 1/100eme de l'ecart (min/max), cela revient // a initialiser la boite sur une boite 'centrale' comprise entre 2/5 et 3/5 if ( _Xincr > 0 ) { SpinBox_Xmini->setValue(_Xcentre-10*_Xincr) ; SpinBox_Xmaxi->setValue(_Xcentre+10*_Xincr) ; } - else { _ZoneType=12 ; } + else { _Type=12 ; } if ( _Yincr > 0 ) { SpinBox_Ymini->setValue(_Ycentre-10*_Yincr) ; SpinBox_Ymaxi->setValue(_Ycentre+10*_Yincr) ; } - else { _ZoneType=13 ; } + else { _Type=13 ; } if ( _Zincr > 0 ) { SpinBox_Zmini->setValue(_Zcentre-10*_Zincr) ; SpinBox_Zmaxi->setValue(_Zcentre+10*_Zincr) ; } - else { _ZoneType=11 ; } + else { _Type=11 ; } } // ------------------------------------------------------------------------ void MonCreateZone::SetSphere() @@ -635,7 +635,7 @@ void MonCreateZone::SetSphere() gBCylindre->setVisible(0) ; gBPipe->setVisible(0) ; adjustSize() ; - _ZoneType=4; + _Type=4; SpinBox_Xcentre->setValue(_Xcentre) ; SpinBox_Ycentre->setValue(_Ycentre) ; SpinBox_Zcentre->setValue(_Zcentre) ; @@ -652,16 +652,16 @@ void MonCreateZone::SetCylinder() gBCylindre->setVisible(1) ; gBPipe->setVisible(0) ; adjustSize() ; - _ZoneType=5; + _Type=5; if ( _Xincr > 0 ) { SpinBox_Xbase->setValue(_Xcentre) ; SpinBox_Xaxis->setValue(0.) ; } - else { _ZoneType=32 ; } + else { _Type=32 ; } if ( _Yincr > 0 ) { SpinBox_Ybase->setValue(_Ycentre) ; SpinBox_Yaxis->setValue(0.) ; } - else { _ZoneType=33 ; } + else { _Type=33 ; } if ( _Zincr > 0 ) { SpinBox_Zbase->setValue(_Zcentre) ; SpinBox_Zaxis->setValue(1.) ; } - else { _ZoneType=31 ; } + else { _Type=31 ; } SpinBox_Radius->setValue(_Rayon) ; SpinBox_Haut->setValue(_Haut) ; MESSAGE("Fin de SetCylinder") @@ -676,16 +676,16 @@ void MonCreateZone::SetPipe() gBCylindre->setVisible(0) ; gBPipe->setVisible(1) ; adjustSize() ; - _ZoneType=7; + _Type=7; if ( _Xincr > 0 ) { SpinBox_Xbase_p->setValue(_Xcentre) ; SpinBox_Xaxis_p->setValue(0.) ; } - else { _ZoneType=62 ; } + else { _Type=62 ; } if ( _Yincr > 0 ) { SpinBox_Ybase_p->setValue(_Ycentre) ; SpinBox_Yaxis_p->setValue(0.) ; } - else { _ZoneType=63 ; } + else { _Type=63 ; } if ( _Zincr > 0 ) { SpinBox_Zbase_p->setValue(_Zcentre) ; SpinBox_Zaxis_p->setValue(1.) ; } - else { _ZoneType=61 ; } + else { _Type=61 ; } SpinBox_Radius_int->setValue(_RayonInt) ; SpinBox_Radius_ext->setValue(_Rayon) ; SpinBox_Haut_p->setValue(_Haut) ; diff --git a/src/HOMARDGUI/MonCreateZone.h b/src/HOMARDGUI/MonCreateZone.h index e1705be1..58fe3542 100644 --- a/src/HOMARDGUI/MonCreateZone.h +++ b/src/HOMARDGUI/MonCreateZone.h @@ -52,7 +52,7 @@ protected : QString _aCaseName; int _Orient; - int _ZoneType; + int _Type; double _Xcentre, _Ycentre, _Zcentre, _Rayon ; double _ZoneXcentre, _ZoneYcentre, _ZoneZcentre, _ZoneRayon ; double _Xmin, _Xmax, _Xincr, _Ymin, _Ymax, _Yincr, _Zmin, _Zmax, _Zincr ; diff --git a/src/HOMARDGUI/MonEditBoundaryAn.cxx b/src/HOMARDGUI/MonEditBoundaryAn.cxx index bf91e602..4703c6c8 100644 --- a/src/HOMARDGUI/MonEditBoundaryAn.cxx +++ b/src/HOMARDGUI/MonEditBoundaryAn.cxx @@ -29,17 +29,17 @@ using namespace std; // ------------------------------------------------------------------------ MonEditBoundaryAn::MonEditBoundaryAn( MonCreateCase* parent, bool modal, HOMARD::HOMARD_Gen_var myHomardGen, - QString caseName, QString zoneName ): + QString caseName, QString boundaryName ): // ------------------------------------------------------------------------ /* Constructs a MonEditBoundaryAn herite de MonCreateBoundaryAn */ MonCreateBoundaryAn(parent, myHomardGen, caseName) { - MESSAGE("Debut de MonEditBoundaryAn pour " << zoneName.toStdString().c_str()); + MESSAGE("Debut de MonEditBoundaryAn pour " << boundaryName.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_BOUN_A_EDIT_WINDOW_TITLE")); - _aBoundaryAnName=zoneName; - aBoundaryAn = _myHomardGen->GetBoundary(_aBoundaryAnName.toStdString().c_str()); + _aName=boundaryName; + aBoundaryAn = _myHomardGen->GetBoundary(_aName.toStdString().c_str()); InitValEdit(); } // ------------------------------------------------------------------------ @@ -52,13 +52,13 @@ MonEditBoundaryAn::~MonEditBoundaryAn() void MonEditBoundaryAn::InitValEdit() // ------------------------------------------------------------------------ { - LEBoundaryName->setText(_aBoundaryAnName); + LEBoundaryName->setText(_aName); LEBoundaryName->setReadOnly(true); - _BoundaryType = aBoundaryAn->GetBoundaryType(); - MESSAGE("_BoundaryType : "<<_BoundaryType); + _Type = aBoundaryAn->GetType(); + MESSAGE("_Type : "<<_Type); InitValBoundaryAnLimit(); if (_aCaseName != QString("")) InitValBoundaryAn(); - switch (_BoundaryType) + switch (_Type) { case 1 : // il s agit d un cylindre { @@ -117,7 +117,7 @@ void MonEditBoundaryAn::SetCylinder() gBSphere->setVisible(0); RBCylindre->setChecked(1); adjustSize(); - _BoundaryType=1; + _Type=1; RBSphere->setDisabled(true); adjustSize(); @@ -150,7 +150,7 @@ void MonEditBoundaryAn::SetSphere() RBSphere->setChecked(1); RBCylindre->setDisabled(true); adjustSize(); - _BoundaryType=2 ; + _Type=2 ; SpinBox_Xcentre->setValue(_BoundaryAnXcentre); if ( _Xincr > 0) { SpinBox_Xcentre->setSingleStep(_Xincr); } @@ -172,7 +172,7 @@ bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() //---------------------------------------------------- // Mise a jour des attributs de la BoundaryAn { - switch (_BoundaryType) + switch (_Type) { case 1 : // il s agit d un cylindre { @@ -185,7 +185,7 @@ bool MonEditBoundaryAn::CreateOrUpdateBoundaryAn() break; } } - if (Chgt) _myHomardGen->InvalideBoundary(_aBoundaryAnName.toStdString().c_str()); + if (Chgt) _myHomardGen->InvalideBoundary(_aName.toStdString().c_str()); HOMARD_UTILS::updateObjBrowser(); return true; } diff --git a/src/HOMARDGUI/MonEditBoundaryDi.cxx b/src/HOMARDGUI/MonEditBoundaryDi.cxx index 66b453e9..56fe257e 100644 --- a/src/HOMARDGUI/MonEditBoundaryDi.cxx +++ b/src/HOMARDGUI/MonEditBoundaryDi.cxx @@ -96,7 +96,7 @@ void MonEditBoundaryDi::SetFiltrage() QObject::tr("HOM_BOUN_CASE") ); return; } - HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCas(_aCaseName.toStdString().c_str()); + HOMARD::HOMARD_Cas_var monCas= _myHomardGen->GetCase(_aCaseName.toStdString().c_str()); HOMARD::ListGroupType_var _listeGroupesCas = monCas->GetGroups(); MonEditListGroup *aDlg = new MonEditListGroup(NULL,this, TRUE, HOMARD::HOMARD_Gen::_duplicate(_myHomardGen), diff --git a/src/HOMARDGUI/MonEditCase.cxx b/src/HOMARDGUI/MonEditCase.cxx index 0045f9be..dddba45d 100644 --- a/src/HOMARDGUI/MonEditCase.cxx +++ b/src/HOMARDGUI/MonEditCase.cxx @@ -40,7 +40,7 @@ MonEditCase::MonEditCase ( QWidget* parent, bool modal, MESSAGE("Debut de MonEditCase" << CaseName.toStdString().c_str()); setWindowTitle(QObject::tr("HOM_CASE_EDIT_WINDOW_TITLE")); _aCaseName = CaseName; - aCase = _myHomardGen->GetCas(_aCaseName.toStdString().c_str()); + aCase = _myHomardGen->GetCase(_aCaseName.toStdString().c_str()); InitValEdit(); } // ------------------------------ @@ -113,7 +113,7 @@ void MonEditCase::InitValEdit() MESSAGE("NomFron "<GetBoundary(NomFron.toStdString().c_str()); - int type_obj = myBoundary->GetBoundaryType() ; + int type_obj = myBoundary->GetType() ; // C'est une frontiere discrete // Rermarque : on ne gere pas les groupes if ( type_obj==0 ) diff --git a/src/HOMARDGUI/MonEditIteration.cxx b/src/HOMARDGUI/MonEditIteration.cxx index 6ea10add..1b57c583 100644 --- a/src/HOMARDGUI/MonEditIteration.cxx +++ b/src/HOMARDGUI/MonEditIteration.cxx @@ -94,7 +94,7 @@ void MonEditIteration::InitValEdit() LEIterationName->setReadOnly(true); // Affichage bloque du nom de l'iteration parent - _IterParentName = aIter->GetIterParent(); + _IterParentName = aIter->GetIterParentName(); LEIterationParentName->setText(_IterParentName); LEIterationParentName->setReadOnly(true); PBIterParent->setEnabled(false); diff --git a/src/HOMARDGUI/MonEditZone.cxx b/src/HOMARDGUI/MonEditZone.cxx index 6febcd14..9c80d5a9 100644 --- a/src/HOMARDGUI/MonEditZone.cxx +++ b/src/HOMARDGUI/MonEditZone.cxx @@ -60,11 +60,11 @@ void MonEditZone::InitValEdit() MESSAGE("InitValEdit "); LEZoneName->setText(_aZoneName); LEZoneName->setReadOnly(true); - _ZoneType = aZone->GetZoneType(); - MESSAGE("InitValEdit _ZoneType ="<<_ZoneType); + _Type = aZone->GetType(); + MESSAGE("InitValEdit _Type ="<<_Type); InitValZoneLimit(); if (_aCaseName != QString("")) InitValZone(); - switch (_ZoneType) + switch (_Type) { case 11 : // il s agit d un rectangle { } @@ -189,7 +189,7 @@ void MonEditZone::SetBox() adjustSize(); RBCylinder->setDisabled(true); RBPipe->setDisabled(true); - if ( _ZoneType == 2 ) { RBSphere->setDisabled(true); } + if ( _Type == 2 ) { RBSphere->setDisabled(true); } else { RBSphere->setVisible(0); RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0, QApplication::UnicodeUTF8)); RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0, QApplication::UnicodeUTF8)); @@ -219,11 +219,11 @@ void MonEditZone::SetBox() SpinBox_Zmini->setSingleStep(incr); SpinBox_Zmaxi->setSingleStep(incr); - if ( _ZoneType == 12 ) { SpinBox_Xmini->setDisabled(true) ; + if ( _Type == 12 ) { SpinBox_Xmini->setDisabled(true) ; SpinBox_Xmaxi->setDisabled(true) ; } - else if ( _ZoneType == 13 ) { SpinBox_Ymini->setDisabled(true) ; + else if ( _Type == 13 ) { SpinBox_Ymini->setDisabled(true) ; SpinBox_Ymaxi->setDisabled(true) ; } - else if ( _ZoneType == 11 ) { SpinBox_Zmini->setDisabled(true) ; + else if ( _Type == 11 ) { SpinBox_Zmini->setDisabled(true) ; SpinBox_Zmaxi->setDisabled(true) ; } } @@ -268,7 +268,7 @@ void MonEditZone::SetCylinder() RBCylinder->setChecked(1); RBBox->setDisabled(true); RBPipe->setDisabled(true); - if ( _ZoneType == 5 ) { RBSphere->setDisabled(true); } + if ( _Type == 5 ) { RBSphere->setDisabled(true); } else { RBSphere->setVisible(0); RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0, QApplication::UnicodeUTF8)); RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0, QApplication::UnicodeUTF8)); @@ -296,7 +296,7 @@ void MonEditZone::SetCylinder() SpinBox_Radius->setMinimum(0.); SpinBox_Radius->setValue(_ZoneRayon); - if ( _ZoneType == 5 ) + if ( _Type == 5 ) { SpinBox_Xaxis->setValue(_ZoneXaxis) ; SpinBox_Yaxis->setValue(_ZoneYaxis) ; SpinBox_Zaxis->setValue(_ZoneZaxis) ; @@ -311,9 +311,9 @@ void MonEditZone::SetCylinder() TLYaxis->setVisible(0) ; TLZaxis->setVisible(0) ; TLHaut->setVisible(0) ; - if ( _ZoneType == 32 ) { SpinBox_Xbase->setDisabled(true) ; } - else if ( _ZoneType == 33 ) { SpinBox_Ybase->setDisabled(true) ; } - else if ( _ZoneType == 31 ) { SpinBox_Zbase->setDisabled(true) ; } + if ( _Type == 32 ) { SpinBox_Xbase->setDisabled(true) ; } + else if ( _Type == 33 ) { SpinBox_Ybase->setDisabled(true) ; } + else if ( _Type == 31 ) { SpinBox_Zbase->setDisabled(true) ; } } } // ------------------------------------------------------------------------ @@ -328,7 +328,7 @@ void MonEditZone::SetPipe() RBPipe->setChecked(1); RBBox->setDisabled(true); RBCylinder->setDisabled(true); - if ( _ZoneType == 7 ) { RBSphere->setDisabled(true); } + if ( _Type == 7 ) { RBSphere->setDisabled(true); } else { RBSphere->setVisible(0); RBPipe->setText(QApplication::translate("CreateZone", "Disk with hole", 0, QApplication::UnicodeUTF8)); RBCylinder->setText(QApplication::translate("CreateZone", "Disk", 0, QApplication::UnicodeUTF8)); @@ -358,7 +358,7 @@ void MonEditZone::SetPipe() SpinBox_Radius_ext->setMinimum(0.); SpinBox_Radius_ext->setValue(_ZoneRayon); - if ( _ZoneType == 7 ) + if ( _Type == 7 ) { SpinBox_Xaxis_p->setValue(_ZoneXaxis) ; SpinBox_Yaxis_p->setValue(_ZoneYaxis) ; SpinBox_Zaxis_p->setValue(_ZoneZaxis) ; @@ -373,9 +373,9 @@ void MonEditZone::SetPipe() TLYaxis_p->setVisible(0) ; TLZaxis_p->setVisible(0) ; TLHaut_p->setVisible(0) ; - if ( _ZoneType == 62 ) { SpinBox_Xbase_p->setDisabled(true) ; } - else if ( _ZoneType == 63 ) { SpinBox_Ybase_p->setDisabled(true) ; } - else if ( _ZoneType == 61 ) { SpinBox_Zbase_p->setDisabled(true) ; } + if ( _Type == 62 ) { SpinBox_Xbase_p->setDisabled(true) ; } + else if ( _Type == 63 ) { SpinBox_Ybase_p->setDisabled(true) ; } + else if ( _Type == 61 ) { SpinBox_Zbase_p->setDisabled(true) ; } } } @@ -388,7 +388,7 @@ bool MonEditZone::CreateOrUpdateZone() { try { - switch (_ZoneType) + switch (_Type) { case 11 : // il s agit d un rectangle { } diff --git a/src/HOMARD_I/HOMARD_Boundary_i.cxx b/src/HOMARD_I/HOMARD_Boundary_i.cxx index c483fe57..e57b7e79 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.cxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.cxx @@ -63,10 +63,10 @@ HOMARD_Boundary_i::~HOMARD_Boundary_i() /*! */ //============================================================================= -void HOMARD_Boundary_i::SetName( const char* NomBoundary ) +void HOMARD_Boundary_i::SetName( const char* Name ) { ASSERT( myHomardBoundary ); - myHomardBoundary->SetName( NomBoundary ); + myHomardBoundary->SetName( Name ); } //============================================================================= @@ -85,17 +85,17 @@ char* HOMARD_Boundary_i::GetDumpPython() //============================================================================= -void HOMARD_Boundary_i::SetBoundaryType( CORBA::Long BoundaryType ) +void HOMARD_Boundary_i::SetType( CORBA::Long Type ) { ASSERT( myHomardBoundary ); - myHomardBoundary->SetBoundaryType( BoundaryType ); + myHomardBoundary->SetType( Type ); } //============================================================================= -CORBA::Long HOMARD_Boundary_i::GetBoundaryType() +CORBA::Long HOMARD_Boundary_i::GetType() { ASSERT( myHomardBoundary ); - return CORBA::Long( myHomardBoundary->GetBoundaryType() ); + return CORBA::Long( myHomardBoundary->GetType() ); } //============================================================================= diff --git a/src/HOMARD_I/HOMARD_Boundary_i.hxx b/src/HOMARD_I/HOMARD_Boundary_i.hxx index c048c9f4..6c6caf81 100644 --- a/src/HOMARD_I/HOMARD_Boundary_i.hxx +++ b/src/HOMARD_I/HOMARD_Boundary_i.hxx @@ -43,13 +43,13 @@ public: virtual ~HOMARD_Boundary_i(); - void SetName( const char* NomBoundary ); + void SetName( const char* Name ); char* GetName(); char* GetDumpPython(); - void SetBoundaryType( CORBA::Long BoundaryType ); + void SetType( CORBA::Long Type ); - CORBA::Long GetBoundaryType(); + CORBA::Long GetType(); void SetMeshFile( const char* MeshFile ); char* GetMeshFile(); diff --git a/src/HOMARD_I/HOMARD_Cas_i.cxx b/src/HOMARD_I/HOMARD_Cas_i.cxx index 7d75ff30..d95893f9 100755 --- a/src/HOMARD_I/HOMARD_Cas_i.cxx +++ b/src/HOMARD_I/HOMARD_Cas_i.cxx @@ -74,10 +74,10 @@ void HOMARD_Cas_i::SetDirName( const char* NomDir ) /*! */ //============================================================================= -void HOMARD_Cas_i::SetName( const char* NomCas ) +void HOMARD_Cas_i::SetName( const char* Name ) { ASSERT( myHomardCas ); - myHomardCas->SetName( NomCas ); + myHomardCas->SetName( Name ); } //============================================================================= @@ -128,17 +128,39 @@ CORBA::Long HOMARD_Cas_i::GetConfType() } //============================================================================= -void HOMARD_Cas_i::AddIteration( const char* NomIteration ) +char* HOMARD_Cas_i::GetIter0Name() { ASSERT( myHomardCas ); - myHomardCas->AddIteration( NomIteration ); + return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); +} +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::GetIter0() +{ +// Nom de l'iteration parent + char* Iter0Name = GetIter0Name() ; + MESSAGE ( "GetIter0 : Iter0Name = " << Iter0Name ); +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte + return _gen_i->GetIteration(Iter0Name) ; } //============================================================================= -char* HOMARD_Cas_i::GetIter0Name() +HOMARD::HOMARD_Iteration_ptr HOMARD_Cas_i::NextIteration( const char* IterName ) +{ +// Nom de l'iteration parent + char* NomIterParent = GetIter0Name() ; + MESSAGE ( "NextIteration : IterName = " << IterName ); + MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte + return _gen_i->CreateIteration(IterName, NomIterParent) ; +} + +//============================================================================= +void HOMARD_Cas_i::AddIteration( const char* NomIteration ) { ASSERT( myHomardCas ); - return CORBA::string_dup( myHomardCas->GetIter0Name().c_str() ); + myHomardCas->AddIteration( NomIteration ); } //============================================================================= HOMARD::extrema* HOMARD_Cas_i::GetBoundingBox() diff --git a/src/HOMARD_I/HOMARD_Cas_i.hxx b/src/HOMARD_I/HOMARD_Cas_i.hxx index 3c7a2007..8e37f6e4 100644 --- a/src/HOMARD_I/HOMARD_Cas_i.hxx +++ b/src/HOMARD_I/HOMARD_Cas_i.hxx @@ -46,14 +46,18 @@ public: void SetDirName( const char* NomDir ); char* GetDirName(); - void SetName( const char* NomCas ); + void SetName( const char* Name ); char* GetName(); void SetConfType( CORBA::Long ConfType ); CORBA::Long GetConfType(); - void AddIteration( const char* NomIteration ); char* GetIter0Name(); + HOMARD::HOMARD_Iteration_ptr GetIter0() ; + + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + + void AddIteration( const char* NomIteration ); HOMARD::extrema* GetBoundingBox(); void SetBoundingBox( const HOMARD::extrema& LesExtremes ); diff --git a/src/HOMARD_I/HOMARD_Gen_i.cxx b/src/HOMARD_I/HOMARD_Gen_i.cxx index da4aa8b4..df0e1679 100755 --- a/src/HOMARD_I/HOMARD_Gen_i.cxx +++ b/src/HOMARD_I/HOMARD_Gen_i.cxx @@ -397,33 +397,6 @@ void HOMARD_Gen_i::InvalideIter(const char* nomIter) DeleteResultInSmesh(nomFichier, MeshName) ; } // -//===================================================================================== -void HOMARD_Gen_i::AssociateHypoZone(const char* nomHypothesis, const char* ZoneName, CORBA::Long TypeUse) -{ - MESSAGE ( "AssociateHypoZone : nomHypo = " << nomHypothesis << ", ZoneName= " << ZoneName << ", TypeUse = " << TypeUse); - IsValidStudy () ; - - HOMARD::HOMARD_Hypothesis_var myHypo = myContextMap[GetCurrentStudyID()]._mesHypotheses[nomHypothesis]; - ASSERT(!CORBA::is_nil(myHypo)); - SALOMEDS::SObject_var aHypoSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myHypo))); - ASSERT(!CORBA::is_nil(aHypoSO)); - - HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; - ASSERT(!CORBA::is_nil(myZone)); - SALOMEDS::SObject_var aZoneSO = SALOMEDS::SObject::_narrow(myCurrentStudy->FindObjectIOR(_orb->object_to_string(myZone))); - ASSERT(!CORBA::is_nil(aZoneSO)); - SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); - aStudyBuilder->NewCommand(); - - SALOMEDS::SObject_var aSubSO = aStudyBuilder->NewObject(aHypoSO); - aStudyBuilder->Addreference(aSubSO, aZoneSO); - aStudyBuilder->CommitCommand(); - - myZone->AddHypo(nomHypothesis); - myHypo->AddZone(ZoneName, TypeUse); - MESSAGE ( "Fin de AssociateHypoZone"); -}; - //===================================================================================== void HOMARD_Gen_i::DissociateHypoZone(const char* ZoneName, const char* nomHypothesis) { @@ -464,21 +437,6 @@ void HOMARD_Gen_i::DissociateHypoZone(const char* ZoneName, const char* nomHypot myHypo->SupprZone(ZoneName); }; -//============================================================================= -void HOMARD_Gen_i::AssociateIterIter(const char* nomIterParent, const char* nomIter) -{ - MESSAGE ( "AssociateIterIter : nomIter = " << nomIter << " nomIterParent = " << nomIterParent); - IsValidStudy () ; - - HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterParent]; - ASSERT(!CORBA::is_nil(myIterationParent)); - HOMARD::HOMARD_Iteration_var myIteration = myContextMap[GetCurrentStudyID()]._mesIterations[nomIter]; - ASSERT(!CORBA::is_nil(myIteration)); - - myIterationParent->AddIteration(nomIter); - myIteration->SetIterParent(nomIterParent); -} - //=================================================================================== void HOMARD_Gen_i::AssociateIterHypo(const char* nomIter, const char* nomHypo) { @@ -570,6 +528,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* nomIter=nom.str(); monNum = monNum+1; } + MESSAGE ( "CreateCase : nomIter = " << nomIter ); HOMARD::HOMARD_Iteration_var anIter = newIteration(); myContextMap[GetCurrentStudyID()]._mesIterations[nomIter] = anIter; @@ -594,7 +553,7 @@ HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::CreateCase(const char* nomCas, const char* } //============================================================================= -HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCas(const char* nomCas) +HOMARD::HOMARD_Cas_ptr HOMARD_Gen_i::GetCase(const char* nomCas) { IsValidStudy () ; HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; @@ -695,7 +654,7 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat return 0; }; - const char* nomCas = GetCaseName(nomIterParent); + const char* nomCas = myIterationParent->GetCaseName(); MESSAGE ("CreateIteration : nomCas = " << nomCas); HOMARD::HOMARD_Cas_var myCase = myContextMap[GetCurrentStudyID()]._mesCas[nomCas]; if (CORBA::is_nil(myCase)) @@ -725,12 +684,13 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat throw SALOME::SALOME_Exception(es); return 0; }; - myContextMap[GetCurrentStudyID()]._mesIterations[std::string(nomIteration)] = myIteration; - myIteration->SetName(nomIteration); - myIteration->SetMeshName(nomIteration); + myContextMap[GetCurrentStudyID()]._mesIterations[std::string(nomIteration)] = myIteration; +// Nom de l'iteration et du maillage + myIteration->SetName(nomIteration); + myIteration->SetMeshName(nomIteration); - int numero = myIterationParent->GetNumber() + 1; - myIteration->SetNumber(numero); + int numero = myIterationParent->GetNumber() + 1; + myIteration->SetNumber(numero); // Nombre d'iterations deja connues pour le cas, permettant // la creation d'un sous-repertoire unique @@ -752,12 +712,14 @@ HOMARD::HOMARD_Iteration_ptr HOMARD_Gen_i::CreateIteration(const char* nomIterat MeshFile << nomDir << "/maill." << iaux.str() << ".med"; myIteration->SetMeshFile(MeshFile.str().c_str()); -// Association avec le cas et l'iteration precedente - std::string label = "IterationHomard_" + std::string(nomIterParent); - AssociateCaseIter(nomCas, nomIteration, label.c_str()); - AssociateIterIter (nomIterParent,nomIteration); +// Association avec le cas + std::string label = "IterationHomard_" + std::string(nomIterParent); + AssociateCaseIter(nomCas, nomIteration, label.c_str()); +// Association avec l'iteration precedente + myIterationParent->AddIteration(nomIteration); + myIteration->SetIterParentName(nomIterParent); - return HOMARD::HOMARD_Iteration::_duplicate(myIteration); + return HOMARD::HOMARD_Iteration::_duplicate(myIteration); } @@ -778,7 +740,7 @@ HOMARD::HOMARD_Boundary_ptr HOMARD_Gen_i::CreateBoundary(const char* BoundaryNam HOMARD::HOMARD_Boundary_var myBoundary = newBoundary(); myBoundary->SetName(BoundaryName); - myBoundary->SetBoundaryType(BoundaryType); + myBoundary->SetType(BoundaryType); myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName] = myBoundary; @@ -839,7 +801,7 @@ HOMARD::HOMARD_Zone_ptr HOMARD_Gen_i::CreateZone(const char* ZoneName, CORBA::Lo HOMARD::HOMARD_Zone_var myZone = newZone(); myZone->SetName(ZoneName); - myZone->SetZoneType(ZoneType); + myZone->SetType(ZoneType); myContextMap[GetCurrentStudyID()]._mesZones[ZoneName] = myZone; @@ -1033,7 +995,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena // A.4. L'iteration parent - const char* nomIterationParent = myIteration->GetIterParent(); + const char* nomIterationParent = myIteration->GetIterParentName(); HOMARD::HOMARD_Iteration_var myIterationParent = myContextMap[GetCurrentStudyID()]._mesIterations[nomIterationParent]; ASSERT(!CORBA::is_nil(myIterationParent)); if ( ! myIterationParent->GetEtat() ) @@ -1245,7 +1207,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[ZoneName]; ASSERT(!CORBA::is_nil(myZone)); - int ZoneType = myZone->GetZoneType(); + int ZoneType = myZone->GetType(); std::string TypeUsestr = std::string((*ListZone)[iaux+1]); int TypeUse = atoi( TypeUsestr.c_str() ); MESSAGE ( "... ZoneType = " << ZoneType << ", TypeUse = "<GetBoundaryType(); + int BoundaryType = myBoundary->GetType(); MESSAGE ( "... BoundaryType = " << BoundaryType ); // Ecriture selon le type if (BoundaryType == 0) // Cas d une frontiere discrete @@ -1393,7 +1355,7 @@ CORBA::Long HOMARD_Gen_i::Compute(const char* nomIteration, CORBA::Long etatMena MESSAGE ( "... BoundaryName = " << BoundaryName); HOMARD::HOMARD_Boundary_var myBoundary = myContextMap[GetCurrentStudyID()]._mesBoundarys[BoundaryName]; ASSERT(!CORBA::is_nil(myBoundary)); - int BoundaryType = myBoundary->GetBoundaryType(); + int BoundaryType = myBoundary->GetType(); MESSAGE ( "... BoundaryType = " << BoundaryType ); // Recuperation du nom du groupe std::string GroupName = std::string((*ListBoundaryGroupType)[NumBoundary+1]); @@ -1647,7 +1609,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishZoneInStudy(SALOMEDS::Study_ptr theSt // Caracteristique de la zone HOMARD::HOMARD_Zone_var myZone = myContextMap[GetCurrentStudyID()]._mesZones[theName]; - CORBA::Long ZoneType = myZone->GetZoneType(); + CORBA::Long ZoneType = myZone->GetType(); // On ajoute la categorie des zones dans l etude si necessaire SALOMEDS::SObject_var aSOZone; @@ -1739,7 +1701,7 @@ SALOMEDS::SObject_ptr HOMARD_Gen_i::PublishBoundaryInStudy(SALOMEDS::Study_ptr t else { MESSAGE("La categorie des boundarys existe deja."); } aResultSO = aStudyBuilder->NewObject(aSOBoundary); - CORBA::Long BoundaryType = myBoundary->GetBoundaryType(); + CORBA::Long BoundaryType = myBoundary->GetType(); // MESSAGE("BoundaryType : "<GetCaseName()); -} //============================================================================= void HOMARD_Gen_i::PublishResultInSmesh(const char* NomFich, CORBA::Long IconeType) { @@ -2139,7 +2085,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, const char* theURL, CORBA::Boolean isMultiFile) { - MESSAGE (" Save pour theURL = "<< theURL); + MESSAGE (" Save for theURL = "<< theURL); SALOMEDS::TMPFile_var aStreamFile; // get temporary directory name @@ -2171,7 +2117,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, int id = 1; - // -> dump cases + // -> save cases std::map::const_iterator it_case; for (it_case = context._mesCas.begin(); it_case != context._mesCas.end(); ++it_case) { HOMARD::HOMARD_Cas_var aCas = it_case->second; @@ -2182,7 +2128,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, context._idmap[id++] = dynamic_cast(aCasServant); } } - // -> dump zones + // -> save zones std::map::const_iterator it_zone; for (it_zone = context._mesZones.begin(); it_zone != context._mesZones.end(); ++it_zone) { HOMARD::HOMARD_Zone_var aZone = it_zone->second; @@ -2193,7 +2139,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, context._idmap[id++] = dynamic_cast(aZoneServant); } } - // -> dump hypotheses + // -> save hypotheses std::map::const_iterator it_hypo; for (it_hypo = context._mesHypotheses.begin(); it_hypo != context._mesHypotheses.end(); ++it_hypo) { HOMARD::HOMARD_Hypothesis_var aHypo = it_hypo->second; @@ -2204,7 +2150,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, context._idmap[id++] = dynamic_cast(aHypoServant); } } - // -> dump iterations + // -> save iterations std::map::const_iterator it_iter; for (it_iter = context._mesIterations.begin(); it_iter != context._mesIterations.end(); ++it_iter) { HOMARD::HOMARD_Iteration_var aIter = it_iter->second; @@ -2215,7 +2161,7 @@ SALOMEDS::TMPFile* HOMARD_Gen_i::Save(SALOMEDS::SComponent_ptr theComponent, context._idmap[id++] = dynamic_cast(aIterServant); } } - // -> dump boundaries + // -> save boundaries std::map::const_iterator it_boundary; for (it_boundary = context._mesBoundarys.begin(); it_boundary != context._mesBoundarys.end(); ++it_boundary) { HOMARD::HOMARD_Boundary_var aBoundary = it_boundary->second; @@ -2601,10 +2547,12 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, } else aScript += "\thomard.SetCurrentStudy(salome.myStudy)\n"; + MESSAGE (". Au depart \n"< 0) { + MESSAGE (". Ecritures des frontieres"); aScript += "#\n# Creation of the boundaries"; aScript += "\n# =========================="; } @@ -2615,12 +2563,14 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, HOMARD::HOMARD_Boundary_var maBoundary = (*it_boundary).second; CORBA::String_var dumpCorbaBoundary = maBoundary->GetDumpPython(); std::string dumpBoundary = dumpCorbaBoundary.in(); + MESSAGE (dumpBoundary<<"\n"); aScript+=dumpBoundary; } if (myContextMap[GetCurrentStudyID()]._mesZones.size() > 0) { + MESSAGE (". Ecritures des zones"); aScript += "#\n# Creation of the zones"; aScript += "\n# ====================="; } @@ -2631,10 +2581,12 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, HOMARD::HOMARD_Zone_var maZone = (*it_zone).second; CORBA::String_var dumpCorbaZone = maZone->GetDumpPython(); std::string dumpZone = dumpCorbaZone.in(); + MESSAGE (dumpZone<<"\n"); aScript+=dumpZone; } + MESSAGE (". Ecritures des hypotheses"); aScript += "#\n# Creation of the hypotheses"; aScript += "\n# =========================="; std::map::const_iterator it_hypo; @@ -2644,10 +2596,12 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, HOMARD::HOMARD_Hypothesis_var monHypo = (*it_hypo).second; CORBA::String_var dumpCorbaHypo = monHypo->GetDumpPython(); std::string dumpHypo = dumpCorbaHypo.in(); + MESSAGE (dumpHypo<<"\n"); aScript+=dumpHypo; } + MESSAGE (". Ecritures des cas"); aScript += "#\n# Creation of the cases"; aScript += "\n# ====================="; std::map::const_iterator it_cas; @@ -2673,10 +2627,12 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::String_var dumpCorbaCase = myCase->GetDumpPython(); std::string dumpCas2= dumpCorbaCase.in(); + MESSAGE (dumpCas<::const_iterator it_iter; @@ -2686,9 +2642,11 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, HOMARD::HOMARD_Iteration_var aIter = (*it_iter).second; CORBA::String_var dumpCorbaIter = aIter->GetDumpPython(); std::string dumpIter = dumpCorbaIter.in(); + MESSAGE (dumpIter<<"\n"); aScript+=dumpIter; } + MESSAGE (". Ecritures finales"); if( isMultiFile ) aScript += "\n\tpass"; aScript += "\n"; @@ -2696,6 +2654,7 @@ Engines::TMPFile* HOMARD_Gen_i::DumpPython(CORBA::Object_ptr theStudy, if( !isMultiFile ) // remove unnecessary tabulation aScript = RemoveTabulation( aScript ); +/* MESSAGE ("A ecrire \n"<SetName( NomHypothesis ); + myHomardHypothesis->SetName( Name ); } //============================================================================= diff --git a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx index b2f60182..30c898a5 100644 --- a/src/HOMARD_I/HOMARD_Hypothesis_i.hxx +++ b/src/HOMARD_I/HOMARD_Hypothesis_i.hxx @@ -43,7 +43,7 @@ public: virtual ~HOMARD_Hypothesis_i(); - void SetName( const char* NomHypothesis ); + void SetName( const char* Name ); char* GetName(); void SetCaseCreation( const char* NomCaseCreation ); char* GetCaseCreation(); diff --git a/src/HOMARD_I/HOMARD_Iteration_i.cxx b/src/HOMARD_I/HOMARD_Iteration_i.cxx index a913cf92..a5693f32 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.cxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.cxx @@ -65,10 +65,10 @@ HOMARD_Iteration_i::~HOMARD_Iteration_i() /*! */ //============================================================================= -void HOMARD_Iteration_i::SetName( const char* NomIter ) +void HOMARD_Iteration_i::SetName( const char* Name ) { ASSERT( myHomardIteration ); - myHomardIteration->SetName( NomIter ); + myHomardIteration->SetName( Name ); } //============================================================================= @@ -128,12 +128,24 @@ char* HOMARD_Iteration_i::GetMeshName() } //============================================================================= -char* HOMARD_Iteration_i::GetIterParent() +char* HOMARD_Iteration_i::GetIterParentName() { ASSERT( myHomardIteration ); - return CORBA::string_dup( myHomardIteration->GetIterParent().c_str() ); + return CORBA::string_dup( myHomardIteration->GetIterParentName().c_str() ); } +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::GetIterParent() +{ +// Nom de l'iteration parent + char* NomIterParent = GetIterParentName() ; + MESSAGE ( "GetIterParent : NomIterParent = " << NomIterParent ); +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte + return _gen_i->GetIteration(NomIterParent) ; +} + + //============================================================================= HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() @@ -152,19 +164,32 @@ HOMARD::listeIterFilles* HOMARD_Iteration_i::GetIterations() } //============================================================================= -void HOMARD_Iteration_i::SetIterParent( const char* NomIterParent ) +void HOMARD_Iteration_i::SetIterParentName( const char* NomIterParent ) { ASSERT( myHomardIteration ); - myHomardIteration->SetIterParent( NomIterParent ); + myHomardIteration->SetIterParentName( NomIterParent ); } //============================================================================= -void HOMARD_Iteration_i::AddIteration( const char* NomIter ) +void HOMARD_Iteration_i::AddIteration( const char* NomIteration ) { ASSERT( myHomardIteration ); - myHomardIteration->AddIteration( NomIter ); + myHomardIteration->AddIteration( NomIteration ); } +//============================================================================= +HOMARD::HOMARD_Iteration_ptr HOMARD_Iteration_i::NextIteration( const char* IterName ) +{ +// Nom de l'iteration parent + char* NomIterParent = GetName() ; + MESSAGE ( "NextIteration : IterName = " << IterName ); + MESSAGE ( "NextIteration : NomIterParent = " << NomIterParent ); +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte + return _gen_i->CreateIteration(IterName, NomIterParent) ; +} + + //============================================================================= CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage) { @@ -174,8 +199,8 @@ CORBA::Long HOMARD_Iteration_i::Compute(CORBA::Long etatMenage) // Nom de l'iteration char* IterName = GetName() ; MESSAGE ( ". IterName = " << IterName ); -// B. Calcul : on passe par la methode sur l'objet HOMARD -// Il serait plus elegant de tout faire ici, mais il est complexe de paser tout le contexte +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte return _gen_i->Compute(IterName, etatMenage) ; } @@ -221,14 +246,37 @@ void HOMARD_Iteration_i::SetDirName( const char* NomDir ) myHomardIteration->SetDirName( NomDir ); } +//============================================================================= +void HOMARD_Iteration_i::AssociateHypo( const char* NomHypo ) +{ + ASSERT( myHomardIteration ); +// +// Nom de l'iteration + char* IterName = GetName() ; + MESSAGE ( ". IterName = " << IterName ); +// On passe par la methode sur l'objet HOMARD +// Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte + return _gen_i->AssociateIterHypo(IterName, NomHypo) ; +} + //============================================================================= char* HOMARD_Iteration_i::GetHypoName() { ASSERT( myHomardIteration ); return CORBA::string_dup( myHomardIteration->GetHypoName().c_str() ); - } +//============================================================================= +// HOMARD::HOMARD_Hypothesis_ptr HOMARD_Iteration_i::GetHypo() +// { +// // Nom de l'hypothese +// char* NomHypo = GetHypoName() ; +// MESSAGE ( "GetHypo : NomHypo = " << NomHypo ); +// // On passe par la methode sur l'objet HOMARD +// // Il serait plus elegant de tout faire ici, mais il est complexe de passer tout le contexte +// return _gen_i->GetHypothesis(NomHypo) ; +// } + //============================================================================= void HOMARD_Iteration_i::SetHypoName( const char* NomHypo ) { diff --git a/src/HOMARD_I/HOMARD_Iteration_i.hxx b/src/HOMARD_I/HOMARD_Iteration_i.hxx index 85903274..f15cfa2f 100644 --- a/src/HOMARD_I/HOMARD_Iteration_i.hxx +++ b/src/HOMARD_I/HOMARD_Iteration_i.hxx @@ -44,9 +44,14 @@ public: virtual ~HOMARD_Iteration_i(); - void SetName( const char* NomIteration ); + void SetName( const char* Name ); char* GetName(); - char* GetDumpPython(); + + HOMARD::HOMARD_Iteration_ptr NextIteration( const char* Name) ; + + void SetIterParentName( const char* NomIterParent ); + char* GetIterParentName(); + HOMARD::HOMARD_Iteration_ptr GetIterParent() ; void SetEtat( CORBA::Boolean etat ); CORBA::Boolean GetEtat(); @@ -69,9 +74,6 @@ public: void SetMessFile( const char* MessFile ); char* GetMessFile(); - void SetIterParent( const char* NomIterParent ); - char* GetIterParent(); - void AddIteration( const char* NomIteration ); HOMARD::listeIterFilles* GetIterations(); @@ -81,6 +83,8 @@ public: void SetDirName( const char* NomDir ); char* GetDirName(); + void AssociateHypo( const char* NomHypo); + void SetHypoName( const char* NomHypo ); char* GetHypoName(); @@ -89,6 +93,8 @@ public: std::string Dump() const; bool Restore( const std::string& stream ); + char* GetDumpPython(); + private: ::HOMARD_Iteration* myHomardIteration; diff --git a/src/HOMARD_I/HOMARD_Zone_i.cxx b/src/HOMARD_I/HOMARD_Zone_i.cxx index 1dbab43d..b7774231 100644 --- a/src/HOMARD_I/HOMARD_Zone_i.cxx +++ b/src/HOMARD_I/HOMARD_Zone_i.cxx @@ -63,10 +63,10 @@ HOMARD_Zone_i::~HOMARD_Zone_i() /*! */ //============================================================================= -void HOMARD_Zone_i::SetName( const char* NomZone ) +void HOMARD_Zone_i::SetName( const char* Name ) { ASSERT( myHomardZone ); - myHomardZone->SetName( NomZone ); + myHomardZone->SetName( Name ); } //============================================================================= @@ -85,17 +85,17 @@ char* HOMARD_Zone_i::GetDumpPython() //============================================================================= -void HOMARD_Zone_i::SetZoneType( CORBA::Long ZoneType ) +void HOMARD_Zone_i::SetType( CORBA::Long Type ) { ASSERT( myHomardZone ); - myHomardZone->SetZoneType( ZoneType ); + myHomardZone->SetType( Type ); } //============================================================================= -CORBA::Long HOMARD_Zone_i::GetZoneType() +CORBA::Long HOMARD_Zone_i::GetType() { ASSERT( myHomardZone ); - return CORBA::Long( myHomardZone->GetZoneType() ); + return CORBA::Long( myHomardZone->GetType() ); } //============================================================================= diff --git a/src/HOMARD_I/HOMARD_Zone_i.hxx b/src/HOMARD_I/HOMARD_Zone_i.hxx index 63526668..33d4a0c7 100644 --- a/src/HOMARD_I/HOMARD_Zone_i.hxx +++ b/src/HOMARD_I/HOMARD_Zone_i.hxx @@ -43,13 +43,13 @@ public: virtual ~HOMARD_Zone_i(); - void SetName( const char* NomZone ); + void SetName( const char* Name ); char* GetName(); char* GetDumpPython(); - void SetZoneType( CORBA::Long ZoneType ); + void SetType( CORBA::Long Type ); - CORBA::Long GetZoneType(); + CORBA::Long GetType(); HOMARD::double_array* GetCoords(); void SetBox( double Xmini, double Xmaxi, diff --git a/tests/test_1.py b/tests/test_1.py index 74a1f658..71e7dac8 100644 --- a/tests/test_1.py +++ b/tests/test_1.py @@ -19,15 +19,15 @@ # """ Python script for HOMARD -Copyright EDF-R&D 2010 +Copyright EDF-R&D 2010, 2013 Test test_1 """ -__revision__ = "V1.6" +__revision__ = "V1.7" -###################################################################################### +#======================================================================== Test_Name = "test_1" n_iter_test_file = 3 -###################################################################################### +#======================================================================== import os import sys import tempfile @@ -43,12 +43,31 @@ salome.salome_init() import iparameters ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1)) ipar.append("AP_MODULES_LIST", "Homard") -###################################################################################### -###################################################################################### +#======================================================================== +#======================================================================== +def remove_dir(directory) : + """ +Empties, then removes a directory. +Copyright EDF-R&D 2013 + """ +# + l_aux = os.listdir(directory) + for fic in l_aux : + fic_a = os.path.join(directory, fic) + if os.path.isdir(fic_a) : + remove_dir(fic_a) + else : + os.remove(fic_a) + os.rmdir(directory) +# + return +# +#======================================================================== +#======================================================================== def homard_exec(theStudy): """ Python script for HOMARD -Copyright EDF-R&D 2010 +Copyright EDF-R&D 2010, 2013 """ error = 0 # @@ -79,8 +98,8 @@ Copyright EDF-R&D 2010 # Creation of the hypothesis Zones_1_et_2 Zones_1_et_2 = homard.CreateHypothesis('Zones_1_et_2') Zones_1_et_2.SetAdapRefinUnRef(0, 1, 0) - homard.AssociateHypoZone('Zones_1_et_2', 'Zone_1', 1) - homard.AssociateHypoZone('Zones_1_et_2', 'Zone_2', 1) + Zones_1_et_2.AddZone('Zone_1', 1) + Zones_1_et_2.AddZone('Zone_2', 1) # # Creation of the cases # ===================== @@ -92,34 +111,34 @@ Copyright EDF-R&D 2010 # Creation of the iterations # ========================== # Creation of the iteration I1 - I1 = homard.CreateIteration('I1', Case_1.GetIter0Name() ) + I1 = Case_1.NextIteration('I1') I1.SetMeshName('M1') I1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) I1.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.00.med')) I1.SetTimeStepRank(1, 1) - homard.AssociateIterHypo('I1', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + I1.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') error = I1.Compute(1) if error : error = 1 break # Creation of the iteration I2 - I2 = homard.CreateIteration('I2', 'I1') + I2 = I1.NextIteration('I2') I2.SetMeshName('M2') I2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) I2.SetFieldFile(os.path.join(Rep_Test, Test_Name + '.01.med')) I2.SetTimeStepRank(1, 1) - homard.AssociateIterHypo('I2', 'a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') + I2.AssociateHypo('a10_1pc_de_mailles_a_raffiner_sur_ERRE_ELEM_SIGM') error = I2.Compute(1) if error : error = 2 break # Creation of the iteration I3 - I3 = homard.CreateIteration('I3', 'I2') + I3 = I2.NextIteration('I3') I3.SetMeshName('M3') I3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - homard.AssociateIterHypo('I3', 'Zones_1_et_2') + I3.AssociateHypo('Zones_1_et_2') error = I3.Compute(1) if error : error = 3 @@ -129,7 +148,7 @@ Copyright EDF-R&D 2010 # return error -###################################################################################### +#======================================================================== homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') assert homard is not None, "Impossible to load homard engine" @@ -188,6 +207,8 @@ for num in range(nblign) : raise Exception(message_erreur) sys.exit(10) # +remove_dir(Rep_Test_Resu) +# if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) iparameters.getSession().restoreVisualState(1) diff --git a/tests/test_2.py b/tests/test_2.py index afb705f2..d6dd949a 100644 --- a/tests/test_2.py +++ b/tests/test_2.py @@ -19,15 +19,15 @@ # """ Python script for HOMARD -Copyright EDF-R&D 2010 +Copyright EDF-R&D 2010, 2013 Test test_2 """ -__revision__ = "V1.5" +__revision__ = "V1.6" -###################################################################################### +#======================================================================== Test_Name = "test_2" n_iter_test_file = 3 -###################################################################################### +#======================================================================== import os import sys import tempfile @@ -43,12 +43,31 @@ salome.salome_init() import iparameters ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1)) ipar.append("AP_MODULES_LIST", "Homard") -###################################################################################### -###################################################################################### +#======================================================================== +#======================================================================== +def remove_dir(directory) : + """ +Empties, then removes a directory. +Copyright EDF-R&D 2013 + """ +# + l_aux = os.listdir(directory) + for fic in l_aux : + fic_a = os.path.join(directory, fic) + if os.path.isdir(fic_a) : + remove_dir(fic_a) + else : + os.remove(fic_a) + os.rmdir(directory) +# + return +# +#======================================================================== +#======================================================================== def homard_exec(theStudy): """ Python script for HOMARD -Copyright EDF-R&D 2010 +Copyright EDF-R&D 2010, 2013 """ error = 0 # @@ -85,30 +104,30 @@ Copyright EDF-R&D 2010 # Creation of the iterations # ========================== # Creation of the iteration Iter_1 - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) + Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('PLAQUE_1') Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - homard.AssociateIterHypo('Iter_1', 'Hypo_1') + Iter_1.AssociateHypo('Hypo_1') error = Iter_1.Compute(1) if error : error = 1 break # Creation of the iteration Iter_2 - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('PLAQUE_2') Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - homard.AssociateIterHypo('Iter_2', 'Hypo_1') + Iter_2.AssociateHypo('Hypo_1') error = Iter_2.Compute(1) if error : error = 2 break # Creation of the iteration Iter_3 - Iter_3 = homard.CreateIteration('Iter_3', 'Iter_2') + Iter_3 = Iter_2.NextIteration('Iter_3') Iter_3.SetMeshName('PLAQUE_3') Iter_3.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.03.med')) - homard.AssociateIterHypo('Iter_3', 'Hypo_2') + Iter_3.AssociateHypo('Hypo_2') error = Iter_3.Compute(1) if error : error = 3 @@ -118,7 +137,7 @@ Copyright EDF-R&D 2010 # return error -###################################################################################### +#======================================================================== homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') assert homard is not None, "Impossible to load homard engine" @@ -176,6 +195,8 @@ for num in range(nblign) : raise Exception(message_erreur) sys.exit(10) # +remove_dir(Rep_Test_Resu) +# if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) iparameters.getSession().restoreVisualState(1) diff --git a/tests/test_3.py b/tests/test_3.py index 98c4e6e3..36a9e8e3 100644 --- a/tests/test_3.py +++ b/tests/test_3.py @@ -19,15 +19,15 @@ # """ Python script for HOMARD -Copyright EDF-R&D 2011 +Copyright EDF-R&D 2011, 2013 Test test_3 """ -__revision__ = "V1.3" +__revision__ = "V1.4" -###################################################################################### +#======================================================================== Test_Name = "test_3" n_iter_test_file = 2 -###################################################################################### +#======================================================================== import os import sys import tempfile @@ -43,12 +43,31 @@ salome.salome_init() import iparameters ipar = iparameters.IParameters(salome.myStudy.GetCommonParameters("Interface Applicative", 1)) ipar.append("AP_MODULES_LIST", "Homard") -###################################################################################### -###################################################################################### +#======================================================================== +#======================================================================== +def remove_dir(directory) : + """ +Empties, then removes a directory. +Copyright EDF-R&D 2013 + """ +# + l_aux = os.listdir(directory) + for fic in l_aux : + fic_a = os.path.join(directory, fic) + if os.path.isdir(fic_a) : + remove_dir(fic_a) + else : + os.remove(fic_a) + os.rmdir(directory) +# + return +# +#======================================================================== +#======================================================================== def homard_exec(theStudy): """ Python script for HOMARD -Copyright EDF-R&D 2010 +Copyright EDF-R&D 2010, 2013 """ error = 0 # @@ -94,20 +113,20 @@ Copyright EDF-R&D 2010 # Creation of the iterations # ========================== # Creation of the iteration Iter_1 - Iter_1 = homard.CreateIteration('Iter_1', Case_1.GetIter0Name() ) + Iter_1 = Case_1.NextIteration('Iter_1') Iter_1.SetMeshName('MOYEU_1') Iter_1.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.01.med')) - homard.AssociateIterHypo('Iter_1', 'Hypo') + Iter_1.AssociateHypo('Hypo') error = Iter_1.Compute(1) if error : error = 1 break # Creation of the iteration Iter_2 - Iter_2 = homard.CreateIteration('Iter_2', 'Iter_1') + Iter_2 = Iter_1.NextIteration('Iter_2') Iter_2.SetMeshName('MOYEU_2') Iter_2.SetMeshFile(os.path.join(Rep_Test_Resu, 'maill.02.med')) - homard.AssociateIterHypo('Iter_2', 'Hypo') + Iter_2.AssociateHypo('Hypo') error = Iter_2.Compute(1) if error : error = 2 @@ -117,7 +136,7 @@ Copyright EDF-R&D 2010 # return error -###################################################################################### +#======================================================================== homard = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD') assert homard is not None, "Impossible to load homard engine" @@ -176,6 +195,8 @@ for num in range(nblign) : raise Exception(message_erreur) sys.exit(10) # +remove_dir(Rep_Test_Resu) +# if salome.sg.hasDesktop(): salome.sg.updateObjBrowser(1) iparameters.getSession().restoreVisualState(1) -- 2.30.2