Version: 8.3.0
SMDS_Down2D Class Referenceabstract

#include <SMDS_Downward.hxx>

Inheritance diagram for SMDS_Down2D:

Public Member Functions

virtual int getNumberOfUpCells (int cellId)
 
virtual const intgetUpCells (int cellId)
 
virtual const unsigned char * getUpTypes (int cellId)
 
virtual void getNodeIds (int cellId, std::set< int > &nodeSet)
 
virtual int getNumberOfDownCells (int cellId)
 Get the number of downward entities associated to a cell (always the same for a given vtk type of cell) More...
 
virtual const intgetDownCells (int cellId)
 get a pointer on the downward entities id's associated to a cell. More...
 
virtual const unsigned char * getDownTypes (int cellId)
 get a list of vtk cell types associated to downward entities of a given cell, in the same order than the downward entities id's list ( More...
 
virtual int getNodes (int cellId, int *nodevec)
 
virtual void getOrderedNodesOfFace (int cellId, std::vector< vtkIdType > &orderedNodes)
 
int getVtkCellId (int cellId)
 
int getMaxId ()
 

Static Public Member Functions

static int getCellDimension (unsigned char cellType)
 get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type More...
 

Protected Member Functions

 SMDS_Down2D (SMDS_UnstructuredGrid *grid, int nbDownCells)
 
 ~SMDS_Down2D ()
 
virtual void allocate (int nbElems)
 Resize the downward connectivity storage vector if needed. More...
 
virtual void compactStorage ()
 
virtual void addUpCell (int cellId, int upCellId, unsigned char aType)
 Id's are downward connectivity id's. More...
 
virtual void computeEdgesWithNodes (int cellId, ListElemByNodesType &facesWithNodes)=0
 
virtual int getNodeSet (int cellId, int *nodeSet)
 
int computeVolumeIds (int cellId, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face already stored in vtkUnstructuredGrid. More...
 
int computeVolumeIds (ElemByNodesType &faceByNodes, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes. More...
 
int computeVolumeIdsFromNodesFace (int *nodes, int nbNodes, int *ids)
 Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes. More...
 
void setTempNodes (int cellId, int vtkId)
 
void setTempNodes (int cellId, ElemByNodesType &faceByNodes)
 
bool isInFace (int cellId, int *pts, int npts)
 Find if all the nodes belongs to the face. More...
 
int FindEdgeByNodes (int cellId, ElemByNodesType &edgeByNodes)
 
int addCell (int vtkId=-1)
 Give or create an entry for downward connectivity structure relative to a cell. More...
 
virtual void initCell (int cellId)
 generic method do nothing. More...
 
virtual void addDownCell (int cellId, int lowCellId, unsigned char aType)
 Id's are downward connectivity id's. More...
 

Protected Attributes

std::vector< int_upCellIds
 2 volumes max. More...
 
std::vector< unsigned char > _upCellTypes
 2 volume types per face More...
 
std::vector< int_tempNodes
 temporary storage of nodes, until downward connectivity completion More...
 
int _nbNodes
 number of nodes in a face More...
 
SMDS_UnstructuredGrid_grid
 
int _maxId
 
int _nbDownCells
 the same number for all cells of a derived class More...
 
std::vector< int_cellIds
 growing size: all the down cell id's, size = _maxId * _nbDownCells More...
 
std::vector< int_vtkCellIds
 growing size: size = _maxId, either vtkId or -1 More...
 
std::vector< unsigned char > _cellTypes
 fixed size: the same vector for all cells of a derived class More...
 

Static Protected Attributes

static std::vector< int_cellDimension
 conversion table: type –> dimension More...
 

Friends

class SMDS_UnstructuredGrid
 
class SMDS_Down1D
 

Constructor & Destructor Documentation

SMDS_Down2D::SMDS_Down2D ( SMDS_UnstructuredGrid grid,
int  nbDownCells 
)
protected
SMDS_Down2D::~SMDS_Down2D ( )
protected

Member Function Documentation

int SMDS_Downward::addCell ( int  vtkId = -1)
protectedinherited

Give or create an entry for downward connectivity structure relative to a cell.

If the entry already exists, just return its id, otherwise, create it. The internal storage memory is allocated if needed. The SMDS_UnstructuredGrid::_cellIdToDownId vector is completed for vtkUnstructuredGrid cells.

Parameters
vtkIdfor a vtkUnstructuredGrid cell or -1 (default) for a created downward cell.
Returns
the rank in downward[vtkType] structure.

References SMDS_Downward::_grid, SMDS_Downward::_maxId, SMDS_Downward::_vtkCellIds, SMDS_Downward::allocate(), SMDS_UnstructuredGrid::CellIdToDownId(), SMDS_Downward::initCell(), and SMDS_UnstructuredGrid::setCellIdToDownId().

void SMDS_Downward::addDownCell ( int  cellId,
int  lowCellId,
unsigned char  aType 
)
protectedvirtualinherited

Id's are downward connectivity id's.

add a downward entity of dimension n-1 (cell or node) to a given cell.

Actual implementation is done in derived methods.

Parameters
cellIdindex of the parent cell (dimension n) in the downward structure relative to a vtk cell type.
lowCellIdindex of the children cell to add (dimension n-1)
aTypevtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).

Reimplemented in SMDS_DownQuadHexa, SMDS_DownHexa, SMDS_DownQuadPenta, SMDS_DownPenta, SMDS_DownQuadPyramid, SMDS_DownPyramid, SMDS_DownQuadTetra, SMDS_DownTetra, SMDS_DownQuadQuadrangle, SMDS_DownQuadrangle, SMDS_DownQuadTriangle, and SMDS_DownTriangle.

void SMDS_Down2D::addUpCell ( int  cellId,
int  upCellId,
unsigned char  aType 
)
protectedvirtual

Id's are downward connectivity id's.

add a downward entity of dimension n+1 to a given cell.

Actual implementation is done in derived methods.

Parameters
cellIdindex of the children cell (dimension n) in the downward structure relative to a vtk cell type.
upCellIdindex of the parent cell to add (dimension n+1)
aTypevtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).

