SMESH_MesherHelper Class Reference

#include <SMESH_MesherHelper.hxx>

Collaboration diagram for SMESH_MesherHelper:
Collaboration graph

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)
SMESH_MeshGetMesh () const
SMESHDS_MeshGetMeshDS () const
bool IsQuadraticSubMesh (const TopoDS_Shape &theShape)
void SetIsQuadratic (const bool theBuildQuadratic)
 Set order of elements to create without calling IsQuadraticSubMesh().
bool GetIsQuadratic () const
 Return myCreateQuadratic flag.
void FixQuadraticElements (bool volumeOnly=true)
 Move medium nodes of faces and volumes to fix distorted elements.
void SetElementsOnShape (bool toSet)
 To set created elements on the shape set by IsQuadraticSubMesh() or the next methods. By defaul elements are set on the shape if a mesh has no shape to be meshed.
void SetSubShape (const int subShapeID)
 Set shape to make elements on without calling IsQuadraticSubMesh().
void SetSubShape (const TopoDS_Shape &subShape)
 ==SMESHDS_MeshShapeToIndex(shape)
int GetSubShapeID () const
 Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape().
TopoDS_Shape GetSubShape () const
 Return the shape set by IsQuadraticSubMesh() or SetSubShape().
SMDS_MeshNodeAddNode (double x, double y, double z, int ID=0)
SMDS_MeshEdgeAddEdge (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const int id=0, const bool force3d=true)
SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const int id=0, const bool force3d=false)
SMDS_MeshFaceAddFace (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const int id=0, const bool force3d=false)
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const int id=0, const bool force3d=true)
SMDS_MeshVolumeAddVolume (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n3, const SMDS_MeshNode *n4, const SMDS_MeshNode *n5, const int id=0, const bool force3d=true)
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 int id=0, const bool force3d=true)
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 int id=0, bool force3d=true)
double GetNodeU (const TopoDS_Edge &theEdge, const SMDS_MeshNode *theNode, bool *check=0)
 Return U of the given node on the edge.
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.
bool CheckNodeUV (const TopoDS_Face &F, const SMDS_MeshNode *n, gp_XY &uv, const double tol) const
 Check and fix node UV on a face.
bool GetNodeUVneedInFaceNode (const TopoDS_Face &F=TopoDS_Face()) const
 Check if inFaceNode argument is necessary for call GetNodeUV(F,..).
bool IsDegenShape (const int subShape) const
 Check if shape is a degenerated edge or it's vertex.
bool IsSeamShape (const int subShape) const
 Check if shape is a seam edge or it's vertex.
bool IsSeamShape (const TopoDS_Shape &subShape) const
 Check if shape is a seam edge or it's vertex.
bool IsRealSeam (const int subShape) const
 Return true if an edge or a vertex encounters twice in face wire.
bool IsRealSeam (const TopoDS_Shape &subShape) const
 Return true if an edge or a vertex encounters twice in face wire.
bool HasSeam () const
 Check if the shape set through IsQuadraticSubMesh() or SetSubShape() has a seam edge.
int GetPeriodicIndex () const
 Return index of periodic parametric direction of a closed face.
double GetOtherParam (const double param) const
 Return an alternative parameter for a node on seam.
const SMDS_MeshNodeGetMediumNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const bool force3d)
 Special function for search or creation medium node.
void AddTLinkNode (const SMDS_MeshNode *n1, const SMDS_MeshNode *n2, const SMDS_MeshNode *n12)
void AddTLinkNodeMap (const TLinkNodeMap &aMap)
 Auxilary function for filling myTLinkNodeMap.
const TLinkNodeMapGetTLinkNodeMap () const
 Returns myTLinkNodeMap.
MType IsQuadraticMesh ()

Static Public Member Functions

static bool IsMedium (const SMDS_MeshNode *node, const SMDSAbs_ElementType typeToCheck=SMDSAbs_All)
 Returns true if given node is medium.
static bool LoadNodeColumns (TParam2ColumnMap &theParam2ColumnMap, const TopoDS_Face &theFace, const TopoDS_Edge &theBaseEdge, SMESHDS_Mesh *theMesh)
 Load nodes bound to face into a map of node columns.
static TopoDS_Shape GetSubShapeByNode (const SMDS_MeshNode *node, SMESHDS_Mesh *meshDS)
 Return support shape of a node.
static int WrapIndex (const int ind, const int nbNodes)
 Return a valid node index, fixing the given one if necessary.
static int NbAncestors (const TopoDS_Shape &shape, const SMESH_Mesh &mesh, TopAbs_ShapeEnum ancestorType=TopAbs_SHAPE)
 Return number of unique ancestors of the shape.
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.

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.

