Version: 9.16.0
SMESH_MesherHelper Class Reference

It helps meshers to add elements and provides other utilities. More...

#include <SMESH_MesherHelper.hxx>

Data Structures

struct  TBiQuad
 

Public Types

enum  MType { LINEAR , QUADRATIC , COMP }
 Check mesh without geometry for: if all elements on this shape are quadratic, quadratic elements will be created. More...
 

Public Member Functions

 SMESH_MesherHelper (SMESH_Mesh &theMesh)
 Constructor. More...
 
SMESH_GenGetGen () const
 Return SMESH_Gen. More...
 
SMESH_MeshGetMesh () const
 
SMESHDS_MeshGetMeshDS () const
 Return mesh DS. More...
 
bool IsQuadraticSubMesh (const TopoDS_Shape &theShape)
 Check submesh for given shape: if all elements on this shape are quadratic, quadratic elements will be created. More...
 
void SetIsQuadratic (const bool theBuildQuadratic)
 Set order of elements to create without calling IsQuadraticSubMesh() More...
 
void SetIsBiQuadratic (const bool theBuildBiQuadratic)
 Set myCreateBiQuadratic flag. More...
 
bool GetIsQuadratic () const
 Return myCreateQuadratic flag. More...
 
bool IsReversedSubMesh (const TopoDS_Face &theFace)
 Find out elements orientation on a geometrical face. More...
 
bool GetIsBiQuadratic () const
 Return myCreateBiQuadratic flag. More...
 
void FixQuadraticElements (SMESH_ComputeErrorPtr &error, bool volumeOnly=true)
 Move medium nodes of faces and volumes to fix distorted elements. More...
 
bool SetElementsOnShape (bool toSet)
 To set created elements on the shape set by IsQuadraticSubMesh() or the next methods. More...
 
void SetSubShape (const int subShapeID)
 Set shape to make elements on without calling IsQuadraticSubMesh() More...
 
void SetSubShape (const TopoDS_Shape &subShape)
 ==SMESHDS_Mesh::ShapeToIndex(shape) More...
 
int GetSubShapeID () const
 Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape() More...
 
const TopoDS_Shape & GetSubShape () const
 Return the shape set by IsQuadraticSubMesh() or SetSubShape() More...
 
void CopySubShapeInfo (const SMESH_MesherHelper &other)
 Copy shape information from another helper to improve performance since SetSubShape() can be time consuming if there are many edges. More...
 
int ShapeToIndex (const TopoDS_Shape &S) const
 Convert a shape to its index in the SMESHDS_Mesh. More...
 
SMDS_MeshNodeAddNode (double x, double y, double z, smIdType ID=0, double u=0., double v=0.)
 Creates a node (!Note ID before u=0.,v0.) More...
 
SMDS_MeshEdgeAddEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const smIdType id=0, const bool force3d=true)
 Creates quadratic or linear edge. More...
 
SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const smIdType id=0, const bool force3d=false)
 Creates quadratic or linear triangle. More...
 
SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const smIdType id=0, const bool force3d=false)
 Creates bi-quadratic, quadratic or linear quadrangle. More...
 
SMDS_MeshFaceAddPolygonalFace (const std::vector< const SMDS_MeshNode * > &nodes, const smIdType id=0, const bool force3d=false)
 Creates polygon, with additional nodes in quadratic mesh. More...
 
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const smIdType id=0, const bool force3d=true)
 Creates quadratic or linear tetrahedron. More...
 
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const smIdType id=0, const bool force3d=true)
 Creates quadratic or linear pyramid. More...
 
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const smIdType id=0, const bool force3d=true)
 Creates quadratic or linear pentahedron. More...
 
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, const smIdType id=0, bool force3d=true)
 Creates bi-quadratic, quadratic or linear hexahedron. More...
 
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const SMDS_MeshNode *n6, const SMDS_MeshNode *n7, const SMDS_MeshNode *n8, const SMDS_MeshNode *n9, const SMDS_MeshNode *n10, const SMDS_MeshNode *n11, const SMDS_MeshNode *n12, const smIdType id=0, bool force3d=true)
 Creates LINEAR!!!!!!!!! octahedron. More...
 
SMDS_MeshVolumeAddPolyhedralVolume (const std::vector< const SMDS_MeshNode * > &nodes, const std::vector< int > &quantities, const smIdType ID=0, const bool force3d=true)
 Creates polyhedron. More...
 
void ToFixNodeParameters (bool toFix)
 Enables fixing node parameters on EDGEs and FACEs by GetNodeU(...,check=true), GetNodeUV(...,check=true), CheckNodeUV() and CheckNodeU() in case if a node lies on a shape set via SetSubShape(). More...
 
double GetNodeU (const TopoDS_Edge &theEdge, const SMDS_MeshNode *theNode, const SMDS_MeshNode *inEdgeNode=0, bool *check=0) const
 Return U of the given node on the edge. More...
 
gp_XY GetNodeUV (const TopoDS_Face &F, const SMDS_MeshNode *n, const SMDS_MeshNode *inFaceNode=0, bool *check=0) const
 Return node UV on face. More...
 
bool CheckNodeUV (const TopoDS_Face &F, const SMDS_MeshNode *n, gp_XY &uv, const double tol, const bool force=false, double distXYZ[4]=0) const
 Check and fix node UV on a face. More...
 
bool CheckNodeU (const TopoDS_Edge &E, const SMDS_MeshNode *n, double &u, const double tol, const bool force=false, double distXYZ[4]=0) const
 Check and fix node U on an edge. More...
 
void AdjustByPeriod (const TopoDS_Face &face, gp_XY uv[], const int nbUV)
 Move node positions on a FACE within surface period. More...
 
bool GetNodeUVneedInFaceNode (const TopoDS_Face &F=TopoDS_Face()) const
 Check if inFaceNode argument is necessary for call GetNodeUV(F,..) More...
 
GeomAPI_ProjectPointOnSurf & GetProjector (const TopoDS_Face &F, TopLoc_Location &loc, double tol=0) const
 Return projector initialized by given face without location. More...
 
GeomAPI_ProjectPointOnSurf & GetProjector (const TopoDS_Face &F, double tol=0) const
 Return projector initialized by given face. More...
 
GeomAPI_ProjectPointOnCurve & GetPCProjector (const TopoDS_Edge &E) const
 Return projector initialized by given EDGE. More...
 
 Handle (ShapeAnalysis_Surface) GetSurface(const TopoDS_Face &F) const
 Return a cached ShapeAnalysis_Surface of a FACE. More...
 
bool IsDegenShape (const int subShape) const
 Check if shape is a degenerated edge or it's vertex. More...
 
bool HasDegeneratedEdges () const
 Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a degenerated edges. More...
 
size_t NbDegeneratedEdges () const
 Return a number of degenerated edges in the shape set through IsQuadraticSubMesh() or SetSubShape() More...
 
bool IsSeamShape (const int subShape) const
 Check if shape is a seam edge or it's vertex. More...
 
bool IsSeamShape (const TopoDS_Shape &subShape) const
 Check if shape is a seam edge or it's vertex. More...
 
bool IsRealSeam (const int subShape) const
 Return true if an edge or a vertex encounters twice in face wire. More...
 
bool IsRealSeam (const TopoDS_Shape &subShape) const
 Return true if an edge or a vertex encounters twice in face wire. More...
 
bool HasSeam () const
 Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge, i.e. More...
 
bool HasRealSeam () const
 Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge that encounters twice in a wire. More...
 
size_t NbRealSeam () const
 Return a number of real seam edges in the shape set through IsQuadraticSubMesh() or SetSubShape(). More...
 
int GetPeriodicIndex () const
 Return index of periodic parametric direction of a closed face. More...
 
double GetPeriod (int perioIndex) const
 Return period in given direction [1,2]. More...
 
double GetOtherParam (const double param) const
 Return an alternative parameter for a node on seam. More...
 
int IsOnSeam (const gp_XY &uv) const
 Check if UV is on seam. More...
 
const SMDS_MeshNodeGetMediumNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const bool force3d, TopAbs_ShapeEnum expectedSupport=TopAbs_SHAPE)
 Return existing or create new medium nodes between given ones. More...
 
const SMDS_MeshNodeGetCentralNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n34, const SMDS_MeshNode *n41, bool force3d)
 Return existing or create a new central node for a quardilateral quadratic face given its 8 nodes. More...
 
const SMDS_MeshNodeGetCentralNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n12, const SMDS_MeshNode *n23, const SMDS_MeshNode *n31, bool force3d)
 Return existing or create a new central node for a quadratic triangle given its 6 nodes. More...
 
