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... | |
This class calls the NETGEN mesher of OCC geometry.
NETGENPlugin_Mesher::NETGENPlugin_Mesher | ( | SMESH_Mesh * | mesh, |
const TopoDS_Shape & | aShape, | ||
const bool | isVolume | ||
) |
References SetDefaultParameters().
NETGENPlugin_Mesher::~NETGENPlugin_Mesher | ( | ) |
Destuctor
|
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(), NETGENPlugin_Internals::getMesh(), SMESH_MesherHelper::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().
|
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 NETGENPlugin_Internals::getMesh(), SMESH_Mesh::GetMeshDS(), and NETGENPlugin_Internals::getSolidsWithVertices().
Referenced by Compute(), and NETGENPlugin_NETGEN_3D::Compute().
|
static |
Fill netgen mesh with segments of a FACE.
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 |
SMESH_ComputeErrorPtr | - error description |
References AddIntVerticesInFaces(), SMESH_TNodeXYZ::Distance(), SMESH_MesherHelper::GetMesh(), SMESH_MesherHelper::GetMeshDS(), SMDS_MeshElement::getshapeId(), 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 Compute(), and NETGENPlugin_NETGEN_2D_ONLY::Compute().
bool NETGENPlugin_Mesher::Compute | ( | ) |
Here we are going to use the NETGEN mesher
References AddIntVerticesInFaces(), AddIntVerticesInSolids(), AddSegmentsToMesh(), StdMeshers_QuadToTriaAdaptor::Compute(), StdMeshers_ViscousLayers2D::Compute(), SMESH_Algo::EdgeLength(), FillNgMesh(), FillSMesh(), FixIntFaces(), SMESH_subMesh::GetComputeError(), GetDefaultMinSize(), StdMeshers_FaceSide::GetFaceWires(), SMESH_subMesh::GetId(), NETGENPlugin_Internals::getInternalEdges(), SMESH_MesherHelper::GetIsQuadratic(), NETGENPlugin_SimpleHypothesis_3D::GetMaxElementVolume(), 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_2D::Compute(), NETGENPlugin_NETGEN_2D3D::Compute(), Fem::FemMeshShapeNetgenObject::execute(), and Fem::FemMeshShapeObject::execute().
bool NETGENPlugin_Mesher::Evaluate | ( | MapShapeNbElems & | aResMap | ) |
Evaluate
References SMESH_Algo::EdgeLength(), SMESH_subMesh::GetComputeError(), GetDefaultMinSize(), NETGENPlugin_SimpleHypothesis_3D::GetMaxElementVolume(), netgen::mparam, netgen::multithread, netgen::OCCGenerateMesh(), PrepareOCCgeometry(), RestrictLocalSize(), NETGENPlugin_NetgenLibWrapper::setMesh(), and NETGENPlugin_Hypothesis::UserDefined.
Referenced by NETGENPlugin_NETGEN_2D::Evaluate(), and NETGENPlugin_NETGEN_2D3D::Evaluate().
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(), SMESHDS_SubMesh::GetElements(), SMESH_subMesh::GetFather(), SMESH_MesherHelper::GetMesh(), SMESH_MesherHelper::GetMeshDS(), 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(), SMESHDS_SubMesh::IsQuadratic(), SMESH_MesherHelper::IsRealSeam(), StdMeshers_FaceSide::NbEdges(), StdMeshers_FaceSide::NbSegments(), uvPtStruct::node, uvPtStruct::normParam, uvPtStruct::param, RestrictLocalSize(), SMESH_MesherHelper::SetSubShape(), SMESHDS_Mesh::ShapeToIndex(), uvPtStruct::u, and uvPtStruct::v.
Referenced by Compute().
|
static |
Fill SMESH mesh according to contents of netgen mesh.
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 |
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(), draftguitools.gui_annotationstyleeditor::param, SMESHDS_Mesh::SetMeshElementOnShape(), SMESHDS_Mesh::SetNodeInVolume(), SMESHDS_Mesh::SetNodeOnEdge(), SMESHDS_Mesh::SetNodeOnFace(), SMESHDS_Mesh::SetNodeOnVertex(), and SMESH_Algo::VertexNode().
Referenced by Compute().
|
static |
Tries to heal the mesh on a FACE. The FACE is supposed to be partially meshed due to NETGEN failure.
[in] | occgeom | - geometry |
[in,out] | ngMesh | - the mesh to fix |
[in,out] | faceID | - ID of the FACE to fix the mesh on |
References Link::Contains(), Link::IsConnected(), Link::n1, and Link::n2.
Referenced by NETGENPlugin_NETGEN_2D_ONLY::Compute().
|
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().
|
static |
Return a default min size value suitable for the given geometry.
Referenced by Compute(), NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), Evaluate(), and NETGENPlugin_Hypothesis::SetParametersByDefaults().
double NETGENPlugin_Mesher::GetProgress | ( | const SMESH_Algo * | holder, |
const int * | algoProgressTic, | ||
const double * | algoProgress | ||
) | const |
References netgen::multithread.
|
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 Compute(), NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), and Evaluate().
|
static |
Read mesh entities preventing successful computation from "test.out" file.
References SMESH_ComputeError::New().
Referenced by Compute(), and NETGENPlugin_NETGEN_3D::compute().
|
static |
Remove "test.out" and "problemfaces" files in current directory.
References SMESH_File::remove().
Referenced by NETGENPlugin_NetgenLibWrapper::~NETGENPlugin_NetgenLibWrapper().
|
static |
Restrict size of elements at a given point.
References netgen::mparam.
Referenced by AddSegmentsToMesh(), Compute(), Evaluate(), and FillNgMesh().
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().
void NETGENPlugin_Mesher::SetParameters | ( | const NETGENPlugin_Hypothesis * | hyp | ) |
Pass parameters to NETGEN
References NETGENPlugin_Hypothesis::GetFineness(), NETGENPlugin_Hypothesis::GetFuseEdges(), NETGENPlugin_Hypothesis::GetGrowthRate(), NETGENPlugin_Hypothesis::GetMaxSize(), NETGENPlugin_Hypothesis::GetMinSize(), NETGENPlugin_Hypothesis::GetNbSegPerEdge(), NETGENPlugin_Hypothesis::GetNbSegPerRadius(), NETGENPlugin_Hypothesis::GetOptimize(), NETGENPlugin_Hypothesis::GetQuadAllowed(), NETGENPlugin_Hypothesis::GetSecondOrder(), NETGENPlugin_Hypothesis::GetSurfaceCurvature(), netgen::merge_solids, and netgen::mparam.
Referenced by NETGENPlugin_NETGEN_2D::Compute(), NETGENPlugin_NETGEN_2D3D::Compute(), NETGENPlugin_NETGEN_2D_ONLY::Compute(), NETGENPlugin_NETGEN_3D::compute(), NETGENPlugin_NETGEN_2D::Evaluate(), NETGENPlugin_NETGEN_2D3D::Evaluate(), and Fem::FemMeshShapeNetgenObject::execute().
void NETGENPlugin_Mesher::SetParameters | ( | const NETGENPlugin_SimpleHypothesis_2D * | hyp | ) |
Pass simple parameters to NETGEN
References SetDefaultParameters().
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_2D::Compute(), and NETGENPlugin_NETGEN_2D3D::Compute().
void NETGENPlugin_Mesher::SetViscousLayers2DAssigned | ( | bool | isAssigned | ) |
Referenced by NETGENPlugin_NETGEN_2D::Compute().
|
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)