Version: 9.12.0
VISCOUS_3D::_LayerEdge Struct Reference

Edge normal to surface, connecting a node on solid surface (_nodes[0]) and a node of the most internal layer (_nodes.back()) More...

Public Types

enum  EFlags {
  TO_SMOOTH = 0x0000001 , MOVED = 0x0000002 , SMOOTHED = 0x0000004 , DIFFICULT = 0x0000008 ,
  ON_CONCAVE_FACE = 0x0000010 , BLOCKED = 0x0000020 , INTERSECTED = 0x0000040 , NORMAL_UPDATED = 0x0000080 ,
  UPD_NORMAL_CONV = 0x0000100 , MARKED = 0x0000200 , MULTI_NORMAL = 0x0000400 , NEAR_BOUNDARY = 0x0000800 ,
  SMOOTHED_C1 = 0x0001000 , DISTORTED = 0x0002000 , RISKY_SWOL = 0x0004000 , SHRUNK = 0x0008000 ,
  UNUSED_FLAG = 0x0100000
}
 
enum  {
  FUN_LAPLACIAN , FUN_LENWEIGHTED , FUN_CENTROIDAL , FUN_NEFPOLY ,
  FUN_ANGULAR , FUN_NB
}
 
typedef gp_XYZ(_LayerEdge::* PSmooFun) ()
 

Public Member Functions

bool Is (int flag) const
 
void Set (int flag)
 
void Unset (int flag)
 
std::string DumpFlags () const
 Print flags. More...
 