std::pair< int, TopAbs_ShapeEnum > GetMediumPos (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const bool useCurSubShape=false, TopAbs_ShapeEnum expectedSupport=TopAbs_SHAPE)
 Return index and type of the shape (EDGE or FACE only) to set a medium node on. More...
 
void AddTLinkNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n12)
 Add a link in my data structure. More...
 
void AddTLinkNodeMap (const TLinkNodeMap &aMap)
 Add many links in my data structure. More...
 
bool AddTLinks (const SMDS_MeshEdge *edge)
 Add quadratic links of edge to own data structure. More...
 
bool AddTLinks (const SMDS_MeshFace *face)
 Add quadratic links of face to own data structure. More...
 
bool AddTLinks (const SMDS_MeshVolume *vol)
 Add quadratic links of volume to own data structure. More...
 
const TLinkNodeMapGetTLinkNodeMap () const
 Returns myTLinkNodeMap. More...
 
MType IsQuadraticMesh ()
 
virtual ~SMESH_MesherHelper ()
 

Static Public Member Functions

static bool IsSameElemGeometry (const SMESHDS_SubMesh *smDS, SMDSAbs_GeometryType shape, const bool nullSubMeshRes=true)
 Returns true if all elements of a sub-mesh are of same shape. More...
 
static bool LoadNodeColumns (TParam2ColumnMap &theParam2ColumnMap, const TopoDS_Face &theFace, const std::list< TopoDS_Edge > &theBaseSide, SMESHDS_Mesh *theMesh, SMESH_ProxyMesh *theProxyMesh=0)
 Load nodes bound to face into a map of node columns. More...
 
static bool LoadNodeColumns (TParam2ColumnMap &theParam2ColumnMap, const TopoDS_Face &theFace, const TopoDS_Edge &theBaseEdge, SMESHDS_Mesh *theMesh, SMESH_ProxyMesh *theProxyMesh=0)
 Variant of LoadNodeColumns() above with theBaseSide given by one edge. More...
 
static bool IsStructured (SMESH_subMesh *faceSM)
 Return true if 2D mesh on FACE is structured. More...
 
static bool IsCornerOfStructure (const SMDS_MeshNode *n, const SMESHDS_SubMesh *faceSM, SMESH_MesherHelper &faceAnalyser)
 Return true if a node is at a corner of a 2D structured mesh of FACE. More...
 
static bool IsDistorted2D (SMESH_subMesh *faceSM, bool checkUV=false, SMESH_MesherHelper *faceHelper=NULL)
 Return true if 2D mesh on FACE is distored. More...
 
static bool IsMedium (const SMDS_MeshNode *node, const SMDSAbs_ElementType typeToCheck=SMDSAbs_All)
 Returns true if given node is medium. More...
 
static TopoDS_Shape GetSubShapeByNode (const SMDS_MeshNode *node, const SMESHDS_Mesh *meshDS)
 Return support shape of a node. More...
 
static int WrapIndex (int ind, const int nbNodes)
 Return a valid node index, fixing the given one if necessary. More...
 
static gp_XY calcTFI (double x, double y, const gp_XY &a0, const gp_XY &a1, const gp_XY &a2, const gp_XY &a3, const gp_XY &p0, const gp_XY &p1, const gp_XY &p2, const gp_XY &p3)
 Return UV of a point inside a quadrilateral FACE by it's normalized parameters within a unit quadrangle and the corresponding projections on sub-shapes of the real-world FACE. More...
 
static gp_XYZ calcTFI (double x, double y, const gp_XYZ &a0, const gp_XYZ &a1, const gp_XYZ &a2, const gp_XYZ &a3, const gp_XYZ &p0, const gp_XYZ &p1, const gp_XYZ &p2, const gp_XYZ &p3)
 Same as "gp_XY calcTFI(...)" but in 3D. More...
 
static int Count (const TopoDS_Shape &shape, const TopAbs_ShapeEnum type, const bool ignoreSame)
 Count nb of sub-shapes. More...
 
static int NbAncestors (const TopoDS_Shape &shape, const SMESH_Mesh &mesh, TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE)
 Return number of unique ancestors of the shape. More...
 
static PShapeIteratorPtr GetAncestors (const TopoDS_Shape &shape, const SMESH_Mesh &mesh, TopAbs_ShapeEnum ancestorType, const TopoDS_Shape *container=0)
 Return iterator on ancestors of the given type, included into a container shape. More...
 
static TopoDS_Shape GetCommonAncestor (const TopoDS_Shape &shape1, const TopoDS_Shape &shape2, const SMESH_Mesh &mesh, TopAbs_ShapeEnum ancestorType)
 Find a common ancestor, of the given type, of two shapes. More...
 
static TopAbs_Orientation GetSubShapeOri (const TopoDS_Shape &shape, const TopoDS_Shape &subShape)
 Return orientation of sub-shape in the main shape. More...
 
static bool IsSubShape (const TopoDS_Shape &shape, const TopoDS_Shape &mainShape)
 
static bool IsSubShape (const TopoDS_Shape &shape, SMESH_Mesh *aMesh)
 
static bool IsBlock (const TopoDS_Shape &shape)
 
static double MaxTolerance (const TopoDS_Shape &shape)
 Return maximal tolerance of shape. More...
 
static double GetAngle (const TopoDS_Edge &E1, const TopoDS_Edge &E2, const TopoDS_Face &F, const TopoDS_Vertex &V, gp_Vec *faceNormal=0)
 Return an angle between two EDGEs sharing a common VERTEX with reference of the FACE normal. More...
 
static bool IsClosedEdge (const TopoDS_Edge &anEdge)
 Check if the first and last vertices of an edge are the same. More...
 
static TopoDS_Vertex IthVertex (const bool is2nd, TopoDS_Edge anEdge, const bool CumOri=true)
 Wrapper over TopExp::FirstVertex() and TopExp::LastVertex() fixing them in the case of INTERNAL edge. More...
 
static TopAbs_ShapeEnum GetGroupType (const TopoDS_Shape &group, const bool avoidCompound=false)
 Return type of shape contained in a group. More...
 
static TopoDS_Shape GetShapeOfHypothesis (const SMESHDS_Hypothesis *hyp, const TopoDS_Shape &shape, SMESH_Mesh *mesh)
 Returns a shape, to which a hypothesis used to mesh a given shape is assigned. More...
 
static gp_XY GetMiddleUV (const Handle(Geom_Surface)&surface, const gp_XY &uv1, const gp_XY &uv2)
 Return middle UV taking in account surface period. More...
 
static gp_XY GetCenterUV (const gp_XY &uv1, const gp_XY &uv2, const gp_XY &uv3, const gp_XY &uv12, const gp_XY &uv23, const gp_XY &uv31, bool *isBadTria=0)
 Return UV for the central node of a biquadratic triangle. More...
 
static gp_XY ApplyIn2D (Handle(Geom_Surface) surface, const gp_XY &uv1, const gp_XY &uv2, xyFunPtr fun, const bool resultInPeriod=true)
 Perform given operation on two 2d points in parameric space of given surface. More...
 
static void WriteShape (const TopoDS_Shape &s)
 DEBUG. More...
 

Protected Member Functions

gp_Pnt2d getUVOnSeam (const gp_Pnt2d &uv1, const gp_Pnt2d &uv2) const
 Select UV on either of 2 pcurves of a seam edge, closest to the given UV. More...
 
const SMDS_MeshNodegetMediumNodeOnComposedWire (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, bool force3d)
 Makes a medium node if nodes reside different edges. More...
 
double getFaceMaxTol (const TopoDS_Shape &face) const
 Return MaxTolerance( face ), probably cached. More...
 

Private Types

typedef std::map< int, Handle(ShapeAnalysis_Surface)> TID2Surface
 
typedef std::map< int, GeomAPI_ProjectPointOnSurf * > TID2ProjectorOnSurf
 
typedef std::map< int, GeomAPI_ProjectPointOnCurve * > TID2ProjectorOnCurve
 

Private Member Functions

 SMESH_MesherHelper (const SMESH_MesherHelper &theOther)
 
bool toCheckPosOnShape (int shapeID) const
 Return true if position of nodes on the shape hasn't yet been checked or the positions proved to be invalid. More...
 
void setPosOnShapeValidity (int shapeID, bool ok) const
 Set validity of positions of nodes on the shape. More...
 

Private Attributes

TLinkNodeMap myTLinkNodeMap
 
std::map< TBiQuad, const SMDS_MeshNode * > myMapWithCentralNode
 
