# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
-# It is possible to constrain GHS3D with another mesh or group.
+# It is possible to constrain MG-Tetra with another mesh or group.
# The constraint can refer to the nodes, edges or faces.
# This feature is available only on 2D meshes without geometry.
# The constraining elements are called enforced elements for the mesh.
geompy.addToStudy( c, "c" )
# Create the 2D algorithm and hypothesis
-BLSURF = smesh.CreateHypothesis('BLSURF', 'BLSURFEngine')
+MG_CADSurf = smesh.CreateHypothesis('MG-CADSurf', 'BLSURFEngine')
# For the box
-BLSURF_Parameters = smesh.CreateHypothesis('BLSURF_Parameters', 'BLSURFEngine')
-BLSURF_Parameters.SetPhysicalMesh( 1 )
-BLSURF_Parameters.SetPhySize( 200 )
+MG_CADSurf_Parameters = smesh.CreateHypothesis('MG-CADSurf Parameters', 'BLSURFEngine')
+MG_CADSurf_Parameters.SetPhysicalMesh( 1 )
+MG_CADSurf_Parameters.SetPhySize( 200 )
# For the cylinder
-BLSURF_Parameters2 = smesh.CreateHypothesis('BLSURF_Parameters', 'BLSURFEngine')
-BLSURF_Parameters2.SetGeometricMesh( 1 )
+MG_CADSurf_Parameters2 = smesh.CreateHypothesis('MG-CADSurf Parameters', 'BLSURFEngine')
+MG_CADSurf_Parameters2.SetGeometricMesh( 1 )
# Create the 3D algorithm and hypothesis
-GHS3D = smesh.CreateHypothesis('GHS3D_3D', 'GHS3DEngine')
-GHS3D_Parameters_node = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-#GHS3D_Parameters_node.SetToMeshHoles( 1 )
-GHS3D_Parameters_edge = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-#GHS3D_Parameters_edge.SetToMeshHoles( 1 )
-GHS3D_Parameters_face = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-GHS3D_Parameters_face.SetToMeshHoles( 1 ) # to mesh inside the cylinder
-GHS3D_Parameters_mesh = smesh.CreateHypothesis('GHS3D_Parameters', 'GHS3DEngine')
-GHS3D_Parameters_mesh.SetToMeshHoles( 1 ) # to mesh inside the cylinder
+MG_Tetra = smesh.CreateHypothesis('MG-Tetra', 'GHS3DEngine')
+MG_Tetra_Parameters_node = smesh.CreateHypothesis('MG-Tetra Parameters', 'GHS3DEngine')
+#MG_Tetra_Parameters_node.SetToMeshHoles( 1 )
+MG_Tetra_Parameters_edge = smesh.CreateHypothesis('MG-Tetra Parameters', 'GHS3DEngine')
+#MG_Tetra_Parameters_edge.SetToMeshHoles( 1 )
+MG_Tetra_Parameters_face = smesh.CreateHypothesis('MG-Tetra Parameters', 'GHS3DEngine')
+MG_Tetra_Parameters_face.SetToMeshHoles( 1 ) # to mesh inside the cylinder
+MG_Tetra_Parameters_mesh = smesh.CreateHypothesis('MG-Tetra Parameters', 'GHS3DEngine')
+MG_Tetra_Parameters_mesh.SetToMeshHoles( 1 ) # to mesh inside the cylinder
# Create the mesh on the cylinder
Mesh_cylindre = smesh.Mesh(cylindre)
smesh.SetName(Mesh_cylindre,"Mesh_cylindre")
-Mesh_cylindre.AddHypothesis( BLSURF )
-Mesh_cylindre.AddHypothesis( BLSURF_Parameters2 )
+Mesh_cylindre.AddHypothesis( MG_CADSurf )
+Mesh_cylindre.AddHypothesis( MG_CADSurf_Parameters2 )
# Create some groups
face_cyl_faces = Mesh_cylindre.GroupOnGeom(face_cyl,'group_face_cyl', SMESH.FACE)
face_cyl_edges = Mesh_cylindre.GroupOnGeom(face_cyl,'group_edge_cyl', SMESH.EDGE)
Mesh_cylindre.Compute()
# Create the mesh on the cylinder
-Mesh_box_tri = smesh.Mesh(box)
-smesh.SetName(Mesh_box_tri,"Mesh_box_tri")
-Mesh_box_tri.AddHypothesis( BLSURF )
-Mesh_box_tri.AddHypothesis( BLSURF_Parameters )
+Mesh_box_tri = smesh.Mesh(box,"Mesh_box_tri")
+Mesh_box_tri.AddHypothesis( MG_CADSurf )
+Mesh_box_tri.AddHypothesis( MG_CADSurf_Parameters )
Mesh_box_tri.Compute()
# Create 4 copies of the 2D mesh to test the 3 types of contraints (NODE, EDGE, FACE)
# Then the 3D algo and hypothesis are assigned to them.
mesh_mesh = smesh.CopyMesh( Mesh_box_tri, 'Enforced by faces of mesh', 0, 0)
-mesh_mesh.AddHypothesis( GHS3D )
-mesh_mesh.AddHypothesis( GHS3D_Parameters_mesh)
+mesh_mesh.AddHypothesis( MG_Tetra )
+mesh_mesh.AddHypothesis( MG_Tetra_Parameters_mesh)
mesh_node = smesh.CopyMesh( Mesh_box_tri, 'Enforced by group of nodes', 0, 0)
-mesh_node.AddHypothesis( GHS3D )
-mesh_node.AddHypothesis( GHS3D_Parameters_node)
+mesh_node.AddHypothesis( MG_Tetra )
+mesh_node.AddHypothesis( MG_Tetra_Parameters_node)
mesh_edge = smesh.CopyMesh( Mesh_box_tri, 'Enforced by group of edges', 0, 0)
-mesh_edge.AddHypothesis( GHS3D )
-mesh_edge.AddHypothesis( GHS3D_Parameters_edge)
+mesh_edge.AddHypothesis( MG_Tetra )
+mesh_edge.AddHypothesis( MG_Tetra_Parameters_edge)
mesh_face = smesh.CopyMesh( Mesh_box_tri, 'Enforced by group of faces', 0, 0)
-mesh_face.AddHypothesis( GHS3D )
-mesh_face.AddHypothesis( GHS3D_Parameters_face)
+mesh_face.AddHypothesis( MG_Tetra )
+mesh_face.AddHypothesis( MG_Tetra_Parameters_face)
# Add the enforced elements
-GHS3D_Parameters_mesh.SetEnforcedMeshWithGroup(Mesh_cylindre.GetMesh(),SMESH.FACE,"faces from cylinder")
-GHS3D_Parameters_node.SetEnforcedMeshWithGroup(face_cyl_nodes,SMESH.NODE,"nodes from face_cyl_nodes")
-GHS3D_Parameters_edge.SetEnforcedMeshWithGroup(face_cyl_edges,SMESH.EDGE,"edges from face_cyl_edges")
-GHS3D_Parameters_face.SetEnforcedMeshWithGroup(face_cyl_faces,SMESH.FACE,"faces from face_cyl_faces")
+MG_Tetra_Parameters_mesh.SetEnforcedMeshWithGroup(Mesh_cylindre.GetMesh(),SMESH.FACE,"faces from cylinder")
+MG_Tetra_Parameters_node.SetEnforcedMeshWithGroup(face_cyl_nodes,SMESH.NODE,"nodes from face_cyl_nodes")
+MG_Tetra_Parameters_edge.SetEnforcedMeshWithGroup(face_cyl_edges,SMESH.EDGE,"edges from face_cyl_edges")
+MG_Tetra_Parameters_face.SetEnforcedMeshWithGroup(face_cyl_faces,SMESH.FACE,"faces from face_cyl_faces")
#Compute the meshes
mesh_node.Compute()
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
import salome
salome.salome_init()
-import GEOM
+
from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy)
-import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
geompy.addToStudy(box, "box")
# create a mesh on the box
-ghs3dMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh")
+mgtetraMesh = smesh.Mesh(box,"box: MG-Tetra and MG-CADSurf mesh")
-# create a BLSurf algorithm for faces
-BLSURF = ghs3dMesh.Triangle(algo=smeshBuilder.BLSURF)
-GHS3D = ghs3dMesh.Tetrahedron(algo=smeshBuilder.GHS3D)
+# create a MG_CADSurf algorithm for faces
+MG_CADSurf = mgtetraMesh.Triangle(algo=smeshBuilder.MG_CADSurf)
+MG_Tetra = mgtetraMesh.Tetrahedron(algo=smeshBuilder.MG_Tetra)
# compute the mesh
-ghs3dMesh.Compute()
+mgtetraMesh.Compute()
# End of script
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME GHS3DPLUGIN User's Guide"
+PROJECT_NAME = "SALOME MG-Tetra plug-in User's Guide"
OUTPUT_DIRECTORY = GHS3DPLUGIN
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
-PROJECT_NAME = "SALOME GHS3DPLUGIN User's Guide"
+PROJECT_NAME = "SALOME MG_Tetra plug-in User's Guide"
OUTPUT_DIRECTORY = GHS3DPLUGIN
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
MG-Tetra Parameters hypothesis works only with <b>MG-Tetra</b>
algorithm. This algorithm is a commercial software.
-To get a license, visit http://www.distene.com/en/corp/eval-distene.html
+To get a license, visit http://www.meshgems.com/meshgems-products.html
\tableofcontents
\page ghs3dplugin_python_interface_page Python Interface
-Python package GHS3DPluginBuilder defines several classes, destined for creation of the 3D meshes.
+\note The former name of MG-Tetra mesher is \a GHS3D and names
+of the corresponding classes and modules still include \a "GHS3D".
-GHS3D meshing plugin dynamically adds several methods to the smeshBuilder.Mesh class to create meshing algorithms.
+Python package GHS3DPluginBuilder defines
+GHS3DPluginBuilder.GHS3D_Algorithm class providing access
+to the MG-Tetra meshing algorithm and its parameters.
-Below you can see an example of usage of the GHS3DPluginBuilder Python API for mesh generation:
+You can get an instance of this class by calling
+smeshBuilder.Mesh.Tetrahedron(algo=smeshBuilder.MG_Tetra) or
+smeshBuilder.Mesh.Tetrahedron(algo=smeshBuilder.GHS3D). This call
+creates an algorithm (if not yet exist), assigns it to the mesh and
+returns an instance of GHS3DPluginBuilder.GHS3D_Algorithm to the caller.
+
+The class of algorithm has methods to set up meshing parameters.
+
+Below you can see examples of usage of this class for tetrahedral mesh generation.
\anchor tui_ghs3d
\section tui_ghs3d_basic Construction of Mesh using MG-Tetra algorithm
-\anchor example_BLSURFPlugin
+\anchor example_GHS3DPlugin
<h2>Example of mesh generation with MG-Tetra algorithm:</h2>
\tui_script{ghs3ddemo.py}
/*!
-\mainpage Introduction to GHS3DPLUGIN
+\mainpage Introduction to MG-Tetra plug-in
-\b GHS3DPLUGIN plugin is destined for:
-- Meshing 3D geometric entities: volumes are split into tetrahedral (pyramidal) elements.
+\b MG-Tetra plug-in adds MG-Tetra (former GHS3D) meshing
+algorithm to the SALOME Mesh module.
+
+\b MG-Tetra meshing algorithm is destined for:
+- Meshing 3D geometric entities: solids are split into tetrahedral (pyramidal) elements.
- Generating 3D meshes from 2D meshes (triangles and quadrangles), working without geometrical objects.
-\note GHS3DPLUGIN plugin used GHS3D commercial mesher and require a
+\note MG-Tetra plug-in uses MG-Tetra commercial mesher and requires a
license to be used within the Mesh module.
+To obtain a license, visit http://www.meshgems.com/meshgems-products.html
-To manage parameters of the GHS3DPLUGIN use \subpage ghs3d_hypo_page and \subpage additional_hypo_page
+To manage parameters of the MG-Tetra mesher use \subpage ghs3d_hypo_page and \subpage additional_hypo_page
-Also all GHS3DPLUGIN functionalities are accessible via
-\subpage ghs3dplugin_python_interface_page "GHS3DPLUGIN Python interface".
+Also all MG-Tetra functionalities are accessible via
+\subpage ghs3dplugin_python_interface_page "MG-Tetra Python interface".
\image html image2.gif "Example of a tetrahedral 3D mesh"
<parameter name="plugins" value="NETGENPlugin,GHS3DPlugin"/>
</section>
<section name="smesh_help" >
- <parameter name="Plug-ins/GHS3D plugin User's Guide" value="${GHS3DPLUGIN_ROOT_DIR}/share/doc/salome/gui/GHS3DPLUGIN/index.html"/>
+ <parameter name="Plug-ins/MG-Tetra plugin User's Guide" value="${GHS3DPLUGIN_ROOT_DIR}/share/doc/salome/gui/GHS3DPLUGIN/index.html"/>
</section>
</document>
##
# @package GHS3DPluginBuilder
-# Python API for the GHS3D meshing plug-in module.
+# Python API for the MG-Tetra meshing plug-in module.
from salome.smesh.smesh_algorithm import Mesh_Algorithm
from salome.smesh.smeshBuilder import AssureGeomPublished
noGHS3DPlugin = 1
pass
-# Optimization level of GHS3D
+# Optimization level of MG-Tetra
# V3.1
None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3
# V4.1 (partialy redefines V3.1). Issue 0020574
# Mesh algo type identifiers
#----------------------------
-## Algorithm type: GHS3D tetrahedron 3D algorithm, see GHS3D_Algorithm
-GHS3D = "MG-Tetra"
+## Algorithm type: MG-Tetra tetrahedron 3D algorithm, see GHS3D_Algorithm
MG_Tetra = "MG-Tetra"
+GHS3D = MG_Tetra
-## Tetrahedron GHS3D 3D algorithm
+## Tetrahedron MG-Tetra 3D algorithm
#
-# It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.GHS3D, geom=0 )
+# It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.MG_Tetra, geom=0 )
class GHS3D_Algorithm(Mesh_Algorithm):
## name of the dynamic method in smeshBuilder.Mesh class
meshMethod = "Tetrahedron"
## type of algorithm used with helper function in smeshBuilder.Mesh class
# @internal
- algoType = GHS3D
+ algoType = MG_Tetra
## doc string of the method in smeshBuilder.Mesh class
# @internal
docHelper = "Creates tetrahedron 3D algorithm for volumes"
## To make groups of volumes of different domains when mesh is generated from skin.
# Default is to make groups.
# This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
- # @param toMesh "mesh holes" flag value
+ # @param toMakeGroups "Make groups of domains" flag value
def SetToMakeGroupsOfDomains(self, toMakeGroups):
self.Parameters().SetToMakeGroupsOfDomains(toMakeGroups)
pass
//=======================================================================
//function : findShapeID
-//purpose : find the solid corresponding to GHS3D sub-domain following
-// the technique proposed in GHS3D manual (available within
-// ghs3d installation) in chapter "B.4 Subdomain (sub-region) assignment".
+//purpose : find the solid corresponding to MG-Tetra sub-domain following
+// the technique proposed in MG-Tetra manual (available within
+// MG-Tetra installation) in chapter "B.4 Subdomain (sub-region) assignment".
// In brief: normal of the triangle defined by the given nodes
// points out of the domain it is associated to
//=======================================================================
// for (int i=0; i < nbTriangle; i++) {
// tabID[i] = 0;
// int nodeId1, nodeId2, nodeId3;
-// // find the solid corresponding to GHS3D sub-domain following
-// // the technique proposed in GHS3D manual in chapter
+// // find the solid corresponding to MG-Tetra sub-domain following
+// // the technique proposed in MG-Tetra manual in chapter
// // "B.4 Subdomain (sub-region) assignment"
//
// nodeId1 = strtol(ptr, &ptr, 10);
// try {
// OCC_CATCH_SIGNALS;
// tabID[i] = findShapeID( theMesh, n1, n2, n3, toMeshHoles );
-// // -- 0020330: Pb with ghs3d as a submesh
+// // -- 0020330: Pb with MG-Tetra as a submesh
// // check that found shape is to be meshed
// if ( tabID[i] > 0 ) {
// const TopoDS_Shape& foundShape = theMeshDS->IndexToShape( tabID[i] );
// if ( !isToBeMeshed )
// tabID[i] = HOLE_ID;
// }
-// // END -- 0020330: Pb with ghs3d as a submesh
+// // END -- 0020330: Pb with MG-Tetra as a submesh
// #ifdef _DEBUG_
// std::cout << i+1 << " subdomain: findShapeID() returns " << tabID[i] << std::endl;
// #endif
//
// // IN WORK
// TopoDS_Shape aSolid;
-// // We always run GHS3D with "to mesh holes"==TRUE but we must not create
+// // We always run MG-Tetra with "to mesh holes"==TRUE but we must not create
// // tetras within holes depending on hypo option,
// // so we first check if aTet is inside a hole and then create it
// if ( nbTriangle > 1 ) {
nbNodes = elem->NbCornerNodes();
while ( nodeIt->more() && nbNodes--)
{
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
- int newId = aNodeToGhs3dIdMap.size() + 1; // ghs3d ids count from 1
+ int newId = aNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1
aNodeToGhs3dIdMap.insert( make_pair( node, newId ));
}
}
nodeIt = elem->nodesIterator();
nbNodes = 2;
while ( nodeIt->more() && nbNodes-- ) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
// Test if point is inside shape to mesh
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbNodes = 2;
int newId = -1;
while ( nodeIt->more() && nbNodes-- ) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
#endif
if (nbFoundElems ==0) {
if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) {
- newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // ghs3d ids count from 1
+ newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1
anEnforcedNodeToGhs3dIdMap.insert( make_pair( node, newId ));
}
}
else
isOK = false;
#ifdef _DEBUG_
- std::cout << "GHS3D node ID: "<<newId<<std::endl;
+ std::cout << "MG-Tetra node ID: "<<newId<<std::endl;
#endif
}
if (isOK)
nodeIt = elem->nodesIterator();
nbNodes = 3;
while ( nodeIt->more() && nbNodes--) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
// Test if point is inside shape to mesh
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbNodes = 3;
int newId = -1;
while ( nodeIt->more() && nbNodes--) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
#endif
if (nbFoundElems ==0) {
if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) {
- newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // ghs3d ids count from 1
+ newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // MG-Tetra ids count from 1
anEnforcedNodeToGhs3dIdMap.insert( make_pair( node, newId ));
}
}
else
isOK = false;
#ifdef _DEBUG_
- std::cout << "GHS3D node ID: "<<newId<<std::endl;
+ std::cout << "MG-Tetra node ID: "<<newId<<std::endl;
#endif
}
if (isOK)
for ( ; n2id != aNodeToGhs3dIdMap.end(); ++ n2id)
{
// std::cout << "n2id->first: "<<n2id->first<<std::endl;
- theNodeByGhs3dId[ n2id->second - 1 ] = n2id->first; // ghs3d ids count from 1
+ theNodeByGhs3dId[ n2id->second - 1 ] = n2id->first; // MG-Tetra ids count from 1
}
// put nodes to anEnforcedNodeToGhs3dIdMap vector
for ( ; n2id != anEnforcedNodeToGhs3dIdMap.end(); ++ n2id)
{
if (n2id->second > aNodeToGhs3dIdMap.size()) {
- theEnforcedNodeByGhs3dId[ n2id->second - aNodeToGhs3dIdMap.size() - 1 ] = n2id->first; // ghs3d ids count from 1
+ theEnforcedNodeByGhs3dId[ n2id->second - aNodeToGhs3dIdMap.size() - 1 ] = n2id->first; // MG-Tetra ids count from 1
}
}
nodeIt = elem->nodesIterator();
int index=0;
while ( nodeIt->more() ) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
map< const SMDS_MeshNode*,int >::iterator it = anEnforcedNodeToGhs3dIdMap.find(node);
if (it == anEnforcedNodeToGhs3dIdMap.end()) {
nodeIt = elem->nodesIterator();
int index=0;
for ( int j = 0; j < 3; ++j ) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
map< const SMDS_MeshNode*,int >::iterator it = aNodeToGhs3dIdMap.find(node);
if (it == aNodeToGhs3dIdMap.end())
nodeIt = elem->nodesIterator();
int index=0;
for ( int j = 0; j < 3; ++j ) {
- // find GHS3D ID
+ // find MG-Tetra ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
map< const SMDS_MeshNode*,int >::iterator it = anEnforcedNodeToGhs3dIdMap.find(node);
if (it == anEnforcedNodeToGhs3dIdMap.end()) {
// nbev = theEnforcedVertices.size();
// nben = theEnforcedNodes.size();
//
-// // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by GHS3D
+// // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by MG-Tetra
// // The problem is in nodes on degenerated edges, we need to skip nodes which are free
// // and replace not-free nodes on edges by the node on vertex
// TNodeNodeMap n2nDegen; // map a node on degenerated edge to a node on vertex
// itOnSubFace = aFace->nodesIterator();
// att.clear();
// for ( int j = 0; j < 3; ++j ) {
-// // find GHS3D ID
+// // find MG-Tetra ID
// node = castToNode( itOnSubFace->next() );
// if (( n2nDegenIt = n2nDegen.find( node )) != n2nDegen.end() )
// node = n2nDegenIt->second;
// // itOnSubFace = aFace->nodesIterator();
// // aqt.clear();
// // while ( itOnSubFace->more() ) {
-// // // find GHS3D ID
+// // // find MG-Tetra ID
// // aSmdsID = itOnSubFace->next()->GetID();
// // itOnMap = theSmdsToGhs3dIdMap.find( aSmdsID );
// // ASSERT( itOnMap != theSmdsToGhs3dIdMap.end() );
itOnSubFace = aFace->nodesIterator();
for ( int j = 0; j < 3; ++j ) {
- // find GHS3D ID
+ // find MG-Tetra ID
aSmdsID = itOnSubFace->next()->GetID();
itOnMap = theSmdsToGhs3dIdMap.find( aSmdsID );
// if ( itOnMap == theSmdsToGhs3dIdMap.end() ) {
SMDS_NodeIteratorPtr nodeIt = theMeshDS->nodesIterator();
const SMDS_MeshNode* node;
- // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by GHS3D
+ // Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by MG-Tetra
// The problem is in nodes on degenerated edges, we need to skip nodes which are free
// and replace not-free nodes on degenerated edges by the node on vertex
TNodeNodeMap n2nDegen; // map a node on degenerated edge to a node on vertex
// Creating SMESH nodes
// - for enforced vertices
// - for vertices of forced edges
- // - for ghs3d nodes
+ // - for MG-Tetra nodes
nodeAssigne[ iNode ] = 0;
aNewNode = theMeshDS->AddNode( coord[0],coord[1],coord[2] );
theGhs3dIdToNodeMap.insert(theGhs3dIdToNodeMap.end(), make_pair( iNode, aNewNode ));
if(theAlgo->computeCanceled())
return false;
tabID[i] = 0;
- // find the solid corresponding to GHS3D sub-domain following
- // the technique proposed in GHS3D manual in chapter
+ // find the solid corresponding to MG-Tetra sub-domain following
+ // the technique proposed in MG-Tetra manual in chapter
// "B.4 Subdomain (sub-region) assignment"
int nodeId1 = strtol(ptr, &ptr, 10);
int nodeId2 = strtol(ptr, &ptr, 10);
OCC_CATCH_SIGNALS;
// tabID[i] = findShapeID( theHelper, n1, n2, n3, toMeshHoles );
tabID[i] = findShapeID( *theHelper.GetMesh(), n1, n2, n3, toMeshHoles );
- // -- 0020330: Pb with ghs3d as a submesh
+ // -- 0020330: Pb with MG-Tetra as a submesh
// check that found shape is to be meshed
if ( tabID[i] > 0 ) {
const TopoDS_Shape& foundShape = theMeshDS->IndexToShape( tabID[i] );
if ( !isToBeMeshed )
tabID[i] = HOLE_ID;
}
- // END -- 0020330: Pb with ghs3d as a submesh
+ // END -- 0020330: Pb with MG-Tetra as a submesh
#ifdef _DEBUG_
std::cout << i+1 << " subdomain: findShapeID() returns " << tabID[i] << std::endl;
#endif
node[ iNode ] = itOnNode->second;
nodeID[ iNode ] = ID;
}
- // We always run GHS3D with "to mesh holes"==TRUE but we must not create
+ // We always run MG-Tetra with "to mesh holes"==TRUE but we must not create
// tetras within holes depending on hypo option,
// so we first check if aTet is inside a hole and then create it
//aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] );
//=============================================================================
/*!
- *Here we are going to use the GHS3D mesher with geometry
+ *Here we are going to use the MG-Tetra mesher with geometry
*/
//=============================================================================
//SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
// we count the number of shapes
- // _nbShape = countShape( meshDS, TopAbs_SOLID ); -- 0020330: Pb with ghs3d as a submesh
+ // _nbShape = countShape( meshDS, TopAbs_SOLID ); -- 0020330: Pb with MG-Tetra as a submesh
// _nbShape = 0;
TopExp_Explorer expBox ( theShape, TopAbs_SOLID );
// for ( ; expBox.More(); expBox.Next() )
std::vector<std::string> aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId;
// proxyMesh must live till readGMFFile() as a proxy face can be used by
- // ghs3d for domain indication
+ // MG-Tetra for domain indication
//{
SMESH_ProxyMesh::Ptr proxyMesh( new SMESH_ProxyMesh( theMesh ));
return error(SMESH_Comment("Can't write into ") << aSmdsToGhs3dIdMapFileName);
}
INFOS( "Writing ids relation into " << aSmdsToGhs3dIdMapFileName);
- aIdsFile << "Smds Ghs3d" << std::endl;
+ aIdsFile << "Smds MG-Tetra" << std::endl;
map <int,int>::const_iterator myit;
for (myit=aSmdsToGhs3dIdMap.begin() ; myit != aSmdsToGhs3dIdMap.end() ; ++myit) {
aIdsFile << myit->first << " " << myit->second << std::endl;
removeFile( aResultFileName ); // needed for boundary recovery module usage
// -----------------
- // run ghs3d mesher
+ // run MG-Tetra mesher
// -----------------
TCollection_AsciiString cmd( (char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
std::cout << std::endl;
- std::cout << "Ghs3d execution..." << std::endl;
+ std::cout << "MG-Tetra execution..." << std::endl;
std::cout << cmd << std::endl;
_compute_canceled = false;
system( cmd.ToCString() ); // run
std::cout << std::endl;
- std::cout << "End of Ghs3d execution !" << std::endl;
+ std::cout << "End of MG-Tetra execution !" << std::endl;
// --------------
// read a result
// fileOpen = open( aResultFileName.ToCString(), O_RDONLY);
// if ( fileOpen < 0 ) {
// std::cout << std::endl;
- // std::cout << "Can't open the " << aResultFileName.ToCString() << " GHS3D output file" << std::endl;
+ // std::cout << "Can't open the " << aResultFileName.ToCString() << " MG-Tetra output file" << std::endl;
// std::cout << "Log: " << aLogFileName << std::endl;
// Ok = false;
// }
{
// the log file is empty
removeFile( aLogFileName );
- INFOS( "GHS3D Error, command '" << cmd.ToCString() << "' failed" );
- error(COMPERR_ALGO_FAILED, "ghs3d: command not found" );
+ INFOS( "MG-Tetra Error, command '" << cmd.ToCString() << "' failed" );
+ error(COMPERR_ALGO_FAILED, "mg-tetra.exe: command not found" );
}
if ( !_keepFiles ) {
removeFile( aResultFileName );
removeFile( aSmdsToGhs3dIdMapFileName );
}
- std::cout << "<" << aResultFileName.ToCString() << "> GHS3D output file ";
+ std::cout << "<" << aResultFileName.ToCString() << "> MG-Tetra output file ";
if ( !Ok )
std::cout << "not ";
std::cout << "treated !" << std::endl;
//=============================================================================
/*!
- *Here we are going to use the GHS3D mesher w/o geometry
+ *Here we are going to use the MG-Tetra mesher w/o geometry
*/
//=============================================================================
bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh,
std::vector<std::string> aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId;
// proxyMesh must live till readGMFFile() as a proxy face can be used by
- // ghs3d for domain indication
+ // MG-Tetra for domain indication
//{
SMESH_ProxyMesh::Ptr proxyMesh( new SMESH_ProxyMesh( theMesh ));
if ( theMesh.NbQuadrangles() > 0 )
//}
// -----------------
- // run ghs3d mesher
+ // run MG-Tetra mesher
// -----------------
TCollection_AsciiString cmd = TCollection_AsciiString((char*)GHS3DPlugin_Hypothesis::CommandToRun( _hyp, false ).c_str());
cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
std::cout << std::endl;
- std::cout << "Ghs3d execution..." << std::endl;
+ std::cout << "MG-Tetra execution..." << std::endl;
std::cout << cmd << std::endl;
_compute_canceled = false;
system( cmd.ToCString() ); // run
std::cout << std::endl;
- std::cout << "End of Ghs3d execution !" << std::endl;
+ std::cout << "End of MG-Tetra execution !" << std::endl;
// --------------
// read a result
else {
// the log file is empty
removeFile( aLogFileName );
- INFOS( "GHS3D Error, command '" << cmd.ToCString() << "' failed" );
- error(COMPERR_ALGO_FAILED, "ghs3d: command not found" );
+ INFOS( "MG-Tetra Error, command '" << cmd.ToCString() << "' failed" );
+ error(COMPERR_ALGO_FAILED, "mg-tetra.exe: command not found" );
}
if ( !_keepFiles )
//================================================================================
/*!
- * \brief Provide human readable text by error code reported by ghs3d
+ * \brief Provide human readable text by error code reported by MG-Tetra
*/
//================================================================================
{
char msg2[] = "SEGMENTATION FAULT";
if ( search( &buf[0], bufEnd, msg2, msg2 + strlen(msg2)) != bufEnd )
- errDescription << "ghs3d: SEGMENTATION FAULT. ";
+ errDescription << "MG-Tetra: SEGMENTATION FAULT. ";
}
}
//================================================================================
/*!
- * \brief Return SMDS element by ids of GHS3D nodes
+ * \brief Return SMDS element by ids of MG-Tetra nodes
*/
//================================================================================
};
/*!
- * \brief Convertor of GHS3D elements to SMDS ones
+ * \brief Convertor of MG-Tetra elements to SMDS ones
*/
class _Ghs2smdsConvertor
{
#include "GHS3DPlugin_GHS3D.hxx"
// ======================================================
-// GHS3D 3d algorithm
+// MG-Tetra 3d algorithm
// ======================================================
class GHS3DPlugin_GHS3D_i:
public virtual POA_GHS3DPlugin::GHS3DPlugin_GHS3D,
//================================================================================
/*!
- * \brief Return command to run ghs3d mesher excluding file prefix (-f)
+ * \brief Return command to run MG-Tetra mesher excluding file prefix (-f)
*/
//================================================================================
if ( !useBndRecovery && hyp )
useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
- // ghs3d needs to know amount of memory it may use (MB).
- // Default memory is defined at ghs3d installation but it may be not enough,
+ // MG-Tetra needs to know amount of memory it may use (MB).
+ // Default memory is defined at MG-Tetra installation but it may be not enough,
// so allow to use about all available memory
if ( m ) {
double aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
// 0 , all components to be meshed
// 1 , only the main ( outermost ) component to be meshed
if ( c && !useBndRecovery ) {
- // We always run GHS3D with "to mesh holes'==TRUE (see PAL19680)
+ // We always run MG-Tetra with "to mesh holes'==TRUE (see PAL19680)
if ( hasShapeToMesh )
cmd += " -c 0";
else {
/*!
- * \brief Return command to run ghs3d mesher excluding file prefix (-f)
+ * \brief Return command to run MG-Tetra mesher excluding file prefix (-f)
*/
static std::string CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
const bool hasShapeToMesh=true);
##
# @package GHS3DPluginBuilder
-# Python API for the GHS3D meshing plug-in module.
+# Python API for the MG-Tetra meshing plug-in module.
</message>
<message>
<source>GHS3D_HYPOTHESIS</source>
- <translation>GHS3D</translation>
+ <translation>MG-Tetra</translation>
</message>
<message>
<source>GHS3D_OPTIMIZATIOL_LEVEL</source>
</message>
<message>
<source>GHS3D_HYPOTHESIS</source>
- <translation>GHS3D</translation>
+ <translation>MG-Tetra</translation>
</message>
<message>
<source>GHS3D_OPTIMIZATIOL_LEVEL</source>