mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 08:50:35 +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")
|
print("---------------------Compute the mesh")
|
||||||
|
|
||||||
ret = mesh.Compute()
|
isDone = mesh.Compute()
|
||||||
print(ret)
|
print(isDone)
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
|
||||||
|
@ -76,8 +76,13 @@ hypNbSeg2 = algoReg2.NumberOfSegments(34)
|
|||||||
smesh.SetName(hypNbSeg2, "NumberOfSegments 2")
|
smesh.SetName(hypNbSeg2, "NumberOfSegments 2")
|
||||||
|
|
||||||
# compute meshes
|
# compute meshes
|
||||||
mesh1.Compute()
|
isDone = mesh1.Compute()
|
||||||
mesh2.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
|
# ---- udate object browser
|
||||||
|
@ -86,8 +86,13 @@ smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2))
|
|||||||
|
|
||||||
|
|
||||||
# compute meshes
|
# compute meshes
|
||||||
mesh1.Compute()
|
isDone = mesh1.Compute()
|
||||||
mesh2.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
|
# ---- update object browser
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -29,7 +29,8 @@ def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theEl
|
|||||||
aName = str(theSubShape)
|
aName = str(theSubShape)
|
||||||
geompy.addToStudyInFather(theShape,theSubShape,aName)
|
geompy.addToStudyInFather(theShape,theSubShape,aName)
|
||||||
|
|
||||||
theMeshGen.Compute(theMesh,theShape)
|
if not theMeshGen.Compute(theMesh,theShape):
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
aFilterMgr = theMeshGen.CreateFilterManager()
|
aFilterMgr = theMeshGen.CreateFilterManager()
|
||||||
aFilter = aFilterMgr.CreateFilter()
|
aFilter = aFilterMgr.CreateFilter()
|
||||||
@ -48,7 +49,9 @@ def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType):
|
|||||||
aName = str(theSubShape)
|
aName = str(theSubShape)
|
||||||
geompy.addToStudyInFather(theShape,theSubShape,aName)
|
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)
|
aFilter = smesh.GetFilter(theElemType, SMESH.FT_BelongToGeom, theSubShape)
|
||||||
return aFilter.GetElementsId(theMesh.GetMesh())
|
return aFilter.GetElementsId(theMesh.GetMesh())
|
||||||
|
|
||||||
|
@ -73,7 +73,9 @@ algo1D_1=Mesh_inf.Segment()
|
|||||||
algo1D_1.NumberOfSegments(10)
|
algo1D_1.NumberOfSegments(10)
|
||||||
algo2D_1=Mesh_inf.Quadrangle()
|
algo2D_1=Mesh_inf.Quadrangle()
|
||||||
algo3D_1=Mesh_inf.Hexahedron()
|
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
|
# create a group on the top face
|
||||||
Gsup1=Mesh_inf.Group(Fsup1, "Sup")
|
Gsup1=Mesh_inf.Group(Fsup1, "Sup")
|
||||||
@ -86,7 +88,9 @@ algo1D_2=Mesh_sup.Segment()
|
|||||||
algo1D_2.NumberOfSegments(5)
|
algo1D_2.NumberOfSegments(5)
|
||||||
algo2D_2=Mesh_sup.Quadrangle()
|
algo2D_2=Mesh_sup.Quadrangle()
|
||||||
algo3D_2=Mesh_sup.Hexahedron()
|
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
|
# create a group on the top face
|
||||||
Gsup2=Mesh_sup.Group(Fsup2, "Sup")
|
Gsup2=Mesh_sup.Group(Fsup2, "Sup")
|
||||||
|
@ -28,7 +28,9 @@ from SMESH_test1 import *
|
|||||||
|
|
||||||
# Compute the mesh created in SMESH_test1
|
# 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:
|
# Create geometry groups on plane:
|
||||||
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
|
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
|
||||||
|
@ -34,7 +34,9 @@ from SMESH_test1 import *
|
|||||||
|
|
||||||
# Compute the mesh created in SMESH_test1
|
# 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:
|
# Create geometry groups on plane:
|
||||||
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
|
aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"])
|
||||||
@ -70,7 +72,10 @@ print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
|
|||||||
print(" ")
|
print(" ")
|
||||||
|
|
||||||
print("Re-compute mesh, contents of aGroupOnShell changes again:")
|
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 size =", aGroupOnShell.Size())
|
||||||
print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
|
print("aGroupOnShell ids :", aGroupOnShell.GetListOfID())
|
||||||
|
|
||||||
|
@ -39,7 +39,9 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape):
|
|||||||
#Example
|
#Example
|
||||||
from SMESH_test1 import *
|
from SMESH_test1 import *
|
||||||
|
|
||||||
mesh.Compute()
|
isDone = mesh.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# First way
|
# First way
|
||||||
BuildGroupLyingOn(mesh.GetMesh(), SMESH.FACE, "Group of faces lying on edge #1", edge )
|
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")
|
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("Information about the Nut:")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
|
@ -102,13 +102,17 @@ def run_test(nbox=2, boxsize=100):
|
|||||||
|
|
||||||
start = time.monotonic()
|
start = time.monotonic()
|
||||||
is_done = seq_mesh.Compute()
|
is_done = seq_mesh.Compute()
|
||||||
assert is_done
|
if not is_done:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
stop = time.monotonic()
|
stop = time.monotonic()
|
||||||
time_seq = stop-start
|
time_seq = stop-start
|
||||||
|
|
||||||
start = time.monotonic()
|
start = time.monotonic()
|
||||||
is_done = par_mesh.Compute()
|
is_done = par_mesh.Compute()
|
||||||
assert is_done
|
if not is_done:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
stop = time.monotonic()
|
stop = time.monotonic()
|
||||||
time_par = stop-start
|
time_par = stop-start
|
||||||
|
|
||||||
|
@ -169,19 +169,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
|||||||
|
|
||||||
print("-------------------------- compute the mesh of alveole ")
|
print("-------------------------- compute the mesh of alveole ")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
|
if not ret:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
if ret != 0:
|
log = mesh.GetLog(0) # no erase trace
|
||||||
log=mesh.GetLog(0) # no erase trace
|
# for linelog in log:
|
||||||
# for linelog in log:
|
# print(linelog)
|
||||||
# print(linelog)
|
print("Information about the Mesh_mechanic:")
|
||||||
print("Information about the Mesh_mechanic:")
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of tetrahedrons: ", mesh.NbTetras())
|
||||||
print("Number of tetrahedrons: ", mesh.NbTetras())
|
|
||||||
else:
|
|
||||||
print("problem when computing the mesh")
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -116,6 +116,8 @@ algo = my_hexa.Segment()
|
|||||||
algo.NumberOfSegments(NbSeg)
|
algo.NumberOfSegments(NbSeg)
|
||||||
my_hexa.Quadrangle()
|
my_hexa.Quadrangle()
|
||||||
my_hexa.Hexahedron()
|
my_hexa.Hexahedron()
|
||||||
my_hexa.Compute()
|
isDone = my_hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -68,6 +68,8 @@ alg3D.SetName("algo3D")
|
|||||||
|
|
||||||
# compute mesh
|
# compute mesh
|
||||||
|
|
||||||
box_mesh.Compute()
|
isDone = box_mesh.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
sg.updateObjBrowser()
|
sg.updateObjBrowser()
|
||||||
|
@ -124,18 +124,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
|||||||
print("-------------------------- compute shell")
|
print("-------------------------- compute shell")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshBox2:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshBox2:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of tetrahedrons: ", mesh.NbTetras())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("probleme when computing the mesh")
|
print("Number of tetrahedrons: ", mesh.NbTetras())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -134,18 +134,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
|||||||
print("-------------------------- compute shell")
|
print("-------------------------- compute shell")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshBox3:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshBox3:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of tetrahedrons: ", mesh.NbTetras())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("probleme when computing the mesh")
|
print("Number of tetrahedrons: ", mesh.NbTetras())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -93,18 +93,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
|||||||
print("-------------------------- compute the mesh of the box")
|
print("-------------------------- compute the mesh of the box")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshBox:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshBox:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of tetrahedrons: ", mesh.NbTetras())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("probleme when computing the mesh")
|
print("Number of tetrahedrons: ", mesh.NbTetras())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
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)
|
middle_1 = Mesh_1.GroupOnGeom(middle,'middle',SMESH.FACE)
|
||||||
bottom_1 = Mesh_1.GroupOnGeom(bottom,'bottom',SMESH.FACE)
|
bottom_1 = Mesh_1.GroupOnGeom(bottom,'bottom',SMESH.FACE)
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
[ top_1, middle_1, bottom_1 ] = Mesh_1.GetGroups()
|
[ 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)
|
algo3d.MaxElementVolume(0.0002)
|
||||||
|
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Create groups
|
# Create groups
|
||||||
d_geom_groups = {}
|
d_geom_groups = {}
|
||||||
|
@ -180,21 +180,20 @@ salome.sg.updateObjBrowser()
|
|||||||
|
|
||||||
print("-------------------------- compute the mesh of the volume")
|
print("-------------------------- compute the mesh of the volume")
|
||||||
|
|
||||||
ret=mesh.Compute()
|
ret = mesh.Compute()
|
||||||
|
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
## log=mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
## for linelog in log:
|
|
||||||
## print linelog
|
##log=mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshBox :")
|
##for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
## print linelog
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshBox :")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of tetrahedrons: ", mesh.NbTetras())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("problem when Computing the mesh")
|
print("Number of tetrahedrons: ", mesh.NbTetras())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -85,18 +85,18 @@ hexa3D.SetName("Hexa_3D")
|
|||||||
print("-------------------------- compute compshell")
|
print("-------------------------- compute compshell")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshcompShel:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshcompShel:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of hexahedrons : ", mesh.NbHexas())
|
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("problem when Computing the mesh")
|
print("Number of hexahedrons : ", mesh.NbHexas())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -64,16 +64,15 @@ netgen.SetFineness( smeshBuilder.Fine )
|
|||||||
print("-------------------------- compute mesh")
|
print("-------------------------- compute mesh")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
print("Information about the MeshcompShel:")
|
raise Exception("Error when computing Mesh")
|
||||||
print("Number of nodes : ", mesh.GetMesh().NbNodes())
|
|
||||||
print("Number of edges : ", mesh.GetMesh().NbEdges())
|
print("Information about the MeshcompShel:")
|
||||||
print("Number of faces : ", mesh.GetMesh().NbFaces())
|
print("Number of nodes : ", mesh.GetMesh().NbNodes())
|
||||||
print("Number of triangles : ", mesh.GetMesh().NbTriangles())
|
print("Number of edges : ", mesh.GetMesh().NbEdges())
|
||||||
print("Number of volumes : ", mesh.GetMesh().NbVolumes())
|
print("Number of faces : ", mesh.GetMesh().NbFaces())
|
||||||
print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
|
print("Number of triangles : ", mesh.GetMesh().NbTriangles())
|
||||||
|
print("Number of volumes : ", mesh.GetMesh().NbVolumes())
|
||||||
else:
|
print("Number of tetrahedrons : ", mesh.GetMesh().NbTetras())
|
||||||
print("problem when computing the mesh")
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -96,19 +96,18 @@ smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume))
|
|||||||
print("-------------------------- compute compshell")
|
print("-------------------------- compute compshell")
|
||||||
ret = mesh.Compute(mesh)
|
ret = mesh.Compute(mesh)
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the MeshcompShel:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshcompShel:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of tetrahedrons : ", mesh.NbTetras())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
else:
|
print("Number of tetrahedrons : ", mesh.NbTetras())
|
||||||
print("problem when computing the mesh")
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -94,17 +94,17 @@ smesh.SetName(hypLengthFromEdge,"LengthFromEdge")
|
|||||||
print("-------------------------- compute the skin flight")
|
print("-------------------------- compute the skin flight")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
log = mesh.GetLog(0) # no erase trace
|
raise Exception("Error when computing Mesh")
|
||||||
# for linelog in log:
|
|
||||||
# print(linelog)
|
log = mesh.GetLog(0) # no erase trace
|
||||||
print("Information about the Mesh_mechanic_tetra:")
|
# for linelog in log:
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
# print(linelog)
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the Mesh_mechanic_tetra:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
else:
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
print("probleme when computing the mesh")
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -59,8 +59,9 @@ algoMef = mesh.Triangle()
|
|||||||
hypArea = algoMef.MaxElementArea(20)
|
hypArea = algoMef.MaxElementArea(20)
|
||||||
|
|
||||||
|
|
||||||
mesh.Compute()
|
isDone = mesh.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Criterion : Free edges. Create group.
|
# Criterion : Free edges. Create group.
|
||||||
|
|
||||||
|
@ -87,15 +87,15 @@ for edges in edgeGroups: # loop on groups of logically parallel edges
|
|||||||
# ---- compute mesh
|
# ---- compute mesh
|
||||||
print("-------------------------- compute mesh")
|
print("-------------------------- compute mesh")
|
||||||
ok = mesh.Compute()
|
ok = mesh.Compute()
|
||||||
if ok:
|
if not ok:
|
||||||
print("Information about the Mesh:")
|
raise Exception("Error when computing Mesh")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the Mesh:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of hexahedrons : ", mesh.NbHexas())
|
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
||||||
else:
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
print("problem when Computing the mesh")
|
print("Number of hexahedrons : ", mesh.NbHexas())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -177,7 +177,9 @@ smesh.SetName(algo.GetSubMesh(), "SubMeshFace4")
|
|||||||
|
|
||||||
print("-------------------------- compute the mesh of the mechanic piece")
|
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("Information about the Mesh_mechanic:")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
|
@ -181,7 +181,9 @@ submesh4 = algo.GetSubMesh()
|
|||||||
|
|
||||||
print("-------------------------- compute the mesh of the mechanic piece")
|
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("Information about the Mesh_mechanic:")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
|
@ -122,17 +122,16 @@ netgen.SetQuadAllowed( 1 )
|
|||||||
print("-------------------------- compute mesh")
|
print("-------------------------- compute mesh")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
if ret != 0:
|
if not ret:
|
||||||
print("Information about the MeshcompShel:")
|
raise Exception("Error when computing Mesh")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
|
||||||
print("Number of edges : ", mesh.NbEdges())
|
print("Information about the MeshcompShel:")
|
||||||
print("Number of faces : ", mesh.NbFaces())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
print("Number of triangles : ", mesh.NbTriangles())
|
print("Number of edges : ", mesh.NbEdges())
|
||||||
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
print("Number of faces : ", mesh.NbFaces())
|
||||||
print("Number of volumes : ", mesh.NbVolumes())
|
print("Number of triangles : ", mesh.NbTriangles())
|
||||||
print("Number of tetrahedrons : ", mesh.NbTetras())
|
print("Number of quadrangles : ", mesh.NbQuadrangles())
|
||||||
|
print("Number of volumes : ", mesh.NbVolumes())
|
||||||
else:
|
print("Number of tetrahedrons : ", mesh.NbTetras())
|
||||||
print("problem when computing the mesh")
|
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -147,7 +147,9 @@ smesh.SetName(hypVolume, "maxElementVolume_" + str(maxElementVolume))
|
|||||||
|
|
||||||
|
|
||||||
print("-------------------------- compute the mesh of the mechanic piece")
|
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("Information about the Mesh_mechanic_tetra:")
|
||||||
print("Number of nodes : ", mesh.NbNodes())
|
print("Number of nodes : ", mesh.NbNodes())
|
||||||
|
@ -94,6 +94,9 @@ face = salome.IDToObject(idf)
|
|||||||
|
|
||||||
ret = mesh.Compute(face)
|
ret = mesh.Compute(face)
|
||||||
print(ret)
|
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
|
log = [] #mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after
|
||||||
for a in log:
|
for a in log:
|
||||||
print("-------")
|
print("-------")
|
||||||
|
@ -109,7 +109,9 @@ print(hypArea2.GetId())
|
|||||||
print(hypArea2.GetMaxElementArea())
|
print(hypArea2.GetMaxElementArea())
|
||||||
smesh.SetName(hypArea2, "MaxElementArea_500")
|
smesh.SetName(hypArea2, "MaxElementArea_500")
|
||||||
|
|
||||||
mesh.Compute()
|
isDone = mesh.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
|
||||||
|
@ -31,6 +31,9 @@ from SMESH_test1 import *
|
|||||||
print("-------------------------- compute box")
|
print("-------------------------- compute box")
|
||||||
ret = mesh.Compute()
|
ret = mesh.Compute()
|
||||||
print(ret)
|
print(ret)
|
||||||
|
if not ret:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
log = mesh.GetLog(0); # no erase trace
|
log = mesh.GetLog(0); # no erase trace
|
||||||
# for linelog in log:
|
# for linelog in log:
|
||||||
# print(linelog)
|
# print(linelog)
|
||||||
|
@ -66,7 +66,9 @@ algo4.MaxElementArea(100)
|
|||||||
submesh = algo4.GetSubMesh()
|
submesh = algo4.GetSubMesh()
|
||||||
smesh.SetName(submesh, "SubMeshFace")
|
smesh.SetName(submesh, "SubMeshFace")
|
||||||
|
|
||||||
mesh.Compute()
|
isDone = mesh.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
faces = submesh.GetElementsByType(SMESH.FACE)
|
faces = submesh.GetElementsByType(SMESH.FACE)
|
||||||
if len(faces) > 1:
|
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)
|
Mesh_1 = smesh.Mesh(Box_1)
|
||||||
NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
NETGEN_1D_2D_3D = Mesh_1.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
## Set names of Mesh objects
|
## Set names of Mesh objects
|
||||||
smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
|
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.SetQuadAllowed( 0 )
|
||||||
NETGEN_3D_Parameters_1.SetCheckChartBoundary( 152 )
|
NETGEN_3D_Parameters_1.SetCheckChartBoundary( 152 )
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
## Set names of Mesh objects
|
## Set names of Mesh objects
|
||||||
smesh.SetName(NETGEN_1D_2D_3D.GetAlgorithm(), 'NETGEN 1D-2D-3D')
|
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)
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
smesh.SetName(Mesh_1, 'Mesh_1')
|
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 )
|
#### 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)
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
Hexa_3D = Mesh_1.Hexahedron(algo=smeshBuilder.Hexa)
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
smesh.SetName(Mesh_1, 'Mesh_1')
|
smesh.SetName(Mesh_1, 'Mesh_1')
|
||||||
|
|
||||||
# 23th of june 2021 : Bug both in ExportMED and in ExportMEDCoupling
|
# 23th of june 2021 : Bug both in ExportMED and in ExportMEDCoupling
|
||||||
|
@ -174,6 +174,8 @@ def createMesh(algo):
|
|||||||
algo_1d_sub.Propagation()
|
algo_1d_sub.Propagation()
|
||||||
|
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
nb_nodes = Mesh_1.NbNodes()
|
nb_nodes = Mesh_1.NbNodes()
|
||||||
# Create 2 cracks by two calls of DoubleNodeElemGroups
|
# Create 2 cracks by two calls of DoubleNodeElemGroups
|
||||||
|
@ -318,7 +318,9 @@ algo.Propagation()
|
|||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -120,7 +120,9 @@ hexa.Hexahedron()
|
|||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -107,7 +107,9 @@ hexa.Hexahedron()
|
|||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -112,7 +112,9 @@ localMesh(box_tetra2, 0)
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
mixed.Compute()
|
isDone = mixed.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -147,7 +147,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -164,7 +164,9 @@ algo4.Propagation()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -104,7 +104,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -137,7 +137,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -140,7 +140,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -102,7 +102,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -123,7 +123,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -143,7 +143,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
t3= time.time()
|
t3= time.time()
|
||||||
|
|
||||||
|
@ -256,7 +256,9 @@ local(cyl_x+d, cyl_y+d, box_dz, 10)
|
|||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -141,7 +141,9 @@ while m_i<m_n:
|
|||||||
# Calculer le maillage
|
# Calculer le maillage
|
||||||
# --------------------
|
# --------------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -200,7 +200,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -144,7 +144,9 @@ local(gx+g_dx, gy-g_dy, gz , 21)
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -103,7 +103,10 @@ hexa.Hexahedron()
|
|||||||
# Calcul du maillage
|
# Calcul du maillage
|
||||||
# ------------------
|
# ------------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|
||||||
|
@ -140,7 +140,9 @@ hexa.Hexahedron()
|
|||||||
# Calcul du maillage
|
# Calcul du maillage
|
||||||
# ------------------
|
# ------------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Update object browser
|
# Update object browser
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
@ -180,7 +180,9 @@ hexa.Hexahedron()
|
|||||||
# Mesh calculus
|
# Mesh calculus
|
||||||
# -------------
|
# -------------
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Le groupe de mailles
|
# Le groupe de mailles
|
||||||
# --------------------
|
# --------------------
|
||||||
|
@ -126,7 +126,9 @@ algo3d.MaxElementVolume(100)
|
|||||||
# Compute the mesh
|
# Compute the mesh
|
||||||
# ----------------
|
# ----------------
|
||||||
|
|
||||||
tetra.Compute()
|
isDone = tetra.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Create a groupe of faces
|
# Create a groupe of faces
|
||||||
# ------------------------
|
# ------------------------
|
||||||
|
@ -125,7 +125,9 @@ discretize( +radius, 0, height/2, 20)
|
|||||||
hexa.Quadrangle()
|
hexa.Quadrangle()
|
||||||
hexa.Hexahedron()
|
hexa.Hexahedron()
|
||||||
|
|
||||||
hexa.Compute()
|
isDone = hexa.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
hexa.Group(group_a)
|
hexa.Group(group_a)
|
||||||
hexa.Group(group_b)
|
hexa.Group(group_b)
|
||||||
|
@ -170,7 +170,9 @@ refine(MyMesh, P2, P3, 12, 14, "Haut" )
|
|||||||
algo2D = MyMesh.Triangle()
|
algo2D = MyMesh.Triangle()
|
||||||
algo2D.MaxElementArea(0.07)
|
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)
|
MyMesh.ExportMED(path+"110_triangles.med", 0)
|
||||||
|
|
||||||
|
@ -42,6 +42,8 @@ Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
|
|||||||
Nb_Segments_1.SetDistrType( 0 )
|
Nb_Segments_1.SetDistrType( 0 )
|
||||||
Quadrangle_2D = Mesh_1.Quadrangle()
|
Quadrangle_2D = Mesh_1.Quadrangle()
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# groups creation
|
# groups creation
|
||||||
|
|
||||||
|
@ -81,6 +81,8 @@ algo3d.SetKeepFiles(False)
|
|||||||
# --------------
|
# --------------
|
||||||
|
|
||||||
status = m.Compute()
|
status = m.Compute()
|
||||||
|
if not status:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# Test if ok
|
# Test if ok
|
||||||
# ----------
|
# ----------
|
||||||
|
@ -42,6 +42,8 @@ Nb_Segments_1.SetDistrType( 0 )
|
|||||||
Quadrangle_2D = Mesh_1.Quadrangle()
|
Quadrangle_2D = Mesh_1.Quadrangle()
|
||||||
Hexa_3D = Mesh_1.Hexahedron()
|
Hexa_3D = Mesh_1.Hexahedron()
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
### CreateDimGroup()
|
### CreateDimGroup()
|
||||||
|
|
||||||
|
@ -18,7 +18,9 @@ smesh = smeshBuilder.New()
|
|||||||
Mesh_1 = smesh.Mesh( Box_1 )
|
Mesh_1 = smesh.Mesh( Box_1 )
|
||||||
Mesh_1.Segment().NumberOfSegments(15)
|
Mesh_1.Segment().NumberOfSegments(15)
|
||||||
Mesh_1.Triangle()
|
Mesh_1.Triangle()
|
||||||
Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
# define arguments for MakePolyLine
|
# define arguments for MakePolyLine
|
||||||
|
|
||||||
|
@ -33,6 +33,9 @@ Regular_1D = Mesh_1.Segment()
|
|||||||
Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
|
Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
|
||||||
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
isDone = Mesh_1.Compute()
|
isDone = Mesh_1.Compute()
|
||||||
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
|
aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
|
||||||
isDone = Mesh_1.QuadToTriObject( Mesh_1, )
|
isDone = Mesh_1.QuadToTriObject( Mesh_1, )
|
||||||
Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 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 = smesh.Mesh(groupe_1, 'Maillage_1')
|
||||||
mesh_2d.AddHypothesis(groupe_1, netgen_2d_parameters_1)
|
mesh_2d.AddHypothesis(groupe_1, netgen_2d_parameters_1)
|
||||||
mesh_2d.Triangle(algo=smeshBuilder.NETGEN_1D2D)
|
mesh_2d.Triangle(algo=smeshBuilder.NETGEN_1D2D)
|
||||||
is_done = mesh_2d.Compute()
|
isDone = mesh_2d.Compute()
|
||||||
assert is_done
|
if not isDone:
|
||||||
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
smesh.SetName(mesh_2d, 'Maillage_1')
|
smesh.SetName(mesh_2d, 'Maillage_1')
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp_dir:
|
with tempfile.TemporaryDirectory() as tmp_dir:
|
||||||
|
@ -105,7 +105,6 @@ PolygonPerFace_2D = Mesh_1.Polygon()
|
|||||||
PolyhedronPerSolid_3D = Mesh_1.Polyhedron()
|
PolyhedronPerSolid_3D = Mesh_1.Polyhedron()
|
||||||
|
|
||||||
ok = Mesh_1.Compute()
|
ok = Mesh_1.Compute()
|
||||||
|
|
||||||
if not ok:
|
if not ok:
|
||||||
raise Exception("Error when computing Mesh")
|
raise Exception("Error when computing Mesh")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user