std::set< int > myDegenShapeIds
 
std::set< int > mySeamShapeIds
 
double myPar1 [2]
 
double myPar2 [2]
 
int myParIndex
 
std::map< int, double > myFaceMaxTol
 
TID2Surface myFace2Surface
 
TID2ProjectorOnSurf myFace2Projector
 
TID2ProjectorOnCurve myEdge2Projector
 
TopoDS_Shape myShape
 
SMESH_MeshmyMesh
 
int myShapeID
 
bool myCreateQuadratic
 
bool myCreateBiQuadratic
 
bool mySetElemOnShape
 
bool myFixNodeParameters
 
std::map< int, boolmyNodePosShapesValidity
 

Detailed Description

It helps meshers to add elements and provides other utilities.

  • It allows meshers not to care about creation of medium nodes when filling a quadratic mesh. Helper does it itself. It defines order of elements to create when IsQuadraticSubMesh() is called.
  • It provides information on a shape it is initialized with: periodicity, presence of singularities etc.
  • ...

Member Typedef Documentation

◆ TID2ProjectorOnCurve

typedef std::map< int, GeomAPI_ProjectPointOnCurve* > SMESH_MesherHelper::TID2ProjectorOnCurve
private

◆ TID2ProjectorOnSurf

typedef std::map< int, GeomAPI_ProjectPointOnSurf* > SMESH_MesherHelper::TID2ProjectorOnSurf
private

◆ TID2Surface

typedef std::map< int, Handle(ShapeAnalysis_Surface)> SMESH_MesherHelper::TID2Surface
private

Member Enumeration Documentation

◆ MType

Check mesh without geometry for: if all elements on this shape are quadratic, quadratic elements will be created.

Used then generated 3D mesh without geometry.

Enumerator
LINEAR 
QUADRATIC 
COMP 

Constructor & Destructor Documentation

◆ SMESH_MesherHelper() [1/2]

SMESH_MesherHelper::SMESH_MesherHelper ( SMESH_Mesh theMesh)

◆ ~SMESH_MesherHelper()

SMESH_MesherHelper::~SMESH_MesherHelper ( )
virtual

◆ SMESH_MesherHelper() [2/2]

SMESH_MesherHelper::SMESH_MesherHelper ( const SMESH_MesherHelper theOther)
private

Member Function Documentation

◆ AddEdge()

◆ AddFace() [1/2]

SMDS_MeshFace * SMESH_MesherHelper::AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const smIdType  id = 0,
const bool  force3d = false 
)

◆ AddFace() [2/2]

◆ AddNode()

◆ AddPolygonalFace()

◆ AddPolyhedralVolume()

SMDS_MeshVolume * SMESH_MesherHelper::AddPolyhedralVolume ( const std::vector< const SMDS_MeshNode * > &  nodes,
const std::vector< int > &  quantities,
const smIdType  ID = 0,
const bool  force3d = true 
)

◆ AddTLinkNode()

void SMESH_MesherHelper::AddTLinkNode ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n12 
)

Add a link in my data structure.

References myTLinkNodeMap.

Referenced by AddTLinks(), IsQuadraticSubMesh(), and SMESH_MeshEditor::QuadToTri().

◆ AddTLinkNodeMap()

void SMESH_MesherHelper::AddTLinkNodeMap ( const TLinkNodeMap aMap)

Add many links in my data structure.

◆ AddTLinks() [1/3]

◆ AddTLinks() [2/3]

bool SMESH_MesherHelper::AddTLinks ( const SMDS_MeshFace face)

Add quadratic links of face to own data structure.

References AddTLinkNode(), SMDS_MeshCell::GetNode(), SMDS_MeshCell::IsPoly(), and SMDS_MeshCell::NbNodes().

◆ AddTLinks() [3/3]

◆ AddVolume() [1/5]

SMDS_MeshVolume * SMESH_MesherHelper::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const SMDS_MeshNode n7,
const SMDS_MeshNode n8,
const SMDS_MeshNode n9,
const SMDS_MeshNode n10,
const SMDS_MeshNode n11,
const SMDS_MeshNode n12,
const smIdType  id = 0,
bool  force3d = true 
)

◆ AddVolume() [2/5]

◆ AddVolume() [3/5]

SMDS_MeshVolume * SMESH_MesherHelper::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const SMDS_MeshNode n6,
const smIdType  id = 0,
const bool  force3d = true 
)

◆ AddVolume() [4/5]

SMDS_MeshVolume * SMESH_MesherHelper::AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n5,
const smIdType  id = 0,
const bool  force3d = true 
)

◆ AddVolume() [5/5]

◆ AdjustByPeriod()

void SMESH_MesherHelper::AdjustByPeriod ( const TopoDS_Face &  face,
gp_XY  uv[],
const int  nbUV 
)

Move node positions on a FACE within surface period.

Parameters
[in]face- the FACE
[in,out]uv- node positions to adjust
[in]nbUV- nb of uv

References GetPeriodicIndex(), myMesh, myPar1, myPar2, myShape, and SetSubShape().

Referenced by FixQuadraticElements(), and GetCentralNode().

◆ ApplyIn2D()

static gp_XY SMESH_MesherHelper::ApplyIn2D ( Handle(Geom_Surface)  surface,
const gp_XY &  uv1,
const gp_XY &  uv2,
xyFunPtr  fun,
const bool  resultInPeriod = true 
)
static

Perform given operation on two 2d points in parameric space of given surface.

It takes into account period of the surface. Use gp_XY_FunPtr macro to easily define pointer to function of gp_XY class.

Referenced by FixQuadraticElements(), and GetMiddleUV().

◆ calcTFI() [1/2]

gp_XY SMESH_MesherHelper::calcTFI ( double  x,
double  y,
const gp_XY &  a0,
const gp_XY &  a1,
const gp_XY &  a2,
const gp_XY &  a3,
const gp_XY &  p0,
const gp_XY &  p1,
const gp_XY &  p2,
const gp_XY &  p3 
)
static

Return UV of a point inside a quadrilateral FACE by it's normalized parameters within a unit quadrangle and the corresponding projections on sub-shapes of the real-world FACE.

The used calculation method is called Trans-Finite Interpolation (TFI).

Parameters
x,y- normalized parameters that should be in range [0,1]
a0,a1,a2,a3- UV of VERTEXes of the FACE == projections on VERTEXes
p0,p1,p2,p3- UV of the point projections on EDGEs of the FACE
Returns
gp_XY - UV of the point on the FACE

Y ^ Order of those UV in the FACE is as follows. | a3 p2 a2 o—x--—o | : | | :UV | p3 x...O.....x p1 | : | o—x--—o -—> X a0 p0 a1

Referenced by VISCOUS_3D::_Mapper2D::ComputeNodePositions(), SMESH_2D_Algo::FixInternalNodes(), FixQuadraticElements(), GetCentralNode(), SMESH_MeshEditor::QuadTo4Tri(), StdMeshers_Quadrangle_2D::smooth(), and VISCOUS_3D::_SmoothNode::Smooth().

◆ calcTFI() [2/2]

gp_XYZ SMESH_MesherHelper::calcTFI ( double  x,
double  y,
const gp_XYZ &  a0,
const gp_XYZ &  a1,
const gp_XYZ &  a2,
const gp_XYZ &  a3,
const gp_XYZ &  p0,
const gp_XYZ &  p1,
const gp_XYZ &  p2,
const gp_XYZ &  p3 
)
static

Same as "gp_XY calcTFI(...)" but in 3D.

◆ CheckNodeU()

bool SMESH_MesherHelper::CheckNodeU ( const TopoDS_Edge &  E,
const SMDS_MeshNode n,
double &  u,
const double  tol,
const bool  force = false,
double  distXYZ[4] = 0 
) const

Check and fix node U on an edge.

Parameters
force- check even if checks of other nodes on this edge passed OK
distXYZ- returns result distance and point coordinates
Return values
bool- false if U is bad and could not be fixed

References SMDS_MeshElement::GetID(), SMDS_MeshElement::getshapeId(), Handle(), MESSAGE, myFixNodeParameters, myShape, myShapeID, setPosOnShapeValidity(), and toCheckPosOnShape().

Referenced by StdMeshers_Import_1D2D::Compute(), StdMeshers_Projection_1D2D::Compute(), StdMeshers_Import_1D::Evaluate(), StdMeshers_Import_1D2D::Evaluate(), GetMediumNode(), getMediumNodeOnComposedWire(), GetNodeU(), SMESH_Pattern::MakeMesh(), SMESH_MeshEditor::SplitEdge(), and VISCOUS_3D::_LayerEdge::UpdatePositionOnSWOL().

