Version: 9.16.0
SMDS_VolumeTool Class Reference

#include <SMDS_VolumeTool.hxx>

Data Structures

struct  Facet
 
struct  SaveFacet
 Saver/restorer of a SMDS_VolumeTool::myCurFace. More...
 

Public Types

enum  VolumeType {
  UNKNOWN = -1 , TETRA = 0 , PYRAM , PENTA ,
  HEXA , HEX_PRISM , QUAD_TETRA , QUAD_PYRAM ,
  QUAD_PENTA , QUAD_HEXA , POLYHEDA , NB_VOLUME_TYPES
}
 

Public Member Functions

 SMDS_VolumeTool ()
 
 ~SMDS_VolumeTool ()
 
 SMDS_VolumeTool (const SMDS_MeshElement *theVolume, const bool ignoreCentralNodes=true)
 
bool Set (const SMDS_MeshElement *theVolume, const bool ignoreCentralNodes=true, const std::vector< const SMDS_MeshNode * > *nodes=0)
 
const SMDS_MeshVolumeElement () const
 
smIdType ID () const
 
bool IsPoly () const
 
VolumeType GetVolumeType () const
 
bool IsForward () const
 
void Inverse ()
 
const SMDS_MeshNode ** GetNodes () const
 
int NbNodes () const
 
double GetSize () const
 
double GetScaledJacobian () const
 
bool GetBaryCenter (double &X, double &Y, double &Z) const
 
bool IsOut (double X, double Y, double Z, double tol) const
 Classify a point. More...
 
bool IsLinked (const SMDS_MeshNode *theNode1, const SMDS_MeshNode *theNode2, const bool theIgnoreMediumNodes=false) const
 
bool IsLinked (const int theNode1Index, const int theNode2Index, bool theIgnoreMediumNodes=false) const
 
int GetNodeIndex (const SMDS_MeshNode *theNode) const
 
int GetAllExistingEdges (std::vector< const SMDS_MeshElement * > &edges) const
 Fill vector with boundary edges existing in the mesh. More...
 
double MinLinearSize2 () const
 Return minimal square distance between connected corner nodes. More...
 
double MaxLinearSize2 () const
 Return maximal square distance between connected corner nodes. More...
 
void SetExternalNormal ()
 
int NbFaces () const
 
int NbFaceNodes (int faceIndex) const
 
const int * GetFaceNodesIndices (int faceIndex) const
 
const SMDS_MeshNode ** GetFaceNodes (int faceIndex) const
 
bool GetFaceNodes (int faceIndex, std::set< const SMDS_MeshNode * > &theFaceNodes) const
 
bool IsFaceExternal (int faceIndex) const
 
bool IsFreeFace (int faceIndex, const SMDS_MeshElement **otherVol=0) const
 Fast quickly check that only one volume is built on the face nodes This check is valid for conformal meshes only. More...
 
bool IsFreeFaceCheckAllNodes (int faceIndex, const SMDS_MeshElement **otherVol=0) const
 Check that only one volume is built on the face nodes Different to IsFreeFace function, all nodes of the face are checked. More...
 
bool IsFreeFaceAdv (int faceIndex, const SMDS_MeshElement **otherVol=0) const
 Thorough check that only one volume is built on the face nodes. More...
 
bool GetFaceNormal (int faceIndex, double &X, double &Y, double &Z) const
 
bool GetFaceBaryCenter (int faceIndex, double &X, double &Y, double &Z) const
 Return barycenter of a face. More...
 
bool AllFacesSameOriented () const
 Check that all the faces in a polyhedron follow the same orientation. More...
 
double GetFaceArea (int faceIndex) const
 
int GetOppFaceIndex (int faceIndex) const
 
int GetCenterNodeIndex (int faceIndex) const
 Return index of the node located at face center of a quadratic element like HEX27. More...
 
int GetFaceIndex (const std::set< const SMDS_MeshNode * > &theFaceNodes, const int theFaceIndexHint=-1) const
 
int GetAllExistingFaces (std::vector< const SMDS_MeshElement * > &faces) const
 Fill vector with boundary faces existing in the mesh. More...
 

Static Public Member Functions

static VolumeType GetType (int nbNodes)
 
static int NbFaces (VolumeType type)
 
static const int * GetFaceNodesIndices (VolumeType type, int faceIndex, bool external)
 
static int NbFaceNodes (VolumeType type, int faceIndex)
 
