Back to index

salome-smesh  6.5.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
SMDS_Downward Class Reference

#include <SMDS_Downward.hxx>

Inheritance diagram for SMDS_Downward:
Inheritance graph
[legend]
Collaboration diagram for SMDS_Downward:
Collaboration graph
[legend]

List of all members.

Public Member Functions

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)
virtual const int * getDownCells (int cellId)
 get a pointer on the downward entities id's associated to a cell.
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 (
virtual int getNumberOfUpCells (int cellId)=0
virtual const int * getUpCells (int cellId)=0
virtual const unsigned char * getUpTypes (int cellId)=0
virtual void getNodeIds (int cellId, std::set< int > &nodeSet)=0
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

Protected Member Functions

 SMDS_Downward (SMDS_UnstructuredGrid *grid, int nbDownCells)
 Generic constructor for all the downward connectivity structures (one per vtk cell type).
 ~SMDS_Downward ()
int addCell (int vtkId=-1)
 Give or create an entry for downward connectivity structure relative to a cell.
virtual void initCell (int cellId)
 generic method do nothing.
virtual void allocate (int nbElems)=0
virtual void compactStorage ()=0
virtual void addDownCell (int cellId, int lowCellId, unsigned char aType)
 Id's are downward connectivity id's.
virtual void addUpCell (int cellId, int upCellId, unsigned char aType)
 Id's are downward connectivity id's.
virtual int getNodeSet (int cellId, int *nodeSet)

Protected Attributes

SMDS_UnstructuredGrid_grid
int _maxId
int _nbDownCells
 the same number for all cells of a derived class
std::vector< int > _cellIds
 growing size: all the down cell id's, size = _maxId * _nbDownCells
std::vector< int > _vtkCellIds
 growing size: size = _maxId, either vtkId or -1
std::vector< unsigned char > _cellTypes
 fixed size: the same vector for all cells of a derived class

Static Protected Attributes

static std::vector< int > _cellDimension
 conversion table: type --> dimension

Friends

class SMDS_UnstructuredGrid
class SMDS_Down2D
class SMDS_Down3D

Detailed Description

Definition at line 67 of file SMDS_Downward.hxx.


Constructor & Destructor Documentation

SMDS_Downward::SMDS_Downward ( SMDS_UnstructuredGrid grid,
int  nbDownCells 
) [protected]

Generic constructor for all the downward connectivity structures (one per vtk cell type).

The static structure for cell dimension is set only once.

Parameters:
gridunstructured grid associated to the mesh.
nbDownCellsnumber of downward entities associated to this vtk type of cell.
Returns:

Definition at line 78 of file SMDS_Downward.cxx.

                                                                         :
  _grid(grid), _nbDownCells(nbDownCells)
{
  this->_maxId = 0;
  this->_cellIds.clear();
  this->_cellTypes.clear();
  if (_cellDimension.empty())
    getCellDimension( VTK_LINE );
}

Here is the call graph for this function:

Definition at line 88 of file SMDS_Downward.cxx.

{
}

Member Function Documentation

int SMDS_Downward::addCell ( int  vtkId = -1) [protected]

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.

Definition at line 99 of file SMDS_Downward.cxx.

{
  int localId = -1;
  if (vtkId >= 0)
    localId = _grid->CellIdToDownId(vtkId);
  if (localId >= 0)
    return localId;

  localId = this->_maxId;
  this->_maxId++;
  this->allocate(_maxId);
  if (vtkId >= 0)
    {
      this->_vtkCellIds[localId] = vtkId;
      _grid->setCellIdToDownId(vtkId, localId);
    }
  this->initCell(localId);
  return localId;
}

Here is the call graph for this function:

void SMDS_Downward::addDownCell ( int  cellId,
int  lowCellId,
unsigned char  aType 
) [protected, virtual]

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.

Definition at line 166 of file SMDS_Downward.cxx.

{
  ASSERT(0); // must be re-implemented in derived class
}
void SMDS_Downward::addUpCell ( int  cellId,
int  upCellId,
unsigned char  aType 
) [protected, virtual]

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 in SMDS_Down2D, and SMDS_Down1D.

Definition at line 177 of file SMDS_Downward.cxx.

{
  ASSERT(0); // must be re-implemented in derived class
}
virtual void SMDS_Downward::allocate ( int  nbElems) [protected, pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

Here is the caller graph for this function:

virtual void SMDS_Downward::compactStorage ( ) [protected, pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

int SMDS_Downward::getCellDimension ( unsigned char  cellType) [static]

get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type

Parameters:
cellTypevtk cell type
See also:
vtkCellType.h
Returns:
1,2 or 3

Definition at line 44 of file SMDS_Downward.cxx.

{
  if (_cellDimension.empty())
    {
      _cellDimension.resize(VTK_MAXTYPE + 1, 0);
      _cellDimension[VTK_LINE] = 1;
      _cellDimension[VTK_QUADRATIC_EDGE] = 1;
      _cellDimension[VTK_TRIANGLE] = 2;
      _cellDimension[VTK_QUADRATIC_TRIANGLE] = 2;
      _cellDimension[VTK_QUAD] = 2;
      _cellDimension[VTK_QUADRATIC_QUAD] = 2;
      _cellDimension[VTK_BIQUADRATIC_QUAD] = 2;
      _cellDimension[VTK_TETRA] = 3;
      _cellDimension[VTK_QUADRATIC_TETRA] = 3;
      _cellDimension[VTK_HEXAHEDRON] = 3;
      _cellDimension[VTK_QUADRATIC_HEXAHEDRON] = 3;
      _cellDimension[VTK_TRIQUADRATIC_HEXAHEDRON] = 3;
      _cellDimension[VTK_WEDGE] = 3;
      _cellDimension[VTK_QUADRATIC_WEDGE] = 3;
      _cellDimension[VTK_PYRAMID] = 3;
      _cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
      _cellDimension[VTK_HEXAGONAL_PRISM] = 3;
    }
  return _cellDimension[cellType];
}

Here is the caller graph for this function:

const int * SMDS_Downward::getDownCells ( int  cellId) [virtual]

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.

Definition at line 143 of file SMDS_Downward.cxx.

{
  //ASSERT((cellId >=0) && (cellId < _maxId));
  return &_cellIds[_nbDownCells * cellId];
}

Here is the caller graph for this function:

const unsigned char * SMDS_Downward::getDownTypes ( int  cellId) [virtual]

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.

Definition at line 155 of file SMDS_Downward.cxx.

{
  return &_cellTypes[0];
}

Here is the caller graph for this function:

int SMDS_Downward::getMaxId ( ) [inline]

Definition at line 86 of file SMDS_Downward.hxx.

  {
    return _maxId;
  }
virtual void SMDS_Downward::getNodeIds ( int  cellId,
std::set< int > &  nodeSet 
) [pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

virtual int SMDS_Downward::getNodes ( int  cellId,
int *  nodevec 
) [inline, virtual]

Reimplemented in SMDS_Down1D.

Definition at line 80 of file SMDS_Downward.hxx.

{return 0; }
int SMDS_Downward::getNodeSet ( int  cellId,
int *  nodeSet 
) [protected, virtual]

Reimplemented in SMDS_Down2D, and SMDS_Down1D.

Definition at line 182 of file SMDS_Downward.cxx.

{
  return 0;
}
int SMDS_Downward::getNumberOfDownCells ( int  cellId) [virtual]

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:

Definition at line 132 of file SMDS_Downward.cxx.

{
  return _nbDownCells;
}

Here is the caller graph for this function:

virtual int SMDS_Downward::getNumberOfUpCells ( int  cellId) [pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

virtual void SMDS_Downward::getOrderedNodesOfFace ( int  cellId,
std::vector< vtkIdType > &  orderedNodes 
) [inline, virtual]
virtual const int* SMDS_Downward::getUpCells ( int  cellId) [pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

virtual const unsigned char* SMDS_Downward::getUpTypes ( int  cellId) [pure virtual]

Implemented in SMDS_Down3D, SMDS_Down2D, and SMDS_Down1D.

int SMDS_Downward::getVtkCellId ( int  cellId) [inline]

Definition at line 82 of file SMDS_Downward.hxx.

  {
    return _vtkCellIds[cellId];
  }
void SMDS_Downward::initCell ( int  cellId) [protected, virtual]

generic method do nothing.

see derived methods

Parameters:
cellId

Reimplemented in SMDS_Down1D.

Definition at line 123 of file SMDS_Downward.cxx.

{
}

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class SMDS_Down2D [friend]

Definition at line 70 of file SMDS_Downward.hxx.

friend class SMDS_Down3D [friend]

Definition at line 71 of file SMDS_Downward.hxx.

friend class SMDS_UnstructuredGrid [friend]

Member Data Documentation

vector< int > SMDS_Downward::_cellDimension [static, protected]

conversion table: type --> dimension

Definition at line 109 of file SMDS_Downward.hxx.

std::vector<int> SMDS_Downward::_cellIds [protected]

growing size: all the down cell id's, size = _maxId * _nbDownCells

Definition at line 105 of file SMDS_Downward.hxx.

std::vector<unsigned char> SMDS_Downward::_cellTypes [protected]

fixed size: the same vector for all cells of a derived class

Definition at line 107 of file SMDS_Downward.hxx.

Definition at line 102 of file SMDS_Downward.hxx.

int SMDS_Downward::_maxId [protected]

Definition at line 103 of file SMDS_Downward.hxx.

int SMDS_Downward::_nbDownCells [protected]

the same number for all cells of a derived class

Definition at line 104 of file SMDS_Downward.hxx.

std::vector<int> SMDS_Downward::_vtkCellIds [protected]

growing size: size = _maxId, either vtkId or -1

Definition at line 106 of file SMDS_Downward.hxx.


The documentation for this class was generated from the following files: