1 # 2d and 3d mesh generation with NETGEN
6 from salome.geom import geomBuilder
7 geompy = geomBuilder.New(salome.myStudy)
10 from salome.smesh import smeshBuilder
11 smesh = smeshBuilder.New(salome.myStudy)
14 box = geompy.MakeBoxDXDYDZ(10., 10., 10.)
15 geompy.addToStudy(box, "Box")
18 # 1. Create a triangular 2D mesh on the box with NETGEN_1D2D algorithm
19 triaN = smesh.Mesh(box, "Box : triangular mesh by NETGEN_1D2D")
21 # create a NETGEN_1D2D algorithm for solids
22 algo2D = triaN.Triangle(smeshBuilder.NETGEN_1D2D)
25 n12_params = algo2D.Parameters()
27 # define number of segments
28 n12_params.SetNbSegPerEdge(19)
31 n12_params.SetMaxSize(300)
33 # 2. Create a tetrahedral mesh on the box with NETGEN_1D2D3D algorithm (full netgen)
34 tetraN = smesh.Mesh(box, "Box : tetrahedrical mesh by NETGEN_1D2D3D")
36 # create a NETGEN_1D2D3D algorithm for solids
37 algo3D = tetraN.Tetrahedron(smeshBuilder.FULL_NETGEN)
40 n123_params = algo3D.Parameters()
42 # define number of segments
43 n123_params.SetNbSegPerEdge(11)
45 # define max element size
46 n123_params.SetMaxSize(300)