static int NbCornerNodes (VolumeType type)
 Useful to know nb of corner nodes of a quadratic volume. More...
 
static int GetOppFaceIndexOfHex (int faceIndex)
 

Private Types

typedef std::pair< int, int > Link
 

Private Member Functions

bool setFace (int faceIndex) const
 
bool projectNodesToNormal (int faceIndex, double &minProj, double &maxProj, double *normal=0) const
 

Private Attributes

const SMDS_MeshElementmyVolume
 
const SMDS_MeshVolumemyPolyedre
 
bool myIgnoreCentralNodes
 
bool myVolForward
 
int myNbFaces
 
std::vector< const SMDS_MeshNode * > myVolumeNodes
 
std::vector< int > myPolyIndices
 
std::vector< int > myPolyQuantities
 
std::vector< int > myPolyFacetOri
 
std::map< Link, int > myFwdLinks
 
bool myExternalFaces
 
const int * myAllFacesNodeIndices_F
 
const int * myAllFacesNodeIndices_RE
 
const int * myAllFacesNbNodes
 
int myMaxFaceNbNodes
 
Facet myCurFace
 

Member Typedef Documentation

◆ Link

typedef std::pair<int,int> SMDS_VolumeTool::Link
private

Member Enumeration Documentation

◆ VolumeType

Enumerator
UNKNOWN 
TETRA 
PYRAM 
PENTA 
HEXA 
HEX_PRISM 
QUAD_TETRA 
QUAD_PYRAM 
QUAD_PENTA 
QUAD_HEXA 
POLYHEDA 
NB_VOLUME_TYPES 

Constructor & Destructor Documentation

◆ SMDS_VolumeTool() [1/2]

SMDS_VolumeTool::SMDS_VolumeTool ( )

References Set().

◆ ~SMDS_VolumeTool()

SMDS_VolumeTool::~SMDS_VolumeTool ( )

◆ SMDS_VolumeTool() [2/2]

SMDS_VolumeTool::SMDS_VolumeTool ( const SMDS_MeshElement theVolume,
const bool  ignoreCentralNodes = true 
)

References Set().

Member Function Documentation

◆ AllFacesSameOriented()

bool SMDS_VolumeTool::AllFacesSameOriented ( ) const

Check that all the faces in a polyhedron follow the same orientation.

Remarks
there is no differentiation for outward and inward face orientation.

References myCurFace, myExternalFaces, myFwdLinks, SMDS_VolumeTool::Facet::myNbNodes, SMDS_VolumeTool::Facet::myNodes, NbFaces(), and setFace().

Referenced by GetSize().

◆ Element()

const SMDS_MeshVolume * SMDS_VolumeTool::Element ( ) const

◆ GetAllExistingEdges()

int SMDS_VolumeTool::GetAllExistingEdges ( std::vector< const SMDS_MeshElement * > &  edges) const

Fill vector with boundary edges existing in the mesh.

Parameters
edges- vector of found edges
Return values
int- nb of found faces

References SMDS_Mesh::FindEdge(), IsLinked(), and myVolumeNodes.

◆ GetAllExistingFaces()

int SMDS_VolumeTool::GetAllExistingFaces ( std::vector< const SMDS_MeshElement * > &  faces) const

Fill vector with boundary faces existing in the mesh.

Parameters
faces- vector of found nodes
Return values
int- nb of found faces

References SMDS_Mesh::FindFace(), GetFaceNodes(), IsPoly(), myCurFace, SMDS_VolumeTool::Facet::myNodes, NbFaceNodes(), NbFaces(), and setFace().

◆ GetBaryCenter()

bool SMDS_VolumeTool::GetBaryCenter ( double &  X,
double &  Y,
double &  Z 
) const

◆ GetCenterNodeIndex()

int SMDS_VolumeTool::GetCenterNodeIndex ( int  faceIndex) const

Return index of the node located at face center of a quadratic element like HEX27.

References myAllFacesNbNodes, and myVolumeNodes.

Referenced by SMESH_MesherHelper::AddTLinks(), SMESH_MeshEditor::MakeBoundaryMesh(), and SMESH_MeshEditor::SplitVolumes().

◆ GetFaceArea()

double SMDS_VolumeTool::GetFaceArea ( int  faceIndex) const

◆ GetFaceBaryCenter()

bool SMDS_VolumeTool::GetFaceBaryCenter ( int  faceIndex,
double &  X,
double &  Y,
double &  Z 
) const

◆ GetFaceIndex()

