Python script for HOMARD
Test test_1
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "test_1"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
while not error :
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation of the zones
# =====================
zones_1_et_2.AddZone('Zone_1_1', 1)
zones_1_et_2.AddZone('Zone_1_2', 1)
laux = zones_1_et_2.GetZones()
- nbzone = len(laux)/2
+ nbzone = len(laux) // 2
jaux = 0
- for _ in range(nbzone) :
+ for iaux in range(nbzone) :
print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
jaux += 2
print(hyponame_2, " : champ utilisé :", zones_1_et_2.GetFieldName())
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
- raise Exception('Pb in homard_exec: ' + str(eee))
- raise Exception('Pb in homard_exec: '+eee.message)
++ raise Exception('Pb in homard_exec: '+str(eee.message))
#
# Test of the results
#
test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test test_2
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "test_2"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
while not error :
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation of the boundaries
# ==========================
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test test_3
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "test_3"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
while not error :
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation of the boundaries
# ==========================
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test test_4
"""
- __revision__ = "V2.2"
+ __revision__ = "V3.01"
#========================================================================
TEST_NAME = "test_4"
#
#========================================================================
#========================================================================
-def geom_smesh_exec(theStudy):
+def geom_smesh_exec():
"""
Python script for GEOM and SMESH
"""
#
while not error :
#
- geompy = geomBuilder.New(theStudy)
+ geompy = geomBuilder.New()
#
# Creation of the box
# ===================
# Creation of the mesh
# ====================
- smesh = smeshBuilder.New(theStudy)
+ smesh = smeshBuilder.New()
box_m = smesh.Mesh(box_g)
smesh.SetName(box_m.GetMesh(), 'MESH')
#
#
try:
ficmed = os.path.join(DIRCASE, 'maill.00.med')
- box_m.ExportMED( ficmed, 0, SMESH.MED_V2_2, 1, None, 1)
+ box_m.ExportMED(ficmed)
except Exception as eee:
error = 2
- raise Exception('ExportToMEDX() failed. '+eee.message)
+ raise Exception('ExportMED() failed. ' + str(eee))
#
break
#
#========================================================================
#
#========================================================================
-def field_exec(theStudy, niter):
+def field_exec(niter):
"""
Python script for MEDCoupling
"""
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
while not error :
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation of the zones
# =====================
hypo_4_1.AddZone('Zone_4_1', 1)
hypo_4_1.SetExtraOutput(2)
laux = hypo_4_1.GetZones()
- nbzone = len(laux)/2
+ nbzone = len(laux) // 2
jaux = 0
for iaux in range(nbzone) :
print(hyponame_1, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
hypo_4_2.AddZone('Zone_4_2', 1)
hypo_4_2.SetExtraOutput(2)
laux = hypo_4_2.GetZones()
- nbzone = len(laux)/2
+ nbzone = len(laux) // 2
jaux = 0
for iaux in range(nbzone) :
print(hyponame_2, " : ", dico[laux[jaux+1]], "sur la zone", laux[jaux])
# Creation of the iteration 3
#
- error = field_exec(theStudy, 2)
+ error = field_exec(2)
if error :
error = 30
break
# Geometry and Mesh
#
try :
- ERROR = geom_smesh_exec(salome.myStudy)
+ ERROR = geom_smesh_exec()
if ERROR :
raise Exception('Pb in geom_smesh_exec')
except Exception as eee:
- raise Exception('Pb in geom_smesh_exec: ' + str(eee))
- raise Exception('Pb in geom_smesh_exec: '+eee.message)
++ raise Exception('Pb in geom_smesh_exec: '+str(eee.message))
HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
assert HOMARD is not None, "Impossible to load homard engine"
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
- raise Exception('Pb in homard_exec: ' + str(eee))
- raise Exception('Pb in homard_exec: '+eee.message)
++ raise Exception('Pb in homard_exec: '+str(eee.message))
#
# Test of the results
#
test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Specific conditions for Code_Saturne
Test test_5
"""
- __revision__ = "V1.0"
+ __revision__ = "V2.01"
#========================================================================
TEST_NAME = "test_5"
#
#========================================================================
#========================================================================
-def mesh_exec(theStudy):
+def mesh_exec():
"""
Python script for MED
"""
meshMEDFile3D.write(ficmed, 2)
except Exception as eee:
error = 2
- raise Exception('ExportToMEDX() failed. '+eee.message)
+ raise Exception('MEDFileUMesh.write() failed. ' + str(eee))
#
break
#
#========================================================================
#
#========================================================================
-def field_exec(theStudy, niter):
+def field_exec(niter):
"""
Python script for MEDCoupling
"""
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
while not error :
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation of the hypothese DISTANCE INVERSE
# ==========================================
#
# Creation of the indicator
#
- error, ficmed_indic = field_exec(theStudy, niter)
+ error, ficmed_indic = field_exec(niter)
if error :
error = 10
break
# Geometry and Mesh
#
try :
- ERROR = mesh_exec(salome.myStudy)
+ ERROR = mesh_exec()
if ERROR :
raise Exception('Pb in mesh_exec')
except Exception as eee:
- raise Exception('Pb in mesh_exec: ' + str(eee))
- raise Exception('Pb in mesh_exec: '+eee.message)
++ raise Exception('Pb in mesh_exec: '+str(eee.message))
HOMARD = salome.lcc.FindOrLoadComponent('FactoryServer', 'HOMARD')
assert HOMARD is not None, "Impossible to load homard engine"
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
- raise Exception('Pb in homard_exec: ' + str(eee))
- raise Exception('Pb in homard_exec: '+eee.message)
++ raise Exception('Pb in homard_exec: '+str(eee.message))
#
# Test of the results
#
test_results(REP_DATA, TEST_NAME, DIRCASE, N_ITER_TEST_FILE, N_REP_TEST_FILE, DESTROY_DIR)
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test tutorial_1 associe au tutorial 1
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "tutorial_1"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
- homard.SetCurrentStudy(theStudy)
+ homard.UpdateStudy()
#
# Hypotheses
# ==========
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
# ==================================
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test tutorial_2 associe au tutorial 2
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "tutorial_2"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Creation des zones
# ==================
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
# ==================================
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test tutorial_3 associe au tutorial 3
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "tutorial_3"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Hypothese "hypo_0vers1"
# =======================
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
# ==================================
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test tutorial_4 associe au tutorial 4
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "tutorial_4"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Frontieres
# ==========
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
# ==================================
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)
Python script for HOMARD
Test tutorial_5 associe au tutorial 5
"""
- __revision__ = "V3.1"
+ __revision__ = "V4.01"
#========================================================================
TEST_NAME = "tutorial_5"
#
#========================================================================
#========================================================================
-def homard_exec(theStudy):
+def homard_exec():
"""
Python script for HOMARD
"""
#
- HOMARD.SetCurrentStudy(theStudy)
+ HOMARD.UpdateStudy()
#
# Frontiere
# =========
# Exec of HOMARD-SALOME
#
try :
- ERROR = homard_exec(salome.myStudy)
+ ERROR = homard_exec()
if ERROR :
raise Exception('Pb in homard_exec at iteration %d' %ERROR )
except Exception as eee:
# ==================================
#
if salome.sg.hasDesktop():
- salome.sg.updateObjBrowser(True)
+ salome.sg.updateObjBrowser()
iparameters.getSession().restoreVisualState(1)