◆ CheckNodeUV()

bool SMESH_MesherHelper::CheckNodeUV ( const TopoDS_Face &  F,
const SMDS_MeshNode n,
gp_XY &  uv,
const double  tol,
const bool  force = false,
double  distXYZ[4] = 0 
) const

◆ CopySubShapeInfo()

void SMESH_MesherHelper::CopySubShapeInfo ( const SMESH_MesherHelper other)

Copy shape information from another helper to improve performance since SetSubShape() can be time consuming if there are many edges.

Copy shape information from another helper.

Used to improve performance since SetSubShape() can be time consuming if there are many edges

References myDegenShapeIds, myFace2Surface, myPar1, myPar2, myParIndex, mySeamShapeIds, myShape, and myShapeID.

Referenced by StdMeshers_Quadrangle_2D::getCorners(), StdMeshers_FaceSide::GetFaceWires(), IsDistorted2D(), and StdMeshers_FaceSide::StdMeshers_FaceSide().

◆ Count()

◆ FixQuadraticElements()

void SMESH_MesherHelper::FixQuadraticElements ( SMESH_ComputeErrorPtr compError,
bool  volumeOnly = true 
)

Move medium nodes of faces and volumes to fix distorted elements.

Parameters
error- container of fixed distorted elements
volumeOnly- fix nodes on geom faces or not if the shape is solid
error- container of fixed distorted elements
volumeOnly- to fix nodes on faces or not, if the shape is solid

Issue 0020307: EDF 992 SMESH : Linea/Quadratic with Medium Node on Geometry

References AdjustByPeriod(), ApplyIn2D(), begin(), SMDS_MeshElement::begin_nodes(), calcTFI(), CheckNodeUV(), EDITERR_NO_MEDIUM_ON_GEOM, SMDS_MeshElement::end_nodes(), Face, SMDS_Mesh::FindFace(), FixQuadraticElements(), GetCenterUV(), SMDS_MeshElement::GetEntityType(), SMDS_VolumeTool::GetFaceNodes(), GetMeshDS(), GetMiddleUV(), SMDS_MeshElement::GetNode(), SMDS_VolumeTool::GetNodes(), GetNodeUV(), SMDS_MeshElement::getshapeId(), SMESH_Mesh::GetShapeToMesh(), SMESH_Mesh::GetSubMesh(), SMESH_Mesh::GetSubMeshContaining(), SMESH_subMesh::GetSubMeshDS(), GetSubShape(), GetSubShapeByNode(), Handle(), SMESH_Mesh::HasShapeToMesh(), SMESH_Block::ID_E00z, SMESH_Block::ID_E01z, SMESH_Block::ID_E0y0, SMESH_Block::ID_E0y1, SMESH_Block::ID_E10z, SMESH_Block::ID_E11z, SMESH_Block::ID_E1y0, SMESH_Block::ID_E1y1, SMESH_Block::ID_Ex00, SMESH_Block::ID_Ex01, SMESH_Block::ID_Ex10, SMESH_Block::ID_Ex11, SMESH_Block::ID_F0yz, SMESH_Block::ID_F1yz, SMESH_Block::ID_Fx0z, SMESH_Block::ID_Fx1z, SMESH_Block::ID_Fxy0, SMESH_Block::ID_Fxy1, SMESH_Block::ID_Shell, SMESH_Block::ID_V000, SMESH_Block::ID_V001, SMESH_Block::ID_V010, SMESH_Block::ID_V011, SMESH_Block::ID_V100, SMESH_Block::ID_V101, SMESH_Block::ID_V110, SMESH_Block::ID_V111, SMESHDS_Mesh::IndexToShape(), SMESH_subMesh::IsEmpty(), SMDS_MeshElement::IsQuadratic(), MESSAGE, SMDS_VolumeTool::MinLinearSize2(), SMESHDS_Mesh::MoveNode(), MSG, MSGBEG, myMesh, myShape, myShapeID, SMESH_Mesh::NbBiQuadPrisms(), SMESH_Mesh::NbBiQuadQuadrangles(), SMESH_Mesh::NbBiQuadTriangles(), SMDS_MeshElement::NbCornerNodes(), SMDS_VolumeTool::NbFaceNodes(), SMDS_VolumeTool::NbFaces(), SMDS_MeshElement::NbNodes(), SMESH_Mesh::NbTriQuadraticHexas(), OCC_CATCH_SIGNALS, SMDS_VolumeTool::Set(), SetSubShape(), ShapeToIndex(), SMESH_Block::ShellPoint(), SMDS_TOP_3DSPACE, SMDS_TOP_EDGE, SMDS_TOP_FACE, SMDSAbs_All, SMDSAbs_Face, SMDSAbs_Volume, SMDSEntity_BiQuad_Penta, SMDSEntity_BiQuad_Quadrangle, SMDSEntity_BiQuad_Triangle, SMDSEntity_TriQuad_Hexa, ToFixNodeParameters(), and SMDS_MeshNode::X().

Referenced by SMESH_MeshEditor::ConvertToQuadratic(), and FixQuadraticElements().

◆ GetAncestors()

PShapeIteratorPtr SMESH_MesherHelper::GetAncestors ( const TopoDS_Shape &  shape,
const SMESH_Mesh mesh,
TopAbs_ShapeEnum  ancestorType,
const TopoDS_Shape *  container = 0 
)
static

◆ GetAngle()

double SMESH_MesherHelper::GetAngle ( const TopoDS_Edge &  theE1,
const TopoDS_Edge &  theE2,
const TopoDS_Face &  theFace,
const TopoDS_Vertex &  theCommonV,
gp_Vec *  theFaceNormal = 0 
)
static

Return an angle between two EDGEs sharing a common VERTEX with reference of the FACE normal.

Returns
double - the angle (between -Pi and Pi), negative if the angle is concave, 1e100 in case of failure
Warning
Care about order of the EDGEs and their orientation to be as they are within the FACE! Don't pass degenerated EDGEs neither!

References CheckAlmostZero(), Handle(), and MESSAGE.

Referenced by StdMeshers_Quadrangle_2D::check(), VISCOUS_3D::getConcaveVertices(), VISCOUS_3D::getFaceDir(), StdMeshers::Cartesian3D::Grid::InitGeometry(), and StdMeshers_Prism_3D::isSimpleBottom().

◆ GetCenterUV()

gp_XY SMESH_MesherHelper::GetCenterUV ( const gp_XY &  uv1,
const gp_XY &  uv2,
const gp_XY &  uv3,
const gp_XY &  uv12,
const gp_XY &  uv23,
const gp_XY &  uv31,
bool isBadTria = 0 
)
static

Return UV for the central node of a biquadratic triangle.

Referenced by FixQuadraticElements(), and GetCentralNode().

◆ GetCentralNode() [1/2]

const SMDS_MeshNode * SMESH_MesherHelper::GetCentralNode ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n31,
bool  force3d 
)

Return existing or create a new central node for a quadratic triangle given its 6 nodes.

Parameters
force3d- true means node creation in between the given nodes, else node position is found on a geometrical face if any.

References SMESHDS_Mesh::AddNode(), AdjustByPeriod(), Face, GetAncestors(), GetCenterUV(), GetMesh(), GetMeshDS(), GetNodeUV(), SMDS_MeshElement::getshapeId(), GetSubShapeByNode(), Handle(), SMESHDS_Mesh::IndexToShape(), myMapWithCentralNode, mySetElemOnShape, myShapeID, SMESHDS_Mesh::SetMeshElementOnShape(), SMESHDS_Mesh::SetNodeInVolume(), SMESHDS_Mesh::SetNodeOnFace(), SMESHDS_Mesh::ShapeToIndex(), and SMDS_MeshNode::X().

◆ GetCentralNode() [2/2]

const SMDS_MeshNode * SMESH_MesherHelper::GetCentralNode ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const SMDS_MeshNode n12,
const SMDS_MeshNode n23,
const SMDS_MeshNode n34,
const SMDS_MeshNode n41,
bool  force3d 
)

Return existing or create a new central node for a quardilateral quadratic face given its 8 nodes.

Parameters
force3d- true means node creation in between the given nodes, else node position is found on a geometrical face if any.

