2013-02-12 20:37:44 +06:00
|
|
|
# Maximum Element Volume
|
|
|
|
|
2013-04-04 13:08:19 +06:00
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
import GEOM
|
|
|
|
from salome.geom import geomBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
geompy = geomBuilder.New()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
|
|
|
import SMESH, SALOMEDS
|
|
|
|
from salome.smesh import smeshBuilder
|
2017-06-13 15:01:10 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a cylinder
|
|
|
|
cyl = geompy.MakeCylinderRH(30., 50.)
|
|
|
|
geompy.addToStudy(cyl, "cyl")
|
|
|
|
|
|
|
|
# create a mesh on the cylinder
|
|
|
|
tetra = smesh.Mesh(cyl, "Cylinder : tetrahedrical mesh")
|
|
|
|
|
|
|
|
# assign algorithms
|
|
|
|
algo1D = tetra.Segment()
|
|
|
|
algo2D = tetra.Triangle()
|
|
|
|
algo3D = tetra.Tetrahedron()
|
|
|
|
|
|
|
|
# assign 1D and 2D hypotheses
|
|
|
|
algo1D.NumberOfSegments(7)
|
|
|
|
algo2D.MaxElementArea(150.)
|
|
|
|
|
|
|
|
# assign Max Element Volume hypothesis
|
|
|
|
algo3D.MaxElementVolume(200.)
|
|
|
|
|
|
|
|
# compute the mesh
|
|
|
|
ret = tetra.Compute()
|
|
|
|
if ret == 0:
|
2017-03-20 17:27:30 +05:00
|
|
|
print("problem when computing the mesh")
|
2013-02-12 20:37:44 +06:00
|
|
|
else:
|
2017-03-20 17:27:30 +05:00
|
|
|
print("Computation succeeded")
|