Reimplemented from SMDS_Downward.

References _upCellIds, and _upCellTypes.

void SMDS_Down2D::allocate ( int  nbElems)
protectedvirtual

Resize the downward connectivity storage vector if needed.

Parameters
nbElemstotal number of elements of the same type required

Implements SMDS_Downward.

References SMDS_Downward::_cellIds, SMDS_Downward::_nbDownCells, _nbNodes, _tempNodes, _upCellIds, _upCellTypes, SMDS_Downward::_vtkCellIds, and SMDS_Mesh::chunkSize.

void SMDS_Down2D::compactStorage ( )
protectedvirtual
virtual void SMDS_Down2D::computeEdgesWithNodes ( int  cellId,
ListElemByNodesType facesWithNodes 
)
protectedpure virtual
int SMDS_Down2D::computeVolumeIds ( int  cellId,
int ids 
)
protected

Find in vtkUnstructuredGrid the volumes containing a face already stored in vtkUnstructuredGrid.

Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes. A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters
cellIdthe face cell id in vkUnstructuredGrid
idsa couple of vtkId, initialized at -1 (no parent volume)
Returns
number of volumes (0, 1 or 2)

References SMDS_Downward::_grid, and computeVolumeIdsFromNodesFace().

Referenced by SMDS_UnstructuredGrid::BuildDownwardConnectivity().

int SMDS_Down2D::computeVolumeIds ( ElemByNodesType faceByNodes,
int ids 
)
protected

Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes.

A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters
faceByNodes
idsa couple of vtkId, initialized at -1 (no parent volume)
Returns
number of volumes (0, 1 or 2)

References computeVolumeIdsFromNodesFace(), ElemByNodesType::nbNodes, and ElemByNodesType::nodeIds.

int SMDS_Down2D::computeVolumeIdsFromNodesFace ( int pts,
int  npts,
int ids 
)
protected

Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes Search the volumes containing a face, to store the info in SMDS_Down2D for later uses with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes.

A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.

Parameters
ptsarray of vtk node id's
nptsnumber of nodes
ids
Returns
number of volumes (0, 1 or 2)

References SMDS_Downward::_grid, SMDS_Downward::getCellDimension(), and SMDS_UnstructuredGrid::GetLinks().