References SMESHDS_Mesh::AddNode(), AdjustByPeriod(), calcTFI(), Face, GetAncestors(), GetMesh(), GetMeshDS(), GetNodeUV(), SMDS_MeshElement::getshapeId(), GetSubShapeByNode(), Handle(), HasDegeneratedEdges(), SMESHDS_Mesh::IndexToShape(), myMapWithCentralNode, mySetElemOnShape, myShapeID, SMESHDS_Mesh::SetMeshElementOnShape(), SMESHDS_Mesh::SetNodeInVolume(), SMESHDS_Mesh::SetNodeOnFace(), SMESHDS_Mesh::ShapeToIndex(), and SMDS_MeshNode::X().

Referenced by AddFace(), AddVolume(), and SMESH_MeshEditor::QuadToTri().

◆ GetCommonAncestor()

TopoDS_Shape SMESH_MesherHelper::GetCommonAncestor ( const TopoDS_Shape &  shape1,
const TopoDS_Shape &  shape2,
const SMESH_Mesh mesh,
TopAbs_ShapeEnum  ancestorType 
)
static

◆ getFaceMaxTol()

double SMESH_MesherHelper::getFaceMaxTol ( const TopoDS_Shape &  face) const
protected

Return MaxTolerance( face ), probably cached.

References GetMeshDS(), SMESH::if(), MaxTolerance(), myFaceMaxTol, and SMESHDS_Mesh::ShapeToIndex().

Referenced by GetMediumNode(), and GetNodeUV().

◆ GetGen()

SMESH_Gen * SMESH_MesherHelper::GetGen ( ) const

Return SMESH_Gen.

References SMESH_Mesh::GetGen(), and GetMesh().

◆ GetGroupType()

TopAbs_ShapeEnum SMESH_MesherHelper::GetGroupType ( const TopoDS_Shape &  group,
const bool  avoidCompound = false 
)
static

Return type of shape contained in a group.

Parameters
group- a shape of type TopAbs_COMPOUND
avoidCompound- not to return TopAbs_COMPOUND

References GetGroupType().

Referenced by SMESH_Gen::GetAlgo(), GetGroupType(), getSubMeshes(), and SMESH_HypoFilter::IsMoreLocalThanPredicate::IsOk().

◆ GetIsBiQuadratic()

bool SMESH_MesherHelper::GetIsBiQuadratic ( ) const

Return myCreateBiQuadratic flag.

Referenced by SMESH_MeshEditor::convertElemToQuadratic().

◆ GetIsQuadratic()

◆ GetMediumNode()

const SMDS_MeshNode * SMESH_MesherHelper::GetMediumNode ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const bool  force3d,
TopAbs_ShapeEnum  expectedSupport = TopAbs_SHAPE 
)

Return existing or create new medium nodes between given ones.

Parameters
force3d- true means node creation at the middle between the two given nodes, else node position is found on its supporting geometrical shape, if any.
expectedSupport- shape type corresponding to element being created , e.g TopAbs_EDGE if SMDSAbs_Edge is created basing on n1 and n2

References SMESHDS_Mesh::AddNode(), CheckNodeU(), CheckNodeUV(), Edge, Face, getFaceMaxTol(), getMediumNodeOnComposedWire(), GetMediumPos(), GetMeshDS(), GetMiddleUV(), GetNodeU(), GetNodeUV(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), Handle(), HasDegeneratedEdges(), SMESHDS_Mesh::IndexToShape(), IsDegenShape(), IsSeamShape(), myParIndex, mySetElemOnShape, myShape, myShapeID, myTLinkNodeMap, SMESHDS_Mesh::SetMeshElementOnShape(), SMESHDS_Mesh::SetNodeOnEdge(), SMESHDS_Mesh::SetNodeOnFace(), SMDS_TOP_EDGE, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

Referenced by AddEdge(), AddFace(), AddPolygonalFace(), AddPolyhedralVolume(), AddVolume(), and SMESH_MeshEditor::SplitEdge().

◆ getMediumNodeOnComposedWire()

const SMDS_MeshNode * SMESH_MesherHelper::getMediumNodeOnComposedWire ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
bool  force3d 
)
protected

◆ GetMediumPos()

std::pair< int, TopAbs_ShapeEnum > SMESH_MesherHelper::GetMediumPos ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const bool  useCurSubShape = false,
TopAbs_ShapeEnum  expectedSupport = TopAbs_SHAPE 
)

◆ GetMesh()

SMESH_Mesh * SMESH_MesherHelper::GetMesh ( ) const

Referenced by StdMeshers::Cartesian3D::Hexahedron::addFaces(), StdMeshers::Cartesian3D::Hexahedron::addPolyhedronToMesh(), StdMeshers::Cartesian3D::Hexahedron::addSegments(), StdMeshers_Prism_3D::assocOrProjBottom2Top(), StdMeshers_Quadrangle_2D::check(), StdMeshers_Prism_3D::compute(), StdMeshers_Prism_3D::Compute(), StdMeshers_Prism_3D::computeBase(), StdMeshers_QuadFromMedialAxis_1D2D::Algo1D::ComputeDistribution(), StdMeshers_RadialPrism_3D::computeLayerPositions(), StdMeshers_RadialQuadrangle_1D2D::computeLayerPositions(), StdMeshers_QuadFromMedialAxis_1D2D::computeQuads(), StdMeshers_Prism_3D::computeWalls(), VISCOUS_3D::_ViscousBuilder::fixBadFaces(), StdMeshers::Cartesian3D::Hexahedron::getBoundaryElems(), GetCentralNode(), VISCOUS_3D::getConcaveVertices(), StdMeshers_PrismAsBlock::TSideFace::GetEdge(), StdMeshers::Cartesian3D::Grid::GetEdgesToImplement(), StdMeshers_Quadrangle_2D::getEnforcedUV(), GetGen(), StdMeshers_PrismAsBlock::TSideFace::GetMesh(), GetMeshDS(), StdMeshers_Prism_3D::getWallFaces(), StdMeshers::Cartesian3D::Hexahedron::hasStrangeEdge(), StdMeshers::Cartesian3D::Hexahedron::init(), StdMeshers_PrismAsBlock::Init(), StdMeshers::Cartesian3D::Grid::InitGeometry(), StdMeshers_Prism_3D::initPrism(), StdMeshers::Cartesian3D::Hexahedron::MakeElements(), StdMeshers_Prism_3D::makeQuadsForOutInProjection(), StdMeshers_Sweeper::prepareTopBotDelaunay(), StdMeshers_Prism_3D::project2dMesh(), StdMeshers_Prism_3D::projectBottomToTop(), VISCOUS_2D::_ViscousBuilder2D::refine(), VISCOUS_3D::_ViscousBuilder::refine(), VISCOUS_3D::_CentralCurveOnEdge::SetShapes(), StdMeshers::Cartesian3D::Grid::SetSolidFather(), StdMeshers_Prism_3D::toSM(), StdMeshers::Cartesian3D::Grid::UpdateFacesOfVertex(), and StdMeshers_PrismAsBlock::TSideFace::Value().

◆ GetMeshDS()

SMESHDS_Mesh * SMESH_MesherHelper::GetMeshDS ( ) const

Return mesh DS.

References GetMesh(), and SMESH_Mesh::GetMeshDS().