int SMDS_VolumeTool::GetFaceIndex ( const std::set< const SMDS_MeshNode * > &  theFaceNodes,
const int  theFaceIndexHint = -1 
) const

◆ GetFaceNodes() [1/2]

◆ GetFaceNodes() [2/2]

bool SMDS_VolumeTool::GetFaceNodes ( int  faceIndex,
std::set< const SMDS_MeshNode * > &  theFaceNodes 
) const

◆ GetFaceNodesIndices() [1/2]

◆ GetFaceNodesIndices() [2/2]

const int * SMDS_VolumeTool::GetFaceNodesIndices ( VolumeType  type,
int  faceIndex,
bool  external 
)
static

◆ GetFaceNormal()

◆ GetNodeIndex()

int SMDS_VolumeTool::GetNodeIndex ( const SMDS_MeshNode theNode) const

References myVolume, and myVolumeNodes.

◆ GetNodes()

◆ GetOppFaceIndex()

int SMDS_VolumeTool::GetOppFaceIndex ( int  faceIndex) const

◆ GetOppFaceIndexOfHex()

int SMDS_VolumeTool::GetOppFaceIndexOfHex ( int  faceIndex)
static

◆ GetScaledJacobian()

◆ GetSize()

◆ GetType()

◆ GetVolumeType()

◆ ID()

smIdType SMDS_VolumeTool::ID ( ) const

◆ Inverse()

◆ IsFaceExternal()

◆ IsForward()

◆ IsFreeFace()

◆ IsFreeFaceAdv()

bool SMDS_VolumeTool::IsFreeFaceAdv ( int  faceIndex,
const SMDS_MeshElement **  otherVol = 0 
) const

◆ IsFreeFaceCheckAllNodes()

bool SMDS_VolumeTool::IsFreeFaceCheckAllNodes ( int  faceIndex,
const SMDS_MeshElement **  otherVol = 0 
) const

Check that only one volume is built on the face nodes Different to IsFreeFace function, all nodes of the face are checked.

For non conforming meshes, the face that is not conform with the neighbor will be identify as free.

References GetFaceNodes(), SMDS_MeshNode::GetInverseElementIterator(), IsFreeFace(), SMDS_MeshElement::IsQuadratic(), myCurFace, SMDS_VolumeTool::Facet::myNbNodes, myVolume, setFace(), and SMDSAbs_Volume.

Referenced by StdMeshers::Cartesian3D::Hexahedron::addFaces().

◆ IsLinked() [1/2]

bool SMDS_VolumeTool::IsLinked ( const int  theNode1Index,
const int  theNode2Index,
bool  theIgnoreMediumNodes = false 
) const

◆ IsLinked() [2/2]

◆ IsOut()

bool SMDS_VolumeTool::IsOut ( double  X,
double  Y,
double  Z,
double  tol 
) const

Classify a point.

Parameters
tol- thickness of faces

References GetFaceNormal(), IsFaceExternal(), myCurFace, myNbFaces, and SMDS_VolumeTool::Facet::myNodes.

Referenced by SMESH_MeshAlgos::IsOut().

◆ IsPoly()

◆ MaxLinearSize2()

double SMDS_VolumeTool::MaxLinearSize2 ( ) const

◆ MinLinearSize2()

double SMDS_VolumeTool::MinLinearSize2 ( ) const

◆ NbCornerNodes()

int SMDS_VolumeTool::NbCornerNodes ( VolumeType  type)
static

Useful to know nb of corner nodes of a quadratic volume.

Parameters
type- volume type
Return values
int- nb of corner nodes

References HEX_PRISM, HEXA, PENTA, PYRAM, QUAD_HEXA, QUAD_PENTA, QUAD_PYRAM, QUAD_TETRA, and TETRA.

Referenced by StdMeshers_Projection_3D::Compute().

◆ NbFaceNodes() [1/2]

◆ NbFaceNodes() [2/2]

int SMDS_VolumeTool::NbFaceNodes ( VolumeType  type,
int  faceIndex 
)
static

◆ NbFaces() [1/2]

◆ NbFaces() [2/2]

int SMDS_VolumeTool::NbFaces ( VolumeType  type)
static

◆ NbNodes()

◆ projectNodesToNormal()

bool SMDS_VolumeTool::projectNodesToNormal ( int  faceIndex,
double &  minProj,
double &  maxProj,
double *  normal = 0 
) const
private

◆ Set()

