mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-24 16:30:34 +05:00
Check result of Compute() in test
This commit is contained in:
parent
38ab7c3864
commit
7fe1146f76
@ -100,8 +100,11 @@ smesh.SetName(hypArea200, "Max. Element Area")
|
||||
|
||||
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()
|
||||
|
||||
|
@ -76,8 +76,13 @@ hypNbSeg2 = algoReg2.NumberOfSegments(34)
|
||||
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
|
||||
|
@ -86,8 +86,13 @@ smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2))
|
||||
|
||||
|
||||
# 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()
|
||||
|
@ -29,7 +29,8 @@ def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theEl
|
||||
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()
|
||||
@ -48,7 +49,9 @@ def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType):
|
||||
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())
|
||||
|
||||
|
@ -73,7 +73,9 @@ algo1D_1=Mesh_inf.Segment()
|
||||
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")
|
||||
@ -86,7 +88,9 @@ algo1D_2=Mesh_sup.Segment()
|
||||
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")
|
||||
|
@ -28,7 +28,9 @@ from SMESH_test1 import *
|
||||
|
||||
# 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"])
|
||||
|
@ -34,7 +34,9 @@ from SMESH_test1 import *
|
||||
|
||||
# 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"])
|
||||
@ -70,7 +72,10 @@ print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
|
||||
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())
|
||||
|
||||
|
@ -39,7 +39,9 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
|
||||
#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 )
|
||||
|
@ -147,7 +147,9 @@ smesh.SetName(hVolume, "MaxElementVolume_"+str(theMaxElementVolume))
|
||||
|
||||
|
||||
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())
|
||||
|
@ -102,13 +102,17 @@ def run_test(nbox=2, boxsize=100):
|
||||
|
||||
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
|
||||
|
||||
|
@ -169,19 +169,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
||||
|
||||
print("-------------------------- compute the mesh of alveole ")
|
||||
ret = mesh.Compute()
|
||||
if not ret:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
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")
|
||||
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()
|
||||
|
@ -116,6 +116,8 @@ algo = my_hexa.Segment()
|
||||
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()
|
||||
|
@ -68,6 +68,8 @@ alg3D.SetName("algo3D")
|
||||
|
||||
# compute mesh
|
||||
|
||||
box_mesh.Compute()
|
||||
isDone = box_mesh.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
sg.updateObjBrowser()
|
||||
|
@ -124,18 +124,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
||||
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()
|
||||
|
@ -134,18 +134,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
||||
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()
|
||||
|
@ -93,18 +93,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
||||
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()
|
||||
|
@ -73,6 +73,8 @@ top_1 = Mesh_1.GroupOnGeom(top,'top',SMESH.FACE)
|
||||
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()
|
||||
|
||||
|
@ -83,6 +83,8 @@ algo3d = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_3D)
|
||||
algo3d.MaxElementVolume(0.0002)
|
||||
|
||||
isDone = Mesh_1.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Create groups
|
||||
d_geom_groups = {}
|
||||
|
@ -180,21 +180,20 @@ salome.sg.updateObjBrowser()
|
||||
|
||||
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()
|
||||
|
@ -85,18 +85,18 @@ hexa3D.SetName("Hexa_3D")
|
||||
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()
|
||||
|
@ -64,16 +64,15 @@ netgen.SetFineness( smeshBuilder.Fine )
|
||||
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()
|
||||
|
@ -96,19 +96,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
||||
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()
|
||||
|
@ -94,17 +94,17 @@ smesh.SetName(hypLengthFromEdge,"LengthFromEdge")
|
||||
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()
|
||||
|
@ -59,8 +59,9 @@ algoMef = mesh.Triangle()
|
||||
hypArea = algoMef.MaxElementArea(20)
|
||||
|
||||
|
||||
mesh.Compute()
|
||||
|
||||
isDone = mesh.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Criterion : Free edges. Create group.
|
||||
|
||||
|
@ -87,15 +87,15 @@ for edges in edgeGroups: # loop on groups of logically parallel edges
|
||||
# ---- 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()
|
||||
|
@ -177,7 +177,9 @@ smesh.SetName(algo.GetSubMesh(), "SubMeshFace4")
|
||||
|
||||
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())
|
||||
|
@ -181,7 +181,9 @@ submesh4 = algo.GetSubMesh()
|
||||
|
||||
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())
|
||||
|
@ -122,17 +122,16 @@ netgen.SetQuadAllowed( 1 )
|
||||
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()
|
||||
|
@ -147,7 +147,9 @@ smesh.SetName(hypVolume, "maxElementVolume_" + str(maxElementVolume))
|
||||
|
||||
|
||||
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())
|
||||
|
@ -94,6 +94,9 @@ face = salome.IDToObject(idf)
|
||||
|
||||
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("-------")
|
||||
|
@ -109,7 +109,9 @@ print(hypArea2.GetId())
|
||||
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()
|
||||
|
||||
|
@ -31,6 +31,9 @@ from SMESH_test1 import *
|
||||
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)
|
||||
|
@ -66,7 +66,9 @@ algo4.MaxElementArea(100)
|
||||
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:
|
||||
|
@ -44,7 +44,8 @@ smesh.SetEnablePublish( True ) # Set to False to avoid publish in study if not n
|
||||
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')
|
||||
|
@ -64,7 +64,8 @@ NETGEN_3D_Parameters_1.SetFuseEdges( 1 )
|
||||
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')
|
||||
|
@ -76,6 +76,8 @@ class SMESHExportOfFieldsInMemory(unittest.TestCase):
|
||||
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 )
|
||||
@ -165,6 +167,8 @@ class SMESHExportOfFieldsInMemory(unittest.TestCase):
|
||||
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
|
||||
|
@ -174,6 +174,8 @@ def createMesh(algo):
|
||||
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
|
||||
|
@ -318,7 +318,9 @@ algo.Propagation()
|
||||
# Compute the mesh
|
||||
# ----------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -120,7 +120,9 @@ hexa.Hexahedron()
|
||||
# Compute the mesh
|
||||
# ----------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -107,7 +107,9 @@ hexa.Hexahedron()
|
||||
# Compute the mesh
|
||||
# ----------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -112,7 +112,9 @@ localMesh(box_tetra2, 0)
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
mixed.Compute()
|
||||
isDone = mixed.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -147,7 +147,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -164,7 +164,9 @@ algo4.Propagation()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -104,7 +104,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -137,7 +137,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -140,7 +140,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -102,7 +102,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -123,7 +123,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -143,7 +143,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
t3= time.time()
|
||||
|
||||
|
@ -256,7 +256,9 @@ local(cyl_x+d, cyl_y+d, box_dz, 10)
|
||||
# Compute the mesh
|
||||
# ----------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -141,7 +141,9 @@ while m_i<m_n:
|
||||
# Calculer le maillage
|
||||
# --------------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -200,7 +200,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -144,7 +144,9 @@ local(gx+g_dx, gy-g_dy, gz , 21)
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -103,7 +103,10 @@ hexa.Hexahedron()
|
||||
# Calcul du maillage
|
||||
# ------------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
||||
|
@ -140,7 +140,9 @@ hexa.Hexahedron()
|
||||
# Calcul du maillage
|
||||
# ------------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Update object browser
|
||||
# ---------------------
|
||||
|
@ -180,7 +180,9 @@ hexa.Hexahedron()
|
||||
# Mesh calculus
|
||||
# -------------
|
||||
|
||||
hexa.Compute()
|
||||
isDone = hexa.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Le groupe de mailles
|
||||
# --------------------
|
||||
|
@ -126,7 +126,9 @@ algo3d.MaxElementVolume(100)
|
||||
# Compute the mesh
|
||||
# ----------------
|
||||
|
||||
tetra.Compute()
|
||||
isDone = tetra.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Create a groupe of faces
|
||||
# ------------------------
|
||||
|
@ -125,7 +125,9 @@ discretize( +radius, 0, height/2, 20)
|
||||
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)
|
||||
|
@ -170,7 +170,9 @@ refine(MyMesh, P2, P3, 12, 14, "Haut" )
|
||||
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)
|
||||
|
||||
|
@ -42,6 +42,8 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
|
||||
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
|
||||
|
||||
|
@ -81,6 +81,8 @@ algo3d.SetKeepFiles(False)
|
||||
# --------------
|
||||
|
||||
status = m.Compute()
|
||||
if not status:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
# Test if ok
|
||||
# ----------
|
||||
|
@ -42,6 +42,8 @@ Nb_Segments_1.SetDistrType( 0 )
|
||||
Quadrangle_2D = Mesh_1.Quadrangle()
|
||||
Hexa_3D = Mesh_1.Hexahedron()
|
||||
isDone = Mesh_1.Compute()
|
||||
if not isDone:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
### CreateDimGroup()
|
||||
|
||||
|
@ -18,7 +18,9 @@ smesh = smeshBuilder.New()
|
||||
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
|
||||
|
||||
|
@ -33,6 +33,9 @@ Regular_1D = Mesh_1.Segment()
|
||||
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 )
|
||||
|
@ -70,8 +70,10 @@ def test_netgen3d():
|
||||
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:
|
||||
|
@ -105,7 +105,6 @@ PolygonPerFace_2D = Mesh_1.Polygon()
|
||||
PolyhedronPerSolid_3D = Mesh_1.Polyhedron()
|
||||
|
||||
ok = Mesh_1.Compute()
|
||||
|
||||
if not ok:
|
||||
raise Exception("Error when computing Mesh")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user