"Transforms" quadrilateral faces into triangular ones by creation of pyramids More...
#include <StdMeshers_QuadToTriaAdaptor.hxx>
Public Types | |
typedef boost::shared_ptr < SMESH_ProxyMesh > | Ptr |
typedef std::map< const SMDS_MeshNode *, const SMDS_MeshNode *, TIDCompare > | TN2NMap |
Public Member Functions | |
StdMeshers_QuadToTriaAdaptor () | |
Constructor. More... | |
~StdMeshers_QuadToTriaAdaptor () | |
Destructor. More... | |
bool | Compute (SMESH_Mesh &aMesh, const TopoDS_Shape &aShape, SMESH_ProxyMesh *aProxyMesh=0) |
bool | Compute (SMESH_Mesh &aMesh) |
Computes pyramids in mesh with no shape. More... | |
const TopoDS_Shape & | GetShape () const |
const SMESHDS_SubMesh * | GetSubMesh (const TopoDS_Shape &shape) const |
Returns the submesh of a shape; it can be a proxy sub-mesh. More... | |
const SubMesh * | GetProxySubMesh (const TopoDS_Shape &shape) const |
Returns the proxy sub-mesh of a shape; it can be NULL. More... | |
const SMDS_MeshNode * | GetProxyNode (const SMDS_MeshNode *node) const |
Returns the proxy node of a node; the input node is returned if no proxy exists. More... | |
int | NbProxySubMeshes () const |
Returns number of proxy sub-meshes. More... | |
SMDS_ElemIteratorPtr | GetFaces () const |
Returns iterator on all faces of the mesh taking into account substitutions To be used in case of mesh without shape. More... | |
SMDS_ElemIteratorPtr | GetFaces (const TopoDS_Shape &face) const |
Returns iterator on all faces on the shape taking into account substitutions. More... | |
int | NbFaces () const |
Return total nb of faces taking into account substitutions. More... | |
bool | IsTemporary (const SMDS_MeshElement *elem) const |
Return true if the element is a temporary one. More... | |
SMESH_Mesh * | GetMesh () const |
SMESHDS_Mesh * | GetMeshDS () const |
Returns mesh DS. More... | |
Protected Member Functions | |
int | Preparation (const SMDS_MeshElement *face, TColgp_Array1OfPnt &PN, TColgp_Array1OfVec &VN, std::vector< const SMDS_MeshNode * > &FNodes, gp_Pnt &PC, gp_Vec &VNorm, const SMDS_MeshElement **volumes=0) |
Prepare data for the given face. More... | |
bool | LimitHeight (gp_Pnt &Papex, const gp_Pnt &PC, const TColgp_Array1OfPnt &PN, const std::vector< const SMDS_MeshNode * > &FNodes, SMESH_Mesh &aMesh, const SMDS_MeshElement *NotCheckedFace, const bool UseApexRay, const TopoDS_Shape &Shape=TopoDS_Shape()) |
Return allowed height of a pyramid. More... | |
bool | Compute2ndPart (SMESH_Mesh &aMesh, const std::vector< const SMDS_MeshElement * > &pyramids) |
Update created pyramids and faces to avoid their intersection. More... | |
void | MergePiramids (const SMDS_MeshElement *PrmI, const SMDS_MeshElement *PrmJ, std::set< const SMDS_MeshNode * > &nodesToMove) |
Merge the two pyramids (i.e. More... | |
void | MergeAdjacent (const SMDS_MeshElement *PrmI, std::set< const SMDS_MeshNode * > &nodesToMove, const bool isRecursion=false) |
Merges adjacent pyramids. More... | |
void | setMesh (const SMESH_Mesh &mesh) |
int | shapeIndex (const TopoDS_Shape &shape) const |
Returns index of a shape. More... | |
virtual SubMesh * | newSubmesh (int index=0) const |
SubMesh * | findProxySubMesh (int shapeIndex=0) const |
Returns a proxy sub-mesh. More... | |
SubMesh * | getProxySubMesh (int shapeIndex) |
Returns a proxy sub-mesh; it is created if not yet exists. More... | |
SubMesh * | getProxySubMesh (const TopoDS_Shape &shape=TopoDS_Shape()) |
Returns a proxy sub-mesh; it is created if not yet exists. More... | |
bool | takeProxySubMesh (const TopoDS_Shape &shape, SMESH_ProxyMesh *proxyMesh) |
Move proxy sub-mesh from other proxy mesh to this, returns true if sub-mesh found. More... | |
void | takeTmpElemsInMesh (SMESH_ProxyMesh *proxyMesh) |
Move tmp elements residing the _mesh from other proxy mesh to this. More... | |
void | removeTmpElement (const SMDS_MeshElement *elem) |
Removes tmp elements from the _mesh. More... | |
void | storeTmpElement (const SMDS_MeshElement *elem) |
Stores tmp element residing the _mesh. More... | |
void | setNode2Node (const SMDS_MeshNode *srcNode, const SMDS_MeshNode *proxyNode, const SubMesh *subMesh) |
Set node-node correspondence. More... | |
Protected Attributes | |
TopoDS_Shape | myShape |
std::set< const SMDS_MeshElement * > | myRemovedTrias |
std::list< const SMDS_MeshNode * > | myDegNodes |
const SMESH_ElementSearcher * | myElemSearcher |
std::vector< SMDSAbs_EntityType > | _allowedTypes |
"Transforms" quadrilateral faces into triangular ones by creation of pyramids
|
inherited |
|
inherited |
StdMeshers_QuadToTriaAdaptor::StdMeshers_QuadToTriaAdaptor | ( | ) |
Constructor.
StdMeshers_QuadToTriaAdaptor::~StdMeshers_QuadToTriaAdaptor | ( | ) |
Destructor.
References myElemSearcher.
bool StdMeshers_QuadToTriaAdaptor::Compute | ( | SMESH_Mesh & | aMesh, |
const TopoDS_Shape & | aShape, | ||
SMESH_ProxyMesh * | aProxyMesh = 0 |
||
) |
References SMESHDS_Mesh::AddFace(), SMESH_MesherHelper::AddNode(), SMESH_MesherHelper::AddVolume(), SMESH_ProxyMesh::SubMesh::ChangeElements(), Compute2ndPart(), DEGEN_QUAD, Face, FindBestPoint(), SMESHDS_SubMesh::GetElements(), SMESH_MeshAlgos::GetElementSearcher(), SMESH_ProxyMesh::GetFaces(), SMESH_ProxyMesh::getProxySubMesh(), SMESH_ProxyMesh::GetSubMesh(), SMESH_MesherHelper::IsQuadraticSubMesh(), SMESH_MesherHelper::IsReversedSubMesh(), LimitHeight(), SMESHDS_Mesh::MeshElements(), myElemSearcher, myShape, SMESH_MesherHelper::NbAncestors(), NOT_QUAD, Preparation(), QUAD, SMESH_ProxyMesh::removeTmpElement(), SMESH_MesherHelper::SetElementsOnShape(), SMESH_ProxyMesh::setMesh(), SMESH_ProxyMesh::storeTmpElement(), SMESH_ProxyMesh::takeProxySubMesh(), and SMESH_ProxyMesh::takeTmpElemsInMesh().
bool StdMeshers_QuadToTriaAdaptor::Compute | ( | SMESH_Mesh & | aMesh | ) |
Computes pyramids in mesh with no shape.
References SMESH_ProxyMesh::_allowedTypes, SMESH_ProxyMesh::SubMesh::AddElement(), SMESHDS_Mesh::AddFace(), SMESH_MesherHelper::AddNode(), SMESH_MesherHelper::AddVolume(), Compute2ndPart(), SMESHDS_GroupBase::Contains(), MESHCUT::d, DEGEN_QUAD, SMDS_Mesh::facesIterator(), FindBestPoint(), SMESH_ElementSearcher::FindElementsByPoint(), SMESH_MeshAlgos::GetElementSearcher(), SMESH_ElementSearcher::GetElementsNearLine(), SMDS_MeshElement::GetNode(), SMESH_ElementSearcher::GetPointState(), SMESH_ProxyMesh::getProxySubMesh(), SMESHDS_GroupBase::GetType(), HasIntersection(), SMESHDS_GroupBase::IsEmpty(), SMESH_MesherHelper::IsQuadraticSubMesh(), LimitHeight(), Min(), myElemSearcher, SMDS_MeshElement::NbCornerNodes(), NOT_QUAD, Preparation(), SMESH_MesherHelper::SetElementsOnShape(), SMESH_ProxyMesh::setMesh(), SMDSAbs_Face, SMDSAbs_Volume, SMDSEntity_Quad_Triangle, SMDSEntity_Triangle, and SMESH_ProxyMesh::storeTmpElement().
|
protected |
Update created pyramids and faces to avoid their intersection.
References SMESH_ProxyMesh::findProxySubMesh(), SMESH_MeshAlgos::GetCommonNodes(), SMESH_MeshAlgos::GetElementSearcher(), SMESH_ElementSearcher::GetElementsInSphere(), SMDS_MeshNode::GetInverseElementIterator(), SMESH_ProxyMesh::GetMeshDS(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::GetNodeIndex(), HasIntersection3(), SMESHDS_Mesh::IsEmbeddedMode(), Max(), SMESHDS_Mesh::MaxShapeIndex(), MergeAdjacent(), MergePiramids(), SMESHDS_Mesh::MoveNode(), myDegNodes, myElemSearcher, myRemovedTrias, PYRAM_APEX, SMDS_MeshNode::setXYZ(), and SMDSAbs_Volume.
Referenced by Compute().
|
protectedinherited |
Returns a proxy sub-mesh.
References SMESH_ProxyMesh::_subMeshes.
Referenced by Compute2ndPart(), SMESH_ProxyMesh::GetProxyNode(), and SMESH_ProxyMesh::takeProxySubMesh().
|
inherited |
Returns iterator on all faces of the mesh taking into account substitutions To be used in case of mesh without shape.
References SMESH_ProxyMesh::_allowedTypes, SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::_subContainer, SMESH_ProxyMesh::_subMeshes, SMESHDS_SubMesh::AddSubMesh(), SMDS_Mesh::elementsIterator(), SMESH_ProxyMesh::GetMeshDS(), SMESH_Mesh::HasShapeToMesh(), SMESH_ProxyMesh::NbFaces(), SMESH_Mesh::NbFaces(), SMESHDS_SubMesh::NbSubMeshes(), SMESHDS_SubMesh::RemoveAllSubmeshes(), and SMDSAbs_Face.
Referenced by Compute(), VISCOUS_3D::_ViscousBuilder::computeGeomSize(), and VISCOUS_3D::_ViscousBuilder::smoothAndCheck().
|
inherited |
Returns iterator on all faces on the shape taking into account substitutions.
References SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::_subContainer, SMESHDS_SubMesh::AddSubMesh(), SMESH_ProxyMesh::GetSubMesh(), SMESH_Mesh::HasShapeToMesh(), and SMESHDS_SubMesh::RemoveAllSubmeshes().
|
inherited |
|
inherited |
Returns mesh DS.
References SMESH_ProxyMesh::_mesh, and SMESH_Mesh::GetMeshDS().
Referenced by Compute2ndPart(), SMESH_2D_Algo::FixInternalNodes(), SMESH_ProxyMesh::GetFaces(), SMESH_ProxyMesh::GetProxyNode(), SMESH_ProxyMesh::GetSubMesh(), VISCOUS_3D::_ViscousBuilder::MakeN2NMap(), SMESH_ProxyMesh::NbFaces(), SMESH_ProxyMesh::removeTmpElement(), SMESH_ProxyMesh::shapeIndex(), and SMESH_ProxyMesh::~SMESH_ProxyMesh().
|
inherited |
Returns the proxy node of a node; the input node is returned if no proxy exists.
References SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::findProxySubMesh(), SMESH_Mesh::GetAncestors(), SMESH_ProxyMesh::GetMeshDS(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), SMESH_MesherHelper::GetSubShapeByNode(), SMDS_Position::GetTypeOfPosition(), SMESH_ProxyMesh::shapeIndex(), and SMDS_TOP_FACE.
Referenced by SMESH_MesherHelper::LoadNodeColumns().
|
inherited |
Returns the proxy sub-mesh of a shape; it can be NULL.
References SMESH_ProxyMesh::_subMeshes, and SMESH_ProxyMesh::shapeIndex().
Referenced by VISCOUS_3D::_ViscousBuilder::MakeN2NMap().
|
protectedinherited |
Returns a proxy sub-mesh; it is created if not yet exists.
References SMESH_ProxyMesh::_subMeshes, and SMESH_ProxyMesh::newSubmesh().
Referenced by Compute(), VISCOUS_3D::_MeshOfSolid::getFaceSubM(), and SMESH_ProxyMesh::getProxySubMesh().
|
protectedinherited |
Returns a proxy sub-mesh; it is created if not yet exists.
References SMESH_ProxyMesh::getProxySubMesh(), and SMESH_ProxyMesh::shapeIndex().
const TopoDS_Shape& StdMeshers_QuadToTriaAdaptor::GetShape | ( | ) | const |
|
inherited |
Returns the submesh of a shape; it can be a proxy sub-mesh.
References SMESH_ProxyMesh::_subMeshes, SMESH_ProxyMesh::GetMeshDS(), SMESHDS_Mesh::MeshElements(), and SMESH_ProxyMesh::shapeIndex().
Referenced by Compute(), SMESH_2D_Algo::FixInternalNodes(), SMESH_ProxyMesh::GetFaces(), VISCOUS_3D::_ViscousListener::GetSolidMesh(), SMESH_MesherHelper::LoadNodeColumns(), SMESH_ProxyMesh::NbFaces(), and VISCOUS_3D::_ViscousListener::RemoveSolidMesh().
|
inherited |
Return true if the element is a temporary one.
References SMESH_ProxyMesh::_elemsInMesh, and SMDS_MeshElement::GetID().
Referenced by SMESH_MesherHelper::LoadNodeColumns().
|
protected |
Return allowed height of a pyramid.
Papex | - optimal pyramid apex |
PC | - gravity center of a quadrangle |
PN | - four nodes of the quadrangle |
aMesh | - mesh |
NotCheckedFace | - the quadrangle face |
Shape | - the shape being meshed |
false | if mesh invalidity detected |
References SMESH_MeshAlgos::GetElementSearcher(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::GetNodeIndex(), HasIntersection(), HasIntersection3(), Max(), Min(), myElemSearcher, SMDS_MeshElement::NbCornerNodes(), and SMDSAbs_Face.
Referenced by Compute().
|
protected |
Merges adjacent pyramids.
References SMDS_MeshNode::GetInverseElementIterator(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::NbCornerNodes(), and SMDSAbs_Volume.
Referenced by Compute2ndPart().
|
protected |
Merge the two pyramids (i.e.
fuse their apex) and others already merged with them
References SMDS_MeshElement::begin_nodes(), SMDS_MeshElement::end_nodes(), SMDS_MeshNode::GetInverseElementIterator(), SMDS_MeshElement::GetNode(), SMDS_MeshElement::getshapeId(), SMDS_MeshElement::GetType(), SMDS_MeshNode::NbInverseElements(), PYRAM_APEX, SMDS_MeshNode::setXYZ(), SMDSAbs_Face, SMDSAbs_Volume, and TRIA_APEX.
Referenced by Compute2ndPart().
|
inherited |
Return total nb of faces taking into account substitutions.
References SMESH_ProxyMesh::_allowedTypes, SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::_subMeshes, SMESH_ProxyMesh::GetMeshDS(), SMDS_Mesh::GetMeshInfo(), SMESH_Mesh::GetShapeToMesh(), SMESH_ProxyMesh::GetSubMesh(), SMESH_Mesh::HasShapeToMesh(), SMDS_MeshInfo::NbEntities(), SMDS_Mesh::NbFaces(), SMDSEntity_Quad_Quadrangle, and SMDSEntity_Triangle.
Referenced by SMESH_ProxyMesh::GetFaces().
|
inherited |
Returns number of proxy sub-meshes.
References SMESH_ProxyMesh::_subMeshes.
Reimplemented in VISCOUS_2D::_ProxyMeshOfFace.
Referenced by SMESH_ProxyMesh::getProxySubMesh().
|
protected |
Prepare data for the given face.
PN | - coordinates of face nodes |
VN | - cross products of vectors (PC-PN(i)) ^ (PC-PN(i+1)) |
FNodes | - face nodes |
PC | - gravity center of nodes |
VNorm | - face normal (sum of VN) |
volumes | - two volumes sharing the given face, the first is in VNorm direction |
int | - 0 if given face is not quad, 1 if given face is quad, 2 if given face is degenerate quad (two nodes are coincided) |
References DEGEN_QUAD, SMDS_MeshElement::GetNode(), SMDS_MeshElement::GetNodeIndex(), myDegNodes, SMDS_MeshElement::NbCornerNodes(), SMDS_MeshElement::NbNodes(), SMDS_MeshElement::nodesIterator(), NOT_QUAD, QUAD, SMDSAbs_Volume, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by Compute().
|
protectedinherited |
Removes tmp elements from the _mesh.
References SMESH_ProxyMesh::_elemsInMesh, SMDS_MeshElement::GetID(), SMESH_ProxyMesh::GetMeshDS(), and SMESHDS_Mesh::RemoveFreeElement().
Referenced by Compute().
|
protectedinherited |
References SMESH_ProxyMesh::_mesh.
Referenced by VISCOUS_3D::_MeshOfSolid::_MeshOfSolid(), and Compute().
|
protectedinherited |
Set node-node correspondence.
References SMESH_ProxyMesh::SubMesh::_n2n.
Referenced by VISCOUS_3D::_MeshOfSolid::setNode2Node().
|
protectedinherited |
Returns index of a shape.
References SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::GetMeshDS(), SMESH_Mesh::HasShapeToMesh(), and SMESHDS_Mesh::ShapeToIndex().
Referenced by VISCOUS_3D::_MeshOfSolid::getFaceSubM(), SMESH_ProxyMesh::GetProxyNode(), SMESH_ProxyMesh::GetProxySubMesh(), SMESH_ProxyMesh::getProxySubMesh(), SMESH_ProxyMesh::GetSubMesh(), and SMESH_ProxyMesh::takeProxySubMesh().
|
protectedinherited |
Stores tmp element residing the _mesh.
References SMESH_ProxyMesh::_elemsInMesh.
Referenced by Compute().
|
protectedinherited |
Move proxy sub-mesh from other proxy mesh to this, returns true if sub-mesh found.
References SMESH_ProxyMesh::_mesh, SMESH_ProxyMesh::_subMeshes, SMESH_ProxyMesh::findProxySubMesh(), and SMESH_ProxyMesh::shapeIndex().
Referenced by Compute().
|
protectedinherited |
Move tmp elements residing the _mesh from other proxy mesh to this.
References SMESH_ProxyMesh::_elemsInMesh.
Referenced by Compute(), and SMESH_ProxyMesh::SMESH_ProxyMesh().
|
protectedinherited |
Referenced by Compute(), SMESH_ProxyMesh::GetFaces(), SMESH_ProxyMesh::NbFaces(), and SMESH_ProxyMesh::SMESH_ProxyMesh().
|
protected |
Referenced by Compute2ndPart(), and Preparation().
|
protected |
Referenced by Compute(), Compute2ndPart(), LimitHeight(), and ~StdMeshers_QuadToTriaAdaptor().
|
protected |
Referenced by Compute2ndPart().
|
protected |
Referenced by Compute().