void SetNewLength (double len, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Add a new segment to _LayerEdge during inflation. More...
 
bool SetNewLength2d (Handle(Geom_Surface)&surface, const TopoDS_Face &F, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Move target node to it's final position on the FACE during shrinking. More...
 
bool UpdatePositionOnSWOL (SMDS_MeshNode *n, double tol, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Update last position on SWOL by projecting node on SWOL. More...
 
void SetDataByNeighbors (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Set _curvature and _2neibors->_plnNorm by 2 neighbor nodes residing the same EDGE. More...
 
void Block (_SolidData &data)
 Set BLOCKED flag and propagate limited _maxLen to _neibors. More...
 
void InvalidateStep (size_t curStep, const _EdgesOnShape &eos, bool restoreLength=false)
 Remove last inflation step. More...
 
void ChooseSmooFunction (const set< TGeomID > &concaveVertices, const TNode2Edge &n2eMap)
 Chooses a smoothing technique giving a position most close to an initial one. More...
 
void SmoothPos (const vector< double > &segLen, const double tol)
 Smooth a path formed by _pos of a _LayerEdge smoothed on FACE. More...
 
int GetSmoothedPos (const double tol)
 Return index of a _pos distant from _normal. More...
 
int Smooth (const int step, const bool isConcaveFace, bool findBest)
 Perform 'smart' 3D smooth of nodes inflated from FACE. More...
 
int Smooth (const int step, bool findBest, vector< _LayerEdge * > &toSmooth)
 Perform 'smart' 3D smooth of nodes inflated from FACE. More...
 
int CheckNeiborsOnBoundary (vector< _LayerEdge * > *badNeibors=0, bool *needSmooth=0)
 Checks validity of _neibors on EDGEs and VERTEXes. More...
 
void SmoothWoCheck ()
 Perform 3D smooth of nodes inflated from FACE. More...
 
bool SmoothOnEdge (Handle(ShapeAnalysis_Surface)&surface, const TopoDS_Face &F, SMESH_MesherHelper &helper)
 Perform smooth of _LayerEdge's based on EDGE's. More...
 
void MoveNearConcaVer (const _EdgesOnShape *eov, const _EdgesOnShape *eos, const int step, vector< _LayerEdge * > &badSmooEdges)
 _LayerEdge, located at a concave VERTEX of a FACE, moves target nodes of neighbor _LayerEdge's by it's own inflation vector. More...
 
bool FindIntersection (SMESH_ElementSearcher &searcher, double &distance, const double &epsilon, _EdgesOnShape &eos, const SMDS_MeshElement **face=0)
 Looks for intersection of it's last segment with faces. More...
 
bool SegTriaInter (const gp_Ax1 &lastSegment, const gp_XYZ &p0, const gp_XYZ &p1, const gp_XYZ &p2, double &dist, const double &epsilon) const
 Test intersection of the last segment with a given triangle using Moller-Trumbore algorithm Intersection is detected if distance to intersection is less than _LayerEdge._len. More...
 
bool SegTriaInter (const gp_Ax1 &lastSegment, const SMDS_MeshNode *n0, const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, double &dist, const double &epsilon) const
 
const gp_XYZ & PrevPos () const
 
gp_XYZ PrevCheckPos (_EdgesOnShape *eos=0) const
 Returns a point used to check orientation of _simplices. More...
 
gp_Ax1 LastSegment (double &segLen, _EdgesOnShape &eos) const
 Returns size and direction of the last segment. More...
 
gp_XY LastUV (const TopoDS_Face &F, _EdgesOnShape &eos, int which=-1) const
 Return the last (or which) position of the target node on a FACE. More...
 
bool IsOnEdge () const
 
bool IsOnFace () const
 
int BaseShapeDim () const
 
gp_XYZ Copy (_LayerEdge &other, _EdgesOnShape &eos, SMESH_MesherHelper &helper)
 Copy data from a _LayerEdge of other SOLID and based on the same node; this and the other _LayerEdge are inflated along a FACE or an EDGE. More...
 
double SetCosin (double cosin)
 Set _cosin and _lenFactor. More...
 
void SetNormal (const gp_XYZ &n)
 
void SetMaxLen (double l)
 
int NbSteps () const
 
bool IsNeiborOnEdge (const _LayerEdge *edge) const
 Check if another _LayerEdge is a neighbor on EDGE. More...
 
void SetSmooLen (double len)
 
double GetSmooLen ()
 
gp_XYZ smoothLaplacian ()
 Computes a new node position using Laplacian smoothing. More...
 
gp_XYZ smoothAngular ()
 Computes a new node position using angular-based smoothing. More...
 
gp_XYZ smoothLengthWeighted ()
 Computes a new node position using weighted node positions. More...
 
gp_XYZ smoothCentroidal ()
 Computes a new node position using angular-based smoothing. More...
 
gp_XYZ smoothNefPolygon ()
 Computes a new node position located inside a Nef polygon. More...
 
int smooFunID (PSmooFun fun=0) const
 Returns a name of _SmooFunction. More...
 

Data Fields

vector< const SMDS_MeshNode * > _nodes
 
gp_XYZ _normal
 
vector< gp_XYZ > _pos
 
double _len
 
double _maxLen
 
double _cosin
 
double _minAngle
 
double _lenFactor
 
int _flags
 
vector< _Simplex_simplices
 
vector< _LayerEdge * > _neibors
 
PSmooFun _smooFunction
 
_Curvature_curvature
 
_2NearEdges_2neibors
 

Static Public Attributes

static const int theNbSmooFuns = FUN_NB
 
static PSmooFun _funs [theNbSmooFuns]
 
static const char * _funNames [theNbSmooFuns+1]
 

Detailed Description

Edge normal to surface, connecting a node on solid surface (_nodes[0]) and a node of the most internal layer (_nodes.back())

Member Typedef Documentation

◆ PSmooFun

typedef gp_XYZ(_LayerEdge::* VISCOUS_3D::_LayerEdge::PSmooFun) ()

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
FUN_LAPLACIAN 
FUN_LENWEIGHTED 
FUN_CENTROIDAL 
FUN_NEFPOLY 
FUN_ANGULAR 
FUN_NB 

◆ EFlags

Enumerator
TO_SMOOTH 
MOVED 
SMOOTHED 
DIFFICULT 
ON_CONCAVE_FACE 
BLOCKED 
INTERSECTED 
NORMAL_UPDATED 
UPD_NORMAL_CONV 
MARKED 
MULTI_NORMAL 
NEAR_BOUNDARY 
SMOOTHED_C1 
DISTORTED 
RISKY_SWOL 
SHRUNK 
UNUSED_FLAG 

Member Function Documentation

◆ BaseShapeDim()

int VISCOUS_3D::_LayerEdge::BaseShapeDim ( ) const

◆ Block()

◆ CheckNeiborsOnBoundary()

int _LayerEdge::CheckNeiborsOnBoundary ( vector< _LayerEdge * > *  badNeibors = 0,
bool *  needSmooth = 0 
)

Checks validity of _neibors on EDGEs and VERTEXes.

References _nodes, _pos, _simplices, debugMsg, and Is().

Referenced by VISCOUS_3D::_ViscousBuilder::smoothAndCheck().

◆ ChooseSmooFunction()

void _LayerEdge::ChooseSmooFunction ( const set< TGeomID > &  concaveVertices,
const TNode2Edge n2eMap 
)

Chooses a smoothing technique giving a position most close to an initial one.

For a correct result, _simplices must contain nodes lying on geometry.

References SMESH_Hypothesis::GetDim().

Referenced by VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace().

◆ Copy()

gp_XYZ _LayerEdge::Copy ( _LayerEdge other,
_EdgesOnShape eos,
SMESH_MesherHelper helper 
)

Copy data from a _LayerEdge of other SOLID and based on the same node; this and the other _LayerEdge are inflated along a FACE or an EDGE.

References _2neibors, _cosin, _curvature, _lenFactor, _nodes, _normal, VISCOUS_3D::_EdgesOnShape::_sWOL, Edge, Face, SMESH_MesherHelper::GetNodeU(), SMESH_MesherHelper::GetNodeUV(), and VISCOUS_3D::_EdgesOnShape::SWOLType().

Referenced by VISCOUS_3D::_ViscousBuilder::makeLayer().

◆ DumpFlags()

std::string _LayerEdge::DumpFlags ( ) const

Print flags.

◆ FindIntersection()

bool _LayerEdge::FindIntersection ( SMESH_ElementSearcher searcher,
double &  distance,
const double &  epsilon,
_EdgesOnShape eos,
const SMDS_MeshElement **  intFace = 0 
)

Looks for intersection of it's last segment with faces.

Parameters
distance- returns shortest distance from the last node to intersection

References SMDS_MeshElement::begin_nodes(), MESHCUT::epsilon, SMESH_ElementSearcher::GetElementsNearLine(), SMESHDS_Hypothesis::GetID(), SMDS_MeshElement::GetNodeIndex(), SMDS_MeshElement::NbCornerNodes(), and SMDSAbs_Face.

◆ GetSmooLen()

double VISCOUS_3D::_LayerEdge::GetSmooLen ( )

◆ GetSmoothedPos()

int _LayerEdge::GetSmoothedPos ( const double  tol)

Return index of a _pos distant from _normal.

Referenced by VISCOUS_3D::_ViscousBuilder::refine().

◆ InvalidateStep()

◆ Is()

◆ IsNeiborOnEdge()

bool _LayerEdge::IsNeiborOnEdge ( const _LayerEdge edge) const

Check if another _LayerEdge is a neighbor on EDGE.

References _2neibors, and VISCOUS_3D::_2NearEdges::include().

◆ IsOnEdge()

◆ IsOnFace()

bool VISCOUS_3D::_LayerEdge::IsOnFace ( ) const

◆ LastSegment()

gp_Ax1 _LayerEdge::LastSegment ( double &  segLen,
_EdgesOnShape eos 
) const

◆ LastUV()

gp_XY _LayerEdge::LastUV ( const TopoDS_Face &  F,
_EdgesOnShape eos,
int  which = -1 
) const

Return the last (or which) position of the target node on a FACE.

Parameters
[in]F- the FACE this _LayerEdge is inflated along
[in]which- index of position
Returns
gp_XY - result UV

References VISCOUS_3D::_EdgesOnShape::_sWOL, Edge, Handle(), and VISCOUS_3D::_EdgesOnShape::SWOLType().

Referenced by VISCOUS_3D::_ViscousBuilder::prepareEdgeToShrink(), and VISCOUS_3D::_Smoother1D::smoothAnalyticEdge().

◆ MoveNearConcaVer()

void _LayerEdge::MoveNearConcaVer ( const _EdgesOnShape eov,
const _EdgesOnShape eos,
const int  step,
vector< _LayerEdge * > &  badSmooEdges 
)

_LayerEdge, located at a concave VERTEX of a FACE, moves target nodes of neighbor _LayerEdge's by it's own inflation vector.

Parameters
[in]eov- EOS of the VERTEX
[in]eos- EOS of the FACE
[in]step- inflation step
[in,out]badSmooEdges- tangled _LayerEdge's

References _curvature, VISCOUS_3D::_Curvature::_h2lenRatio, VISCOUS_3D::_Curvature::_k, _neibors, _nodes, _pos, VISCOUS_3D::_Curvature::_r, VISCOUS_3D::_EdgesOnShape::_shapeID, VISCOUS_3D::_EdgesOnShape::_sWOL, VISCOUS_3D::_Curvature::_uv, dumpMoveComm, Edge, Face, PrevPos(), SMDS_MeshNode::setXYZ(), Smooth(), VISCOUS_3D::_EdgesOnShape::SWOLType(), and Unset().

◆ NbSteps()

int VISCOUS_3D::_LayerEdge::NbSteps ( ) const

◆ PrevCheckPos()

gp_XYZ _LayerEdge::PrevCheckPos ( _EdgesOnShape eos = 0) const

◆ PrevPos()

const gp_XYZ& VISCOUS_3D::_LayerEdge::PrevPos ( ) const

◆ SegTriaInter() [1/2]

bool _LayerEdge::SegTriaInter ( const gp_Ax1 &  lastSegment,
const gp_XYZ &  p0,
const gp_XYZ &  p1,
const gp_XYZ &  p2,
double &  dist,
const double &  epsilon 
) const

Test intersection of the last segment with a given triangle using Moller-Trumbore algorithm Intersection is detected if distance to intersection is less than _LayerEdge._len.

Referenced by VISCOUS_3D::_ViscousBuilder::findCollisionEdges(), and VISCOUS_3D::_ViscousBuilder::updateNormals().

◆ SegTriaInter() [2/2]

bool VISCOUS_3D::_LayerEdge::SegTriaInter ( const gp_Ax1 &  lastSegment,
const SMDS_MeshNode n0,
const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
double &  dist,
const double &  epsilon 
) const

References MESHCUT::epsilon.

◆ Set()

◆ SetCosin()

double _LayerEdge::SetCosin ( double  cosin)

◆ SetDataByNeighbors()

void _LayerEdge::SetDataByNeighbors ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const _EdgesOnShape eos,
SMESH_MesherHelper helper 
)

◆ SetMaxLen()

◆ SetNewLength()

◆ SetNewLength2d()

bool _LayerEdge::SetNewLength2d ( Handle(Geom_Surface)&  surface,
const TopoDS_Face &  F,
_EdgesOnShape eos,
SMESH_MesherHelper helper 
)

◆ SetNormal()

void VISCOUS_3D::_LayerEdge::SetNormal ( const gp_XYZ &  n)

◆ SetSmooLen()

void VISCOUS_3D::_LayerEdge::SetSmooLen ( double  len)

◆ smooFunID()

int _LayerEdge::smooFunID ( _LayerEdge::PSmooFun  fun = 0) const

Returns a name of _SmooFunction.

◆ Smooth() [1/2]

int _LayerEdge::Smooth ( const int  step,
bool  findBest,
vector< _LayerEdge * > &  toSmooth 
)

Perform 'smart' 3D smooth of nodes inflated from FACE.

Return values
int- nb of bad simplices around this _LayerEdge

References dumpMoveComm, VISCOUS_3D::_Curvature::lenDelta(), and SMDS_MeshNode::setXYZ().

◆ Smooth() [2/2]

int _LayerEdge::Smooth ( const int  step,
const bool  isConcaveFace,
bool  findBest 
)

Perform 'smart' 3D smooth of nodes inflated from FACE.

Return values
int- nb of bad simplices around this _LayerEdge

References dumpMoveComm, VISCOUS_3D::_Curvature::lenDelta(), and SMDS_MeshNode::setXYZ().

Referenced by MoveNearConcaVer(), and VISCOUS_3D::_ViscousBuilder::smoothAndCheck().

◆ smoothAngular()

gp_XYZ _LayerEdge::smoothAngular ( )

Computes a new node position using angular-based smoothing.

◆ smoothCentroidal()

gp_XYZ _LayerEdge::smoothCentroidal ( )

Computes a new node position using angular-based smoothing.

◆ smoothLaplacian()

gp_XYZ _LayerEdge::smoothLaplacian ( )

Computes a new node position using Laplacian smoothing.

◆ smoothLengthWeighted()

gp_XYZ _LayerEdge::smoothLengthWeighted ( )

Computes a new node position using weighted node positions.

◆ smoothNefPolygon()

gp_XYZ _LayerEdge::smoothNefPolygon ( )

Computes a new node position located inside a Nef polygon.

References SMESH_MeshAlgos::IsOut(), and SMESH_MesherHelper::WrapIndex().

◆ SmoothOnEdge()

bool _LayerEdge::SmoothOnEdge ( Handle(ShapeAnalysis_Surface)&  surface,
const TopoDS_Face &  F,
SMESH_MesherHelper helper 
)

◆ SmoothPos()

void _LayerEdge::SmoothPos ( const vector< double > &  segLen,
const double  tol 
)

Smooth a path formed by _pos of a _LayerEdge smoothed on FACE.

Referenced by VISCOUS_3D::_ViscousBuilder::refine().

◆ SmoothWoCheck()

void _LayerEdge::SmoothWoCheck ( )

Perform 3D smooth of nodes inflated from FACE.

No check of validity

References dumpMoveComm, and SMDS_MeshNode::setXYZ().

◆ Unset()

◆ UpdatePositionOnSWOL()

bool _LayerEdge::UpdatePositionOnSWOL ( SMDS_MeshNode n,
double  tol,
_EdgesOnShape eos,
SMESH_MesherHelper helper 
)

Field Documentation

◆ _2neibors

◆ _cosin

◆ _curvature

◆ _flags

◆ _funNames

const char * VISCOUS_3D::_LayerEdge::_funNames
static
Initial value:
= { "Laplacian",
"LengthWeighted",
"Centroidal",
"NefPolygon",
"Angular",
"None"}

◆ _funs

_LayerEdge::PSmooFun VISCOUS_3D::_LayerEdge::_funs
static
Initial value:
gp_XYZ smoothLengthWeighted()
Computes a new node position using weighted node positions.
Definition: StdMeshers_ViscousLayers.cxx:9490
gp_XYZ smoothCentroidal()
Computes a new node position using angular-based smoothing.
Definition: StdMeshers_ViscousLayers.cxx:9529
gp_XYZ smoothAngular()
Computes a new node position using angular-based smoothing.
Definition: StdMeshers_ViscousLayers.cxx:9395
gp_XYZ smoothLaplacian()
Computes a new node position using Laplacian smoothing.
Definition: StdMeshers_ViscousLayers.cxx:9379
gp_XYZ smoothNefPolygon()
Computes a new node position located inside a Nef polygon.
Definition: StdMeshers_ViscousLayers.cxx:9555

◆ _len

◆ _lenFactor

◆ _maxLen

◆ _minAngle

double VISCOUS_3D::_LayerEdge::_minAngle

◆ _neibors

◆ _nodes

vector< const SMDS_MeshNode*> VISCOUS_3D::_LayerEdge::_nodes

Referenced by VISCOUS_3D::_TmpMeshFaceOnEdge::_TmpMeshFaceOnEdge(), VISCOUS_3D::_ViscousBuilder::addBoundaryElements(), VISCOUS_3D::_Shrinker1D::AddEdge(), Block(), CheckNeiborsOnBoundary(), VISCOUS_3D::_ConvexFace::CheckPrisms(), Copy(), VISCOUS_3D::_ViscousBuilder::findCollisionEdges(), VISCOUS_3D::_ViscousBuilder::findEdgesToUpdateNormalNearConvexFace(), VISCOUS_3D::_ViscousBuilder::findNeiborsOnEdge(), VISCOUS_3D::_ConvexFace::GetCenterOfCurvature(), VISCOUS_3D::_TmpMeshFaceOnEdge::GetDir(), VISCOUS_3D::_ViscousBuilder::getNormalByOffset(), VISCOUS_3D::_SolidData::GetShapeEdges(), VISCOUS_3D::_ViscousBuilder::getWeigthedNormal(), VISCOUS_3D::_ViscousBuilder::invalidateBadSmooth(), VISCOUS_3D::_ViscousBuilder::isNewNormalOk(), VISCOUS_3D::_Smoother1D::isToSmooth(), VISCOUS_3D::_ViscousBuilder::limitMaxLenByCurvature(), VISCOUS_3D::_ViscousBuilder::limitStepSizeByCurvature(), VISCOUS_3D::_ViscousBuilder::makeGroupOfLE(), VISCOUS_3D::_ViscousBuilder::makeLayer(), VISCOUS_3D::_ViscousBuilder::makeOffsetSurface(), MoveNearConcaVer(), VISCOUS_3D::PeriodicFaces::MoveNodes(), VISCOUS_3D::_LayerEdgeCmp::operator()(), VISCOUS_3D::_Smoother1D::prepare(), VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace(), VISCOUS_3D::_ViscousBuilder::prepareEdgeToShrink(), VISCOUS_3D::_ViscousBuilder::putOnOffsetSurface(), VISCOUS_3D::_ViscousBuilder::refine(), VISCOUS_3D::_ViscousBuilder::restoreNoShrink(), VISCOUS_3D::_ViscousBuilder::setEdgeData(), VISCOUS_3D::_ViscousBuilder::shrink(), VISCOUS_3D::_Smoother1D::smoothAnalyticEdge(), VISCOUS_3D::_ViscousBuilder::smoothAndCheck(), VISCOUS_3D::_2NearEdges::srcNode(), VISCOUS_3D::_Shrinker1D::SrcNode(), VISCOUS_3D::_2NearEdges::tgtNode(), VISCOUS_3D::_Shrinker1D::TgtNode(), VISCOUS_3D::_ViscousBuilder::updateNormals(), and VISCOUS_3D::_ViscousBuilder::updateNormalsOfConvexFaces().

◆ _normal

◆ _pos

◆ _simplices

◆ _smooFunction

PSmooFun VISCOUS_3D::_LayerEdge::_smooFunction

◆ theNbSmooFuns

const int VISCOUS_3D::_LayerEdge::theNbSmooFuns = FUN_NB
static