#include <SMDS_Downward.hxx>

Public Member Functions | |
| virtual int | getNumberOfUpCells (int cellId) |
| virtual const int * | getUpCells (int cellId) |
| virtual const unsigned char * | getUpTypes (int cellId) |
| virtual void | getNodeIds (int cellId, std::set< int > &nodeSet) |
| virtual void | getOrderedNodesOfFace (int cellId, std::vector< vtkIdType > &orderedNodes)=0 |
| 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 | getNodes (int cellId, int *nodevec) |
| 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_Down3D (SMDS_UnstructuredGrid *grid, int nbDownCells) | |
| ~SMDS_Down3D () | |
| virtual void | allocate (int nbElems) |
| virtual void | compactStorage () |
| virtual void | computeFacesWithNodes (int cellId, ListElemByNodesType &facesWithNodes)=0 |
| int | FindFaceByNodes (int cellId, ElemByNodesType &faceByNodes) |
| 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 | 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 |
Definition at line 173 of file SMDS_Downward.hxx.
| SMDS_Down3D::SMDS_Down3D | ( | SMDS_UnstructuredGrid * | grid, |
| int | nbDownCells | ||
| ) | [protected] |
Definition at line 768 of file SMDS_Downward.cxx.
: SMDS_Downward(grid, nbDownCells) { }
| SMDS_Down3D::~SMDS_Down3D | ( | ) | [protected] |
Definition at line 773 of file SMDS_Downward.cxx.
{
}
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.
| vtkId | for a vtkUnstructuredGrid cell or -1 (default) for a created downward cell. |
Definition at line 112 of file SMDS_Downward.cxx.
References SMDS_Downward._grid, SMDS_Downward._maxId, SMDS_Downward._vtkCellIds, SMDS_Downward.allocate(), SMDS_UnstructuredGrid.CellIdToDownId(), SMDS_Downward.initCell(), and SMDS_UnstructuredGrid.setCellIdToDownId().
{
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;
}
| void SMDS_Downward::addDownCell | ( | int | cellId, |
| int | lowCellId, | ||
| unsigned char | aType | ||
| ) | [protected, virtual, inherited] |
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.
| cellId | index of the parent cell (dimension n) in the downward structure relative to a vtk cell type. |
| lowCellId | index of the children cell to add (dimension n-1) |
| aType | vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add). |
Reimplemented in SMDS_DownTriangle, SMDS_DownQuadTriangle, SMDS_DownQuadrangle, SMDS_DownQuadQuadrangle, SMDS_DownTetra, SMDS_DownQuadTetra, SMDS_DownPyramid, SMDS_DownQuadPyramid, SMDS_DownPenta, SMDS_DownQuadPenta, SMDS_DownHexa, and SMDS_DownQuadHexa.
Definition at line 179 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, inherited] |
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.
| cellId | index of the children cell (dimension n) in the downward structure relative to a vtk cell type. |
| upCellId | index of the parent cell to add (dimension n+1) |
| aType | vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add). |
Reimplemented in SMDS_Down1D, and SMDS_Down2D.
Definition at line 190 of file SMDS_Downward.cxx.
{
ASSERT(0); // must be re-implemented in derived class
}
| void SMDS_Down3D::allocate | ( | int | nbElems | ) | [protected, virtual] |
Implements SMDS_Downward.
Definition at line 777 of file SMDS_Downward.cxx.
References SMDS_Downward._cellIds, SMDS_Downward._nbDownCells, SMDS_Downward._vtkCellIds, and SMDS_Mesh.chunkSize.
{
if (nbElems >= _vtkCellIds.size())
{
_cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
_vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
}
}
| void SMDS_Down3D::compactStorage | ( | ) | [protected, virtual] |
Implements SMDS_Downward.
Definition at line 786 of file SMDS_Downward.cxx.
{
// nothing to do, size was known before
}
| virtual void SMDS_Down3D.computeFacesWithNodes | ( | int | cellId, |
| ListElemByNodesType & | facesWithNodes | ||
| ) | [protected, pure virtual] |
Implemented in SMDS_DownTetra, SMDS_DownQuadTetra, SMDS_DownPyramid, SMDS_DownQuadPyramid, SMDS_DownPenta, SMDS_DownQuadPenta, SMDS_DownHexa, and SMDS_DownQuadHexa.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().
| int SMDS_Down3D::FindFaceByNodes | ( | int | cellId, |
| ElemByNodesType & | faceByNodes | ||
| ) | [protected] |
Definition at line 816 of file SMDS_Downward.cxx.
References SMDS_Downward._cellIds, SMDS_Downward._cellTypes, SMDS_Downward._grid, SMDS_Downward._nbDownCells, ex21_lamp.faces, SMDS_UnstructuredGrid.getDownArray(), SMDS_Downward.getNodeSet(), ElemByNodesType.nbNodes, ElemByNodesType.nodeIds, SMESH_mechanic_editor.point, and ElemByNodesType.vtkType.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().
{
int *faces = &_cellIds[_nbDownCells * cellId];
int npoints = 0;
for (int i = 0; i < _nbDownCells; i++)
{
if ((faces[i] >= 0) && (faceByNodes.vtkType == _cellTypes[i]))
{
if (npoints == 0)
npoints = faceByNodes.nbNodes;
int nodeSet[10];
int npts = this->_grid->getDownArray(faceByNodes.vtkType)->getNodeSet(faces[i], nodeSet);
if (npts != npoints)
continue; // skip this face
bool found = false;
for (int j = 0; j < npts; j++)
{
int point = faceByNodes.nodeIds[j];
found = false;
for (int k = 0; k < npts; k++)
{
if (nodeSet[k] == point)
{
found = true;
break; // point j is in the 2 faces, skip remaining k values
}
}
if (!found)
break; // point j is not in the 2 faces, skip the remaining tests
}
if (found)
return faces[i];
}
}
return -1;
}
| int SMDS_Downward::getCellDimension | ( | unsigned char | cellType | ) | [static, inherited] |
get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type
| cellType | vtk cell type |
Definition at line 44 of file SMDS_Downward.cxx.
References VTK_MAXTYPE.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), SMDS_Down1D.computeFaces(), SMDS_Down2D.computeVolumeIdsFromNodesFace(), SMDS_Down1D.computeVtkCells(), SMDS_UnstructuredGrid.GetNeighbors(), SMDS_UnstructuredGrid.getOrderedNodesOfFace(), and SMDS_UnstructuredGrid.GetParentVolumes().
{
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_TETRA] = 3;
_cellDimension[VTK_QUADRATIC_TETRA] = 3;
_cellDimension[VTK_HEXAHEDRON] = 3;
_cellDimension[VTK_QUADRATIC_HEXAHEDRON] = 3;
_cellDimension[VTK_WEDGE] = 3;
_cellDimension[VTK_QUADRATIC_WEDGE] = 3;
_cellDimension[VTK_PYRAMID] = 3;
_cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
}
return _cellDimension[cellType];
}
get a pointer on the downward entities id's associated to a cell.
| cellId | index of the cell in the downward structure relative to a given vtk cell type. |
Definition at line 156 of file SMDS_Downward.cxx.
References SMDS_Downward._cellIds, and SMDS_Downward._nbDownCells.
Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().
{
//ASSERT((cellId >=0) && (cellId < _maxId));
return &_cellIds[_nbDownCells * cellId];
}
| const unsigned char * SMDS_Downward::getDownTypes | ( | int | cellId | ) | [virtual, inherited] |
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 (
| cellId | index of the cell in the downward structure relative to a vtk cell type. |
Definition at line 168 of file SMDS_Downward.cxx.
References SMDS_Downward._cellTypes.
Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().
{
return &_cellTypes[0];
}
| int SMDS_Downward.getMaxId | ( | ) | [inherited] |
Definition at line 85 of file SMDS_Downward.hxx.
References SMDS_Downward._maxId.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity().
{
return _maxId;
}
Implements SMDS_Downward.
Definition at line 806 of file SMDS_Downward.cxx.
References SMDS_Downward._grid, SMDS_Downward._vtkCellIds, and SMESH_AdvancedEditor.nodes.
{
int vtkId = this->_vtkCellIds[cellId];
vtkIdType npts = 0;
vtkIdType *nodes; // will refer to the point id's of the volume
_grid->GetCellPoints(vtkId, npts, nodes);
for (int i = 0; i < npts; i++)
nodeSet.insert(nodes[i]);
}
Reimplemented in SMDS_Down1D.
Definition at line 80 of file SMDS_Downward.hxx.
Referenced by SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().
{return 0; }
Reimplemented in SMDS_Down1D, and SMDS_Down2D.
Definition at line 195 of file SMDS_Downward.cxx.
Referenced by SMDS_Down2D.FindEdgeByNodes(), and FindFaceByNodes().
{
return 0;
}
Get the number of downward entities associated to a cell (always the same for a given vtk type of cell)
| cellId | not used here. |
Definition at line 145 of file SMDS_Downward.cxx.
References SMDS_Downward._nbDownCells.
Referenced by SMDS_Down1D.computeFaces(), and SMESH_MeshEditor.DoubleNodesOnGroupBoundaries().
{
return _nbDownCells;
}
| virtual void SMDS_Down3D.getOrderedNodesOfFace | ( | int | cellId, |
| std::vector< vtkIdType > & | orderedNodes | ||
| ) | [pure virtual] |
Implemented in SMDS_DownTetra, SMDS_DownQuadTetra, SMDS_DownPyramid, SMDS_DownQuadPyramid, SMDS_DownPenta, SMDS_DownQuadPenta, SMDS_DownHexa, and SMDS_DownQuadHexa.
Referenced by SMDS_UnstructuredGrid.getOrderedNodesOfFace().
| const unsigned char * SMDS_Down3D::getUpTypes | ( | int | cellId | ) | [virtual] |
Definition at line 81 of file SMDS_Downward.hxx.
References SMDS_Downward._vtkCellIds.
{
return _vtkCellIds[cellId];
}
| void SMDS_Downward::initCell | ( | int | cellId | ) | [protected, virtual, inherited] |
generic method do nothing.
see derived methods
| cellId |
Reimplemented in SMDS_Down1D.
Definition at line 136 of file SMDS_Downward.cxx.
Referenced by SMDS_Downward.addCell().
{
}
friend class SMDS_UnstructuredGrid [friend] |
Reimplemented from SMDS_Downward.
Reimplemented in SMDS_DownTetra, SMDS_DownQuadTetra, SMDS_DownPyramid, SMDS_DownQuadPyramid, SMDS_DownPenta, SMDS_DownQuadPenta, SMDS_DownHexa, and SMDS_DownQuadHexa.
Definition at line 175 of file SMDS_Downward.hxx.
vector< int > SMDS_Downward::_cellDimension [static, protected, inherited] |
conversion table: type --> dimension
Definition at line 108 of file SMDS_Downward.hxx.
Referenced by SMDS_Downward.SMDS_Downward().
std::vector<int> SMDS_Downward._cellIds [protected, inherited] |
growing size: all the down cell id's, size = _maxId * _nbDownCells
Definition at line 104 of file SMDS_Downward.hxx.
Referenced by SMDS_DownQuadHexa.addDownCell(), SMDS_DownHexa.addDownCell(), SMDS_DownQuadPenta.addDownCell(), SMDS_DownPenta.addDownCell(), SMDS_DownQuadPyramid.addDownCell(), SMDS_DownPyramid.addDownCell(), SMDS_DownQuadTetra.addDownCell(), SMDS_DownTetra.addDownCell(), SMDS_DownQuadQuadrangle.addDownCell(), SMDS_DownQuadrangle.addDownCell(), SMDS_DownQuadTriangle.addDownCell(), SMDS_DownTriangle.addDownCell(), allocate(), SMDS_Down2D.allocate(), SMDS_Down1D.allocate(), SMDS_Down2D.compactStorage(), SMDS_Down1D.compactStorage(), SMDS_Down1D.computeFaces(), SMDS_Down1D.computeVtkCells(), SMDS_Down2D.FindEdgeByNodes(), FindFaceByNodes(), SMDS_Downward.getDownCells(), SMDS_Down2D.getNodeIds(), SMDS_Down1D.getNodeIds(), SMDS_Down1D.getNodeSet(), SMDS_Down1D.setNodes(), and SMDS_Downward.SMDS_Downward().
std::vector<unsigned char> SMDS_Downward._cellTypes [protected, inherited] |
fixed size: the same vector for all cells of a derived class
Definition at line 106 of file SMDS_Downward.hxx.
Referenced by SMDS_Down2D.FindEdgeByNodes(), FindFaceByNodes(), SMDS_Downward.getDownTypes(), SMDS_Down2D.getNodeIds(), SMDS_DownEdge.SMDS_DownEdge(), SMDS_DownHexa.SMDS_DownHexa(), SMDS_DownPenta.SMDS_DownPenta(), SMDS_DownPyramid.SMDS_DownPyramid(), SMDS_DownQuadEdge.SMDS_DownQuadEdge(), SMDS_DownQuadHexa.SMDS_DownQuadHexa(), SMDS_DownQuadPenta.SMDS_DownQuadPenta(), SMDS_DownQuadPyramid.SMDS_DownQuadPyramid(), SMDS_DownQuadQuadrangle.SMDS_DownQuadQuadrangle(), SMDS_DownQuadrangle.SMDS_DownQuadrangle(), SMDS_DownQuadTetra.SMDS_DownQuadTetra(), SMDS_DownQuadTriangle.SMDS_DownQuadTriangle(), SMDS_DownTetra.SMDS_DownTetra(), SMDS_DownTriangle.SMDS_DownTriangle(), and SMDS_Downward.SMDS_Downward().
SMDS_UnstructuredGrid* SMDS_Downward._grid [protected, inherited] |
Definition at line 101 of file SMDS_Downward.hxx.
Referenced by SMDS_Downward.addCell(), SMDS_Down1D.computeFaces(), SMDS_DownQuadHexa.computeFacesWithNodes(), SMDS_DownHexa.computeFacesWithNodes(), SMDS_DownQuadPenta.computeFacesWithNodes(), SMDS_DownPenta.computeFacesWithNodes(), SMDS_DownQuadPyramid.computeFacesWithNodes(), SMDS_DownPyramid.computeFacesWithNodes(), SMDS_DownQuadTetra.computeFacesWithNodes(), SMDS_DownTetra.computeFacesWithNodes(), SMDS_Down2D.computeVolumeIds(), SMDS_Down2D.computeVolumeIdsFromNodesFace(), SMDS_Down1D.computeVtkCells(), SMDS_Down2D.FindEdgeByNodes(), FindFaceByNodes(), getNodeIds(), SMDS_Down2D.getNodeIds(), SMDS_DownQuadHexa.getOrderedNodesOfFace(), SMDS_DownHexa.getOrderedNodesOfFace(), SMDS_DownQuadPenta.getOrderedNodesOfFace(), SMDS_DownPenta.getOrderedNodesOfFace(), SMDS_DownQuadPyramid.getOrderedNodesOfFace(), SMDS_DownPyramid.getOrderedNodesOfFace(), SMDS_DownQuadTetra.getOrderedNodesOfFace(), SMDS_DownTetra.getOrderedNodesOfFace(), SMDS_Down1D.setNodes(), and SMDS_Down2D.setTempNodes().
int SMDS_Downward._maxId [protected, inherited] |
Definition at line 102 of file SMDS_Downward.hxx.
Referenced by SMDS_Downward.addCell(), SMDS_Down2D.compactStorage(), SMDS_Down1D.compactStorage(), SMDS_Downward.getMaxId(), and SMDS_Downward.SMDS_Downward().
int SMDS_Downward._nbDownCells [protected, inherited] |
the same number for all cells of a derived class
Definition at line 103 of file SMDS_Downward.hxx.
Referenced by SMDS_DownQuadHexa.addDownCell(), SMDS_DownHexa.addDownCell(), SMDS_DownQuadPenta.addDownCell(), SMDS_DownPenta.addDownCell(), SMDS_DownQuadPyramid.addDownCell(), SMDS_DownPyramid.addDownCell(), SMDS_DownQuadTetra.addDownCell(), SMDS_DownTetra.addDownCell(), SMDS_DownQuadQuadrangle.addDownCell(), SMDS_DownQuadrangle.addDownCell(), SMDS_DownQuadTriangle.addDownCell(), SMDS_DownTriangle.addDownCell(), allocate(), SMDS_Down2D.allocate(), SMDS_Down1D.allocate(), SMDS_Down2D.compactStorage(), SMDS_Down1D.compactStorage(), SMDS_Down1D.computeFaces(), SMDS_Down1D.computeVtkCells(), SMDS_Down2D.FindEdgeByNodes(), FindFaceByNodes(), SMDS_Downward.getDownCells(), SMDS_Down2D.getNodeIds(), SMDS_Down1D.getNodeIds(), SMDS_Down1D.getNodeSet(), SMDS_Downward.getNumberOfDownCells(), and SMDS_Down1D.setNodes().
std::vector<int> SMDS_Downward._vtkCellIds [protected, inherited] |
growing size: size = _maxId, either vtkId or -1
Definition at line 105 of file SMDS_Downward.hxx.
Referenced by SMDS_Downward.addCell(), allocate(), SMDS_Down2D.allocate(), SMDS_Down1D.allocate(), SMDS_Down2D.compactStorage(), SMDS_Down1D.compactStorage(), getNodeIds(), SMDS_DownQuadHexa.getOrderedNodesOfFace(), SMDS_DownHexa.getOrderedNodesOfFace(), SMDS_DownQuadPenta.getOrderedNodesOfFace(), SMDS_DownPenta.getOrderedNodesOfFace(), SMDS_DownQuadPyramid.getOrderedNodesOfFace(), SMDS_DownPyramid.getOrderedNodesOfFace(), SMDS_DownQuadTetra.getOrderedNodesOfFace(), SMDS_DownTetra.getOrderedNodesOfFace(), and SMDS_Downward.getVtkCellId().