Private Member Functions

 SMESH_MesherHelper (const SMESH_MesherHelper &theOther)

Private Attributes

TLinkNodeMap myTLinkNodeMap
std::set< intmyDegenShapeIds
std::set< intmySeamShapeIds
double myPar1
double myPar2
int myParIndex
TopoDS_Shape myShape
SMESH_MeshmyMesh
int myShapeID
bool myCreateQuadratic
bool mySetElemOnShape
std::set< intmyOkNodePosShapes

Detailed Description

Definition at line 57 of file SMESH_MesherHelper.hxx.


Member Enumeration Documentation

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 

Definition at line 362 of file SMESH_MesherHelper.hxx.


Constructor & Destructor Documentation

SMESH_MesherHelper.SMESH_MesherHelper ( SMESH_Mesh theMesh  ) 
SMESH_MesherHelper.SMESH_MesherHelper ( const SMESH_MesherHelper theOther  )  [private]

Definition at line 378 of file SMESH_MesherHelper.hxx.


Member Function Documentation

static 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
static bool SMESH_MesherHelper.LoadNodeColumns ( TParam2ColumnMap theParam2ColumnMap,
const TopoDS_Face &  theFace,
const TopoDS_Edge &  theBaseEdge,
SMESHDS_Mesh theMesh 
) [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
theBaseEdge - the edge nodes of which are columns' bases
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 theBaseEdge. This method works in supposition that nodes on the face forms a rectangular grid and elements can be quardrangles or triangles

static TopoDS_Shape SMESH_MesherHelper.GetSubShapeByNode ( const SMDS_MeshNode node,
SMESHDS_Mesh meshDS 
) [static]

Return support shape of a node.

Parameters:
node - the node
meshDS - mesh DS
Return values:
TopoDS_Shape - found support shape
static int SMESH_MesherHelper.WrapIndex ( const int  ind,
const int  nbNodes 
) [static]

Return a valid node index, fixing the given one if necessary.

Parameters:
ind - node index
nbNodes - total nb of nodes
Return values:
int - valid node index

Definition at line 103 of file SMESH_MesherHelper.hxx.

static int SMESH_MesherHelper.NbAncestors ( const TopoDS_Shape shape,
const SMESH_Mesh mesh,
TopAbs_ShapeEnum  ancestorType = TopAbs_SHAPE 
) [static]

Return number of unique ancestors of the shape.

SMESH_Mesh* SMESH_MesherHelper.GetMesh (  )  const

Definition at line 122 of file SMESH_MesherHelper.hxx.

SMESHDS_Mesh* SMESH_MesherHelper.GetMeshDS (  )  const

Definition at line 124 of file SMESH_MesherHelper.hxx.

bool SMESH_MesherHelper.IsQuadraticSubMesh ( const TopoDS_Shape theShape  ) 

Check submesh for given shape: if all elements on this shape are quadratic, quadratic elements will be created. Also fill myTLinkNodeMap

void SMESH_MesherHelper.SetIsQuadratic ( const bool  theBuildQuadratic  ) 

Set order of elements to create without calling IsQuadraticSubMesh().

Definition at line 134 of file SMESH_MesherHelper.hxx.

bool SMESH_MesherHelper.GetIsQuadratic (  )  const

Return myCreateQuadratic flag.

Definition at line 139 of file SMESH_MesherHelper.hxx.

void SMESH_MesherHelper.FixQuadraticElements ( bool  volumeOnly = true  ) 

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

Parameters:
volumeOnly - fix nodes on geom faces or not if the shape is solid
void SMESH_MesherHelper.SetElementsOnShape ( bool  toSet  ) 

To set created elements on the shape set by IsQuadraticSubMesh() or the next methods. By defaul elements are set on the shape if a mesh has no shape to be meshed.

Definition at line 152 of file SMESH_MesherHelper.hxx.

void SMESH_MesherHelper.SetSubShape ( const int  subShapeID  ) 

Set shape to make elements on without calling IsQuadraticSubMesh().

void SMESH_MesherHelper.SetSubShape ( const TopoDS_Shape subShape  ) 

==SMESHDS_MeshShapeToIndex(shape)

int SMESH_MesherHelper.GetSubShapeID (  )  const

Return ID of the shape set by IsQuadraticSubMesh() or SetSubShape().

Return values:
int - shape index in SMESHDS

Definition at line 163 of file SMESH_MesherHelper.hxx.

TopoDS_Shape SMESH_MesherHelper.GetSubShape (  )  const

Return the shape set by IsQuadraticSubMesh() or SetSubShape().

Definition at line 167 of file SMESH_MesherHelper.hxx.

SMDS_MeshNode* SMESH_MesherHelper.AddNode ( double  x,
double  y,
double  z,
int  ID = 0 
)

Creates a node

SMDS_MeshEdge* SMESH_MesherHelper.AddEdge ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const int  id = 0,
const bool  force3d = true 
)

