2018-05-25 22:04:48 +05:00
|
|
|
# Split volumic elements into tetrahedrons
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2018-05-25 22:04:48 +05:00
|
|
|
|
|
|
|
from salome.geom import geomBuilder
|
2018-06-29 18:38:39 +05:00
|
|
|
geompy = geomBuilder.New()
|
2018-05-25 22:04:48 +05:00
|
|
|
from salome.smesh import smeshBuilder
|
2018-06-29 18:38:39 +05:00
|
|
|
smesh = smeshBuilder.New()
|
2018-05-25 22:04:48 +05:00
|
|
|
|
|
|
|
# mesh a hexahedral mesh
|
|
|
|
box = geompy.MakeBoxDXDYDZ (1, 1, 1 )
|
|
|
|
mesh = smesh.Mesh( box )
|
|
|
|
mesh.AutomaticHexahedralization(0)
|
|
|
|
print("Nb volumes mesh: %s" % mesh.NbHexas())
|
|
|
|
|
|
|
|
# split each hexahedron into 6 tetrahedra
|
|
|
|
mesh.SplitVolumesIntoTetra( mesh, smesh.Hex_6Tet )
|
|
|
|
print("Nb volumes mesh: %s" % mesh.NbTetras())
|