#
#========================================================================
#========================================================================
-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: '+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: '+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)