This class calls the NETGEN mesher of OCC geometry. More...
#include <NETGENPlugin_Mesher.hxx>
Public Member Functions | |
bool | Compute () |
bool | Evaluate (MapShapeNbElems &aResMap) |
bool | FillNgMesh (netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, std::vector< const SMDS_MeshNode * > &nodeVec, const std::list< SMESH_subMesh * > &meshedSM, SMESH_MesherHelper *quadHelper=0, SMESH_ProxyMesh::Ptr proxyMesh=SMESH_ProxyMesh::Ptr()) |
fill ngMesh with nodes and elements of computed submeshes More... | |
double | GetProgress (const SMESH_Algo *holder, const int *algoProgressTic, const double *algoProgress) const |
NETGENPlugin_Mesher (SMESH_Mesh *mesh, const TopoDS_Shape &aShape, const bool isVolume) | |
void | SetDefaultParameters () |
Initialize global NETGEN parameters with default values. More... | |
void | SetParameters (const NETGENPlugin_Hypothesis *hyp) |
void | SetParameters (const NETGENPlugin_SimpleHypothesis_2D *hyp) |
void | SetSelfPointer (NETGENPlugin_Mesher **ptr) |
void | SetViscousLayers2DAssigned (bool isAssigned) |
~NETGENPlugin_Mesher () | |
Static Public Member Functions | |
static void | AddIntVerticesInFaces (const netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, std::vector< const SMDS_MeshNode * > &nodeVec, NETGENPlugin_Internals &internalShapes) |
Make netgen take internal vertices in faces into account by adding segments including internal vertices. More... | |
static void | AddIntVerticesInSolids (const netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, std::vector< const SMDS_MeshNode * > &nodeVec, NETGENPlugin_Internals &internalShapes) |
Make netgen take internal vertices in solids into account by adding faces including internal vertices. More... | |
static SMESH_ComputeErrorPtr | AddSegmentsToMesh (netgen::Mesh &ngMesh, netgen::OCCGeometry &geom, const TSideVector &wires, SMESH_MesherHelper &helper, std::vector< const SMDS_MeshNode * > &nodeVec, const bool overrideMinH=true) |
Fill netgen mesh with segments of a FACE. More... | |
static int | FillSMesh (const netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, const NETGENPlugin_ngMeshInfo &initState, SMESH_Mesh &sMesh, std::vector< const SMDS_MeshNode * > &nodeVec, SMESH_Comment &comment, SMESH_MesherHelper *quadHelper=0) |
Fill SMESH mesh according to contents of netgen mesh. More... | |
static bool | FixFaceMesh (const netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, const int faceID) |
Tries to heal the mesh on a FACE. The FACE is supposed to be partially meshed due to NETGEN failure. More... | |
static void | FixIntFaces (const netgen::OCCGeometry &occgeom, netgen::Mesh &ngMesh, NETGENPlugin_Internals &internalShapes) |
Duplicate mesh faces on internal geom faces. More... | |
static double | GetDefaultMinSize (const TopoDS_Shape &shape, const double maxSize) |
Return a default min size value suitable for the given geometry. More... | |
static void | PrepareOCCgeometry (netgen::OCCGeometry &occgeom, const TopoDS_Shape &shape, SMESH_Mesh &mesh, std::list< SMESH_subMesh * > *meshedSM=0, NETGENPlugin_Internals *internalShapes=0) |
Initialize netgen::OCCGeometry with OCCT shape. More... | |
static SMESH_ComputeErrorPtr | ReadErrors (const std::vector< const SMDS_MeshNode * > &nodeVec) |
Read mesh entities preventing successful computation from "test.out" file. More... | |
static void | RemoveTmpFiles () |
Remove "test.out" and "problemfaces" files in current directory. More... | |
static void | RestrictLocalSize (netgen::Mesh &ngMesh, const gp_XYZ &p, double size, const bool overrideMinH=true) |
Restrict size of elements at a given point. More... | |
static void | toPython (const netgen::Mesh *ngMesh, const std::string &pyFile) |
Write a python script creating an equivalent SALOME mesh. This is useful to see what mesh is passed as input for the next step of mesh generation (of mesh of higher dimension) More... | |
Detailed Description
This class calls the NETGEN mesher of OCC geometry.
Constructor & Destructor Documentation
◆ NETGENPlugin_Mesher()
NETGENPlugin_Mesher::NETGENPlugin_Mesher | ( | SMESH_Mesh * | mesh, |
const TopoDS_Shape & | aShape, | ||
const bool | isVolume | ||
) |
References SetDefaultParameters().
◆ ~NETGENPlugin_Mesher()
NETGENPlugin_Mesher::~NETGENPlugin_Mesher | ( | ) |
Destuctor
Member Function Documentation
◆ AddIntVerticesInFaces()
|
static |
Make netgen take internal vertices in faces into account by adding segments including internal vertices.
This function works in supposition that 1D mesh is already computed in ngMesh
References SMESH_MesherHelper::AddNode(), SMESH_MesherHelper::ApplyIn2D(), SMESH_MesherHelper::CheckNodeUV(), SMESH_subMesh::COMPUTE, SMESH_subMesh::ComputeStateEngine(), NETGENPlugin_Internals::getFacesWithVertices(), SMESH_MesherHelper::GetMesh(), NETGENPlugin_Internals::getMesh(), SMESH_Mesh::GetMeshDS(), SMESH_MesherHelper::GetNodeUV(), SMESH_Mesh::GetSubMesh(), SMESHDS_Mesh::IndexToShape(), SMESH_MesherHelper::SetElementsOnShape(), SMESH_MesherHelper::SetSubShape(), SMESH_Algo::VertexNode(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by AddSegmentsToMesh(), and Compute().
◆ AddIntVerticesInSolids()
|
static |
Make netgen take internal vertices in solids into account by adding faces including internal vertices.
This function works in supposition that 2D mesh is already computed in ngMesh
References SMESH_MesherHelper::AddNode(), SMESH_subMesh::COMPUTE, SMESH_subMesh::ComputeStateEngine(), DraftVecUtils::dist(), SMESH_MesherHelper::GetMesh(), NETGENPlugin_Internals::getMesh(), SMESH_Mesh::GetMeshDS(), NETGENPlugin_Internals::getSolidsWithVertices(), SMESH_Mesh::GetSubMesh(), SMESHDS_Mesh::IndexToShape(), SMESH_MesherHelper::SetElementsOnShape(), SMESH_MesherHelper::SetSubShape(), SMESH_Algo::VertexNode(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by NETGENPlugin_NETGEN_3D::Compute(), and Compute().
◆ AddSegmentsToMesh()
|
static |
Fill netgen mesh with segments of a FACE.
- Parameters
-
ngMesh - netgen mesh geom - container of OCCT geometry to mesh wires - data of nodes on FACE boundary helper - mesher helper holding the FACE nodeVec - vector of nodes in which node index == netgen ID
- Return values
-
SMESH_ComputeErrorPtr - error description
References AddIntVerticesInFaces(), SMESH_TNodeXYZ::Distance(), SMESH_MesherHelper::GetMesh(), SMESH_MesherHelper::GetMeshDS(), SMESH_MesherHelper::GetSubShape(), SMESH_MesherHelper::IsDegenShape(), SMESH_MesherHelper::IsRealSeam(), SMESH_ComputeError::New(), uvPtStruct::normParam, uvPtStruct::param, RestrictLocalSize(), SMESHDS_Mesh::ShapeToIndex(), uvPtStruct::u, uvPtStruct::v, SMESH_MesherHelper::WrapIndex(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by NETGENPlugin_NETGEN_2D_ONLY::Compute(), and Compute().
◆ Compute()
bool NETGENPlugin_Mesher::Compute | ( | ) |
Here we are going to use the NETGEN mesher
References AddIntVerticesInFaces(), AddIntVerticesInSolids(), AddSegmentsToMesh(), StdMeshers_ViscousLayers2D::Compute(), StdMeshers_QuadToTriaAdaptor::Compute(), SMESH_Algo::EdgeLength(), FillNgMesh(), FillSMesh(), FixIntFaces(), SMESH_subMesh::GetComputeError(), GetDefaultMinSize(), StdMeshers_FaceSide::GetFaceWires(), SMESH_subMesh::GetId(), NETGENPlugin_Internals::getInternalEdges(), SMESH_MesherHelper::GetIsQuadratic(), SMESH_Algo::GetMeshError(), SMESH_ProxyMesh::GetProxySubMesh(), NETGENPlugin_Internals::getSolidsWithVertices(), SMESH_subMesh::GetSubMeshDS(), NETGENPlugin_Internals::hasInternalEdges(), NETGENPlugin_Internals::hasInternalFaces(), NETGENPlugin_Internals::hasInternalVertexInFace(), NETGENPlugin_Internals::hasInternalVertexInSolid(), SMESH_subMesh::IsEmpty(), SMESH_subMesh::IsMeshComputed(), SMESH_Algo::MEr_OK, netgen::merge_solids, netgen::mparam, netgen::multithread, SMESHDS_SubMesh::NbElements(), SMESHDS_SubMesh::NbNodes(), SMESH_ComputeError::New(), netgen::OCCGenerateMesh(), PrepareOCCgeometry(), ReadErrors(), NETGENPlugin_ngMeshInfo::restoreLocalH(), RestrictLocalSize(), SMESH_subMesh::SetIsAlwaysComputed(), SMESH_MesherHelper::SetIsQuadratic(), NETGENPlugin_NetgenLibWrapper::setMesh(), SMESH_MesherHelper::SetSubShape(), NETGENPlugin_ngMeshInfo::transferLocalH(), and NETGENPlugin_Hypothesis::UserDefined.
Referenced by NETGENPlugin_NETGEN_2D3D::Compute(), NETGENPlugin_NETGEN_2D::Compute(), Fem::FemMeshShapeObject::execute(), and Fem::FemMeshShapeNetgenObject::execute().
◆ Evaluate()
bool NETGENPlugin_Mesher::Evaluate | ( | MapShapeNbElems & | aResMap | ) |
Evaluate
References SMESH_Algo::EdgeLength(), SMESH_subMesh::GetComputeError(), GetDefaultMinSize(), netgen::mparam, netgen::multithread, netgen::OCCGenerateMesh(), PrepareOCCgeometry(), RestrictLocalSize(), NETGENPlugin_NetgenLibWrapper::setMesh(), and NETGENPlugin_Hypothesis::UserDefined.
Referenced by NETGENPlugin_NETGEN_2D3D::Evaluate(), and NETGENPlugin_NETGEN_2D::Evaluate().
◆ FillNgMesh()
bool NETGENPlugin_Mesher::FillNgMesh | ( | netgen::OCCGeometry & | occgeom, |
netgen::Mesh & | ngMesh, | ||
std::vector< const SMDS_MeshNode * > & | nodeVec, | ||
const std::list< SMESH_subMesh * > & | meshedSM, | ||
SMESH_MesherHelper * | quadHelper = 0 , |
||
SMESH_ProxyMesh::Ptr | proxyMesh = SMESH_ProxyMesh::Ptr() |
||
) |
fill ngMesh with nodes and elements of computed submeshes
References SMESH_MesherHelper::AddTLinks(), StdMeshers_FaceSide::Edge(), StdMeshers_FaceSide::EdgeIndex(), SMESH_MesherHelper::GetAncestors(), SMESH_subMesh::GetComputeError(), SMESHDS_SubMesh::GetElements(), SMESH_subMesh::GetFather(), SMESH_MesherHelper::GetMesh(), SMESH_MesherHelper::GetMeshDS(), SMDS_MeshElement::GetNode(), SMESHDS_SubMesh::GetNodes(), SMESH_MesherHelper::GetNodeUV(), SMESH_MesherHelper::GetOtherParam(), SMESH_MesherHelper::GetPeriodicIndex(), SMDS_MeshNode::GetPosition(), StdMeshers_QuadToTriaAdaptor::GetShape(), SMDS_MeshElement::getshapeId(), SMESH_Mesh::GetSubMesh(), SMESH_subMesh::GetSubMeshDS(), SMESH_subMesh::GetSubShape(), SMESH_MesherHelper::GetSubShapeOri(), SMDS_Position::GetTypeOfPosition(), StdMeshers_FaceSide::GetUVPtStruct(), SMESH_MesherHelper::HasSeam(), SMESH_Algo::isDegenerated(), SMESH_subMesh::IsEmpty(), SMESHDS_SubMesh::IsQuadratic(), SMESH_MesherHelper::IsRealSeam(), SMESH_MesherHelper::IsReversedSubMesh(), SMESH_MesherHelper::IsSeamShape(), StdMeshers_FaceSide::NbEdges(), StdMeshers_FaceSide::NbSegments(), uvPtStruct::node, uvPtStruct::normParam, uvPtStruct::param, RestrictLocalSize(), SMESH_TNodeXYZ::Set(), SMESH_MesherHelper::SetSubShape(), SMESHDS_Mesh::ShapeToIndex(), uvPtStruct::u, and uvPtStruct::v.
Referenced by Compute().
◆ FillSMesh()
|
static |
Fill SMESH mesh according to contents of netgen mesh.
- Parameters
-
occgeo - container of OCCT geometry to mesh ngMesh - netgen mesh initState - bn of entities in netgen mesh before computing sMesh - SMESH mesh to fill in nodeVec - vector of nodes in which node index == netgen ID comment - returns problem description quadHelper - holder of medium nodes of sub-meshes
- Return values
-
int - error
References SMESHDS_Mesh::AddEdge(), SMESH_MesherHelper::AddEdge(), SMESHDS_Mesh::AddFace(), SMESH_MesherHelper::AddFace(), SMESHDS_Mesh::AddNode(), SMESHDS_Mesh::AddVolume(), SMDS_Mesh::FindEdge(), SMESH_MesherHelper::GetIsQuadratic(), SMESH_Mesh::GetMeshDS(), SMDS_MeshElement::getshapeId(), SMESH_MesherHelper::GetTLinkNodeMap(), SMESHDS_Mesh::SetMeshElementOnShape(), SMESHDS_Mesh::SetNodeInVolume(), SMESHDS_Mesh::SetNodeOnEdge(), SMESHDS_Mesh::SetNodeOnFace(), SMESHDS_Mesh::SetNodeOnVertex(), and SMESH_Algo::VertexNode().
Referenced by Compute().
◆ FixFaceMesh()
|
static |
Tries to heal the mesh on a FACE. The FACE is supposed to be partially meshed due to NETGEN failure.
- Parameters
-
[in] occgeom - geometry [in,out] ngMesh - the mesh to fix [in,out] faceID - ID of the FACE to fix the mesh on
- Returns
- bool - is mesh is or becomes OK
References Link::Contains(), Link::IsConnected(), Link::n1, and Link::n2.
Referenced by NETGENPlugin_NETGEN_2D_ONLY::Compute().
◆ FixIntFaces()
|
static |
Duplicate mesh faces on internal geom faces.
References NETGENPlugin_Internals::getMesh(), SMESH_Mesh::GetMeshDS(), NETGENPlugin_Internals::isInternalShape(), and SMESHDS_Mesh::ShapeToIndex().
Referenced by Compute().
◆ GetDefaultMinSize()
|
static |
Return a default min size value suitable for the given geometry.
Referenced by NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), Compute(), Evaluate(), and NETGENPlugin_Hypothesis::SetParametersByDefaults().
◆ GetProgress()
double NETGENPlugin_Mesher::GetProgress | ( | const SMESH_Algo * | holder, |
const int * | algoProgressTic, | ||
const double * | algoProgress | ||
) | const |
References netgen::multithread.
◆ PrepareOCCgeometry()
|
static |
Initialize netgen::OCCGeometry with OCCT shape.
References SMESH_subMesh::getDependsOnIterator(), SMESH_Gen::GetShapeDim(), SMESH_subMesh::GetSubShape(), SMESH_subMesh::IsEmpty(), NETGENPlugin_Internals::isShapeToPrecompute(), and netgen::mparam.
Referenced by NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), Compute(), and Evaluate().
◆ ReadErrors()
|
static |
Read mesh entities preventing successful computation from "test.out" file.
References SMESH_ComputeError::New().
Referenced by NETGENPlugin_NETGEN_3D::compute(), and Compute().
◆ RemoveTmpFiles()
|
static |
Remove "test.out" and "problemfaces" files in current directory.
References SMESH_File::remove().
Referenced by NETGENPlugin_NetgenLibWrapper::~NETGENPlugin_NetgenLibWrapper().
◆ RestrictLocalSize()
|
static |
Restrict size of elements at a given point.
References netgen::mparam.
Referenced by AddSegmentsToMesh(), Compute(), Evaluate(), and FillNgMesh().
◆ SetDefaultParameters()
void NETGENPlugin_Mesher::SetDefaultParameters | ( | ) |
Initialize global NETGEN parameters with default values.
References NETGENPlugin_Hypothesis::GetDefaultFineness(), NETGENPlugin_Hypothesis::GetDefaultFuseEdges(), NETGENPlugin_Hypothesis::GetDefaultGrowthRate(), NETGENPlugin_Hypothesis::GetDefaultNbSegPerEdge(), NETGENPlugin_Hypothesis::GetDefaultNbSegPerRadius(), NETGENPlugin_Hypothesis::GetDefaultQuadAllowed(), NETGENPlugin_Hypothesis::GetDefaultSecondOrder(), NETGENPlugin_Hypothesis::GetDefaultSurfaceCurvature(), netgen::merge_solids, and netgen::mparam.
Referenced by NETGENPlugin_Mesher(), and SetParameters().
◆ SetParameters() [1/2]
void NETGENPlugin_Mesher::SetParameters | ( | const NETGENPlugin_Hypothesis * | hyp | ) |
Pass parameters to NETGEN
References netgen::merge_solids, and netgen::mparam.
Referenced by NETGENPlugin_NETGEN_2D3D::Compute(), NETGENPlugin_NETGEN_2D::Compute(), NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), NETGENPlugin_NETGEN_2D3D::Evaluate(), NETGENPlugin_NETGEN_2D::Evaluate(), and Fem::FemMeshShapeNetgenObject::execute().
◆ SetParameters() [2/2]
void NETGENPlugin_Mesher::SetParameters | ( | const NETGENPlugin_SimpleHypothesis_2D * | hyp | ) |
Pass simple parameters to NETGEN
References SetDefaultParameters().
◆ SetSelfPointer()
void NETGENPlugin_Mesher::SetSelfPointer | ( | NETGENPlugin_Mesher ** | ptr | ) |
Set pointer to NETGENPlugin_Mesher* field of the holder, that will be nullified at destruction of this
Referenced by NETGENPlugin_NETGEN_2D3D::Compute(), and NETGENPlugin_NETGEN_2D::Compute().
◆ SetViscousLayers2DAssigned()
void NETGENPlugin_Mesher::SetViscousLayers2DAssigned | ( | bool | isAssigned | ) |
Referenced by NETGENPlugin_NETGEN_2D::Compute().
◆ toPython()
|
static |
Write a python script creating an equivalent SALOME mesh. This is useful to see what mesh is passed as input for the next step of mesh generation (of mesh of higher dimension)
The documentation for this class was generated from the following files:
- src/3rdParty/salomesmesh/inc/NETGENPlugin_Mesher.hxx
- src/3rdParty/salomesmesh/src/NETGENPlugin/NETGENPlugin_Mesher.cpp