Referenced by VISCOUS_3D::_Shrinker1D::AddEdge(), AddEdge(), StdMeshers_Quadrangle_2D::addEnforcedNodes(), AddFace(), StdMeshers::Cartesian3D::Hexahedron::addFaces(), AddNode(), AddPolygonalFace(), AddPolyhedralVolume(), StdMeshers::Cartesian3D::Hexahedron::addPolyhedronToMesh(), StdMeshers::Cartesian3D::Hexahedron::addSegments(), AddVolume(), StdMeshers::Cartesian3D::Hexahedron::addVolumes(), StdMeshers_Quadrangle_2D::check(), VISCOUS_3D::_Shrinker1D::Compute(), StdMeshers_Prism_3D::compute(), StdMeshers::Cartesian3D::Grid::ComputeNodes(), StdMeshers_Prism_3D::computeWalls(), StdMeshers::Cartesian3D::Hexahedron::cutByExtendedInternal(), StdMeshers_Import_1D::Evaluate(), StdMeshers_Import_1D2D::Evaluate(), VISCOUS_3D::_ViscousBuilder::fixBadFaces(), FixQuadraticElements(), StdMeshers::Cartesian3D::Hexahedron::getBoundaryElems(), GetCentralNode(), VISCOUS_3D::getConcaveVertices(), StdMeshers_Quadrangle_2D::getCorners(), StdMeshers_Quadrangle_2D::getEnforcedUV(), getFaceMaxTol(), VISCOUS_3D::_ViscousBuilder::getFaceNormal(), GetMediumNode(), getMediumNodeOnComposedWire(), GetMediumPos(), GetNodeU(), GetNodeUV(), GetPCProjector(), GetProjector(), StdMeshers_Prism_3D::getSweepTolerance(), Handle(), StdMeshers_PrismAsBlock::Init(), StdMeshers::Cartesian3D::Grid::InitClassifier(), StdMeshers_PrismAsBlock::TSideFace::InsertSubShapes(), IsDistorted2D(), IsQuadraticSubMesh(), IsReversedSubMesh(), StdMeshers::Cartesian3D::Hexahedron::MakeElements(), StdMeshers_RadialPrism_3D::makeNodeColumn(), VISCOUS_3D::PeriodicFaces::MoveNodes(), StdMeshers_ProjectionUtils::Morph::Perform(), VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace(), StdMeshers_Sweeper::prepareTopBotDelaunay(), StdMeshers_Prism_3D::project2dMesh(), StdMeshers_Prism_3D::projectBottomToTop(), StdMeshers::Cartesian3D::Grid::SetOnShape(), StdMeshers::Cartesian3D::Grid::SetSolidFather(), SetSubShape(), StdMeshers::Cartesian3D::Grid::Shape(), StdMeshers_Prism_3D::shapeID(), StdMeshers::Cartesian3D::Grid::ShapeID(), ShapeToIndex(), VISCOUS_3D::_ViscousBuilder::shrink(), StdMeshers_Quadrangle_2D::smooth(), StdMeshers_PrismAsBlock::TPCurveOnHorFaceAdaptor::TPCurveOnHorFaceAdaptor(), StdMeshers_PrismAsBlock::TSideFace::TSideFace(), VISCOUS_3D::_ViscousBuilder::updateNormalsOfConvexFaces(), and StdMeshers_PrismAsBlock::TSideFace::Value().

◆ GetMiddleUV()

gp_XY SMESH_MesherHelper::GetMiddleUV ( const Handle(Geom_Surface)&  surface,
const gp_XY &  uv1,
const gp_XY &  uv2 
)
static

Return middle UV taking in account surface period.

References ApplyIn2D().

Referenced by FixQuadraticElements(), GetMediumNode(), SMESH_MeshEditor::QuadTo4Tri(), and SMESH_MeshEditor::Smooth().

◆ GetNodeU()

◆ GetNodeUV()

gp_XY SMESH_MesherHelper::GetNodeUV ( const TopoDS_Face &  F,
const SMDS_MeshNode n,
const SMDS_MeshNode inFaceNode = 0,
bool check = 0 
) const

Return node UV on face.

Parameters
inFaceNode- a node of element being created located inside a face
check- if provided, returns result of UV check that it enforces

References CheckNodeUV(), Edge, SMESH_Mesh::GetAncestors(), getFaceMaxTol(), GetMeshDS(), GetNodeUV(), SMDS_MeshNode::GetPosition(), SMDS_MeshElement::getshapeId(), getUVOnSeam(), Handle(), IsSeamShape(), IsSubShape(), IthVertex(), MESSAGE, myMesh, myPar1, myPar2, myParIndex, myShape, SetSubShape(), ShapeToIndex(), SMDS_TOP_EDGE, SMDS_TOP_FACE, and SMDS_TOP_VERTEX.

Referenced by SMESH_Pattern::Apply(), VISCOUS_3D::_NodeCoordHelper::byUV(), StdMeshers_Quadrangle_2D::check(), StdMeshers_Import_1D2D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_Sweeper::ComputeNodesOnStraight(), VISCOUS_3D::_LayerEdge::Copy(), StdMeshers_Sweeper::findDelaunayTriangles(), VISCOUS_3D::_ViscousBuilder::findEdgesToUpdateNormalNearConvexFace(), StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces(), SMESH_2D_Algo::FixInternalNodes(), FixQuadraticElements(), VISCOUS_3D::_ConvexFace::GetCenterOfCurvature(), GetCentralNode(), VISCOUS_3D::getFaceDir(), VISCOUS_3D::_ViscousBuilder::getFaceNormal(), VISCOUS_3D::_ConvexFace::GetMaxCurvature(), GetMediumNode(), GetNodeUV(), StdMeshers_PrismAsBlock::TSideFace::GetNodeUV(), StdMeshers_ProjectionUtils::Delaunay::getNodeUV(), SMESH_MeshEditor::InverseDiag(), IsDistorted2D(), VISCOUS_3D::_Simplex::IsForward(), IsReversedSubMesh(), VISCOUS_3D::_ViscousBuilder::limitStepSizeByCurvature(), SMESH_Pattern::Load(), VISCOUS_3D::_ViscousBuilder::makeLayer(), StdMeshers_Penta_3D::MakeNodes(), VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace(), StdMeshers_Prism_3D::projectBottomToTop(), SMESH_MeshEditor::QuadTo4Tri(), VISCOUS_2D::_ViscousBuilder2D::refine(), VISCOUS_3D::_ViscousBuilder::refine(), VISCOUS_3D::_ViscousBuilder::setEdgeData(), VISCOUS_3D::_LayerEdge::SetNewLength2d(), VISCOUS_3D::_ViscousBuilder::shrink(), StdMeshers_Quadrangle_2D::smooth(), VISCOUS_3D::_SmoothNode::Smooth(), SMESH_MeshEditor::Smooth(), StdMeshers_PrismAsBlock::TPCurveOnHorFaceAdaptor::TPCurveOnHorFaceAdaptor(), and StdMeshers_PrismAsBlock::TSideFace::Value().

◆ GetNodeUVneedInFaceNode()

bool SMESH_MesherHelper::GetNodeUVneedInFaceNode ( const TopoDS_Face &  F = TopoDS_Face()) const

Check if inFaceNode argument is necessary for call GetNodeUV(F,..)

Return values
bool- return true if the face is periodic

If F is Null, answer about subshape set through IsQuadraticSubMesh() or SetSubShape()

References Handle(), mySeamShapeIds, and myShape.

Referenced by SMESH_Pattern::Apply().

◆ GetOtherParam()

double SMESH_MesherHelper::GetOtherParam ( const double  param) const

Return an alternative parameter for a node on seam.

References myPar1, myPar2, and myParIndex.

Referenced by StdMeshers_Import_1D2D::Compute().

◆ GetPCProjector()

GeomAPI_ProjectPointOnCurve & SMESH_MesherHelper::GetPCProjector ( const TopoDS_Edge &  E) const

Return projector initialized by given EDGE.

References GetMeshDS(), Handle(), myEdge2Projector, and SMESHDS_Mesh::ShapeToIndex().

◆ GetPeriod()

double SMESH_MesherHelper::GetPeriod ( int  perioIndex) const

Return period in given direction [1,2].

Referenced by StdMeshers_Quadrangle_2D::check().

◆ GetPeriodicIndex()

int SMESH_MesherHelper::GetPeriodicIndex ( ) const

Return index of periodic parametric direction of a closed face.

Return values
int- 1 for U, 2 for V direction

Referenced by AdjustByPeriod(), StdMeshers_Quadrangle_2D::check(), StdMeshers_Import_1D2D::Compute(), SMESH_2D_Algo::FixInternalNodes(), VISCOUS_3D::_ViscousBuilder::makeLayer(), and VISCOUS_2D::_ViscousBuilder2D::refine().

◆ GetProjector() [1/2]

GeomAPI_ProjectPointOnSurf & SMESH_MesherHelper::GetProjector ( const TopoDS_Face &  F,
double  tol = 0 
) const

Return projector initialized by given face.

References GetMeshDS(), Handle(), myFace2Projector, and SMESHDS_Mesh::ShapeToIndex().

◆ GetProjector() [2/2]

GeomAPI_ProjectPointOnSurf & SMESH_MesherHelper::GetProjector ( const TopoDS_Face &  F,
TopLoc_Location &  loc,
double  tol = 0 
) const

◆ GetShapeOfHypothesis()

TopoDS_Shape SMESH_MesherHelper::GetShapeOfHypothesis ( const SMESHDS_Hypothesis hyp,
const TopoDS_Shape &  shape,
SMESH_Mesh mesh 
)
static

Returns a shape, to which a hypothesis used to mesh a given shape is assigned.

Parameters
[in]hyp- the hypothesis
[in]shape- the shape, for meshing which the hyp is used
[in]mesh- the mesh
Returns
TopoDS_Shape - the shape the hyp is assigned to

References SMESH_Mesh::GetHypothesis(), and SMESH_HypoFilter::Is().

Referenced by SMESH_subMesh::cleanDependsOn().

