Version: 9.16.0
SMESHUtils::SMESH_RegularGrid Class Reference

Define a regular grid of nx,ny,nz dimension. More...

#include <SMESH_RegularGrid.hxx>

Public Types

enum  EdgeType {
  BOTTOM , RIGHT , TOP , LEFT ,
  NONE
}
 
enum  VertexType {
  V0 , V1 , V2 , V3 ,
  V4 , V5 , V6 , V7
}
 
enum  FaceType {
  B_BOTTOM , B_RIGHT , B_BACK , B_LEFT ,
  B_FRONT , B_TOP , B_NONE
}
 

Public Member Functions

 SMESH_RegularGrid (const int id, const int nx, const int ny, const int nz=1)
 
void SetNode (const std::shared_ptr< gp_Pnt > &point, const int iIndex, const int jIndex, const int zIndex=0)
 
void SetNode (const SMDS_MeshNode *point, const int iIndex, const int jIndex, const int zIndex=0)
 
void SetNode (const SMDS_MeshNode *point, const int index)
 
const std::shared_ptr< gp_Pnt > GetNode (const int index) const
 
const std::shared_ptr< gp_Pnt > GetNode (const int iIndex, const int jIndex, const int zIndex)
 
int nx () const
 
int ny () const
 
int nz () const
 
int Size ()
 
NCollection_Array1< std::shared_ptr< gp_Pnt > >::Iterator CoordinateBegin ()
 
int id () const
 
void GetEdgeInterfaces (SMESH_RegularGrid *grid, std::vector< int > &interface)
 
void GetFaceInterfaces (SMESH_RegularGrid *grid, std::vector< int > &interface)
 
template<typename T >
void getAllEdgeIndexLimits (std::vector< std::vector< T > > &allRanges)
 
template<typename T >
void getAllFaceIndexLimits (std::vector< std::vector< T > > &allRanges)
 
template<typename T >
std::vector< T > getEdgeIndexLimits (const EdgeType edge) const
 
std::vector< int > getEdgeIndexLimitsInverted (const EdgeType edge) const
 
template<typename T >
std::vector< T > getFaceIndexLimits (SMESH_RegularGrid::FaceType face) const
 
SMESH_RegularGrid::FaceType getFaceTypeByGeomFace (TopoDS_Shape shapeFace) const
 
SMESH_RegularGrid::EdgeType getEdgeTypeByGeomEdge (TopoDS_Shape shapeEdge) const
 
 ~SMESH_RegularGrid ()
 

Protected Member Functions

void GetCommontInterface (EdgeType edge, SMESH_RegularGrid *grid, std::vector< int > &interface)
 
void GetCommontInterface (FaceType face, SMESH_RegularGrid *grid, std::vector< int > &interface)
 
bool GetPrecomputedInterface (EdgeType edge, const SMESH_RegularGrid *grid, std::vector< int > &interface)
 
bool GetPrecomputedInterface (FaceType face, const SMESH_RegularGrid *grid, std::vector< int > &interface)
 
void setInterface (SMESH_RegularGrid::EdgeType edge, const int gridId, std::vector< int > &interface)
 
void setInterface (SMESH_RegularGrid::FaceType face, const int gridId, std::vector< int > &interface)
 
std::pair< int, int > getEdgeLimits (const SMESH_RegularGrid::EdgeType edge) const
 
std::tuple< int, int, int, int > getFaceLimits (const SMESH_RegularGrid::FaceType face) const
 
std::vector< int > getEdgeIndexLimits (const int start, const int end) const
 
std::vector< int > getFaceIndexLimits (const int start, const int end) const
 
std::vector< int > computeTransformation (const SMESH_RegularGrid::EdgeType edge, SMESH_RegularGrid::EdgeType gridDonorEdge, std::vector< int > &interfaceRange, std::vector< int > &interfaceDonor) const
 
std::vector< int > computeTransformation (const SMESH_RegularGrid::FaceType face, SMESH_RegularGrid::FaceType gridDonorFace, std::vector< int > &interfaceRange, std::vector< int > &interfaceDonor) const
 
int getEdgeSize (const EdgeType edge) const
 
int getFaceSize (const FaceType face) const
 
int getFaceCoordinateIndex (const VertexType v) const
 
std::tuple< int, int, int > GetIJK (const int index) const
 
template<typename FUNCTION >
void foreachGridSide (const FUNCTION &fSide) const
 
template<typename FUNCTION >
void foreachGridFace (const FUNCTION &fSide) const
 
