Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.9"
+__revision__ = "V2.1"
#
import os
import sys
#
# ==================================
-pathHomard = os.getenv('HOMARD_ROOT_DIR')
+PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
# Repertoire des donnees du tutorial
-data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
-data_dir = os.path.normpath(data_dir)
-sys.path.append(data_dir)
+DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
+sys.path.append(DATA_TUTORIAL)
from tutorial_util import gzip_gunzip
from tutorial_util import creation_dircase
# ==================================
-dircase = creation_dircase(1)
-gzip_gunzip(data_dir, 1, -1)
+DIRCASE = creation_dircase(1)
+gzip_gunzip(DATA_TUTORIAL, 1, -1)
# ==================================
#
import salome
#
# Hypotheses
# ==========
-Hypo_1 = homard.CreateHypothesis('Hypo_1')
-Hypo_1.SetUnifRefinUnRef(1)
+hypo_1 = homard.CreateHypothesis('hypo_1')
+hypo_1.SetUnifRefinUnRef(1)
#
# Cas
# ===
-Case_1 = homard.CreateCase('Case_1', 'MAILL', data_dir+'/tutorial_1.00.med')
-Case_1.SetDirName(dircase)
-Case_1.SetConfType(1)
+case_1 = homard.CreateCase('Case_1', 'MAILL', DATA_TUTORIAL+'/tutorial_1.00.med')
+case_1.SetDirName(DIRCASE)
+case_1.SetConfType(1)
#
# Iterations
# ==========
-# Iteration "Iter_1_1"
-Iter_1_1 = Case_1.NextIteration('Iter_1_1')
-Iter_1_1.SetMeshName('MESH')
-Iter_1_1.SetMeshFile(dircase+'/maill.01.med')
-Iter_1_1.AssociateHypo('Hypo_1')
-error = Iter_1_1.Compute(1, 2)
+# Iteration "iter_1_1"
+iter_1_1 = case_1.NextIteration('iter_1_1')
+iter_1_1.SetMeshName('MESH')
+iter_1_1.SetMeshFile(DIRCASE+'/maill.01.med')
+iter_1_1.AssociateHypo('hypo_1')
+error = iter_1_1.Compute(1, 2)
-# Iteration "Iter_1_2"
-Iter_1_2 = Iter_1_1.NextIteration('Iter_1_2')
-Iter_1_2.SetMeshName('MESH')
-Iter_1_2.SetMeshFile(dircase+'/maill.02.med')
-Iter_1_2.AssociateHypo('Hypo_1')
-error = Iter_1_2.Compute(1, 2)
-
-# Iteration "Iter_1_3"
-Iter_1_3 = Iter_1_2.NextIteration('Iter_1_3')
-Iter_1_3.SetMeshName('MESH')
-Iter_1_3.SetMeshFile(dircase+'/maill.03.med')
-Iter_1_3.AssociateHypo('Hypo_1')
-error = Iter_1_3.Compute(1, 2)
+# Iteration "iter_1_2"
+iter_1_2 = iter_1_1.NextIteration('iter_1_2')
+iter_1_2.SetMeshName('MESH')
+iter_1_2.SetMeshFile(DIRCASE+'/maill.02.med')
+iter_1_2.AssociateHypo('hypo_1')
+error = iter_1_2.Compute(1, 2)
+# Iteration "iter_1_3"
+iter_1_3 = iter_1_2.NextIteration('iter_1_3')
+iter_1_3.SetMeshName('MESH')
+iter_1_3.SetMeshFile(DIRCASE+'/maill.03.med')
+iter_1_3.AssociateHypo('hypo_1')
+error = iter_1_3.Compute(1, 2)
+#
# ==================================
-gzip_gunzip(data_dir, 1, 1)
+gzip_gunzip(DATA_TUTORIAL, 1, 1)
# ==================================
-
+#
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
+ iparameters.getSession().restoreVisualState(1)
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.10"
+__revision__ = "V2.10"
#
import os
import sys
#
# ==================================
-pathHomard = os.getenv('HOMARD_ROOT_DIR')
+PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
# Repertoire des donnees du tutorial
-data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
-data_dir = os.path.normpath(data_dir)
-sys.path.append(data_dir)
+DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
+sys.path.append(DATA_TUTORIAL)
from tutorial_util import gzip_gunzip
from tutorial_util import creation_dircase
# ==================================
-dircase = creation_dircase(2)
-gzip_gunzip(data_dir, 2, -1)
+DIRCASE = creation_dircase(2)
+gzip_gunzip(DATA_TUTORIAL, 2, -1)
# ==================================
#
import salome
# Box "Zone_2"
Zone_2 = homard.CreateZoneBox ('Zone_2', -0.1, 0.51, -0.1, 0.51, -0.1, 0.51)
#
-# Hypothese "Hypo_2"
+# Hypothese "hypo_2"
# ==================
-Hypo_2 = homard.CreateHypothesis('Hypo_2')
-Hypo_2.AddZone('Zone_1', 1)
-Hypo_2.AddZone('Zone_0', 1)
+hypo_2 = homard.CreateHypothesis('hypo_2')
+hypo_2.AddZone('Zone_1', 1)
+hypo_2.AddZone('Zone_0', 1)
#
-# Hypothese "Hypo_2_bis"
+# Hypothese "hypo_2_bis"
# ======================
-Hypo_2_bis = homard.CreateHypothesis('Hypo_2_bis')
-Hypo_2_bis.AddZone('Zone_0', -1)
-Hypo_2_bis.AddZone('Zone_2', 1)
+hypo_2_bis = homard.CreateHypothesis('hypo_2_bis')
+hypo_2_bis.AddZone('Zone_0', -1)
+hypo_2_bis.AddZone('Zone_2', 1)
#
# Cas
# ===
-Case_2 = homard.CreateCase('Case_2', 'MZERO', data_dir+'/tutorial_2.00.med')
-Case_2.SetDirName(dircase)
+case_2 = homard.CreateCase('Case_2', 'MZERO', DATA_TUTORIAL+'/tutorial_2.00.med')
+case_2.SetDirName(DIRCASE)
#
-# Iteration "Iter_2_1"
+# Iteration "iter_2_1"
# ====================
-Iter_2_1 = Case_2.NextIteration('Iter_2_1')
-Iter_2_1.SetMeshName('M_1')
-Iter_2_1.SetMeshFile(dircase+'/maill.01.med')
-Iter_2_1.AssociateHypo('Hypo_2')
-error = Iter_2_1.Compute(1, 2)
+iter_2_1 = case_2.NextIteration('iter_2_1')
+iter_2_1.SetMeshName('M_1')
+iter_2_1.SetMeshFile(DIRCASE+'/maill.01.med')
+iter_2_1.AssociateHypo('hypo_2')
+error = iter_2_1.Compute(1, 2)
#
-# Iteration "Iter_2_2"
+# Iteration "iter_2_2"
# ====================
-Iter_2_2 = Iter_2_1.NextIteration('Iter_2_2')
-Iter_2_2.SetMeshName('M_2')
-Iter_2_2.SetMeshFile(dircase+'/maill.02.med')
-Iter_2_2.AssociateHypo('Hypo_2_bis')
-error = Iter_2_2.Compute(1, 2)
+iter_2_2 = iter_2_1.NextIteration('iter_2_2')
+iter_2_2.SetMeshName('M_2')
+iter_2_2.SetMeshFile(DIRCASE+'/maill.02.med')
+iter_2_2.AssociateHypo('hypo_2_bis')
+error = iter_2_2.Compute(1, 2)
# ==================================
-gzip_gunzip(data_dir, 2, 1)
+gzip_gunzip(DATA_TUTORIAL, 2, 1)
# ==================================
if salome.sg.hasDesktop():
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.9"
+__revision__ = "V2.1"
#
import os
import sys
#
# ==================================
-pathHomard = os.getenv('HOMARD_ROOT_DIR')
+PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
# Repertoire des donnees du tutorial
-data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
-data_dir = os.path.normpath(data_dir)
-sys.path.append(data_dir)
+DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
+sys.path.append(DATA_TUTORIAL)
from tutorial_util import gzip_gunzip
from tutorial_util import creation_dircase
# ==================================
-dircase = creation_dircase(3)
-gzip_gunzip(data_dir, 3, -1)
+DIRCASE = creation_dircase(3)
+gzip_gunzip(DATA_TUTORIAL, 3, -1)
# ==================================
#
import salome
study_main = salome.myStudyManager.NewStudy("HOMARD")
homard.SetCurrentStudy(salome.myStudy)
#
-# Hypothese "Hypo_0vers1"
+# Hypothese "hypo_0vers1"
# =======================
-Hypo_0vers1 = homard.CreateHypothesis('Hypo_0vers1')
+hypo_0vers1 = homard.CreateHypothesis('hypo_0vers1')
# Characterization of the field
-Hypo_0vers1.SetField('SOLU_0__QIRE_ELEM_SIGM__________')
-Hypo_0vers1.SetUseComp(0)
-Hypo_0vers1.AddComp('ERREST ')
-Hypo_0vers1.SetRefinThr(3, 1.0)
-Hypo_0vers1.SetTypeFieldInterp(2)
-Hypo_0vers1.AddFieldInterp('SOLU_0__DEPL____________________')
-Hypo_0vers1.AddFieldInterp('SOLU_0__ERRE_ELEM_SIGM__________')
-#
-# Hypothese "Hypo_1vers2"
+hypo_0vers1.SetField('SOLU_0__QIRE_ELEM_SIGM__________')
+hypo_0vers1.SetUseComp(0)
+hypo_0vers1.AddComp('ERREST ')
+hypo_0vers1.SetRefinThr(3, 1.0)
+hypo_0vers1.SetTypeFieldInterp(2)
+hypo_0vers1.AddFieldInterp('SOLU_0__DEPL____________________')
+hypo_0vers1.AddFieldInterp('SOLU_0__ERRE_ELEM_SIGM__________')
+#
+# Hypothese "hypo_1vers2"
# =======================
-Hypo_1vers2 = homard.CreateHypothesis('Hypo_1vers2')
+hypo_1vers2 = homard.CreateHypothesis('hypo_1vers2')
# Characterization of the field
-Hypo_1vers2.SetField('SOLU_1__QIRE_ELEM_SIGM__________')
-Hypo_1vers2.SetUseComp(0)
-Hypo_1vers2.AddComp('ERREST ')
-Hypo_1vers2.SetRefinThr(3, 1.5)
-Hypo_1vers2.SetUnRefThr(3, 6.)
-Hypo_1vers2.SetTypeFieldInterp(2)
-Hypo_1vers2.AddFieldInterp('SOLU_1__DEPL____________________')
-Hypo_1vers2.AddFieldInterp('SOLU_1__QIRE_ELEM_SIGM__________')
-#
-# Hypothese "Hypo_1vers2_bis"
+hypo_1vers2.SetField('SOLU_1__QIRE_ELEM_SIGM__________')
+hypo_1vers2.SetUseComp(0)
+hypo_1vers2.AddComp('ERREST ')
+hypo_1vers2.SetRefinThr(3, 1.5)
+hypo_1vers2.SetUnRefThr(3, 6.)
+hypo_1vers2.SetTypeFieldInterp(2)
+hypo_1vers2.AddFieldInterp('SOLU_1__DEPL____________________')
+hypo_1vers2.AddFieldInterp('SOLU_1__QIRE_ELEM_SIGM__________')
+#
+# Hypothese "hypo_1vers2_bis"
# ===========================
-Hypo_1vers2_bis = homard.CreateHypothesis('Hypo_1vers2_bis')
+hypo_1vers2_bis = homard.CreateHypothesis('hypo_1vers2_bis')
# Characterization of the field
-Hypo_1vers2_bis.SetField('SOLU_1__DEPL____________________')
-Hypo_1vers2_bis.SetUseComp(1)
-Hypo_1vers2_bis.AddComp('DX')
-Hypo_1vers2_bis.AddComp('DY')
-Hypo_1vers2_bis.AddComp('DZ')
-Hypo_1vers2_bis.SetRefinThr(1, 0.0001)
-Hypo_1vers2_bis.SetUnRefThr(1, 0.000001)
-Hypo_1vers2_bis.SetTypeFieldInterp(0)
+hypo_1vers2_bis.SetField('SOLU_1__DEPL____________________')
+hypo_1vers2_bis.SetUseComp(1)
+hypo_1vers2_bis.AddComp('DX')
+hypo_1vers2_bis.AddComp('DY')
+hypo_1vers2_bis.AddComp('DZ')
+hypo_1vers2_bis.SetRefinThr(1, 0.0001)
+hypo_1vers2_bis.SetUnRefThr(1, 0.000001)
+hypo_1vers2_bis.SetTypeFieldInterp(0)
#
# Cas
# ===
-Case_3 = homard.CreateCase('Case_3', 'G_0', data_dir+'/tutorial_3.00.med')
-Case_3.SetDirName(dircase)
+case_3 = homard.CreateCase('Case_3', 'G_0', DATA_TUTORIAL+'/tutorial_3.00.med')
+case_3.SetDirName(DIRCASE)
#
-# Iteration "Iter_3_1"
+# Iteration "iter_3_1"
# ====================
-Iter_3_1 = Case_3.NextIteration('Iter_3_1')
-Iter_3_1.SetMeshName('H_1')
-Iter_3_1.SetMeshFile(dircase+'/maill.01.med')
-Iter_3_1.SetFieldFile(data_dir+'/tutorial_3.00.med')
-Iter_3_1.SetTimeStepRank( 1, 1)
-Iter_3_1.AssociateHypo('Hypo_0vers1')
-error = Iter_3_1.Compute(1, 2)
-#
-# Iteration "Iter_3_2"
+iter_3_1 = case_3.NextIteration('iter_3_1')
+iter_3_1.SetMeshName('H_1')
+iter_3_1.SetMeshFile(DIRCASE+'/maill.01.med')
+iter_3_1.SetFieldFile(DATA_TUTORIAL+'/tutorial_3.00.med')
+iter_3_1.SetTimeStepRank( 1, 1)
+iter_3_1.AssociateHypo('hypo_0vers1')
+error = iter_3_1.Compute(1, 2)
+#
+# Iteration "iter_3_2"
# ====================
-Iter_3_2 = Iter_3_1.NextIteration('Iter_3_2')
-Iter_3_2.SetMeshName('H_2')
-Iter_3_2.SetMeshFile(dircase+'/maill.02.med')
-Iter_3_2.SetFieldFile(data_dir+'/tutorial_3.01.med')
-Iter_3_2.SetTimeStepRank(1, 1)
-Iter_3_2.AssociateHypo('Hypo_1vers2')
-error = Iter_3_2.Compute(1, 2)
-#
-# Iteration "Iter_3_2_bis"
+iter_3_2 = iter_3_1.NextIteration('iter_3_2')
+iter_3_2.SetMeshName('H_2')
+iter_3_2.SetMeshFile(DIRCASE+'/maill.02.med')
+iter_3_2.SetFieldFile(DATA_TUTORIAL+'/tutorial_3.01.med')
+iter_3_2.SetTimeStepRank(1, 1)
+iter_3_2.AssociateHypo('hypo_1vers2')
+error = iter_3_2.Compute(1, 2)
+#
+# Iteration "iter_3_2_bis"
# ========================
-Iter_3_2_bis = Iter_3_1.NextIteration('Iter_3_2_bis')
-Iter_3_2_bis.SetMeshName('H_2_bis')
-Iter_3_2_bis.SetMeshFile(dircase+'/maill.02.bis.med')
-Iter_3_2_bis.SetFieldFile(data_dir+'/tutorial_3.01.med')
-Iter_3_2_bis.SetTimeStepRank(1, 1)
-Iter_3_2_bis.AssociateHypo('Hypo_1vers2_bis')
-error = Iter_3_2_bis.Compute(1, 2)
+iter_3_2_bis = iter_3_1.NextIteration('iter_3_2_bis')
+iter_3_2_bis.SetMeshName('H_2_bis')
+iter_3_2_bis.SetMeshFile(DIRCASE+'/maill.02.bis.med')
+iter_3_2_bis.SetFieldFile(DATA_TUTORIAL+'/tutorial_3.01.med')
+iter_3_2_bis.SetTimeStepRank(1, 1)
+iter_3_2_bis.AssociateHypo('hypo_1vers2_bis')
+error = iter_3_2_bis.Compute(1, 2)
# ==================================
-gzip_gunzip(data_dir, 3, 1)
+gzip_gunzip(DATA_TUTORIAL, 3, 1)
# ==================================
if salome.sg.hasDesktop():
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2011, 2014
"""
-__revision__ = "V2.5"
+__revision__ = "V3.1"
#
import os
import sys
#
# ==================================
-pathHomard = os.getenv('HOMARD_ROOT_DIR')
+PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
# Repertoire des donnees du tutorial
-data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
-data_dir = os.path.normpath(data_dir)
-sys.path.append(data_dir)
+DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
+sys.path.append(DATA_TUTORIAL)
from tutorial_util import gzip_gunzip
from tutorial_util import creation_dircase
# ==================================
-dircase = creation_dircase(4)
-gzip_gunzip(data_dir, 4, -1)
+DIRCASE = creation_dircase(4)
+gzip_gunzip(DATA_TUTORIAL, 4, -1)
# ==================================
#
import salome
#
# Frontieres
# ==========
-Boun_4_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', data_dir+'/tutorial_4.fr.med')
+boun_4_1 = homard.CreateBoundaryDi('intersection', 'PIQUAGE', DATA_TUTORIAL+'/tutorial_4.fr.med')
#
-Boun_4_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.)
+boun_4_2 = homard.CreateBoundaryCylinder('cyl_1_ext', 0.0, 25., -25., 25., 50., 75., 100.)
#
-Boun_4_3 = homard.CreateBoundaryCylinder('cyl_2_ext', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
+boun_4_3 = homard.CreateBoundaryCylinder('cyl_2_ext', 17.5, -2.5, -12.5, -100., -75., -25., 50.)
#
-Boun_4_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50., 75., 75.)
+boun_4_4 = homard.CreateBoundaryCylinder('cyl_1_int', 0.0, 25., -25., 25., 50., 75., 75.)
#
-Boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.)
+boun_4_5 = homard.CreateBoundaryCylinder('cyl_2_int', 17.5, -2.5, -12.5, -100., -75., -25., 25.)
#
# Hypotheses
# ==========
-# Creation of the hypothesis Hypo_4
-Hypo_4 = homard.CreateHypothesis('Hypo_4')
-Hypo_4.SetUnifRefinUnRef(1)
-Hypo_4.AddGroup('T1_INT_I')
-Hypo_4.AddGroup('T1_INT_O')
-Hypo_4.AddGroup('T2_INT')
-# Creation of the hypothesis Hypo_4_bis
-Hypo_4_bis = homard.CreateHypothesis('Hypo_4_bis')
-Hypo_4_bis.SetUnifRefinUnRef(1)
-Hypo_4_bis.AddGroup('T1_EXT_I')
-Hypo_4_bis.AddGroup('T1_EXT_O')
-Hypo_4_bis.AddGroup('T2_EXT')
+# Creation of the hypothesis hypo_4
+hypo_4 = homard.CreateHypothesis('hypo_4')
+hypo_4.SetUnifRefinUnRef(1)
+hypo_4.AddGroup('T1_INT_I')
+hypo_4.AddGroup('T1_INT_O')
+hypo_4.AddGroup('T2_INT')
+# Creation of the hypothesis hypo_4_bis
+hypo_4_bis = homard.CreateHypothesis('hypo_4_bis')
+hypo_4_bis.SetUnifRefinUnRef(1)
+hypo_4_bis.AddGroup('T1_EXT_I')
+hypo_4_bis.AddGroup('T1_EXT_O')
+hypo_4_bis.AddGroup('T2_EXT')
#
# Cas
# ===
-Case_4 = homard.CreateCase('Case_4', 'PIQUAGE', data_dir+'/tutorial_4.00.med')
-Case_4.SetDirName(dircase)
-Case_4.AddBoundaryGroup( 'intersection', '' )
-Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_I' )
-Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' )
-Case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_O' )
-Case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_O' )
-Case_4.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' )
-Case_4.AddBoundaryGroup( 'cyl_2_ext', 'T2_EXT' )
+case_4 = homard.CreateCase('Case_4', 'PIQUAGE', DATA_TUTORIAL+'/tutorial_4.00.med')
+case_4.SetDirName(DIRCASE)
+case_4.AddBoundaryGroup( 'intersection', '' )
+case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_I' )
+case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_I' )
+case_4.AddBoundaryGroup( 'cyl_1_int', 'T1_INT_O' )
+case_4.AddBoundaryGroup( 'cyl_1_ext', 'T1_EXT_O' )
+case_4.AddBoundaryGroup( 'cyl_2_int', 'T2_INT' )
+case_4.AddBoundaryGroup( 'cyl_2_ext', 'T2_EXT' )
#
# Iterations
# ==========
-# Iteration Iter_4_1 : raffinement selon les faces internes
-Iter_4_1 = Case_4.NextIteration('Iter_4_1')
-Iter_4_1.SetMeshName('PIQUAGE_1')
-Iter_4_1.SetMeshFile(dircase+'/maill.01.med')
-Iter_4_1.AssociateHypo('Hypo_4')
-error = Iter_4_1.Compute(1, 2)
-# Iteration Iter_4_2 : raffinement selon les faces externes
-Iter_4_2 = Iter_4_1.NextIteration('Iter_4_2')
-Iter_4_2.SetMeshName('PIQUAGE_2')
-Iter_4_2.SetMeshFile(dircase+'/maill.02.med')
-Iter_4_2.AssociateHypo('Hypo_4_bis')
-error = Iter_4_2.Compute(1, 2)
-# Iteration Iter_4_3 : second raffinement selon les faces externes
-Iter_4_3 = Iter_4_2.NextIteration('Iter_4_3')
-Iter_4_3.SetMeshName('PIQUAGE_3')
-Iter_4_3.SetMeshFile(dircase+'/maill.03.med')
-Iter_4_3.AssociateHypo('Hypo_4_bis')
-error = Iter_4_3.Compute(1, 2)
+# Iteration iter_4_1 : raffinement selon les faces internes
+iter_4_1 = case_4.NextIteration('iter_4_1')
+iter_4_1.SetMeshName('PIQUAGE_1')
+iter_4_1.SetMeshFile(DIRCASE+'/maill.01.med')
+iter_4_1.AssociateHypo('hypo_4')
+error = iter_4_1.Compute(1, 2)
+# Iteration iter_4_2 : raffinement selon les faces externes
+iter_4_2 = iter_4_1.NextIteration('iter_4_2')
+iter_4_2.SetMeshName('PIQUAGE_2')
+iter_4_2.SetMeshFile(DIRCASE+'/maill.02.med')
+iter_4_2.AssociateHypo('hypo_4_bis')
+error = iter_4_2.Compute(1, 2)
+# Iteration iter_4_3 : second raffinement selon les faces externes
+iter_4_3 = iter_4_2.NextIteration('iter_4_3')
+iter_4_3.SetMeshName('PIQUAGE_3')
+iter_4_3.SetMeshFile(DIRCASE+'/maill.03.med')
+iter_4_3.AssociateHypo('hypo_4_bis')
+error = iter_4_3.Compute(1, 2)
# ==================================
-gzip_gunzip(data_dir, 4, 1)
+gzip_gunzip(DATA_TUTORIAL, 4, 1)
# ==================================
if salome.sg.hasDesktop():
Exemple de couplage HOMARD-Salome
Copyright EDF-R&D 1996, 2010, 2014
"""
-__revision__ = "V1.8"
+__revision__ = "V2.1"
#
import os
import sys
#
# ==================================
-pathHomard = os.getenv('HOMARD_ROOT_DIR')
+PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
# Repertoire des donnees du tutorial
-data_dir = os.path.join(pathHomard, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
-data_dir = os.path.normpath(data_dir)
-sys.path.append(data_dir)
+DATA_TUTORIAL = os.path.join(PATH_HOMARD, "share", "doc", "salome", "gui", "HOMARD", "fr", "_downloads")
+DATA_TUTORIAL = os.path.normpath(DATA_TUTORIAL)
+sys.path.append(DATA_TUTORIAL)
from tutorial_util import gzip_gunzip
from tutorial_util import creation_dircase
# ==================================
-dircase = creation_dircase(5)
-gzip_gunzip(data_dir, 5, -1)
+DIRCASE = creation_dircase(5)
+gzip_gunzip(DATA_TUTORIAL, 5, -1)
# ==================================
#
import salome
#
# Frontiere
# =========
-# Creation of the discrete boundary Boun_5_1
-Boun_5_1 = homard.CreateBoundaryDi('Boun_5_1', 'MAIL_EXT', data_dir+'/tutorial_5.fr.med')
+# Creation of the discrete boundary boun_5_1
+boun_5_1 = homard.CreateBoundaryDi('boun_5_1', 'MAIL_EXT', DATA_TUTORIAL+'/tutorial_5.fr.med')
#
# Creation des zones
# ==================
#
# Hypotheses
# ==========
-# Creation of the hypothesis Hypo_5
-Hypo_5 = homard.CreateHypothesis('Hypo_5')
-Hypo_5.AddZone('enveloppe', 1)
-# Creation of the hypothesis Hypo_5_bis
-Hypo_5_bis = homard.CreateHypothesis('Hypo_5_bis')
-Hypo_5_bis.AddZone('quart_sup', 1)
+# Creation of the hypothesis hypo_5
+hypo_5 = homard.CreateHypothesis('hypo_5')
+hypo_5.AddZone('enveloppe', 1)
+# Creation of the hypothesis hypo_5_bis
+hypo_5_bis = homard.CreateHypothesis('hypo_5_bis')
+hypo_5_bis.AddZone('quart_sup', 1)
#
# Cas
# ===
-Case_5 = homard.CreateCase('Case_5', 'COEUR_2D', data_dir+'/tutorial_5.00.med')
-Case_5.SetDirName(dircase)
-Case_5.SetConfType(3)
-Case_5.AddBoundaryGroup('Boun_5_1', '')
+case_5 = homard.CreateCase('Case_5', 'COEUR_2D', DATA_TUTORIAL+'/tutorial_5.00.med')
+case_5.SetDirName(DIRCASE)
+case_5.SetConfType(3)
+case_5.AddBoundaryGroup('boun_5_1', '')
#
-# Iteration "Iter_5_1"
+# Iteration "iter_5_1"
# ====================
-Iter_5_1 = Case_5.NextIteration('Iter_5_1')
-Iter_5_1.SetMeshName('COEUR_2D_01')
-Iter_5_1.SetMeshFile(dircase+'/maill.01.med')
-Iter_5_1.AssociateHypo('Hypo_5')
-error = Iter_5_1.Compute(1, 2)
+iter_5_1 = case_5.NextIteration('iter_5_1')
+iter_5_1.SetMeshName('COEUR_2D_01')
+iter_5_1.SetMeshFile(DIRCASE+'/maill.01.med')
+iter_5_1.AssociateHypo('hypo_5')
+error = iter_5_1.Compute(1, 2)
#
-# Iteration "Iter_5_2"
+# Iteration "iter_5_2"
# ====================
-Iter_5_2 = Iter_5_1.NextIteration('Iter_5_2')
-Iter_5_2.SetMeshName('COEUR_2D_02')
-Iter_5_2.SetMeshFile(dircase+'/maill.02.med')
-Iter_5_2.AssociateHypo('Hypo_5_bis')
-error = Iter_5_2.Compute(1, 2)
+iter_5_2 = iter_5_1.NextIteration('iter_5_2')
+iter_5_2.SetMeshName('COEUR_2D_02')
+iter_5_2.SetMeshFile(DIRCASE+'/maill.02.med')
+iter_5_2.AssociateHypo('hypo_5_bis')
+error = iter_5_2.Compute(1, 2)
# ==================================
-gzip_gunzip(data_dir, 5, 1)
+gzip_gunzip(DATA_TUTORIAL, 5, 1)
# ==================================
if salome.sg.hasDesktop():
Python script for HOMARD
Copyright EDF-R&D 2014
"""
-__revision__ = "V1.2"
+__revision__ = "V1.3"
import os
import sys
PATH_HOMARD = os.getenv('HOMARD_ROOT_DIR')
-# Repertoire
-REP_DATA = os.path.join(PATH_HOMARD, "share", "salome", "resources", "homard")
-REP_DATA = os.path.normpath(REP_DATA)
-sys.path.append(REP_DATA)
+# Repertoire des scripts utilitaires
+REP_PYTHON = os.path.join(PATH_HOMARD, "bin", "salome", "test", "HOMARD")
+REP_PYTHON = os.path.normpath(REP_PYTHON)
+sys.path.append(REP_PYTHON)
from test_util import remove_dir
#========================================================================