Version: 8.3.0
SMDS_Down1D Class Reference

#include <SMDS_Downward.hxx>

Inheritance diagram for SMDS_Down1D:

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 getNodes (int cellId, int *nodevec)
 
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 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_Down1D (SMDS_UnstructuredGrid *grid, int nbDownCells)
 
 ~SMDS_Down1D ()
 
virtual void initCell (int cellId)
 clear vectors used to reference 2D cells containing the edge More...
 
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 int getNodeSet (int cellId, int *nodeSet)
 
void setNodes (int cellId, int vtkId)
 
void setNodes (int cellId, const int *nodeIds)
 
int computeVtkCells (int cellId, std::vector< int > &vtkIds)
 Build the list of vtkUnstructuredGrid cells containing the edge. More...
 
int computeVtkCells (int *pts, std::vector< int > &vtkIds)
 Build the list of vtkUnstructuredGrid cells containing the edge. More...
 
int computeFaces (int cellId, int *vtkIds, int nbcells, int *downFaces, unsigned char *downTypes)
 Build the list of downward faces from a list of vtk cells. More...
 
int computeFaces (int *pts, int *vtkIds, int nbcells, int *downFaces, unsigned char *downTypes)
 Build the list of downward faces from a list of vtk cells. More...
 
int addCell (int vtkId=-1)
 Give or create an entry for downward connectivity structure relative to a cell. More...
 
virtual void addDownCell (int cellId, int lowCellId, unsigned char aType)
 Id's are downward connectivity id's. More...
 

Protected Attributes

std::vector< std::vector< int > > _upCellIdsVector
 the number of faces sharing an edge is not known More...
 
std::vector< std::vector
< unsigned char > > 
_upCellTypesVector
 the number of faces sharing an edge is not known More...
 
std::vector< int_upCellIds
 compacted storage after connectivity calculation More...
 
std::vector< unsigned char > _upCellTypes
 compacted storage after connectivity calculation More...
 
std::vector< int_upCellIndex
 compacted storage after connectivity calculation 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
 

Constructor & Destructor Documentation

SMDS_Down1D::SMDS_Down1D ( SMDS_UnstructuredGrid grid,
int  nbDownCells 
)
protected
SMDS_Down1D::~SMDS_Down1D ( )
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_Down1D::addUpCell ( int  cellId,
int  upCellId,
unsigned char  aType 
)
protectedvirtual

Id's are downward connectivity id's.

Reimplemented from SMDS_Downward.

References _upCellIdsVector, and _upCellTypesVector.

void SMDS_Down1D::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, _upCellIdsVector, _upCellTypesVector, SMDS_Downward::_vtkCellIds, and SMDS_Mesh::chunkSize.

int SMDS_Down1D::computeFaces ( int  cellId,
int vtkIds,
int  nbcells,
int downFaces,
unsigned char *  downTypes 
)
protected

Build the list of downward faces from a list of vtk cells.

Parameters
cellIdid of the edge in the downward structure
vtkIdsvector of vtk id's
downFacesvector of face id's in downward structures
downTypesvector of face types
Returns
number of downward faces

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

Referenced by SMDS_UnstructuredGrid::BuildDownwardConnectivity().

int SMDS_Down1D::computeFaces ( int pts,
int vtkIds,
int  nbcells,
int downFaces,
unsigned char *  downTypes 
)
protected

Build the list of downward faces from a list of vtk cells.

Parameters
ptslist of points id's defining an edge
vtkIdsvector of vtk id's
downFacesvector of face id's in downward structures
downTypesvector of face types
Returns
number of downward faces

References SMDS_Downward::_grid, SMDS_Downward::_nbDownCells, SMDS_UnstructuredGrid::CellIdToDownId(), SMDS_Downward::getCellDimension(), SMDS_UnstructuredGrid::getDownArray(), SMDS_Downward::getDownCells(), SMDS_Downward::getDownTypes(), SMDS_Downward::getNumberOfDownCells(), and SMDS_Down2D::isInFace().

int SMDS_Down1D::computeVtkCells ( int  cellId,
std::vector< int > &  vtkIds 
)
protected

Build the list of vtkUnstructuredGrid cells containing the edge.

We keep in the list the cells that contains all the nodes, we keep only volumes and faces.

Parameters
cellIdid of the edge in the downward structure
vtkIdsvector of vtk id's
Returns
number of vtk cells (size of vector)

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

Referenced by SMDS_UnstructuredGrid::BuildDownwardConnectivity().

int SMDS_Down1D::computeVtkCells ( int pts,
std::vector< int > &  vtkIds 
)
protected

Build the list of vtkUnstructuredGrid cells containing the edge.

Parameters
ptslist of points id's defining an edge
vtkIdsvector of vtk id's
Returns
number of vtk cells (size of vector)

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

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 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 computeFaces(), SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

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

Reimplemented from SMDS_Downward.

References SMDS_Downward::getNodeSet().

int SMDS_Down1D::getNodeSet ( int  cellId,
int nodeSet 
)
protectedvirtual
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 computeFaces(), SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

int SMDS_Down1D::getNumberOfUpCells ( int  cellId)
virtual

Implements SMDS_Downward.

References _upCellIndex.

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

Implements SMDS_Downward.

References _upCellIds, and _upCellIndex.

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

Implements SMDS_Downward.

References _upCellIndex, and _upCellTypes.

int SMDS_Downward::getVtkCellId ( int  cellId)
inherited
void SMDS_Down1D::initCell ( int  cellId)
protectedvirtual

clear vectors used to reference 2D cells containing the edge

Parameters
cellId

Reimplemented from SMDS_Downward.

References _upCellIdsVector, and _upCellTypesVector.

void SMDS_Down1D::setNodes ( int  cellId,
int  vtkId 
)
protected
void SMDS_Down1D::setNodes ( int  cellId,
const int nodeIds 
)
protected

Friends And Related Function Documentation

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_Down1D::_upCellIds
protected

compacted storage after connectivity calculation

Referenced by compactStorage(), getUpCells(), and SMDS_Down1D().

std::vector<std::vector<int> > SMDS_Down1D::_upCellIdsVector
protected

the number of faces sharing an edge is not known

Referenced by addUpCell(), allocate(), compactStorage(), initCell(), and SMDS_Down1D().

std::vector<int> SMDS_Down1D::_upCellIndex
protected

compacted storage after connectivity calculation

Referenced by compactStorage(), getNumberOfUpCells(), getUpCells(), getUpTypes(), and SMDS_Down1D().

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

compacted storage after connectivity calculation

Referenced by compactStorage(), getUpTypes(), and SMDS_Down1D().

std::vector<std::vector<unsigned char> > SMDS_Down1D::_upCellTypesVector
protected

the number of faces sharing an edge is not known

Referenced by addUpCell(), allocate(), compactStorage(), initCell(), and SMDS_Down1D().