]> SALOME platform Git repositories - modules/smesh.git/blob - doc/salome/examples/modifying_meshes_split_vol.py
Salome HOME
IPAL54417: Hexahedron(ijk) crashes salome
[modules/smesh.git] / doc / salome / examples / modifying_meshes_split_vol.py
1 # Split volumic elements into tetrahedrons
2
3 import salome
4 salome.salome_init()
5
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New()
8 from salome.smesh import smeshBuilder
9 smesh = smeshBuilder.New()
10
11 # mesh a hexahedral mesh
12 box = geompy.MakeBoxDXDYDZ (1, 1, 1 )
13 mesh = smesh.Mesh( box )
14 mesh.AutomaticHexahedralization(0)
15 print("Nb volumes mesh: %s" % mesh.NbHexas())
16
17 # split each hexahedron into 6 tetrahedra
18 mesh.SplitVolumesIntoTetra( mesh, smesh.Hex_6Tet )
19 print("Nb volumes mesh: %s" % mesh.NbTetras())