Creates quadratic or linear edge

SMDS_MeshFace* SMESH_MesherHelper.AddFace ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const int  id = 0,
const bool  force3d = false 
)

Creates quadratic or linear triangle

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

Creates quadratic or linear quadrangle

SMDS_MeshVolume* SMESH_MesherHelper.AddVolume ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const SMDS_MeshNode n3,
const SMDS_MeshNode n4,
const int  id = 0,
const bool  force3d = true 
)

Creates quadratic or linear tetraahedron

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 int  id = 0,
const bool  force3d = true 
)

Creates quadratic or linear pyramid

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 int  id = 0,
const bool  force3d = true 
)

Creates quadratic or linear pentahedron

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 int  id = 0,
bool  force3d = true 
)

Creates quadratic or linear hexahedron

double SMESH_MesherHelper.GetNodeU ( const TopoDS_Edge &  theEdge,
const SMDS_MeshNode theNode,
bool *  check = 0 
)

Return U of the given node on the edge.

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
bool SMESH_MesherHelper.CheckNodeUV ( const TopoDS_Face &  F,
const SMDS_MeshNode n,
gp_XY &  uv,
const double  tol 
) const

Check and fix node UV on a face.

Return values:
bool - false if UV is bad and could not be fixed
static 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.

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()

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

Definition at line 284 of file SMESH_MesherHelper.hxx.

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 represenations on the face

Definition at line 294 of file SMESH_MesherHelper.hxx.

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 represenations on the face

Definition at line 304 of file SMESH_MesherHelper.hxx.

References IsSeamShape().

Referenced by IsSeamShape().

Here is the call graph for this function:

Here is the caller graph for this function:

bool SMESH_MesherHelper.IsRealSeam ( const int  subShape  )  const

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

Parameters:
subShape - Id of edge or vertex

Definition at line 310 of file SMESH_MesherHelper.hxx.

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

Definition at line 316 of file SMESH_MesherHelper.hxx.

References IsRealSeam().

Referenced by IsRealSeam().

Here is the call graph for this function:

Here is the caller graph for this function:

bool SMESH_MesherHelper.HasSeam (  )  const

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

Return values:
bool - true if it has

Definition at line 323 of file SMESH_MesherHelper.hxx.

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

Definition at line 328 of file SMESH_MesherHelper.hxx.

double SMESH_MesherHelper.GetOtherParam ( const double  param  )  const

Return an alternative parameter for a node on seam.

const SMDS_MeshNode* SMESH_MesherHelper.GetMediumNode ( const SMDS_MeshNode n1,
const SMDS_MeshNode n2,
const bool  force3d 
)

Special function for search or creation medium node.

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

Auxilary function for filling myTLinkNodeMap

void SMESH_MesherHelper.AddTLinkNodeMap ( const TLinkNodeMap aMap  ) 

Auxilary function for filling myTLinkNodeMap.

Definition at line 349 of file SMESH_MesherHelper.hxx.

const TLinkNodeMap& SMESH_MesherHelper.GetTLinkNodeMap (  )  const

Returns myTLinkNodeMap.

Definition at line 355 of file SMESH_MesherHelper.hxx.

MType SMESH_MesherHelper.IsQuadraticMesh (  ) 
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

Field Documentation

Definition at line 378 of file SMESH_MesherHelper.hxx.

std::set< int > SMESH_MesherHelper.myDegenShapeIds [private]

Definition at line 383 of file SMESH_MesherHelper.hxx.

std::set< int > SMESH_MesherHelper.mySeamShapeIds [private]

Definition at line 384 of file SMESH_MesherHelper.hxx.

double SMESH_MesherHelper.myPar1 [private]

Definition at line 385 of file SMESH_MesherHelper.hxx.

double SMESH_MesherHelper.myPar2 [private]

Definition at line 385 of file SMESH_MesherHelper.hxx.

Definition at line 386 of file SMESH_MesherHelper.hxx.

Definition at line 388 of file SMESH_MesherHelper.hxx.

Definition at line 389 of file SMESH_MesherHelper.hxx.

Definition at line 390 of file SMESH_MesherHelper.hxx.

Definition at line 393 of file SMESH_MesherHelper.hxx.

Definition at line 394 of file SMESH_MesherHelper.hxx.

Definition at line 395 of file SMESH_MesherHelper.hxx.


Generated on 22 Oct 2012 for SALOME - SMESH by  doxygen 1.6.1