print("---------------------Compute the mesh")
-ret = mesh.Compute()
-print(ret)
+isDone = mesh.Compute()
+print(isDone)
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
salome.sg.updateObjBrowser()
smesh.SetName(hypNbSeg2, "NumberOfSegments 2")
# compute meshes
-mesh1.Compute()
-mesh2.Compute()
+isDone = mesh1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
+isDone = mesh2.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# ---- udate object browser
# compute meshes
-mesh1.Compute()
-mesh2.Compute()
+isDone = mesh1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
+isDone = mesh2.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# ---- update object browser
salome.sg.updateObjBrowser()
aName = str(theSubShape)
geompy.addToStudyInFather(theShape,theSubShape,aName)
- theMeshGen.Compute(theMesh,theShape)
+ if not theMeshGen.Compute(theMesh,theShape):
+ raise Exception("Error when computing Mesh")
aFilterMgr = theMeshGen.CreateFilterManager()
aFilter = aFilterMgr.CreateFilter()
aName = str(theSubShape)
geompy.addToStudyInFather(theShape,theSubShape,aName)
- theMesh.Compute()
+ if not theMesh.Compute():
+ raise Exception("Error when computing Mesh")
+
aFilter = smesh.GetFilter(theElemType, SMESH.FT_BelongToGeom, theSubShape)
return aFilter.GetElementsId(theMesh.GetMesh())
algo1D_1.NumberOfSegments(10)
algo2D_1=Mesh_inf.Quadrangle()
algo3D_1=Mesh_inf.Hexahedron()
-Mesh_inf.Compute()
+isDone = Mesh_inf.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# create a group on the top face
Gsup1=Mesh_inf.Group(Fsup1, "Sup")
algo1D_2.NumberOfSegments(5)
algo2D_2=Mesh_sup.Quadrangle()
algo3D_2=Mesh_sup.Hexahedron()
-Mesh_sup.Compute()
+isDone = Mesh_sup.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# create a group on the top face
Gsup2=Mesh_sup.Group(Fsup2, "Sup")
# Compute the mesh created in SMESH_test1
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Create geometry groups on plane:
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
# Compute the mesh created in SMESH_test1
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Create geometry groups on plane:
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
print(" ")
print("Re-compute mesh, contents of aGroupOnShell changes again:")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
print("aGroupOnShell size =", aGroupOnShell.Size())
print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
#Example
from SMESH_test1 import *
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# First way
BuildGroupLyingOn(mesh.GetMesh(), SMESH.FACE, "Group of faces lying on edge #1", edge )
print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
print("Information about the Nut:")
print("Number of nodes : ", mesh.NbNodes())
start = time.monotonic()
is_done = seq_mesh.Compute()
- assert is_done
+ if not is_done:
+ raise Exception("Error when computing Mesh")
+
stop = time.monotonic()
time_seq = stop-start
start = time.monotonic()
is_done = par_mesh.Compute()
- assert is_done
+ if not is_done:
+ raise Exception("Error when computing Mesh")
+
stop = time.monotonic()
time_par = stop-start
print("-------------------------- compute the mesh of alveole ")
ret = mesh.Compute()
-
-if ret != 0:
- log=mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the Mesh_mechanic:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
- print("problem when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the Mesh_mechanic:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
salome.sg.updateObjBrowser()
algo.NumberOfSegments(NbSeg)
my_hexa.Quadrangle()
my_hexa.Hexahedron()
-my_hexa.Compute()
+isDone = my_hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
salome.sg.updateObjBrowser()
# compute mesh
-box_mesh.Compute()
+isDone = box_mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
sg.updateObjBrowser()
print("-------------------------- compute shell")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the MeshBox2:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
- print("probleme when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the MeshBox2:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute shell")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the MeshBox3:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
- print("probleme when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the MeshBox3:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute the mesh of the box")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the MeshBox:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
- print("probleme when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the MeshBox:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
salome.sg.updateObjBrowser()
middle_1 = Mesh_1.GroupOnGeom(middle,'middle',SMESH.FACE)
bottom_1 = Mesh_1.GroupOnGeom(bottom,'bottom',SMESH.FACE)
isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
[ top_1, middle_1, bottom_1 ] = Mesh_1.GetGroups()
algo3d.MaxElementVolume(0.0002)
isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Create groups
d_geom_groups = {}
print("-------------------------- compute the mesh of the volume")
-ret=mesh.Compute()
-
+ret = mesh.Compute()
print(ret)
-if ret != 0:
-## log=mesh.GetLog(0) # no erase trace
-## for linelog in log:
-## print linelog
- print("Information about the MeshBox :")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons: ", mesh.NbTetras())
-else:
- print("problem when Computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+##log=mesh.GetLog(0) # no erase trace
+##for linelog in log:
+## print linelog
+print("Information about the MeshBox :")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons: ", mesh.NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute compshell")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the MeshcompShel:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of quadrangles : ", mesh.NbQuadrangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of hexahedrons : ", mesh.NbHexas())
-else:
- print("problem when Computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the MeshcompShel:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of quadrangles : ", mesh.NbQuadrangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of hexahedrons : ", mesh.NbHexas())
salome.sg.updateObjBrowser()
print("-------------------------- compute mesh")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- print("Information about the MeshcompShel:")
- print("Number of nodes : ", mesh.GetMesh().NbNodes())
- print("Number of edges : ", mesh.GetMesh().NbEdges())
- print("Number of faces : ", mesh.GetMesh().NbFaces())
- print("Number of triangles : ", mesh.GetMesh().NbTriangles())
- print("Number of volumes : ", mesh.GetMesh().NbVolumes())
- print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
-
-else:
- print("problem when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+print("Information about the MeshcompShel:")
+print("Number of nodes : ", mesh.GetMesh().NbNodes())
+print("Number of edges : ", mesh.GetMesh().NbEdges())
+print("Number of faces : ", mesh.GetMesh().NbFaces())
+print("Number of triangles : ", mesh.GetMesh().NbTriangles())
+print("Number of volumes : ", mesh.GetMesh().NbVolumes())
+print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute compshell")
ret = mesh.Compute(mesh)
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the MeshcompShel:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons : ", mesh.NbTetras())
-
-else:
- print("problem when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the MeshcompShel:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons : ", mesh.NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute the skin flight")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- log = mesh.GetLog(0) # no erase trace
- # for linelog in log:
- # print(linelog)
- print("Information about the Mesh_mechanic_tetra:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of volumes : ", mesh.NbVolumes())
-else:
- print("probleme when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+log = mesh.GetLog(0) # no erase trace
+# for linelog in log:
+# print(linelog)
+print("Information about the Mesh_mechanic_tetra:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of volumes : ", mesh.NbVolumes())
salome.sg.updateObjBrowser()
hypArea = algoMef.MaxElementArea(20)
-mesh.Compute()
-
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Criterion : Free edges. Create group.
# ---- compute mesh
print("-------------------------- compute mesh")
ok = mesh.Compute()
-if ok:
- print("Information about the Mesh:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of quadrangles : ", mesh.NbQuadrangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of hexahedrons : ", mesh.NbHexas())
-else:
- print("problem when Computing the mesh")
+if not ok:
+ raise Exception("Error when computing Mesh")
+
+print("Information about the Mesh:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of quadrangles : ", mesh.NbQuadrangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of hexahedrons : ", mesh.NbHexas())
salome.sg.updateObjBrowser()
print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
print("Information about the Mesh_mechanic:")
print("Number of nodes : ", mesh.NbNodes())
print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
print("Information about the Mesh_mechanic:")
print("Number of nodes : ", mesh.NbNodes())
print("-------------------------- compute mesh")
ret = mesh.Compute()
print(ret)
-if ret != 0:
- print("Information about the MeshcompShel:")
- print("Number of nodes : ", mesh.NbNodes())
- print("Number of edges : ", mesh.NbEdges())
- print("Number of faces : ", mesh.NbFaces())
- print("Number of triangles : ", mesh.NbTriangles())
- print("Number of quadrangles : ", mesh.NbQuadrangles())
- print("Number of volumes : ", mesh.NbVolumes())
- print("Number of tetrahedrons : ", mesh.NbTetras())
-
-else:
- print("problem when computing the mesh")
+if not ret:
+ raise Exception("Error when computing Mesh")
+
+print("Information about the MeshcompShel:")
+print("Number of nodes : ", mesh.NbNodes())
+print("Number of edges : ", mesh.NbEdges())
+print("Number of faces : ", mesh.NbFaces())
+print("Number of triangles : ", mesh.NbTriangles())
+print("Number of quadrangles : ", mesh.NbQuadrangles())
+print("Number of volumes : ", mesh.NbVolumes())
+print("Number of tetrahedrons : ", mesh.NbTetras())
salome.sg.updateObjBrowser()
print("-------------------------- compute the mesh of the mechanic piece")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
print("Information about the Mesh_mechanic_tetra:")
print("Number of nodes : ", mesh.NbNodes())
ret = mesh.Compute(face)
print(ret)
+if not ret:
+ raise Exception("Error when computing Mesh")
+
log = [] #mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after
for a in log:
print("-------")
print(hypArea2.GetMaxElementArea())
smesh.SetName(hypArea2, "MaxElementArea_500")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
salome.sg.updateObjBrowser()
print("-------------------------- compute box")
ret = mesh.Compute()
print(ret)
+if not ret:
+ raise Exception("Error when computing Mesh")
+
log = mesh.GetLog(0); # no erase trace
# for linelog in log:
# print(linelog)
submesh = algo4.GetSubMesh()
smesh.SetName(submesh, "SubMeshFace")
-mesh.Compute()
+isDone = mesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
faces = submesh.GetElementsByType(SMESH.FACE)
if len(faces) > 1:
Mesh_1 = smesh.Mesh(Box_1)
NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
isDone = Mesh_1.Compute()
-
+if not isDone:
+ raise Exception("Error when computing Mesh")
## Set names of Mesh objects
smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
NETGEN_3D_Parameters_1.SetQuadAllowed( 0 )
NETGEN_3D_Parameters_1.SetCheckChartBoundary( 152 )
isDone = Mesh_1.Compute()
-
+if not isDone:
+ raise Exception("Error when computing Mesh")
## Set names of Mesh objects
smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
isDone = Mesh_1.Compute()
+ if not isDone:
+ raise Exception("Error when computing Mesh")
smesh.SetName(Mesh_1, 'Mesh_1')
#### Mesh_1.ExportMED( r'Mesh_with_one_field_on_cells.med', 0, 41, 1, Mesh_1.GetMesh(), 1, [ Field_1_1 ], '',-1 )
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
isDone = Mesh_1.Compute()
+ if not isDone:
+ raise Exception("Error when computing Mesh")
smesh.SetName(Mesh_1, 'Mesh_1')
# 23th of june 2021 : Bug both in ExportMED and in ExportMEDCoupling
algo_1d_sub.Propagation()
isDone = Mesh_1.Compute()
+ if not isDone:
+ raise Exception("Error when computing Mesh")
nb_nodes = Mesh_1.NbNodes()
# Create 2 cracks by two calls of DoubleNodeElemGroups
# Compute the mesh
# ----------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Compute the mesh
# ----------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Compute the mesh
# ----------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-mixed.Compute()
+isDone = mixed.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
t3= time.time()
# Compute the mesh
# ----------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Calculer le maillage
# --------------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Calcul du maillage
# ------------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
# Update object browser
# ---------------------
# Calcul du maillage
# ------------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Update object browser
# ---------------------
# Mesh calculus
# -------------
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Le groupe de mailles
# --------------------
# Compute the mesh
# ----------------
-tetra.Compute()
+isDone = tetra.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# Create a groupe of faces
# ------------------------
hexa.Quadrangle()
hexa.Hexahedron()
-hexa.Compute()
+isDone = hexa.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
hexa.Group(group_a)
hexa.Group(group_b)
algo2D = MyMesh.Triangle()
algo2D.MaxElementArea(0.07)
-MyMesh.Compute()
+isDone = MyMesh.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
MyMesh.ExportMED(path+"110_triangles.med", 0)
Nb_Segments_1.SetDistrType( 0 )
Quadrangle_2D = Mesh_1.Quadrangle()
isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# groups creation
# --------------
status = m.Compute()
+if not status:
+ raise Exception("Error when computing Mesh")
# Test if ok
# ----------
Quadrangle_2D = Mesh_1.Quadrangle()
Hexa_3D = Mesh_1.Hexahedron()
isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
### CreateDimGroup()
Mesh_1 = smesh.Mesh( Box_1 )
Mesh_1.Segment().NumberOfSegments(15)
Mesh_1.Triangle()
-Mesh_1.Compute()
+isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
# define arguments for MakePolyLine
Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
isDone = Mesh_1.Compute()
+if not isDone:
+ raise Exception("Error when computing Mesh")
+
aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
isDone = Mesh_1.QuadToTriObject( Mesh_1, )
Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 1 )
mesh_2d = smesh.Mesh(groupe_1, 'Maillage_1')
mesh_2d.AddHypothesis(groupe_1, netgen_2d_parameters_1)
mesh_2d.Triangle(algo=smeshBuilder.NETGEN_1D2D)
- is_done = mesh_2d.Compute()
- assert is_done
+ isDone = mesh_2d.Compute()
+ if not isDone:
+ raise Exception("Error when computing Mesh")
+
smesh.SetName(mesh_2d, 'Maillage_1')
with tempfile.TemporaryDirectory() as tmp_dir:
PolyhedronPerSolid_3D = Mesh_1.Polyhedron()
ok = Mesh_1.Compute()
-
if not ok:
raise Exception("Error when computing Mesh")