void foreachNodeOnSide (SMESH_RegularGrid::EdgeType edge, const std::function< void(const std::shared_ptr< gp_Pnt > point, const int index)> &function) const
 
void foreachNodeOnFace (SMESH_RegularGrid::FaceType face, const std::function< void(const std::shared_ptr< gp_Pnt > point, const int index)> &function) const
 
std::vector< int > nodesOfSide (SMESH_RegularGrid::EdgeType edge) const
 
std::vector< int > nodesOfFace (SMESH_RegularGrid::FaceType face) const
 
void transformIndexLimits (FaceType face, std::vector< int > &faceLimits, const std::shared_ptr< gp_Pnt > &V0, const std::shared_ptr< gp_Pnt > &V1, const std::shared_ptr< gp_Pnt > &V2, const std::shared_ptr< gp_Pnt > &V3)
 

Private Attributes

int myId
 
int mnx
 
int mny
 
int mnz
 
int mns
 
NCollection_Array1< std::shared_ptr< gp_Pnt > > myCoordinates
 
std::map< SMESH_RegularGrid::EdgeType, std::map< int, std::vector< int > > > myInterfaceMap
 
std::map< SMESH_RegularGrid::FaceType, std::map< int, std::vector< int > > > myFaceInterafaceMap
 

Detailed Description

Define a regular grid of nx,ny,nz dimension.

A vector with gp_Pnt is defined by default by a canonical order, the canonical order is: i-index goes faster, then j-index and finally z-index. This data structure was created to index mesh nodes created by Quadrangle_2D and Prism_3D meshers. The StructuredCGNS export driver uses this data structure to define zones, grid coordinate points and interfaces.

Member Enumeration Documentation

◆ EdgeType

Enumerator
BOTTOM 
RIGHT 
TOP 
LEFT 
NONE 

◆ FaceType

Enumerator
B_BOTTOM 
B_RIGHT 
B_BACK 
B_LEFT 
B_FRONT 
B_TOP 
B_NONE 

◆ VertexType

Enumerator
V0 
V1 
V2 
V3 
V4 
V5 
V6 
V7 

Constructor & Destructor Documentation

◆ SMESH_RegularGrid()

SMESH_RegularGrid::SMESH_RegularGrid ( const int  id,
const int  nx,
const int  ny,
const int  nz = 1 
)

References mnx, mny, mnz, and myCoordinates.

◆ ~SMESH_RegularGrid()

SMESH_RegularGrid::~SMESH_RegularGrid ( )

Member Function Documentation

◆ computeTransformation() [1/2]

std::vector< int > SMESH_RegularGrid::computeTransformation ( const SMESH_RegularGrid::EdgeType  edge,
SMESH_RegularGrid::EdgeType  gridDonorEdge,
std::vector< int > &  interfaceRange,
std::vector< int > &  interfaceDonor 
) const
protected

References BOTTOM, MESHCUT::d, LEFT, RIGHT, and TOP.

Referenced by GetCommontInterface().

◆ computeTransformation() [2/2]

std::vector< int > SMESH_RegularGrid::computeTransformation ( const SMESH_RegularGrid::FaceType  face,
SMESH_RegularGrid::FaceType  gridDonorFace,
std::vector< int > &  interfaceRange,
std::vector< int > &  interfaceDonor 
) const
protected

◆ CoordinateBegin()

NCollection_Array1< std::shared_ptr< gp_Pnt > >::Iterator SMESHUtils::SMESH_RegularGrid::CoordinateBegin ( )

◆ foreachGridFace()

template<typename FUNCTION >
void SMESHUtils::SMESH_RegularGrid::foreachGridFace ( const FUNCTION &  fSide) const
protected

◆ foreachGridSide()

template<typename FUNCTION >
void SMESHUtils::SMESH_RegularGrid::foreachGridSide ( const FUNCTION &  fSide) const
protected

◆ foreachNodeOnFace()

void SMESHUtils::SMESH_RegularGrid::foreachNodeOnFace ( SMESH_RegularGrid::FaceType  face,
const std::function< void(const std::shared_ptr< gp_Pnt > point, const int index)> &  function 
) const
protected

References myCoordinates, and nodesOfFace().

Referenced by GetCommontInterface().

◆ foreachNodeOnSide()

void SMESHUtils::SMESH_RegularGrid::foreachNodeOnSide ( SMESH_RegularGrid::EdgeType  edge,
const std::function< void(const std::shared_ptr< gp_Pnt > point, const int index)> &  function 
) const
protected