◆ GetSubShape()

◆ GetSubShapeByNode()

◆ GetSubShapeID()

◆ GetSubShapeOri()

TopAbs_Orientation SMESH_MesherHelper::GetSubShapeOri ( const TopoDS_Shape &  shape,
const TopoDS_Shape &  subShape 
)
static

◆ GetTLinkNodeMap()

const TLinkNodeMap & SMESH_MesherHelper::GetTLinkNodeMap ( ) const

Returns myTLinkNodeMap.

Referenced by StdMeshers_Quadrangle_2D::smooth().

◆ getUVOnSeam()

gp_Pnt2d SMESH_MesherHelper::getUVOnSeam ( const gp_Pnt2d &  uv1,
const gp_Pnt2d &  uv2 
) const
protected

Select UV on either of 2 pcurves of a seam edge, closest to the given UV.

Parameters
uv1- UV on the seam
uv2- UV within a face
Return values
gp_Pnt2d- selected UV

References myPar1, myPar2, and myParIndex.

Referenced by GetNodeUV(), and IsDistorted2D().

◆ Handle()

SMESH_MesherHelper::Handle ( ShapeAnalysis_Surface  ) const &

◆ HasDegeneratedEdges()

◆ HasRealSeam()

bool SMESH_MesherHelper::HasRealSeam ( ) const

Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge that encounters twice in a wire.

Return values
bool- true if it has

Referenced by StdMeshers_Quadrangle_2D::check(), StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces(), and VISCOUS_3D::_ViscousBuilder::limitStepSizeByCurvature().

◆ HasSeam()

bool SMESH_MesherHelper::HasSeam ( ) const

Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge, i.e.

an edge that has two parametric representations on a surface

Return values
bool- true if it has

Referenced by StdMeshers_Quadrangle_2D::check(), StdMeshers_Import_1D2D::Compute(), StdMeshers_Projection_1D2D::Compute(), IsDistorted2D(), SMESH_Pattern::Load(), and StdMeshers_Sweeper::prepareTopBotDelaunay().

◆ IsBlock()

bool SMESH_MesherHelper::IsBlock ( const TopoDS_Shape &  shape)
static

◆ IsClosedEdge()

bool SMESH_MesherHelper::IsClosedEdge ( const TopoDS_Edge &  anEdge)
static

◆ IsCornerOfStructure()

bool SMESH_MesherHelper::IsCornerOfStructure ( const SMDS_MeshNode n,
const SMESHDS_SubMesh faceSM,
SMESH_MesherHelper faceAnalyser 
)
static

◆ IsDegenShape()

bool SMESH_MesherHelper::IsDegenShape ( const int  subShape) const

Check if shape is a degenerated edge or it's vertex.

Parameters
subShape- edge or vertex index in SMESHDS
Return values
bool- true if subShape is a degenerated shape

It works only if IsQuadraticSubMesh() or SetSubShape() has been called

Referenced by StdMeshers_Projection_2D::Compute(), VISCOUS_3D::_ViscousBuilder::getFaceNormal(), GetMediumNode(), StdMeshers_FaceSide::GetOrderedNodes(), StdMeshers_FaceSide::GetUVPtStruct(), IsDistorted2D(), VISCOUS_3D::_ViscousBuilder::makeLayer(), StdMeshers_FaceSide::NbPoints(), and StdMeshers_Quadrangle_2D::updateDegenUV().

◆ IsDistorted2D()

◆ IsMedium()

bool SMESH_MesherHelper::IsMedium ( const SMDS_MeshNode node,
const SMDSAbs_ElementType  typeToCheck = SMDSAbs_All 
)
static

Returns true if given node is medium.

Parameters
n- node to check
typeToCheck- type of elements containing the node to ask about node status
Return values
bool- check result

References SMESH_MeshEditor::IsMedium().

Referenced by StdMeshers_Projection_1D::Compute(), SMESH_MeshEditor::FindCoincidentNodes(), StdMeshers_Penta_3D::FindNodeOnShape(), SMESH_Algo::GetSortedNodesOnEdge(), SMESH_Mesh_i::IsMediumNodeOfAnyElem(), SMESH_Pattern::Load(), StdMeshers_Penta_3D::LoadIJNodes(), StdMeshers_Penta_3D::MakeMeshOnFxy1(), and StdMeshers_Penta_3D::MakeNodes().

◆ IsOnSeam()

int SMESH_MesherHelper::IsOnSeam ( const gp_XY &  uv) const

Check if UV is on seam.

Return 0 if not, 1 for U seam, 2 for V seam

References myPar1, myPar2, and myParIndex.

Referenced by StdMeshers_Quadrangle_2D::check(), StdMeshers_Import_1D2D::Compute(), and IsDistorted2D().

◆ IsQuadraticMesh()

◆ IsQuadraticSubMesh()

◆ IsRealSeam() [1/2]

◆ IsRealSeam() [2/2]

bool SMESH_MesherHelper::IsRealSeam ( const TopoDS_Shape &  subShape) const

Return true if an edge or a vertex encounters twice in face wire.

Parameters
subShape- edge or vertex

◆ IsReversedSubMesh()

◆ IsSameElemGeometry()

bool SMESH_MesherHelper::IsSameElemGeometry ( const SMESHDS_SubMesh smDS,
SMDSAbs_GeometryType  shape,
const bool  nullSubMeshRes = true 
)
static

Returns true if all elements of a sub-mesh are of same shape.

Parameters
smDS- sub-mesh to check elements of
shape- expected shape of elements
nullSubMeshRes- result value for the case of smDS == NULL
Return values
bool- check result

References SMESHDS_SubMesh::GetElements(), and SMDS_MeshElement::GetGeomType().

Referenced by StdMeshers_Hexa_3D::Compute(), StdMeshers_Prism_3D::Compute(), and StdMeshers_Prism_3D::initPrism().

◆ IsSeamShape() [1/2]

bool SMESH_MesherHelper::IsSeamShape ( const int  subShape) const

Check if shape is a seam edge or it's vertex.

Parameters
subShape- edge or vertex index in SMESHDS
Return values
bool- true if subShape is a seam shape

It works only if IsQuadraticSubMesh() or SetSubShape() has been called. Seam shape has two 2D alternative representations on the face

Referenced by SMESH_Pattern::Apply(), StdMeshers_Quadrangle_2D::check(), StdMeshers_Import_1D2D::Evaluate(), StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces(), GetMediumNode(), GetNodeUV(), IsDistorted2D(), SMESH_Pattern::Load(), VISCOUS_3D::_ViscousBuilder::setEdgeData(), SetSubShape(), and VISCOUS_3D::_ViscousBuilder::shrink().

◆ IsSeamShape() [2/2]

bool SMESH_MesherHelper::IsSeamShape ( const TopoDS_Shape &  subShape) const

Check if shape is a seam edge or it's vertex.

Parameters
subShape- edge or vertex
Return values
bool- true if subShape is a seam shape

It works only if IsQuadraticSubMesh() or SetSubShape() has been called. Seam shape has two 2D alternative representations on the face

◆ IsStructured()

◆ IsSubShape() [1/2]

◆ IsSubShape() [2/2]

bool SMESH_MesherHelper::IsSubShape ( const TopoDS_Shape &  shape,
SMESH_Mesh aMesh 
)
static

◆ IthVertex()

◆ LoadNodeColumns() [1/2]

bool SMESH_MesherHelper::LoadNodeColumns ( TParam2ColumnMap theParam2ColumnMap,
const TopoDS_Face &  theFace,
const std::list< TopoDS_Edge > &  theBaseSide,
SMESHDS_Mesh theMesh,
SMESH_ProxyMesh theProxyMesh = 0 
)
static

Load nodes bound to face into a map of node columns.

Parameters
theParam2ColumnMap- map of node columns to fill
theFace- the face on which nodes are searched for
theBaseSide- the edges holding nodes on which columns base
theMesh- the mesh containing nodes
Return values
bool- false if something is wrong

The key of the map is a normalized parameter of each base node on theBaseSide. Edges in theBaseSide must be sequenced. This method works in supposition that nodes on the face forms a structured grid and elements can be quardrangles or triangles

References SMESHDS_SubMesh::Contains(), SMESH_Algo::EdgeLength(), SMESH_MeshAlgos::FindFaceInSet(), SMESHDS_SubMesh::GetElements(), SMDS_MeshNode::GetNode(), SMESH_ProxyMesh::GetProxyNode(), SMESH_Algo::GetSortedNodesOnEdge(), SMESH_ProxyMesh::GetSubMesh(), SMESH_ProxyMesh::IsTemporary(), SMESHDS_Mesh::MeshElements(), SMDS_MeshNode::NbCornerNodes(), and SMESHDS_SubMesh::NbElements().