bool SMDS_VolumeTool::Set ( const SMDS_MeshElement theVolume,
const bool  ignoreCentralNodes = true,
const std::vector< const SMDS_MeshNode * > *  nodes = 0 
)

References SMDS_MeshElement::begin_nodes(), SMDS_MeshElement::end_nodes(), GetFaceNormal(), SMDS_MeshElement::GetType(), IsLinked(), SMDS_MeshElement::IsPoly(), myAllFacesNbNodes, myAllFacesNodeIndices_F, myAllFacesNodeIndices_RE, myCurFace, myExternalFaces, myFwdLinks, myIgnoreCentralNodes, SMDS_VolumeTool::Facet::myIndex, myNbFaces, SMDS_VolumeTool::Facet::myNodeIndices, SMDS_VolumeTool::Facet::myNodes, myPolyedre, myPolyFacetOri, myPolyIndices, myPolyQuantities, myVolForward, myVolume, myVolumeNodes, SMDS_MeshElement::NbCornerNodes(), SMDS_MeshElement::NbFaces(), SMDS_MeshElement::NbNodes(), setFace(), SMDSAbs_Volume, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

Referenced by StdMeshers::Cartesian3D::Hexahedron::addFaces(), StdMeshers_Prism_3D::AddPrisms(), SMESH_Mesh_i::BaryCenter(), SMESH_MeshAlgos::DeMerge(), DriverSTL_W_SMDS_Mesh::findVolumeTriangles(), SMESH_MesherHelper::FixQuadraticElements(), SMESH_MeshEditor::GetHexaFacetsToSplit(), SMESH_Algo::GetMeshError(), SMESH::Controls::Volume::GetValue(), SMESH::Controls::ScaledJacobian::GetValue(), SMESH_MeshAlgos::IntersectRayVolume(), SMESH::Controls::BareBorderVolume::IsSatisfy(), SMESH::Controls::OverConstrainedVolume::IsSatisfy(), SMESH_Block::LoadMeshBlock(), SMESH_MeshEditor::MakeBoundaryMesh(), SMESH_Pattern::makePolyElements(), StdMeshers_Penta_3D::MakeVolumeMesh(), SMESH_MeshEditor::makeWalls(), StdMeshers_QuadToTriaAdaptor::MergePiramids(), SMESH::SelectionProxy::perFaceConnectivity(), DriverCGNS_Write::Perform(), SMESH_MeshEditor::Reorient2DBy3D(), SMESH_MeshEditor::SewFreeBorder(), SMDS_VolumeTool(), splitPolygon(), and SMESH_MeshEditor::SplitVolumes().

◆ SetExternalNormal()

◆ setFace()

Field Documentation

◆ myAllFacesNbNodes

const int* SMDS_VolumeTool::myAllFacesNbNodes
mutableprivate

◆ myAllFacesNodeIndices_F

const int* SMDS_VolumeTool::myAllFacesNodeIndices_F
mutableprivate

Referenced by Set(), and setFace().

◆ myAllFacesNodeIndices_RE

const int* SMDS_VolumeTool::myAllFacesNodeIndices_RE
mutableprivate

Referenced by Set(), and setFace().

◆ myCurFace

◆ myExternalFaces

bool SMDS_VolumeTool::myExternalFaces
mutableprivate

◆ myFwdLinks

std::map<Link, int> SMDS_VolumeTool::myFwdLinks
private

◆ myIgnoreCentralNodes

bool SMDS_VolumeTool::myIgnoreCentralNodes
private

Referenced by Set(), and setFace().

◆ myMaxFaceNbNodes

int SMDS_VolumeTool::myMaxFaceNbNodes
mutableprivate

Referenced by setFace().

◆ myNbFaces

int SMDS_VolumeTool::myNbFaces
private

◆ myPolyedre

const SMDS_MeshVolume* SMDS_VolumeTool::myPolyedre
private

◆ myPolyFacetOri

std::vector< int > SMDS_VolumeTool::myPolyFacetOri
private

Referenced by IsFaceExternal(), and Set().

◆ myPolyIndices

std::vector< int > SMDS_VolumeTool::myPolyIndices
private

Referenced by Set(), and setFace().

◆ myPolyQuantities

std::vector<int> SMDS_VolumeTool::myPolyQuantities
private

Referenced by IsLinked(), Set(), and setFace().

◆ myVolForward

bool SMDS_VolumeTool::myVolForward
private

Referenced by Inverse(), Set(), and setFace().

◆ myVolume

◆ myVolumeNodes