Builder of viscous layers. More...
Public Member Functions | |
_ViscousBuilder2D (SMESH_Mesh &theMesh, const TopoDS_Face &theFace, vector< const THypVL * > &theHyp, vector< TopoDS_Shape > &theHypShapes) | |
Constructor of _ViscousBuilder2D. More... | |
SMESH_ComputeErrorPtr | GetError () const |
SMESH_ProxyMesh::Ptr | Compute () |
Does its job. More... | |
Private Member Functions | |
bool | findEdgesWithLayers () |
Finds EDGE's to make viscous layers on. More... | |
bool | makePolyLines () |
Create the inner front of the viscous layers and prepare data for inflation. More... | |
bool | inflate () |
Increase length of _LayerEdge's to reach the required thickness of layers. More... | |
bool | fixCollisions () |
Remove intersection of _PolyLine's. More... | |
bool | refine () |
Make faces. More... | |
bool | shrink () |
Create new edges and shrink edges existing on a non-advancable _PolyLine adjacent to an advancable one. More... | |
bool | improve () |
Improve quality of the created mesh elements. More... | |
bool | toShrinkForAdjacent (const TopoDS_Face &adjFace, const TopoDS_Edge &E, const TopoDS_Vertex &V) |
Returns true if there will be a shrinked mesh on EDGE E of FACE adjFace near VERTEX V. More... | |
void | setLenRatio (_LayerEdge &LE, const gp_Pnt &pOut) |
Compute and set _LayerEdge::_len2dTo3dRatio. More... | |
void | setLayerEdgeData (_LayerEdge &lEdge, const double u, Handle(Geom2d_Curve)&pcurve, Handle(Geom_Curve)&curve, const gp_Pnt pOut, const bool reverse, GeomAPI_ProjectPointOnSurf *faceProj) |
initialize data of a _LayerEdge More... | |
void | adjustCommonEdge (_PolyLine &LL, _PolyLine &LR) |
adjust common _LayerEdge of two adjacent _PolyLine's More... | |
void | calcLayersHeight (const double totalThick, vector< double > &heights, const THypVL *hyp) |
Calculate height of layers for the given thickness. More... | |
bool | removeMeshFaces (const TopoDS_Shape &face) |
Remove elements and nodes from a face. More... | |
const THypVL * | getLineHypothesis (int iPL) |
Returns a hypothesis for a _PolyLine. More... | |
double | getLineThickness (int iPL) |
Returns a layers thickness for a _PolyLine. More... | |
bool | error (const string &text) |
Stores error description and returns false. More... | |
SMESHDS_Mesh * | getMeshDS () |
_ProxyMeshOfFace * | getProxyMesh () |
Creates a _ProxyMeshOfFace and store it in a sub-mesh of FACE. More... | |
Handle (Geom_Surface) _surface | |
Private Attributes | |
SMESH_Mesh * | _mesh |
TopoDS_Face | _face |
vector< const THypVL * > | _hyps |
vector< TopoDS_Shape > | _hypShapes |
SMESH_ProxyMesh::Ptr | _proxyMesh |
SMESH_ComputeErrorPtr | _error |
SMESH_MesherHelper | _helper |
TSideVector | _faceSideVec |
vector< _PolyLine > | _polyLineVec |
vector< const THypVL * > | _hypOfEdge |
bool | _is2DIsotropic |
vector< TopoDS_Face > | _clearedFaces |
double | _maxThickness |
set< TGeomID > | _ignoreShapeIds |
set< TGeomID > | _noShrinkVert |
int | _nbLE |
Friends | |
class | ::StdMeshers_ViscousLayers2D |
Builder of viscous layers.
_ViscousBuilder2D::_ViscousBuilder2D | ( | SMESH_Mesh & | theMesh, |
const TopoDS_Face & | theFace, | ||
vector< const THypVL * > & | theHyp, | ||
vector< TopoDS_Shape > & | theHypShapes | ||
) |
Constructor of _ViscousBuilder2D.
References _error, _face, _helper, _hyps, _hypShapes, _nbLE, COMPERR_OK, SMESH_ComputeError::New(), SMESH_MesherHelper::SetElementsOnShape(), and SMESH_MesherHelper::SetSubShape().
adjust common _LayerEdge of two adjacent _PolyLine's
References VISCOUS_2D::_PolyLine::_advancable, VISCOUS_2D::_LayerEdge::_isBlocked, VISCOUS_2D::_PolyLine::_lastPntInd, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_LayerEdge::_len2dTo3dRatio, VISCOUS_2D::_LayerEdge::_length2D, _maxThickness, VISCOUS_2D::_LayerEdge::_normal2D, VISCOUS_2D::_SegmentIntersection::_param1, VISCOUS_2D::_SegmentIntersection::_param2, _polyLineVec, VISCOUS_2D::_LayerEdge::_ray, VISCOUS_2D::_PolyLine::_segTree, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_PolyLine::_wire, Abs(), VISCOUS_2D::_SegmentIntersection::Compute(), StdMeshers_FaceSide::GetUVPtStruct(), Max(), Min(), and setLenRatio().
Referenced by makePolyLines().
|
private |
Calculate height of layers for the given thickness.
Height is measured from the outer boundary
References StdMeshers_ViscousLayers::GetNumberLayers(), and StdMeshers_ViscousLayers::GetStretchFactor().
SMESH_ProxyMesh::Ptr _ViscousBuilder2D::Compute | ( | ) |
Does its job.
References _error, _face, _faceSideVec, _helper, _mesh, _proxyMesh, findEdgesWithLayers(), StdMeshers_FaceSide::GetFaceWires(), inflate(), makePolyLines(), refine(), removeMeshFaces(), and shrink().
Referenced by StdMeshers_ViscousLayers2D::Compute().
|
private |
Stores error description and returns false.
References _error, _face, _mesh, and COMPERR_ALGO_FAILED.
Referenced by findEdgesWithLayers(), and makePolyLines().
|
private |
Finds EDGE's to make viscous layers on.
References _face, _faceSideVec, _helper, _hypOfEdge, _hyps, _hypShapes, _ignoreShapeIds, _mesh, _noShrinkVert, error(), SMESH_MesherHelper::GetAncestors(), VISCOUS_2D::getEdgesToIgnore(), getMeshDS(), StdMeshers_ViscousLayers::GetNumberLayers(), SMESH_MesherHelper::IsSubShape(), and SMESHDS_Mesh::ShapeToIndex().
Referenced by StdMeshers_ViscousLayers2D::CheckHypothesis(), Compute(), and toShrinkForAdjacent().
|
private |
Remove intersection of _PolyLine's.
References VISCOUS_2D::_PolyLine::_advancable, VISCOUS_2D::_LayerEdge::_isBlocked, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_PolyLine::_leftLine, VISCOUS_2D::_LayerEdge::_len2dTo3dRatio, VISCOUS_2D::_LayerEdge::_length2D, VISCOUS_2D::_SegmentIntersection::_param1, VISCOUS_2D::_SegmentIntersection::_param2, _polyLineVec, VISCOUS_2D::_LayerEdge::_ray, VISCOUS_2D::_PolyLine::_reachableLines, VISCOUS_2D::_PolyLine::_segTree, VISCOUS_2D::_LayerEdge::_uvIn, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_SegmentIntersection::Compute(), VISCOUS_2D::_PolyLine::FirstLEdge(), VISCOUS_2D::_PolyLine::IsAdjacent(), and VISCOUS_2D::_LayerEdge::SetNewLength().
Referenced by inflate().
SMESH_ComputeErrorPtr VISCOUS_2D::_ViscousBuilder2D::GetError | ( | ) | const |
Referenced by StdMeshers_ViscousLayers2D::CheckHypothesis(), and StdMeshers_ViscousLayers2D::Compute().
|
private |
Returns a hypothesis for a _PolyLine.
References _hypOfEdge, and _hyps.
Referenced by getLineThickness(), refine(), and shrink().
|
private |
Returns a layers thickness for a _PolyLine.
References _maxThickness, getLineHypothesis(), and Min().
Referenced by inflate(), and makePolyLines().
|
private |
Referenced by findEdgesWithLayers(), refine(), removeMeshFaces(), shrink(), and toShrinkForAdjacent().
|
private |
Creates a _ProxyMeshOfFace and store it in a sub-mesh of FACE.
References _face, _mesh, and _proxyMesh.
|
private |
Referenced by makePolyLines(), and shrink().
|
private |
Improve quality of the created mesh elements.
References VISCOUS_2D::_PolyLine::_edgeInd, _faceSideVec, VISCOUS_2D::_PolyLine::_isStraight2D, _mesh, VISCOUS_2D::_PolyLine::_newFaces, _polyLineVec, _proxyMesh, VISCOUS_2D::_PolyLine::_rightNodes, VISCOUS_2D::_PolyLine::_wire, SMESH_MeshEditor::CENTROIDAL, and StdMeshers_FaceSide::Edge().
|
private |
Increase length of _LayerEdge's to reach the required thickness of layers.
L._leftLine->_advancable &&
References VISCOUS_2D::_PolyLine::_advancable, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_PolyLine::_leftLine, VISCOUS_2D::_LayerEdge::_length2D, _maxThickness, VISCOUS_2D::_LayerEdge::_normal2D, VISCOUS_2D::_SegmentIntersection::_param1, VISCOUS_2D::_SegmentIntersection::_param2, _polyLineVec, VISCOUS_2D::_PolyLine::_reachableLines, VISCOUS_2D::_PolyLine::_rightLine, VISCOUS_2D::_PolyLine::_segments, VISCOUS_2D::_PolyLine::_segTree, VISCOUS_2D::_LayerEdge::_uvIn, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_SegmentIntersection::Compute(), VISCOUS_2D::_PolyLine::FirstLEdge(), fixCollisions(), getLineThickness(), VISCOUS_2D::_PolyLine::IsAdjacent(), VISCOUS_2D::_PolyLine::IsCommonEdgeShared(), Max(), and Min().
Referenced by Compute().
|
private |
Create the inner front of the viscous layers and prepare data for inflation.
References VISCOUS_2D::_PolyLine::_advancable, VISCOUS_2D::_PolyLine::_edgeInd, _face, _faceSideVec, VISCOUS_2D::_PolyLine::_firstPntInd, _helper, _hyps, _ignoreShapeIds, VISCOUS_2D::_PolyLine::_index, VISCOUS_2D::_Segment::_indexInLine, _is2DIsotropic, VISCOUS_2D::_PolyLine::_isStraight2D, VISCOUS_2D::_PolyLine::_lastPntInd, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_PolyLine::_leftLine, VISCOUS_2D::_LayerEdge::_len2dTo3dRatio, _maxThickness, VISCOUS_2D::_LayerEdge::_normal2D, VISCOUS_2D::_SegmentIntersection::_param2, _polyLineVec, VISCOUS_2D::_PolyLine::_reachableLines, VISCOUS_2D::_PolyLine::_rightLine, VISCOUS_2D::_PolyLine::_segments, VISCOUS_2D::_PolyLine::_segTree, VISCOUS_2D::_Segment::_uv, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_PolyLine::_wire, Abs(), adjustCommonEdge(), VISCOUS_2D::_SegmentIntersection::Compute(), StdMeshers_FaceSide::Edge(), error(), getLineThickness(), SMESH_MesherHelper::GetProjector(), Handle(), SMESH_MeshAlgos::IsOut(), Max(), Min(), uvPtStruct::node, reverse(), setLayerEdgeData(), setLenRatio(), uvPtStruct::u, and uvPtStruct::v.
Referenced by Compute().
|
private |
Make faces.
L._leftLine->_advancable &&
References VISCOUS_2D::_PolyLine::_advancable, _clearedFaces, VISCOUS_2D::_PolyLine::_edgeInd, _face, VISCOUS_2D::_PolyLine::_firstPntInd, _helper, _is2DIsotropic, VISCOUS_2D::_PolyLine::_lastPntInd, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_PolyLine::_leftLine, VISCOUS_2D::_PolyLine::_leftNodes, VISCOUS_2D::_LayerEdge::_length2D, _mesh, VISCOUS_2D::_PolyLine::_newFaces, VISCOUS_2D::_LayerEdge::_normal2D, _noShrinkVert, _polyLineVec, VISCOUS_2D::_PolyLine::_rightLine, VISCOUS_2D::_PolyLine::_rightNodes, VISCOUS_2D::_PolyLine::_segments, VISCOUS_2D::_LayerEdge::_uvIn, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_PolyLine::_wire, Abs(), SMESH_MesherHelper::AddFace(), SMESH_MesherHelper::AddNode(), calcLayersHeight(), SMESH_subMesh::COMPUTE, StdMeshers_FaceSide::EdgeID(), StdMeshers_FaceSide::FirstParameter(), StdMeshers_FaceSide::FirstU(), StdMeshers_FaceSide::FirstVertex(), VISCOUS_2D::_ProxyMeshOfFace::GetEdgeSubMesh(), getLineHypothesis(), getMeshDS(), SMESH_MesherHelper::GetNodeUV(), StdMeshers_ViscousLayers::GetNumberLayers(), SMESH_MesherHelper::GetPeriodicIndex(), getProxyMesh(), SMESH_MesherHelper::GetSubShapeOri(), StdMeshers_FaceSide::GetUVPtStruct(), if(), VISCOUS_2D::_PolyLine::IsCommonEdgeShared(), StdMeshers_FaceSide::LastParameter(), StdMeshers_FaceSide::LastU(), StdMeshers_FaceSide::LastVertex(), uvPtStruct::node, VISCOUS_2D::_Segment::p1(), VISCOUS_2D::_Segment::p2(), SMESH_subMesh::READY_TO_COMPUTE, VISCOUS_2D::_ProxyMeshOfFace::_EdgeSubMesh::SetUVPtStructVec(), and SMESHDS_Mesh::ShapeToIndex().
Referenced by Compute().
|
private |
Remove elements and nodes from a face.
References _mesh, SMESH_subMesh::CHECK_COMPUTE_STATE, getMeshDS(), SMESHDS_Mesh::RemoveFreeElement(), and SMESHDS_Mesh::RemoveFreeNode().
|
private |
initialize data of a _LayerEdge
References _hyps, VISCOUS_2D::_LayerEdge::_isBlocked, VISCOUS_2D::_LayerEdge::_length2D, _nbLE, VISCOUS_2D::_LayerEdge::_normal2D, VISCOUS_2D::_LayerEdge::_ray, VISCOUS_2D::_LayerEdge::_uvIn, and VISCOUS_2D::_LayerEdge::_uvOut.
Referenced by makePolyLines().
|
private |
Compute and set _LayerEdge::_len2dTo3dRatio.
References VISCOUS_2D::_LayerEdge::_len2dTo3dRatio, VISCOUS_2D::_LayerEdge::_normal2D, and VISCOUS_2D::_LayerEdge::_uvOut.
Referenced by adjustCommonEdge(), and makePolyLines().
|
private |
Create new edges and shrink edges existing on a non-advancable _PolyLine adjacent to an advancable one.
References VISCOUS_2D::_PolyLine::_advancable, VISCOUS_2D::_PolyLine::_edgeInd, _face, VISCOUS_2D::_PolyLine::_firstPntInd, _helper, VISCOUS_2D::_PolyLine::_index, VISCOUS_2D::_PolyLine::_lastPntInd, VISCOUS_2D::_PolyLine::_lEdges, VISCOUS_2D::_PolyLine::_leftLine, VISCOUS_2D::_PolyLine::_leftNodes, VISCOUS_2D::_LayerEdge::_len2dTo3dRatio, VISCOUS_2D::_LayerEdge::_length2D, _maxThickness, _mesh, VISCOUS_2D::_LayerEdge::_normal2D, _noShrinkVert, _polyLineVec, VISCOUS_2D::_PolyLine::_rightLine, VISCOUS_2D::_PolyLine::_rightNodes, VISCOUS_2D::_PolyLine::_segments, VISCOUS_2D::_LayerEdge::_uvIn, VISCOUS_2D::_LayerEdge::_uvOut, VISCOUS_2D::_LayerEdge::_uvRefined, VISCOUS_2D::_PolyLine::_wire, Abs(), SMESH_MesherHelper::AddEdge(), SMESH_MesherHelper::AddNode(), calcLayersHeight(), SMESHDS_Mesh::ChangeElementNodes(), StdMeshers_FaceSide::Edge(), StdMeshers_FaceSide::EdgeID(), StdMeshers_FaceSide::EdgeLength(), Face, VISCOUS_2D::_ProxyMeshHolder::FindProxyMeshOfFace(), StdMeshers_FaceSide::FirstU(), StdMeshers_FaceSide::FirstVertex(), SMESH_MesherHelper::GetAncestors(), VISCOUS_2D::_ProxyMeshOfFace::GetEdgeSubMesh(), SMDS_MeshElement::GetID(), SMDS_MeshNode::GetInverseElementIterator(), getLineHypothesis(), getMeshDS(), SMDS_MeshElement::GetNode(), StdMeshers_ViscousLayers::GetNumberLayers(), SMDS_MeshNode::GetPosition(), getProxyMesh(), SMDS_MeshElement::getshapeId(), SMDS_Position::GetTypeOfPosition(), StdMeshers_FaceSide::GetUVPtStruct(), Handle(), VISCOUS_2D::_PolyLine::IsCommonEdgeShared(), SMESH_MesherHelper::IsRealSeam(), StdMeshers_FaceSide::LastU(), StdMeshers_FaceSide::LastVertex(), Max(), Min(), SMESHDS_Mesh::MoveNode(), SMDS_MeshElement::NbNodes(), uvPtStruct::node, uvPtStruct::normParam, uvPtStruct::param, removeMeshFaces(), SMESH_MesherHelper::SetElementsOnShape(), SMESH_MesherHelper::SetSubShape(), SMDS_EdgePosition::SetUParameter(), VISCOUS_2D::_ProxyMeshOfFace::_EdgeSubMesh::SetUVPtStructVec(), SMESHDS_Mesh::ShapeToIndex(), SMDS_TOP_EDGE, SMDS_TOP_VERTEX, SMDSAbs_Edge, VISCOUS_3D::ToClearSubWithMain(), toShrinkForAdjacent(), uvPtStruct::u, uvPtStruct::v, and SMDS_MeshNode::X().
Referenced by Compute().
|
private |
Returns true if there will be a shrinked mesh on EDGE E of FACE adjFace near VERTEX V.
References _error, _faceSideVec, _helper, _ignoreShapeIds, _mesh, _noShrinkVert, findEdgesWithLayers(), VISCOUS_2D::findHyps(), SMESH_MesherHelper::GetAncestors(), StdMeshers_FaceSide::GetFaceWires(), getMeshDS(), and SMESH_MesherHelper::IsSubShape().
Referenced by shrink().
|
friend |
|
private |
Referenced by refine().
|
private |
Referenced by _ViscousBuilder2D(), Compute(), error(), and toShrinkForAdjacent().
|
private |
Referenced by _ViscousBuilder2D(), Compute(), error(), findEdgesWithLayers(), getProxyMesh(), makePolyLines(), refine(), and shrink().
|
private |
|
private |
Referenced by _ViscousBuilder2D(), Compute(), findEdgesWithLayers(), makePolyLines(), refine(), shrink(), and toShrinkForAdjacent().
|
private |
Referenced by findEdgesWithLayers(), and getLineHypothesis().
|
private |
Referenced by _ViscousBuilder2D(), findEdgesWithLayers(), getLineHypothesis(), makePolyLines(), and setLayerEdgeData().
|
private |
Referenced by _ViscousBuilder2D(), and findEdgesWithLayers().
|
private |
Referenced by findEdgesWithLayers(), makePolyLines(), and toShrinkForAdjacent().
|
private |
Referenced by makePolyLines(), and refine().
|
private |
Referenced by adjustCommonEdge(), getLineThickness(), inflate(), makePolyLines(), and shrink().
|
private |
Referenced by Compute(), error(), findEdgesWithLayers(), getProxyMesh(), improve(), refine(), removeMeshFaces(), shrink(), and toShrinkForAdjacent().
|
private |
Referenced by _ViscousBuilder2D(), and setLayerEdgeData().
|
private |
Referenced by findEdgesWithLayers(), refine(), shrink(), and toShrinkForAdjacent().
|
private |
Referenced by adjustCommonEdge(), fixCollisions(), improve(), inflate(), makePolyLines(), refine(), and shrink().
|
private |
Referenced by Compute(), getProxyMesh(), and improve().