References myCoordinates, and nodesOfSide().

Referenced by GetCommontInterface().

◆ getAllEdgeIndexLimits()

template<typename T >
void SMESHUtils::SMESH_RegularGrid::getAllEdgeIndexLimits ( std::vector< std::vector< T > > &  allRanges)

References foreachGridSide().

◆ getAllFaceIndexLimits()

template<typename T >
void SMESHUtils::SMESH_RegularGrid::getAllFaceIndexLimits ( std::vector< std::vector< T > > &  allRanges)

References foreachGridFace().

◆ GetCommontInterface() [1/2]

void SMESH_RegularGrid::GetCommontInterface ( EdgeType  edge,
SMESH_RegularGrid grid,
std::vector< int > &  interface 
)
protected

◆ GetCommontInterface() [2/2]

void SMESH_RegularGrid::GetCommontInterface ( FaceType  face,
SMESH_RegularGrid grid,
std::vector< int > &  interface 
)
protected

◆ getEdgeIndexLimits() [1/2]

template<typename T >
std::vector< T > SMESHUtils::SMESH_RegularGrid::getEdgeIndexLimits ( const EdgeType  edge) const

References mnx, and mny.

Referenced by GetCommontInterface().

◆ getEdgeIndexLimits() [2/2]

std::vector< int > SMESH_RegularGrid::getEdgeIndexLimits ( const int  start,
const int  end 
) const
protected

References end(), and GetIJK().

◆ getEdgeIndexLimitsInverted()

std::vector< int > SMESH_RegularGrid::getEdgeIndexLimitsInverted ( const EdgeType  edge) const

Referenced by GetCommontInterface().

◆ GetEdgeInterfaces()

void SMESH_RegularGrid::GetEdgeInterfaces ( SMESH_RegularGrid grid,
std::vector< int > &  interface 
)

◆ getEdgeLimits()

std::pair< int, int > SMESH_RegularGrid::getEdgeLimits ( const SMESH_RegularGrid::EdgeType  edge) const
protected

References mnx, and mny.

Referenced by GetCommontInterface(), and getEdgeTypeByGeomEdge().

◆ getEdgeSize()

int SMESH_RegularGrid::getEdgeSize ( const EdgeType  edge) const
protected

References mnx, and mny.

Referenced by GetCommontInterface().

◆ getEdgeTypeByGeomEdge()

SMESH_RegularGrid::EdgeType SMESH_RegularGrid::getEdgeTypeByGeomEdge ( TopoDS_Shape  shapeEdge) const

◆ getFaceCoordinateIndex()

int SMESH_RegularGrid::getFaceCoordinateIndex ( const VertexType  v) const
protected

References mnx, mny, and mnz.

Referenced by getFaceLimits().

◆ getFaceIndexLimits() [1/2]

std::vector< int > SMESH_RegularGrid::getFaceIndexLimits ( const int  start,
const int  end 
) const
protected

References end(), and GetIJK().

◆ getFaceIndexLimits() [2/2]

template<typename T >
std::vector< T > SMESHUtils::SMESH_RegularGrid::getFaceIndexLimits ( SMESH_RegularGrid::FaceType  face) const

References B_BACK, B_BOTTOM, B_FRONT, B_LEFT, B_RIGHT, B_TOP, mnx, mny, and mnz.

Referenced by GetCommontInterface().

◆ GetFaceInterfaces()

void SMESH_RegularGrid::GetFaceInterfaces ( SMESH_RegularGrid grid,
std::vector< int > &  interface 
)

◆ getFaceLimits()

std::tuple< int, int, int, int > SMESH_RegularGrid::getFaceLimits ( const SMESH_RegularGrid::FaceType  face) const
protected

◆ getFaceSize()

int SMESH_RegularGrid::getFaceSize ( const FaceType  face) const
protected

References B_BACK, B_BOTTOM, B_FRONT, B_LEFT, B_RIGHT, B_TOP, mnx, mny, and mnz.

Referenced by GetCommontInterface().

◆ getFaceTypeByGeomFace()

SMESH_RegularGrid::FaceType SMESH_RegularGrid::getFaceTypeByGeomFace ( TopoDS_Shape  shapeFace) const

◆ GetIJK()

std::tuple< int, int, int > SMESH_RegularGrid::GetIJK ( const int  index) const
protected

References mnx, and mny.