Referenced by StdMeshers_Hexa_3D::Compute(), StdMeshers_PrismAsBlock::Init(), LoadNodeColumns(), and VISCOUS_3D::_SolidData::PrepareEdgesToSmoothOnFace().

◆ LoadNodeColumns() [2/2]

bool SMESH_MesherHelper::LoadNodeColumns ( TParam2ColumnMap theParam2ColumnMap,
const TopoDS_Face &  theFace,
const TopoDS_Edge &  theBaseEdge,
SMESHDS_Mesh theMesh,
SMESH_ProxyMesh theProxyMesh = 0 
)
static

Variant of LoadNodeColumns() above with theBaseSide given by one edge.

References LoadNodeColumns().

◆ MaxTolerance()

◆ NbAncestors()

int SMESH_MesherHelper::NbAncestors ( const TopoDS_Shape &  shape,
const SMESH_Mesh mesh,
TopAbs_ShapeEnum  ancestorType = TopAbs_SHAPE 
)
static

◆ NbDegeneratedEdges()

size_t SMESH_MesherHelper::NbDegeneratedEdges ( ) const

Return a number of degenerated edges in the shape set through IsQuadraticSubMesh() or SetSubShape()

Return values
size_t- nb edges

◆ NbRealSeam()

size_t SMESH_MesherHelper::NbRealSeam ( ) const

Return a number of real seam edges in the shape set through IsQuadraticSubMesh() or SetSubShape().

A real seam edge encounters twice in a wire

Return values
size_t- nb of real seams

References mySeamShapeIds.

◆ SetElementsOnShape()

◆ SetIsBiQuadratic()

void SMESH_MesherHelper::SetIsBiQuadratic ( const bool  theBuildBiQuadratic)

◆ SetIsQuadratic()

void SMESH_MesherHelper::SetIsQuadratic ( const bool  theBuildQuadratic)

◆ setPosOnShapeValidity()

void SMESH_MesherHelper::setPosOnShapeValidity ( int  shapeID,
bool  ok 
) const
private

Set validity of positions of nodes on the shape.

Once set, validity is not changed

Referenced by CheckNodeU(), CheckNodeUV(), and SetSubShape().

◆ SetSubShape() [1/2]

void SMESH_MesherHelper::SetSubShape ( const int  subShapeID)

Set shape to make elements on without calling IsQuadraticSubMesh()

References GetMeshDS(), myShapeID, and SetSubShape().

Referenced by VISCOUS_2D::_ViscousBuilder2D::_ViscousBuilder2D(), VISCOUS_3D::_ViscousBuilder::addBoundaryElements(), AdjustByPeriod(), SMESH_Pattern::Apply(), StdMeshers_Hexa_3D::Compute(), StdMeshers_Import_1D::Compute(), StdMeshers_Import_1D2D::Compute(), StdMeshers_Projection_1D2D::Compute(), StdMeshers_Projection_2D::Compute(), StdMeshers_QuadFromMedialAxis_1D2D::Compute(), StdMeshers_RadialQuadrangle_1D2D::Compute(), SMESH_subMesh::ComputeStateEngine(), SMESH_MeshEditor::ConvertToQuadratic(), StdMeshers_Import_1D2D::Evaluate(), StdMeshers_Prism_3D::Evaluate(), StdMeshers_RadialQuadrangle_1D2D::Evaluate(), StdMeshers_FaceSide::FaceHelper(), VISCOUS_3D::_ViscousBuilder::findFacesWithLayers(), StdMeshers_ProjectionUtils::FindMatchingNodesOnFaces(), VISCOUS_3D::_ViscousBuilder::findSolidsWithLayers(), SMESH_2D_Algo::FixInternalNodes(), FixQuadraticElements(), StdMeshers::Cartesian3D::Grid::GetEdgesToImplement(), GetNodeUV(), StdMeshers_FaceSide::GetOrderedNodes(), StdMeshers_FaceSide::GetUVPtStruct(), StdMeshers_Prism_3D::initPrism(), SMESH_MeshEditor::InverseDiag(), IsDistorted2D(), IsQuadraticSubMesh(), IsStructured(), VISCOUS_3D::_ViscousBuilder::limitStepSizeByCurvature(), SMESH_Pattern::Load(), VISCOUS_3D::_ViscousBuilder::makeLayer(), SMESH_Pattern::MakeMesh(), StdMeshers_Penta_3D::MakeMeshOnFxy1(), StdMeshers_Sweeper::prepareTopBotDelaunay(), StdMeshers_Prism_3D::projectBottomToTop(), SMESH_MeshEditor::QuadTo4Tri(), SMESH_MeshEditor::QuadToTri(), StdMeshers_Adaptive1D::SetParametersByMesh(), SetSubShape(), VISCOUS_2D::_ViscousBuilder2D::shrink(), VISCOUS_3D::_ViscousBuilder::shrink(), SMESH_MeshEditor::Smooth(), VISCOUS_3D::_ViscousBuilder::smoothAndCheck(), SMESH_MeshEditor::SplitFace(), SMESH_MeshEditor::SplitVolumes(), StdMeshers_PrismAsBlock::TPCurveOnHorFaceAdaptor::TPCurveOnHorFaceAdaptor(), StdMeshers_PrismAsBlock::TSideFace::TSideFace(), and VISCOUS_3D::_ViscousBuilder::updateNormalsOfConvexFaces().

◆ SetSubShape() [2/2]

void SMESH_MesherHelper::SetSubShape ( const TopoDS_Shape &  subShape)

◆ ShapeToIndex()

int SMESH_MesherHelper::ShapeToIndex ( const TopoDS_Shape &  S) const

Convert a shape to its index in the SMESHDS_Mesh.

References GetMeshDS(), and SMESHDS_Mesh::ShapeToIndex().

Referenced by FixQuadraticElements(), and GetNodeUV().

◆ toCheckPosOnShape()

bool SMESH_MesherHelper::toCheckPosOnShape ( int  shapeID) const
private

Return true if position of nodes on the shape hasn't yet been checked or the positions proved to be invalid.

References myNodePosShapesValidity.

Referenced by CheckNodeU(), and CheckNodeUV().

◆ ToFixNodeParameters()

◆ WrapIndex()

◆ WriteShape()

void SMESH_MesherHelper::WriteShape ( const TopoDS_Shape &  s)
static

DEBUG.

References MESSAGE, and UNV164::Write().

Field Documentation

◆ myCreateBiQuadratic

bool SMESH_MesherHelper::myCreateBiQuadratic
private

Referenced by AddFace(), and AddVolume().

◆ myCreateQuadratic

bool SMESH_MesherHelper::myCreateQuadratic
private

◆ myDegenShapeIds

std::set< int > SMESH_MesherHelper::myDegenShapeIds
private

Referenced by CopySubShapeInfo(), and SetSubShape().

◆ myEdge2Projector

TID2ProjectorOnCurve SMESH_MesherHelper::myEdge2Projector
private

◆ myFace2Projector

TID2ProjectorOnSurf SMESH_MesherHelper::myFace2Projector
private

◆ myFace2Surface

TID2Surface SMESH_MesherHelper::myFace2Surface
mutableprivate

Referenced by CopySubShapeInfo(), and Handle().

◆ myFaceMaxTol

std::map< int, double > SMESH_MesherHelper::myFaceMaxTol
private

Referenced by getFaceMaxTol().

◆ myFixNodeParameters

bool SMESH_MesherHelper::myFixNodeParameters
private

◆ myMapWithCentralNode

std::map< TBiQuad, const SMDS_MeshNode* > SMESH_MesherHelper::myMapWithCentralNode
private

Referenced by AddTLinks(), and GetCentralNode().

◆ myMesh

◆ myNodePosShapesValidity

std::map< int,bool > SMESH_MesherHelper::myNodePosShapesValidity
private

Referenced by toCheckPosOnShape().

◆ myPar1

double SMESH_MesherHelper::myPar1[2]
private

◆ myPar2

double SMESH_MesherHelper::myPar2[2]
private

◆ myParIndex

int SMESH_MesherHelper::myParIndex
private

◆ mySeamShapeIds

std::set< int > SMESH_MesherHelper::mySeamShapeIds
private

◆ mySetElemOnShape

◆ myShape

◆ myShapeID

◆ myTLinkNodeMap

TLinkNodeMap SMESH_MesherHelper::myTLinkNodeMap
private