Referenced by SMDS_UnstructuredGrid::BuildDownwardConnectivity(), and computeVolumeIds().

int SMDS_Downward::getCellDimension ( unsigned char  cellType)
staticinherited
const int * SMDS_Downward::getDownCells ( int  cellId)
virtualinherited

get a pointer on the downward entities id's associated to a cell.

See Also
SMDS_Downward::getNumberOfDownCells for the number of downward entities.
SMDS_Downward::getDownTypes for the vtk cell types associated to the downward entities.
Parameters
cellIdindex of the cell in the downward structure relative to a given vtk cell type.
Returns
table of downward entities id's.

References SMDS_Downward::_cellIds, and SMDS_Downward::_nbDownCells.

Referenced by SMDS_Down1D::computeFaces(), SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

const unsigned char * SMDS_Downward::getDownTypes ( int  cellId)
virtualinherited

get a list of vtk cell types associated to downward entities of a given cell, in the same order than the downward entities id's list (

See Also
SMDS_Downward::getDownCells).
Parameters
cellIdindex of the cell in the downward structure relative to a vtk cell type.
Returns
table of downward entities types.

References SMDS_Downward::_cellTypes.

Referenced by SMDS_Down1D::computeFaces(), SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

int SMDS_Downward::getMaxId ( )
inherited
void SMDS_Down2D::getNodeIds ( int  cellId,
std::set< int > &  nodeSet 
)
virtual
virtual int SMDS_Downward::getNodes ( int  cellId,
int nodevec 
)
virtualinherited
int SMDS_Down2D::getNodeSet ( int  cellId,
int nodeSet 
)
protectedvirtual

Reimplemented from SMDS_Downward.

References _nbNodes, and _tempNodes.

int SMDS_Downward::getNumberOfDownCells ( int  cellId)
virtualinherited

Get the number of downward entities associated to a cell (always the same for a given vtk type of cell)

Parameters
cellIdnot used here.
Returns

References SMDS_Downward::_nbDownCells.

Referenced by SMDS_Down1D::computeFaces(), SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

int SMDS_Down2D::getNumberOfUpCells ( int  cellId)
virtual

Implements SMDS_Downward.

References _upCellIds.

virtual void SMDS_Downward::getOrderedNodesOfFace ( int  cellId,
std::vector< vtkIdType > &  orderedNodes 
)
virtualinherited
const int * SMDS_Down2D::getUpCells ( int  cellId)
virtual

Implements SMDS_Downward.

References _upCellIds.

const unsigned char * SMDS_Down2D::getUpTypes ( int  cellId)
virtual

Implements SMDS_Downward.

References _upCellTypes.

int SMDS_Downward::getVtkCellId ( int  cellId)
inherited
void SMDS_Downward::initCell ( int  cellId)
protectedvirtualinherited

generic method do nothing.

see derived methods

Parameters
cellId

Reimplemented in SMDS_Down1D.

Referenced by SMDS_Downward::addCell().

bool SMDS_Down2D::isInFace ( int  cellId,
int pts,
int  npts 
)
protected

Find if all the nodes belongs to the face.

Parameters
cellIdthe face cell Id
nodeSetset of node id's to be found in the face list of nodes
Returns

References _nbNodes, and _tempNodes.

Referenced by SMDS_Down1D::computeFaces().

void SMDS_Down2D::setTempNodes ( int  cellId,
int  vtkId 
)
protected
void SMDS_Down2D::setTempNodes ( int  cellId,
ElemByNodesType faceByNodes 
)
protected

Friends And Related Function Documentation

friend class SMDS_Down1D
friend
friend class SMDS_UnstructuredGrid
friend

Field Documentation

vector< int > SMDS_Downward::_cellDimension
staticprotectedinherited

conversion table: type –> dimension

Referenced by SMDS_Downward::SMDS_Downward().

std::vector<int> SMDS_Down2D::_upCellIds
protected

2 volumes max.

per face

Referenced by addUpCell(), allocate(), compactStorage(), getNumberOfUpCells(), getUpCells(), and SMDS_Down2D().

std::vector<unsigned char> SMDS_Down2D::_upCellTypes
protected

2 volume types per face

Referenced by addUpCell(), allocate(), compactStorage(), getUpTypes(), and SMDS_Down2D().