Version: 8.3.0
VISCOUS_2D::_ViscousBuilder2D Class Reference

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 THypVLgetLineHypothesis (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_MeshgetMeshDS ()
 
_ProxyMeshOfFacegetProxyMesh ()
 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
 

Detailed Description

Builder of viscous layers.

Constructor & Destructor Documentation

_ViscousBuilder2D::_ViscousBuilder2D ( SMESH_Mesh theMesh,
const TopoDS_Face &  theFace,
vector< const THypVL * > &  theHyp,
vector< TopoDS_Shape > &  theHypShapes 
)

Member Function Documentation

void _ViscousBuilder2D::calcLayersHeight ( const double  totalThick,
vector< double > &  heights,
const THypVL hyp 
)
private

Calculate height of layers for the given thickness.

Height is measured from the outer boundary

References StdMeshers_ViscousLayers::GetNumberLayers(), and StdMeshers_ViscousLayers::GetStretchFactor().

Referenced by refine(), and shrink().

bool _ViscousBuilder2D::error ( const string &  text)
private

Stores error description and returns false.

References _error, _face, _mesh, and COMPERR_ALGO_FAILED.

Referenced by findEdgesWithLayers(), and makePolyLines().

SMESH_ComputeErrorPtr VISCOUS_2D::_ViscousBuilder2D::GetError ( ) const
const StdMeshers_ViscousLayers2D * _ViscousBuilder2D::getLineHypothesis ( int  iPL)
private

Returns a hypothesis for a _PolyLine.

References _hypOfEdge, and _hyps.

Referenced by getLineThickness(), refine(), and shrink().

double _ViscousBuilder2D::getLineThickness ( int  iPL)
private

Returns a layers thickness for a _PolyLine.

References _maxThickness, getLineHypothesis(), and Min().

Referenced by inflate(), and makePolyLines().

SMESHDS_Mesh* VISCOUS_2D::_ViscousBuilder2D::getMeshDS ( )
private
_ProxyMeshOfFace * _ViscousBuilder2D::getProxyMesh ( )
private

Creates a _ProxyMeshOfFace and store it in a sub-mesh of FACE.

References _face, _mesh, and _proxyMesh.

Referenced by refine(), and shrink().

VISCOUS_2D::_ViscousBuilder2D::Handle ( Geom_Surface  )
private

Referenced by makePolyLines(), and shrink().

bool _ViscousBuilder2D::refine ( )
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().

bool _ViscousBuilder2D::removeMeshFaces ( const TopoDS_Shape &  face)
private

Remove elements and nodes from a face.

References _mesh, SMESH_subMesh::CHECK_COMPUTE_STATE, getMeshDS(), SMESHDS_Mesh::RemoveFreeElement(), and SMESHDS_Mesh::RemoveFreeNode().

Referenced by Compute(), and shrink().

void _ViscousBuilder2D::setLayerEdgeData ( _LayerEdge lEdge,
const double  u,
Handle(Geom2d_Curve)&  pcurve,
Handle(Geom_Curve)&  curve,
const gp_Pnt  pOut,
const bool  reverse,
GeomAPI_ProjectPointOnSurf *  faceProj 
)
private
void _ViscousBuilder2D::setLenRatio ( _LayerEdge LE,
const gp_Pnt &  pOut 
)
private
bool _ViscousBuilder2D::shrink ( )
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().

bool _ViscousBuilder2D::toShrinkForAdjacent ( const TopoDS_Face &  adjFace,
const TopoDS_Edge &  E,
const TopoDS_Vertex &  V 
)
private

Friends And Related Function Documentation

friend class ::StdMeshers_ViscousLayers2D
friend

Field Documentation

vector<TopoDS_Face> VISCOUS_2D::_ViscousBuilder2D::_clearedFaces
private

Referenced by refine().

SMESH_ComputeErrorPtr VISCOUS_2D::_ViscousBuilder2D::_error
private
TopoDS_Face VISCOUS_2D::_ViscousBuilder2D::_face
private
SMESH_MesherHelper VISCOUS_2D::_ViscousBuilder2D::_helper
private
vector< const THypVL* > VISCOUS_2D::_ViscousBuilder2D::_hypOfEdge
private
vector< const THypVL* > VISCOUS_2D::_ViscousBuilder2D::_hyps
private
vector< TopoDS_Shape > VISCOUS_2D::_ViscousBuilder2D::_hypShapes
private
set<TGeomID> VISCOUS_2D::_ViscousBuilder2D::_ignoreShapeIds
private
bool VISCOUS_2D::_ViscousBuilder2D::_is2DIsotropic
private

Referenced by makePolyLines(), and refine().

double VISCOUS_2D::_ViscousBuilder2D::_maxThickness
private
SMESH_Mesh* VISCOUS_2D::_ViscousBuilder2D::_mesh
private
int VISCOUS_2D::_ViscousBuilder2D::_nbLE
private
set<TGeomID> VISCOUS_2D::_ViscousBuilder2D::_noShrinkVert
private
vector<_PolyLine> VISCOUS_2D::_ViscousBuilder2D::_polyLineVec
private
SMESH_ProxyMesh::Ptr VISCOUS_2D::_ViscousBuilder2D::_proxyMesh
private

Referenced by Compute(), getProxyMesh(), and improve().