import salome
salome.salome_init()
-import GEOM
+
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
-import SMESH, SALOMEDS
+import SMESH
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
geompy.addToStudy(box, "box")
# create a mesh on the box
-ghs3dMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh")
-# create a BLSurf algorithm for faces
-ghs3dMesh.Triangle(algo=smeshBuilder.BLSURF)
+mgtetraMesh = smesh.Mesh(box,"box: MG-Tetra and MG-CADSurf mesh")
+# create a MG-CADSurf algorithm for faces
+mgtetraMesh.Triangle(algo=smeshBuilder.MG_CADSurf)
# compute the mesh
-ghs3dMesh.Compute()
+mgtetraMesh.Compute()
# Make a copy of the 2D mesh
-ghs3dMesh_wo_geometry = smesh.CopyMesh( ghs3dMesh, 'Ghs3D wo geometry', 0, 0)
+mgtetraMesh_wo_geometry = smesh.CopyMesh( mgtetraMesh, 'MG-Tetra w/o geometry', 0, 0)
-# create a Ghs3D algorithm and hypothesis and assign them to the mesh
-GHS3D = smesh.CreateHypothesis('GHS3D_3D', 'GHS3DEngine')
-GHS3D_Parameters = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-ghs3dMesh.AddHypothesis( GHS3D )
-ghs3dMesh.AddHypothesis( GHS3D_Parameters )
+# create a MG_Tetra algorithm and hypothesis and assign them to the mesh
+MG_Tetra = mgtetraMesh.Tetrahedron( smeshBuilder.MG_Tetra )
+MG_Tetra_Parameters = MG_Tetra.Parameters()
# Create the enforced vertex
-GHS3D_Parameters.SetEnforcedVertex( 50, 50, 100, 2) # no group
+MG_Tetra_Parameters.SetEnforcedVertex( 50, 50, 100, 2) # no group
# Compute the mesh
-ghs3dMesh.Compute()
+mgtetraMesh.Compute()
# Ex2: Add one vertex enforced by a GEOM vertex at (50,50,100)
# with physical size 5 and add it to a group called "My special nodes"
-# Create another GHS3D hypothesis and assign it to the mesh without geometry
-GHS3D_Parameters_wo_geometry = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-ghs3dMesh_wo_geometry.AddHypothesis( GHS3D )
-ghs3dMesh_wo_geometry.AddHypothesis( GHS3D_Parameters_wo_geometry )
+# Create another MG_Tetra hypothesis and assign it to the mesh without geometry
+MG_Tetra_Parameters_wo_geometry = smesh.CreateHypothesis('MG-Tetra Parameters', 'GHS3DEngine')
+mgtetraMesh_wo_geometry.AddHypothesis( MG_Tetra )
+mgtetraMesh_wo_geometry.AddHypothesis( MG_Tetra_Parameters_wo_geometry )
# Create the enforced vertex
p1 = geompy.MakeVertex(150, 150, 100)
geompy.addToStudy(p1, "p1")
-GHS3D_Parameters_wo_geometry.SetEnforcedVertexGeomWithGroup( p1, 5 , "My special nodes")
-#GHS3D_Parameters.SetEnforcedVertexGeom( p1, 5 ) # no group
+MG_Tetra_Parameters_wo_geometry.SetEnforcedVertexGeomWithGroup( p1, 5 , "My special nodes")
+#MG_Tetra_Parameters.SetEnforcedVertexGeom( p1, 5 ) # no group
# compute the mesh
-ghs3dMesh_wo_geometry.Compute()
+mgtetraMesh_wo_geometry.Compute()
# Erase all enforced vertices
-GHS3D_Parameters.ClearEnforcedVertices()
+MG_Tetra_Parameters.ClearEnforcedVertices()
# End of script