Referenced by getEdgeIndexLimits(), and getFaceIndexLimits().

◆ GetNode() [1/2]

const std::shared_ptr< gp_Pnt > SMESH_RegularGrid::GetNode ( const int  iIndex,
const int  jIndex,
const int  zIndex 
)

References mns, mnx, mny, and myCoordinates.

◆ GetNode() [2/2]

const std::shared_ptr< gp_Pnt > SMESHUtils::SMESH_RegularGrid::GetNode ( const int  index) const

Referenced by GetCommontInterface().

◆ GetPrecomputedInterface() [1/2]

bool SMESH_RegularGrid::GetPrecomputedInterface ( EdgeType  edge,
const SMESH_RegularGrid grid,
std::vector< int > &  interface 
)
protected

References id(), and myInterfaceMap.

Referenced by GetEdgeInterfaces(), and GetFaceInterfaces().

◆ GetPrecomputedInterface() [2/2]

bool SMESH_RegularGrid::GetPrecomputedInterface ( FaceType  face,
const SMESH_RegularGrid grid,
std::vector< int > &  interface 
)
protected

References id(), and myFaceInterafaceMap.

◆ id()

int SMESHUtils::SMESH_RegularGrid::id ( ) const

◆ nodesOfFace()

std::vector< int > SMESH_RegularGrid::nodesOfFace ( SMESH_RegularGrid::FaceType  face) const
protected

◆ nodesOfSide()

std::vector< int > SMESH_RegularGrid::nodesOfSide ( SMESH_RegularGrid::EdgeType  edge) const
protected

References BOTTOM, mnx, mny, and TOP.

Referenced by foreachNodeOnSide().

◆ nx()

int SMESHUtils::SMESH_RegularGrid::nx ( ) const

◆ ny()

int SMESHUtils::SMESH_RegularGrid::ny ( ) const

◆ nz()

int SMESHUtils::SMESH_RegularGrid::nz ( ) const

◆ setInterface() [1/2]

void SMESH_RegularGrid::setInterface ( SMESH_RegularGrid::EdgeType  edge,
const int  gridId,
std::vector< int > &  interface 
)
protected

References myInterfaceMap.

Referenced by GetCommontInterface().

◆ setInterface() [2/2]

void SMESH_RegularGrid::setInterface ( SMESH_RegularGrid::FaceType  face,
const int  gridId,
std::vector< int > &  interface 
)
protected

References myFaceInterafaceMap.

◆ SetNode() [1/3]

void SMESH_RegularGrid::SetNode ( const SMDS_MeshNode point,
const int  iIndex,
const int  jIndex,
const int  zIndex = 0 
)

◆ SetNode() [2/3]

void SMESH_RegularGrid::SetNode ( const SMDS_MeshNode point,
const int  index 
)

◆ SetNode() [3/3]

void SMESH_RegularGrid::SetNode ( const std::shared_ptr< gp_Pnt > &  point,
const int  iIndex,
const int  jIndex,
const int  zIndex = 0 
)

References mns, mnx, mny, and myCoordinates.

◆ Size()

int SMESHUtils::SMESH_RegularGrid::Size ( )

◆ transformIndexLimits()

void SMESH_RegularGrid::transformIndexLimits ( FaceType  face,
std::vector< int > &  faceLimits,
const std::shared_ptr< gp_Pnt > &  V0,
const std::shared_ptr< gp_Pnt > &  V1,
const std::shared_ptr< gp_Pnt > &  V2,
const std::shared_ptr< gp_Pnt > &  V3 
)
protected

Field Documentation

◆ mns

int SMESHUtils::SMESH_RegularGrid::mns
private

Referenced by GetNode(), and SetNode().

◆ mnx

◆ mny

◆ mnz

int SMESHUtils::SMESH_RegularGrid::mnz
private

◆ myCoordinates

NCollection_Array1<std::shared_ptr<gp_Pnt> > SMESHUtils::SMESH_RegularGrid::myCoordinates
private

◆ myFaceInterafaceMap

std::map<SMESH_RegularGrid::FaceType,std::map<int,std::vector<int> > > SMESHUtils::SMESH_RegularGrid::myFaceInterafaceMap
private

◆ myId

int SMESHUtils::SMESH_RegularGrid::myId
private

◆ myInterfaceMap

std::map<SMESH_RegularGrid::EdgeType,std::map<int,std::vector<int> > > SMESHUtils::SMESH_RegularGrid::myInterfaceMap
private