4 * Created on: Jun 3, 2010
8 #include "SMDS_Downward.hxx"
9 #include "SMDS_Mesh.hxx"
10 #include "utilities.h"
12 #include <vtkCellType.h>
13 #include <vtkCellLinks.h>
19 // ---------------------------------------------------------------------------
21 vector<int> SMDS_Downward::_cellDimension;
23 /*! get the dimension of a cell (1,2,3 for 1D, 2D 3D) given the vtk cell type
25 * @param cellType vtk cell type @see vtkCellType.h
28 int SMDS_Downward::getCellDimension(unsigned char cellType)
30 return _cellDimension[cellType];
33 // ---------------------------------------------------------------------------
35 /*! Generic constructor for all the downward connectivity structures (one per vtk cell type).
36 * The static structure for cell dimension is set only once.
37 * @param grid unstructured grid associated to the mesh.
38 * @param nbDownCells number of downward entities associated to this vtk type of cell.
41 SMDS_Downward::SMDS_Downward(SMDS_UnstructuredGrid *grid, int nbDownCells) :
42 _grid(grid), _nbDownCells(nbDownCells)
45 this->_cellIds.clear();
46 this->_cellTypes.clear();
47 if (_cellDimension.empty())
49 _cellDimension.resize(VTK_MAXTYPE + 1, 0);
50 _cellDimension[VTK_LINE] = 1;
51 _cellDimension[VTK_QUADRATIC_EDGE] = 1;
52 _cellDimension[VTK_TRIANGLE] = 2;
53 _cellDimension[VTK_QUADRATIC_TRIANGLE] = 2;
54 _cellDimension[VTK_QUAD] = 2;
55 _cellDimension[VTK_QUADRATIC_QUAD] = 2;
56 _cellDimension[VTK_TETRA] = 3;
57 _cellDimension[VTK_QUADRATIC_TETRA] = 3;
58 _cellDimension[VTK_HEXAHEDRON] = 3;
59 _cellDimension[VTK_QUADRATIC_HEXAHEDRON] = 3;
60 _cellDimension[VTK_WEDGE] = 3;
61 _cellDimension[VTK_QUADRATIC_WEDGE] = 3;
62 _cellDimension[VTK_PYRAMID] = 3;
63 _cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
67 SMDS_Downward::~SMDS_Downward()
71 /*! Give or create an entry for downward connectivity structure relative to a cell.
72 * If the entry already exists, just return its id, otherwise, create it.
73 * The internal storage memory is allocated if needed.
74 * The SMDS_UnstructuredGrid::_cellIdToDownId vector is completed for vtkUnstructuredGrid cells.
75 * @param vtkId for a vtkUnstructuredGrid cell or -1 (default) for a created downward cell.
76 * @return the rank in downward[vtkType] structure.
78 int SMDS_Downward::addCell(int vtkId)
82 localId = _grid->CellIdToDownId(vtkId);
86 localId = this->_maxId;
88 this->allocate(_maxId);
91 this->_vtkCellIds[localId] = vtkId;
92 _grid->setCellIdToDownId(vtkId, localId);
94 this->initCell(localId);
98 /*! generic method do nothing. see derived methods
102 void SMDS_Downward::initCell(int cellId)
106 /*! Get the number of downward entities associated to a cell (always the same for a given vtk type of cell)
108 * @param cellId not used here.
111 int SMDS_Downward::getNumberOfDownCells(int cellId)
116 /*! get a pointer on the downward entities id's associated to a cell.
117 * @see SMDS_Downward::getNumberOfDownCells for the number of downward entities.
118 * @see SMDS_Downward::getDownTypes for the vtk cell types associated to the downward entities.
119 * @param cellId index of the cell in the downward structure relative to a given vtk cell type.
120 * @return table of downward entities id's.
122 const int* SMDS_Downward::getDownCells(int cellId)
124 //ASSERT((cellId >=0) && (cellId < _maxId));
125 return &_cellIds[_nbDownCells * cellId];
128 /*! get a list of vtk cell types associated to downward entities of a given cell, in the same order
129 * than the downward entities id's list (@see SMDS_Downward::getDownCells).
131 * @param cellId index of the cell in the downward structure relative to a vtk cell type.
132 * @return table of downward entities types.
134 const unsigned char* SMDS_Downward::getDownTypes(int cellId)
136 return &_cellTypes[0];
139 /*! add a downward entity of dimension n-1 (cell or node) to a given cell.
140 * Actual implementation is done in derived methods.
141 * @param cellId index of the parent cell (dimension n) in the downward structure relative to a vtk cell type.
142 * @param lowCellId index of the children cell to add (dimension n-1)
143 * @param aType vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).
145 void SMDS_Downward::addDownCell(int cellId, int lowCellId, unsigned char aType)
147 ASSERT(0); // must be re-implemented in derived class
150 /*! add a downward entity of dimension n+1 to a given cell.
151 * Actual implementation is done in derived methods.
152 * @param cellId index of the children cell (dimension n) in the downward structure relative to a vtk cell type.
153 * @param upCellId index of the parent cell to add (dimension n+1)
154 * @param aType vtk cell type of the cell to add (needed to find the SMDS_Downward structure containing the cell to add).
156 void SMDS_Downward::addUpCell(int cellId, int upCellId, unsigned char aType)
158 ASSERT(0); // must be re-implemented in derived class
161 int SMDS_Downward::getNodeSet(int cellId, int* nodeSet)
166 // ---------------------------------------------------------------------------
168 SMDS_Down1D::SMDS_Down1D(SMDS_UnstructuredGrid *grid, int nbDownCells) :
169 SMDS_Downward(grid, nbDownCells)
171 _upCellIdsVector.clear();
172 _upCellTypesVector.clear();
174 _upCellTypes.clear();
175 _upCellIndex.clear();
178 SMDS_Down1D::~SMDS_Down1D()
182 /*! clear vectors used to reference 2D cells containing the edge
186 void SMDS_Down1D::initCell(int cellId)
188 _upCellIdsVector[cellId].clear();
189 _upCellTypesVector[cellId].clear();
192 /*! Resize the downward connectivity storage vector if needed.
194 * @param nbElems total number of elements of the same type required
196 void SMDS_Down1D::allocate(int nbElems)
198 if (nbElems >= _vtkCellIds.size())
200 _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
201 _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
202 _upCellIdsVector.resize(nbElems + SMDS_Mesh::chunkSize);
203 _upCellTypesVector.resize(nbElems + SMDS_Mesh::chunkSize);
207 void SMDS_Down1D::compactStorage()
209 _cellIds.resize(_nbDownCells * _maxId);
210 _vtkCellIds.resize(_maxId);
213 for (int i = 0; i < _maxId; i++)
214 sizeUpCells += _upCellIdsVector[i].size();
215 _upCellIds.resize(sizeUpCells, -1);
216 _upCellTypes.resize(sizeUpCells);
217 _upCellIndex.resize(_maxId + 1, -1); // id and types of rank i correspond to [ _upCellIndex[i], _upCellIndex[i+1] [
219 for (int i = 0; i < _maxId; i++)
221 _upCellIndex[i] = current;
222 for (int j = 0; j < _upCellIdsVector[i].size(); j++)
224 _upCellIds[current] = _upCellIdsVector[i][j];
225 _upCellTypes[current] = _upCellTypesVector[i][j];
229 _upCellIndex[_maxId] = current;
231 _upCellIdsVector.clear();
232 _upCellTypesVector.clear();
235 void SMDS_Down1D::addUpCell(int cellId, int upCellId, unsigned char aType)
237 //ASSERT((cellId >=0) && (cellId < _maxId));
238 int nbFaces = _upCellIdsVector[cellId].size();
239 for (int i = 0; i < nbFaces; i++)
241 if ((_upCellIdsVector[cellId][i] == upCellId) && (_upCellTypesVector[cellId][i] == aType))
243 return; // already done
246 _upCellIdsVector[cellId].push_back(upCellId);
247 _upCellTypesVector[cellId].push_back(aType);
250 int SMDS_Down1D::getNumberOfUpCells(int cellId)
252 //ASSERT((cellId >=0) && (cellId < _maxId));
253 return _upCellIndex[cellId + 1] - _upCellIndex[cellId];
256 const int* SMDS_Down1D::getUpCells(int cellId)
258 //ASSERT((cellId >=0) && (cellId < _maxId));
259 return &_upCellIds[_upCellIndex[cellId]];
262 const unsigned char* SMDS_Down1D::getUpTypes(int cellId)
264 //ASSERT((cellId >=0) && (cellId < _maxId));
265 return &_upCellTypes[_upCellIndex[cellId]];
268 void SMDS_Down1D::getNodeIds(int cellId, std::set<int>& nodeSet)
270 for (int i = 0; i < _nbDownCells; i++)
271 nodeSet.insert(_cellIds[_nbDownCells * cellId + i]);
274 int SMDS_Down1D::getNodeSet(int cellId, int* nodeSet)
276 for (int i = 0; i < _nbDownCells; i++)
277 nodeSet[i] = _cellIds[_nbDownCells * cellId + i];
281 void SMDS_Down1D::setNodes(int cellId, int vtkId)
284 vtkIdType *pts; // will refer to the point id's of the face
285 _grid->GetCellPoints(vtkId, npts, pts);
286 // MESSAGE(vtkId << " " << npts << " " << _nbDownCells);
287 //ASSERT(npts == _nbDownCells);
288 for (int i = 0; i < npts; i++)
290 _cellIds[_nbDownCells * cellId + i] = pts[i];
294 void SMDS_Down1D::setNodes(int cellId, const int* nodeIds)
296 //ASSERT(nodeIds.size() == _nbDownCells);
297 for (int i = 0; i < _nbDownCells; i++)
299 _cellIds[_nbDownCells * cellId + i] = nodeIds[i];
303 /*! Build the list of vtkUnstructuredGrid cells containing the edge.
304 * We keep in the list the cells that contains all the nodes, we keep only volumes and faces.
305 * @param cellId id of the edge in the downward structure
306 * @param vtkIds vector of vtk id's
307 * @return number of vtk cells (size of vector)
309 int SMDS_Down1D::computeVtkCells(int cellId, std::vector<int>& vtkIds)
313 // --- find all the cells the points belong to, and how many of the points belong to a given cell
315 int *pts = &_cellIds[_nbDownCells * cellId];
316 int ncells = this->computeVtkCells(pts, vtkIds);
320 /*! Build the list of vtkUnstructuredGrid cells containing the edge.
322 * @param pts list of points id's defining an edge
323 * @param vtkIds vector of vtk id's
324 * @return number of vtk cells (size of vector)
326 int SMDS_Down1D::computeVtkCells(int *pts, std::vector<int>& vtkIds)
329 // --- find all the cells the points belong to, and how many of the points belong to a given cell
334 for (int i = 0; i < _nbDownCells; i++)
336 vtkIdType point = pts[i];
337 int numCells = _grid->GetLinks()->GetNcells(point);
338 vtkIdType *cells = _grid->GetLinks()->GetCells(point);
339 for (int j = 0; j < numCells; j++)
341 int vtkCellId = cells[j];
343 for (int k = 0; k < cnt; k++)
345 if (cellIds[k] == vtkCellId)
354 cellIds[cnt] = vtkCellId;
356 // TODO ASSERT(cnt<1000);
362 // --- find the face and volume cells: they contains all the points and are of type volume or face
365 for (int i = 0; i < cnt; i++)
367 if (cellCnt[i] == _nbDownCells)
369 int vtkElemId = cellIds[i];
370 int vtkType = _grid->GetCellType(vtkElemId);
371 if (SMDS_Downward::getCellDimension(vtkType) > 1)
373 vtkIds.push_back(vtkElemId);
382 /*! Build the list of downward faces from a list of vtk cells.
384 * @param cellId id of the edge in the downward structure
385 * @param vtkIds vector of vtk id's
386 * @param downFaces vector of face id's in downward structures
387 * @param downTypes vector of face types
388 * @return number of downward faces
390 int SMDS_Down1D::computeFaces(int cellId, int* vtkIds, int nbcells, int* downFaces, unsigned char* downTypes)
392 int *pts = &_cellIds[_nbDownCells * cellId];
393 int nbFaces = this->computeFaces(pts, vtkIds, nbcells, downFaces, downTypes);
397 /*! Build the list of downward faces from a list of vtk cells.
399 * @param pts list of points id's defining an edge
400 * @param vtkIds vector of vtk id's
401 * @param downFaces vector of face id's in downward structures
402 * @param downTypes vector of face types
403 * @return number of downward faces
405 int SMDS_Down1D::computeFaces(int* pts, int* vtkIds, int nbcells, int* downFaces, unsigned char* downTypes)
408 for (int i = 0; i < nbcells; i++)
410 int vtkId = vtkIds[i];
411 int vtkType = _grid->GetCellType(vtkId);
412 if (SMDS_Downward::getCellDimension(vtkType) == 2)
414 int faceId = _grid->CellIdToDownId(vtkId);
415 downFaces[cnt] = faceId;
416 downTypes[cnt] = vtkType;
421 int volId = _grid->CellIdToDownId(vtkId);
422 SMDS_Downward * downvol = _grid->getDownArray(vtkType);
423 //const int *downIds = downvol->getDownCells(volId);
424 const unsigned char* downTypesVol = downvol->getDownTypes(volId);
425 int nbFaces = downvol->getNumberOfDownCells(volId);
426 const int* faceIds = downvol->getDownCells(volId);
427 for (int n = 0; n < nbFaces; n++)
429 SMDS_Down2D *downFace = static_cast<SMDS_Down2D*> (_grid->getDownArray(downTypesVol[n]));
430 bool isInFace = downFace->isInFace(faceIds[n], pts, _nbDownCells);
433 bool alreadySet = false;
434 for (int k = 0; k < cnt; k++)
435 if (faceIds[n] == downFaces[k])
442 downFaces[cnt] = faceIds[n];
443 downTypes[cnt] = downTypesVol[n];
453 // ---------------------------------------------------------------------------
455 SMDS_Down2D::SMDS_Down2D(SMDS_UnstructuredGrid *grid, int nbDownCells) :
456 SMDS_Downward(grid, nbDownCells)
459 _upCellTypes.clear();
464 SMDS_Down2D::~SMDS_Down2D()
468 int SMDS_Down2D::getNumberOfUpCells(int cellId)
471 if (_upCellIds[2 * cellId] >= 0)
473 if (_upCellIds[2 * cellId + 1] >= 0)
478 const int* SMDS_Down2D::getUpCells(int cellId)
480 //ASSERT((cellId >=0) && (cellId < _maxId));
481 return &_upCellIds[2 * cellId];
484 const unsigned char* SMDS_Down2D::getUpTypes(int cellId)
486 //ASSERT((cellId >=0) && (cellId < _maxId));
487 return &_upCellTypes[2 * cellId];
490 void SMDS_Down2D::getNodeIds(int cellId, std::set<int>& nodeSet)
492 for (int i = 0; i < _nbDownCells; i++)
494 int downCellId = _cellIds[_nbDownCells * cellId + i];
495 unsigned char cellType = _cellTypes[i];
496 this->_grid->getDownArray(cellType)->getNodeIds(downCellId, nodeSet);
500 /*! Find in vtkUnstructuredGrid the volumes containing a face already stored in vtkUnstructuredGrid.
501 * Search the volumes containing a face, to store the info in SMDS_Down2D for later uses
502 * with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes.
503 * A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.
504 * @param cellId the face cell id in vkUnstructuredGrid
505 * @param ids a couple of vtkId, initialized at -1 (no parent volume)
506 * @return number of volumes (0, 1 or 2)
508 int SMDS_Down2D::computeVolumeIds(int cellId, int* ids)
510 // --- find point id's of the face
513 vtkIdType *pts; // will refer to the point id's of the face
514 _grid->GetCellPoints(cellId, npts, pts);
516 for (int i = 0; i < npts; i++)
517 nodes.push_back(pts[i]);
518 int nvol = this->computeVolumeIdsFromNodesFace(&nodes[0], npts, ids);
522 /*! Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes
523 * Search the volumes containing a face, to store the info in SMDS_Down2D for later uses
524 * with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes.
525 * A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.
527 * @param ids a couple of vtkId, initialized at -1 (no parent volume)
528 * @return number of volumes (0, 1 or 2)
530 int SMDS_Down2D::computeVolumeIds(ElemByNodesType& faceByNodes, int* ids)
532 int nvol = this->computeVolumeIdsFromNodesFace(&faceByNodes.nodeIds[0], faceByNodes.nbNodes, ids);
536 /*! Find in vtkUnstructuredGrid the volumes containing a face described by it's nodes
537 * Search the volumes containing a face, to store the info in SMDS_Down2D for later uses
538 * with SMDS_Down2D::getUpCells and SMDS_Down2D::getUpTypes.
539 * A face belongs to 0, 1 or 2 volumes, identified by their id in vtkUnstructuredGrid.
540 * @param pts array of vtk node id's
541 * @param npts number of nodes
543 * @return number of volumes (0, 1 or 2)
545 int SMDS_Down2D::computeVolumeIdsFromNodesFace(int* pts, int npts, int* ids)
548 // --- find all the cells the points belong to, and how many of the points belong to a given cell
553 for (int i = 0; i < npts; i++)
555 vtkIdType point = pts[i];
556 int numCells = _grid->GetLinks()->GetNcells(point);
557 //MESSAGE("cells pour " << i << " " << numCells);
558 vtkIdType *cells = _grid->GetLinks()->GetCells(point);
559 for (int j = 0; j < numCells; j++)
561 int vtkCellId = cells[j];
563 for (int k = 0; k < cnt; k++)
565 if (cellIds[k] == vtkCellId)
574 cellIds[cnt] = vtkCellId;
576 // TODO ASSERT(cnt<1000);
582 // --- find the volume cells: they contains all the points and are of type volume
585 for (int i = 0; i < cnt; i++)
587 //MESSAGE("cell " << cellIds[i] << " points " << cellCnt[i]);
588 if (cellCnt[i] == npts)
590 int vtkElemId = cellIds[i];
591 int vtkType = _grid->GetCellType(vtkElemId);
592 if (SMDS_Downward::getCellDimension(vtkType) == 3)
594 ids[nvol] = vtkElemId; // store the volume id in given vector
605 void SMDS_Down2D::setTempNodes(int cellId, int vtkId)
608 vtkIdType *pts; // will refer to the point id's of the face
609 _grid->GetCellPoints(vtkId, npts, pts);
610 // MESSAGE(vtkId << " " << npts << " " << _nbNodes);
611 //ASSERT(npts == _nbNodes);
612 for (int i = 0; i < npts; i++)
614 _tempNodes[_nbNodes * cellId + i] = pts[i];
618 void SMDS_Down2D::setTempNodes(int cellId, ElemByNodesType& faceByNodes)
620 for (int i = 0; i < faceByNodes.nbNodes; i++)
621 _tempNodes[_nbNodes * cellId + i] = faceByNodes.nodeIds[i];
624 /*! Find if all the nodes belongs to the face.
626 * @param cellId the face cell Id
627 * @param nodeSet set of node id's to be found in the face list of nodes
630 bool SMDS_Down2D::isInFace(int cellId, int *pts, int npts)
633 int *nodes = &_tempNodes[_nbNodes * cellId];
634 for (int j = 0; j < npts; j++)
637 for (int i = 0; i < _nbNodes; i++)
639 if (nodes[i] == point)
646 return (nbFound == npts);
649 /*! Resize the downward connectivity storage vector if needed.
651 * @param nbElems total number of elements of the same type required
653 void SMDS_Down2D::allocate(int nbElems)
655 if (nbElems >= _vtkCellIds.size())
657 _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
658 _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
659 _upCellIds.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
660 _upCellTypes.resize(2 * (nbElems + SMDS_Mesh::chunkSize), -1);
661 _tempNodes.resize(_nbNodes * (nbElems + SMDS_Mesh::chunkSize), -1);
665 void SMDS_Down2D::compactStorage()
667 _cellIds.resize(_nbDownCells * _maxId);
668 _upCellIds.resize(2 * _maxId);
669 _upCellTypes.resize(2 * _maxId);
670 _vtkCellIds.resize(_maxId);
674 void SMDS_Down2D::addUpCell(int cellId, int upCellId, unsigned char aType)
676 //ASSERT((cellId >=0)&& (cellId < _maxId));
677 int *vols = &_upCellIds[2 * cellId];
678 unsigned char *types = &_upCellTypes[2 * cellId];
679 for (int i = 0; i < 2; i++)
683 vols[i] = upCellId; // use non affected volume
687 if ((vols[i] == upCellId) && (types[i] == aType)) // already done
693 int SMDS_Down2D::getNodeSet(int cellId, int* nodeSet)
695 for (int i = 0; i < _nbNodes; i++)
696 nodeSet[i] = _tempNodes[_nbNodes * cellId + i];
700 int SMDS_Down2D::FindEdgeByNodes(int cellId, ElemByNodesType& edgeByNodes)
702 int *edges = &_cellIds[_nbDownCells * cellId];
703 for (int i = 0; i < _nbDownCells; i++)
705 if ((edges[i] >= 0) && (edgeByNodes.vtkType == _cellTypes[i]))
708 int npts = this->_grid->getDownArray(edgeByNodes.vtkType)->getNodeSet(edges[i], nodeSet);
710 for (int j = 0; j < npts; j++)
712 int point = edgeByNodes.nodeIds[j];
714 for (int k = 0; k < npts; k++)
716 if (nodeSet[k] == point)
732 // ---------------------------------------------------------------------------
734 SMDS_Down3D::SMDS_Down3D(SMDS_UnstructuredGrid *grid, int nbDownCells) :
735 SMDS_Downward(grid, nbDownCells)
739 SMDS_Down3D::~SMDS_Down3D()
743 void SMDS_Down3D::allocate(int nbElems)
745 if (nbElems >= _vtkCellIds.size())
747 _cellIds.resize(_nbDownCells * (nbElems + SMDS_Mesh::chunkSize), -1);
748 _vtkCellIds.resize(nbElems + SMDS_Mesh::chunkSize, -1);
752 void SMDS_Down3D::compactStorage()
754 // nothing to do, size was known before
757 int SMDS_Down3D::getNumberOfUpCells(int cellId)
762 const int* SMDS_Down3D::getUpCells(int cellId)
767 const unsigned char* SMDS_Down3D::getUpTypes(int cellId)
772 void SMDS_Down3D::getNodeIds(int cellId, std::set<int>& nodeSet)
774 int vtkId = this->_vtkCellIds[cellId];
776 vtkIdType *nodes; // will refer to the point id's of the volume
777 _grid->GetCellPoints(vtkId, npts, nodes);
778 for (int i = 0; i < npts; i++)
779 nodeSet.insert(nodes[i]);
782 int SMDS_Down3D::FindFaceByNodes(int cellId, ElemByNodesType& faceByNodes)
784 int *faces = &_cellIds[_nbDownCells * cellId];
788 for (int i = 0; i < _nbDownCells; i++)
790 if ((faces[i] >= 0) && (faceByNodes.vtkType == _cellTypes[i]))
794 for (int j = 0; j < faceByNodes.nbNodes; j++)
795 faceNodeSet[j] = faceByNodes.nodeIds[j];
796 npoints = faceByNodes.nbNodes;
800 int npts = this->_grid->getDownArray(faceByNodes.vtkType)->getNodeSet(faces[i], nodeSet);
802 continue; // skip this face
804 for (int j = 0; j < npts; j++)
806 int point = faceByNodes.nodeIds[j];
808 for (int k = 0; k < npts; k++)
810 if (nodeSet[k] == point)
813 break; // point j is in the 2 faces, skip remaining k values
817 break; // point j is not in the 2 faces, skip the remaining tests
826 // ---------------------------------------------------------------------------
828 SMDS_DownEdge::SMDS_DownEdge(SMDS_UnstructuredGrid *grid) :
831 _cellTypes.push_back(VTK_VERTEX);
832 _cellTypes.push_back(VTK_VERTEX);
835 SMDS_DownEdge::~SMDS_DownEdge()
839 // ---------------------------------------------------------------------------
841 SMDS_DownQuadEdge::SMDS_DownQuadEdge(SMDS_UnstructuredGrid *grid) :
844 _cellTypes.push_back(VTK_VERTEX);
845 _cellTypes.push_back(VTK_VERTEX);
846 _cellTypes.push_back(VTK_VERTEX);
849 SMDS_DownQuadEdge::~SMDS_DownQuadEdge()
853 // ---------------------------------------------------------------------------
855 SMDS_DownTriangle::SMDS_DownTriangle(SMDS_UnstructuredGrid *grid) :
858 _cellTypes.push_back(VTK_LINE);
859 _cellTypes.push_back(VTK_LINE);
860 _cellTypes.push_back(VTK_LINE);
864 SMDS_DownTriangle::~SMDS_DownTriangle()
868 void SMDS_DownTriangle::computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes)
870 int *nodes = &_tempNodes[_nbNodes * cellId];
871 edgesWithNodes.nbElems = 3;
873 edgesWithNodes.elems[0].nodeIds[0] = nodes[0];
874 edgesWithNodes.elems[0].nodeIds[1] = nodes[1];
875 edgesWithNodes.elems[0].nbNodes = 2;
876 edgesWithNodes.elems[0].vtkType = VTK_LINE;
878 edgesWithNodes.elems[1].nodeIds[0] = nodes[1];
879 edgesWithNodes.elems[1].nodeIds[1] = nodes[2];
880 edgesWithNodes.elems[1].nbNodes = 2;
881 edgesWithNodes.elems[1].vtkType = VTK_LINE;
883 edgesWithNodes.elems[2].nodeIds[0] = nodes[2];
884 edgesWithNodes.elems[2].nodeIds[1] = nodes[0];
885 edgesWithNodes.elems[2].nbNodes = 2;
886 edgesWithNodes.elems[2].vtkType = VTK_LINE;
889 void SMDS_DownTriangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
891 //ASSERT((cellId >=0)&& (cellId < _maxId));
892 //ASSERT(aType == VTK_LINE);
893 int *faces = &_cellIds[_nbDownCells * cellId];
894 for (int i = 0; i < _nbDownCells; i++)
898 faces[i] = lowCellId;
901 if (faces[i] == lowCellId)
907 // ---------------------------------------------------------------------------
909 SMDS_DownQuadTriangle::SMDS_DownQuadTriangle(SMDS_UnstructuredGrid *grid) :
912 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
913 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
914 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
918 SMDS_DownQuadTriangle::~SMDS_DownQuadTriangle()
922 void SMDS_DownQuadTriangle::computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes)
924 int *nodes = &_tempNodes[_nbNodes * cellId];
925 edgesWithNodes.nbElems = 3;
927 edgesWithNodes.elems[0].nodeIds[0] = nodes[0];
928 edgesWithNodes.elems[0].nodeIds[1] = nodes[1];
929 edgesWithNodes.elems[0].nodeIds[2] = nodes[3];
930 edgesWithNodes.elems[0].nbNodes = 3;
931 edgesWithNodes.elems[0].vtkType = VTK_QUADRATIC_EDGE;
933 edgesWithNodes.elems[1].nodeIds[0] = nodes[1];
934 edgesWithNodes.elems[1].nodeIds[1] = nodes[2];
935 edgesWithNodes.elems[1].nodeIds[2] = nodes[4];
936 edgesWithNodes.elems[1].nbNodes = 3;
937 edgesWithNodes.elems[1].vtkType = VTK_QUADRATIC_EDGE;
939 edgesWithNodes.elems[2].nodeIds[0] = nodes[2];
940 edgesWithNodes.elems[2].nodeIds[1] = nodes[0];
941 edgesWithNodes.elems[2].nodeIds[2] = nodes[5];
942 edgesWithNodes.elems[2].nbNodes = 3;
943 edgesWithNodes.elems[2].vtkType = VTK_QUADRATIC_EDGE;
946 void SMDS_DownQuadTriangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
948 //ASSERT((cellId >=0)&& (cellId < _maxId));
949 //ASSERT(aType == VTK_QUADRATIC_EDGE);
950 int *faces = &_cellIds[_nbDownCells * cellId];
951 for (int i = 0; i < _nbDownCells; i++)
955 faces[i] = lowCellId;
958 if (faces[i] == lowCellId)
964 // ---------------------------------------------------------------------------
966 SMDS_DownQuadrangle::SMDS_DownQuadrangle(SMDS_UnstructuredGrid *grid) :
969 _cellTypes.push_back(VTK_LINE);
970 _cellTypes.push_back(VTK_LINE);
971 _cellTypes.push_back(VTK_LINE);
972 _cellTypes.push_back(VTK_LINE);
976 SMDS_DownQuadrangle::~SMDS_DownQuadrangle()
980 void SMDS_DownQuadrangle::computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes)
982 int *nodes = &_tempNodes[_nbNodes * cellId];
983 edgesWithNodes.nbElems = 4;
985 edgesWithNodes.elems[0].nodeIds[0] = nodes[0];
986 edgesWithNodes.elems[0].nodeIds[1] = nodes[1];
987 edgesWithNodes.elems[0].nbNodes = 2;
988 edgesWithNodes.elems[0].vtkType = VTK_LINE;
990 edgesWithNodes.elems[1].nodeIds[0] = nodes[1];
991 edgesWithNodes.elems[1].nodeIds[1] = nodes[2];
992 edgesWithNodes.elems[1].nbNodes = 2;
993 edgesWithNodes.elems[1].vtkType = VTK_LINE;
995 edgesWithNodes.elems[2].nodeIds[0] = nodes[2];
996 edgesWithNodes.elems[2].nodeIds[1] = nodes[3];
997 edgesWithNodes.elems[2].nbNodes = 2;
998 edgesWithNodes.elems[2].vtkType = VTK_LINE;
1000 edgesWithNodes.elems[3].nodeIds[0] = nodes[3];
1001 edgesWithNodes.elems[3].nodeIds[1] = nodes[0];
1002 edgesWithNodes.elems[3].nbNodes = 2;
1003 edgesWithNodes.elems[3].vtkType = VTK_LINE;
1006 void SMDS_DownQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
1008 //ASSERT((cellId >=0)&& (cellId < _maxId));
1009 //ASSERT(aType == VTK_LINE);
1010 int *faces = &_cellIds[_nbDownCells * cellId];
1011 for (int i = 0; i < _nbDownCells; i++)
1015 faces[i] = lowCellId;
1018 if (faces[i] == lowCellId)
1024 // ---------------------------------------------------------------------------
1026 SMDS_DownQuadQuadrangle::SMDS_DownQuadQuadrangle(SMDS_UnstructuredGrid *grid) :
1027 SMDS_Down2D(grid, 4)
1029 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
1030 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
1031 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
1032 _cellTypes.push_back(VTK_QUADRATIC_EDGE);
1036 SMDS_DownQuadQuadrangle::~SMDS_DownQuadQuadrangle()
1040 void SMDS_DownQuadQuadrangle::computeEdgesWithNodes(int cellId, ListElemByNodesType& edgesWithNodes)
1042 int *nodes = &_tempNodes[_nbNodes * cellId];
1043 edgesWithNodes.nbElems = 4;
1045 edgesWithNodes.elems[0].nodeIds[0] = nodes[0];
1046 edgesWithNodes.elems[0].nodeIds[1] = nodes[1];
1047 edgesWithNodes.elems[0].nodeIds[2] = nodes[4];
1048 edgesWithNodes.elems[0].nbNodes = 3;
1049 edgesWithNodes.elems[0].vtkType = VTK_QUADRATIC_EDGE;
1051 edgesWithNodes.elems[1].nodeIds[0] = nodes[1];
1052 edgesWithNodes.elems[1].nodeIds[1] = nodes[2];
1053 edgesWithNodes.elems[1].nodeIds[2] = nodes[5];
1054 edgesWithNodes.elems[1].nbNodes = 3;
1055 edgesWithNodes.elems[1].vtkType = VTK_QUADRATIC_EDGE;
1057 edgesWithNodes.elems[2].nodeIds[0] = nodes[2];
1058 edgesWithNodes.elems[2].nodeIds[1] = nodes[3];
1059 edgesWithNodes.elems[2].nodeIds[2] = nodes[6];
1060 edgesWithNodes.elems[2].nbNodes = 3;
1061 edgesWithNodes.elems[2].vtkType = VTK_QUADRATIC_EDGE;
1063 edgesWithNodes.elems[3].nodeIds[0] = nodes[3];
1064 edgesWithNodes.elems[3].nodeIds[1] = nodes[0];
1065 edgesWithNodes.elems[3].nodeIds[2] = nodes[7];
1066 edgesWithNodes.elems[3].nbNodes = 3;
1067 edgesWithNodes.elems[3].vtkType = VTK_QUADRATIC_EDGE;
1070 void SMDS_DownQuadQuadrangle::addDownCell(int cellId, int lowCellId, unsigned char aType)
1072 //ASSERT((cellId >=0)&& (cellId < _maxId));
1073 //ASSERT(aType == VTK_QUADRATIC_EDGE);
1074 int *faces = &_cellIds[_nbDownCells * cellId];
1075 for (int i = 0; i < _nbDownCells; i++)
1079 faces[i] = lowCellId;
1082 if (faces[i] == lowCellId)
1088 // ---------------------------------------------------------------------------
1090 SMDS_DownTetra::SMDS_DownTetra(SMDS_UnstructuredGrid *grid) :
1091 SMDS_Down3D(grid, 4)
1093 _cellTypes.push_back(VTK_TRIANGLE);
1094 _cellTypes.push_back(VTK_TRIANGLE);
1095 _cellTypes.push_back(VTK_TRIANGLE);
1096 _cellTypes.push_back(VTK_TRIANGLE);
1099 SMDS_DownTetra::~SMDS_DownTetra()
1103 void SMDS_DownTetra::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1107 for (int i = 0; i < orderedNodes.size(); i++)
1108 setNodes.insert(orderedNodes[i]);
1109 //MESSAGE("cellId = " << cellId);
1112 vtkIdType *nodes; // will refer to the point id's of the volume
1113 _grid->GetCellPoints(this->_vtkCellIds[cellId], npts, nodes);
1116 int ids[12] = { 0, 1, 2, 0, 1, 3, 0, 2, 3, 1, 2, 3 };
1117 for (int k = 0; k < 4; k++)
1120 for (int i = 0; i < 3; i++)
1121 tofind.insert(nodes[ids[3 * k + i]]);
1122 if (setNodes == tofind)
1124 for (int i = 0; i < 3; i++)
1125 orderedNodes[i] = nodes[ids[3 * k + i]];
1129 MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
1130 MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
1131 MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
1134 void SMDS_DownTetra::addDownCell(int cellId, int lowCellId, unsigned char aType)
1136 //ASSERT((cellId >=0)&& (cellId < _maxId));
1137 //ASSERT(aType == VTK_TRIANGLE);
1138 int *faces = &_cellIds[_nbDownCells * cellId];
1139 for (int i = 0; i < _nbDownCells; i++)
1143 faces[i] = lowCellId;
1146 if (faces[i] == lowCellId)
1152 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1153 * The linear tetrahedron is defined by four points.
1154 * @see vtkTetra.h in Filtering.
1155 * @param cellId volumeId in vtkUnstructuredGrid
1156 * @param facesWithNodes vector of face descriptors to be filled
1158 void SMDS_DownTetra::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1160 // --- find point id's of the volume
1163 vtkIdType *nodes; // will refer to the point id's of the volume
1164 _grid->GetCellPoints(cellId, npts, nodes);
1166 // --- create all the ordered list of node id's for each face
1168 facesWithNodes.nbElems = 4;
1170 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1171 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1172 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1173 facesWithNodes.elems[0].nbNodes = 3;
1174 facesWithNodes.elems[0].vtkType = VTK_TRIANGLE;
1176 facesWithNodes.elems[1].nodeIds[0] = nodes[0];
1177 facesWithNodes.elems[1].nodeIds[1] = nodes[1];
1178 facesWithNodes.elems[1].nodeIds[2] = nodes[3];
1179 facesWithNodes.elems[1].nbNodes = 3;
1180 facesWithNodes.elems[1].vtkType = VTK_TRIANGLE;
1182 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1183 facesWithNodes.elems[2].nodeIds[1] = nodes[2];
1184 facesWithNodes.elems[2].nodeIds[2] = nodes[3];
1185 facesWithNodes.elems[2].nbNodes = 3;
1186 facesWithNodes.elems[2].vtkType = VTK_TRIANGLE;
1188 facesWithNodes.elems[3].nodeIds[0] = nodes[1];
1189 facesWithNodes.elems[3].nodeIds[1] = nodes[2];
1190 facesWithNodes.elems[3].nodeIds[2] = nodes[3];
1191 facesWithNodes.elems[3].nbNodes = 3;
1192 facesWithNodes.elems[3].vtkType = VTK_TRIANGLE;
1195 // ---------------------------------------------------------------------------
1197 SMDS_DownQuadTetra::SMDS_DownQuadTetra(SMDS_UnstructuredGrid *grid) :
1198 SMDS_Down3D(grid, 4)
1200 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1201 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1202 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1203 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1206 SMDS_DownQuadTetra::~SMDS_DownQuadTetra()
1210 void SMDS_DownQuadTetra::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1215 void SMDS_DownQuadTetra::addDownCell(int cellId, int lowCellId, unsigned char aType)
1217 //ASSERT((cellId >=0)&& (cellId < _maxId));
1218 //ASSERT(aType == VTK_QUADRATIC_TRIANGLE);
1219 int *faces = &_cellIds[_nbDownCells * cellId];
1220 for (int i = 0; i < _nbDownCells; i++)
1224 faces[i] = lowCellId;
1227 if (faces[i] == lowCellId)
1233 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1234 * The ordering of the ten points defining the quadratic tetrahedron cell is point id's (0-3,4-9)
1235 * where id's 0-3 are the four tetrahedron vertices;
1236 * and point id's 4-9 are the mid-edge nodes between (0,1), (1,2), (2,0), (0,3), (1,3), and (2,3).
1237 * @see vtkQuadraticTetra.h in Filtering.
1238 * @param cellId volumeId in vtkUnstructuredGrid
1239 * @param facesWithNodes vector of face descriptors to be filled
1241 void SMDS_DownQuadTetra::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1243 // --- find point id's of the volume
1246 vtkIdType *nodes; // will refer to the point id's of the volume
1247 _grid->GetCellPoints(cellId, npts, nodes);
1249 // --- create all the ordered list of node id's for each face
1251 facesWithNodes.nbElems = 4;
1253 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1254 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1255 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1256 facesWithNodes.elems[0].nodeIds[3] = nodes[4];
1257 facesWithNodes.elems[0].nodeIds[4] = nodes[5];
1258 facesWithNodes.elems[0].nodeIds[5] = nodes[6];
1259 facesWithNodes.elems[0].nbNodes = 6;
1260 facesWithNodes.elems[0].vtkType = VTK_QUADRATIC_TRIANGLE;
1262 facesWithNodes.elems[1].nodeIds[0] = nodes[0];
1263 facesWithNodes.elems[1].nodeIds[1] = nodes[1];
1264 facesWithNodes.elems[1].nodeIds[2] = nodes[3];
1265 facesWithNodes.elems[1].nodeIds[3] = nodes[4];
1266 facesWithNodes.elems[1].nodeIds[4] = nodes[7];
1267 facesWithNodes.elems[1].nodeIds[5] = nodes[8];
1268 facesWithNodes.elems[1].nbNodes = 6;
1269 facesWithNodes.elems[1].vtkType = VTK_QUADRATIC_TRIANGLE;
1271 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1272 facesWithNodes.elems[2].nodeIds[1] = nodes[2];
1273 facesWithNodes.elems[2].nodeIds[2] = nodes[3];
1274 facesWithNodes.elems[2].nodeIds[3] = nodes[6];
1275 facesWithNodes.elems[2].nodeIds[4] = nodes[7];
1276 facesWithNodes.elems[2].nodeIds[5] = nodes[9];
1277 facesWithNodes.elems[2].nbNodes = 6;
1278 facesWithNodes.elems[2].vtkType = VTK_QUADRATIC_TRIANGLE;
1280 facesWithNodes.elems[3].nodeIds[0] = nodes[1];
1281 facesWithNodes.elems[3].nodeIds[1] = nodes[2];
1282 facesWithNodes.elems[3].nodeIds[2] = nodes[3];
1283 facesWithNodes.elems[3].nodeIds[3] = nodes[5];
1284 facesWithNodes.elems[3].nodeIds[4] = nodes[8];
1285 facesWithNodes.elems[3].nodeIds[5] = nodes[9];
1286 facesWithNodes.elems[3].nbNodes = 6;
1287 facesWithNodes.elems[3].vtkType = VTK_QUADRATIC_TRIANGLE;
1290 // ---------------------------------------------------------------------------
1292 SMDS_DownPyramid::SMDS_DownPyramid(SMDS_UnstructuredGrid *grid) :
1293 SMDS_Down3D(grid, 5)
1295 _cellTypes.push_back(VTK_QUAD);
1296 _cellTypes.push_back(VTK_TRIANGLE);
1297 _cellTypes.push_back(VTK_TRIANGLE);
1298 _cellTypes.push_back(VTK_TRIANGLE);
1299 _cellTypes.push_back(VTK_TRIANGLE);
1302 SMDS_DownPyramid::~SMDS_DownPyramid()
1306 void SMDS_DownPyramid::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1311 void SMDS_DownPyramid::addDownCell(int cellId, int lowCellId, unsigned char aType)
1313 //ASSERT((cellId >=0) && (cellId < _maxId));
1314 int *faces = &_cellIds[_nbDownCells * cellId];
1315 if (aType == VTK_QUAD)
1319 faces[0] = lowCellId;
1322 if (faces[0] == lowCellId)
1327 //ASSERT(aType == VTK_TRIANGLE);
1328 for (int i = 1; i < _nbDownCells; i++)
1332 faces[i] = lowCellId;
1335 if (faces[i] == lowCellId)
1342 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1343 * The pyramid is defined by the five points (0-4) where (0,1,2,3) is the base of the pyramid which,
1344 * using the right hand rule, forms a quadrilateral whose normal points in the direction of the
1345 * pyramid apex at vertex #4.
1346 * @see vtkPyramid.h in Filtering.
1347 * @param cellId volumeId in vtkUnstructuredGrid
1348 * @param facesWithNodes vector of face descriptors to be filled
1350 void SMDS_DownPyramid::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1352 // --- find point id's of the volume
1355 vtkIdType *nodes; // will refer to the point id's of the volume
1356 _grid->GetCellPoints(cellId, npts, nodes);
1358 // --- create all the ordered list of node id's for each face
1360 facesWithNodes.nbElems = 5;
1362 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1363 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1364 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1365 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1366 facesWithNodes.elems[0].nbNodes = 4;
1367 facesWithNodes.elems[0].vtkType = VTK_QUAD;
1369 facesWithNodes.elems[1].nodeIds[0] = nodes[0];
1370 facesWithNodes.elems[1].nodeIds[1] = nodes[1];
1371 facesWithNodes.elems[1].nodeIds[2] = nodes[4];
1372 facesWithNodes.elems[1].nbNodes = 3;
1373 facesWithNodes.elems[1].vtkType = VTK_TRIANGLE;
1375 facesWithNodes.elems[2].nodeIds[0] = nodes[1];
1376 facesWithNodes.elems[2].nodeIds[1] = nodes[2];
1377 facesWithNodes.elems[2].nodeIds[2] = nodes[4];
1378 facesWithNodes.elems[2].nbNodes = 3;
1379 facesWithNodes.elems[2].vtkType = VTK_TRIANGLE;
1381 facesWithNodes.elems[3].nodeIds[0] = nodes[2];
1382 facesWithNodes.elems[3].nodeIds[1] = nodes[3];
1383 facesWithNodes.elems[3].nodeIds[2] = nodes[4];
1384 facesWithNodes.elems[3].nbNodes = 3;
1385 facesWithNodes.elems[3].vtkType = VTK_TRIANGLE;
1387 facesWithNodes.elems[4].nodeIds[0] = nodes[3];
1388 facesWithNodes.elems[4].nodeIds[1] = nodes[0];
1389 facesWithNodes.elems[4].nodeIds[2] = nodes[4];
1390 facesWithNodes.elems[4].nbNodes = 3;
1391 facesWithNodes.elems[4].vtkType = VTK_TRIANGLE;
1394 // ---------------------------------------------------------------------------
1396 SMDS_DownQuadPyramid::SMDS_DownQuadPyramid(SMDS_UnstructuredGrid *grid) :
1397 SMDS_Down3D(grid, 5)
1399 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1400 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1401 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1402 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1403 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1406 SMDS_DownQuadPyramid::~SMDS_DownQuadPyramid()
1410 void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1415 void SMDS_DownQuadPyramid::addDownCell(int cellId, int lowCellId, unsigned char aType)
1417 //ASSERT((cellId >=0) && (cellId < _maxId));
1418 int *faces = &_cellIds[_nbDownCells * cellId];
1419 if (aType == VTK_QUADRATIC_QUAD)
1423 faces[0] = lowCellId;
1426 if (faces[0] == lowCellId)
1431 //ASSERT(aType == VTK_QUADRATIC_TRIANGLE);
1432 for (int i = 1; i < _nbDownCells; i++)
1436 faces[i] = lowCellId;
1439 if (faces[i] == lowCellId)
1446 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1447 * The ordering of the thirteen points defining the quadratic pyramid cell is point id's (0-4,5-12)
1448 * where point id's 0-4 are the five corner vertices of the pyramid; followed
1449 * by eight mid-edge nodes (5-12). Note that these mid-edge nodes lie on the edges defined by
1450 * 5(0,1), 6(1,2), 7(2,3), 8(3,0), 9(0,4), 10(1,4), 11(2,4), 12(3,4).
1451 * @see vtkQuadraticPyramid.h in Filtering.
1452 * @param cellId volumeId in vtkUnstructuredGrid
1453 * @param facesWithNodes vector of face descriptors to be filled
1455 void SMDS_DownQuadPyramid::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1457 // --- find point id's of the volume
1460 vtkIdType *nodes; // will refer to the point id's of the volume
1461 _grid->GetCellPoints(cellId, npts, nodes);
1463 // --- create all the ordered list of node id's for each face
1465 facesWithNodes.nbElems = 5;
1467 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1468 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1469 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1470 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1471 facesWithNodes.elems[0].nodeIds[4] = nodes[5];
1472 facesWithNodes.elems[0].nodeIds[5] = nodes[6];
1473 facesWithNodes.elems[0].nodeIds[6] = nodes[7];
1474 facesWithNodes.elems[0].nodeIds[7] = nodes[8];
1475 facesWithNodes.elems[0].nbNodes = 8;
1476 facesWithNodes.elems[0].vtkType = VTK_QUADRATIC_QUAD;
1478 facesWithNodes.elems[1].nodeIds[0] = nodes[0];
1479 facesWithNodes.elems[1].nodeIds[1] = nodes[1];
1480 facesWithNodes.elems[1].nodeIds[2] = nodes[4];
1481 facesWithNodes.elems[1].nodeIds[3] = nodes[5];
1482 facesWithNodes.elems[1].nodeIds[4] = nodes[9];
1483 facesWithNodes.elems[1].nodeIds[5] = nodes[10];
1484 facesWithNodes.elems[1].nbNodes = 6;
1485 facesWithNodes.elems[1].vtkType = VTK_QUADRATIC_TRIANGLE;
1487 facesWithNodes.elems[2].nodeIds[0] = nodes[1];
1488 facesWithNodes.elems[2].nodeIds[1] = nodes[2];
1489 facesWithNodes.elems[2].nodeIds[2] = nodes[4];
1490 facesWithNodes.elems[2].nodeIds[3] = nodes[6];
1491 facesWithNodes.elems[2].nodeIds[4] = nodes[10];
1492 facesWithNodes.elems[2].nodeIds[5] = nodes[11];
1493 facesWithNodes.elems[2].nbNodes = 6;
1494 facesWithNodes.elems[2].vtkType = VTK_QUADRATIC_TRIANGLE;
1496 facesWithNodes.elems[3].nodeIds[0] = nodes[2];
1497 facesWithNodes.elems[3].nodeIds[1] = nodes[3];
1498 facesWithNodes.elems[3].nodeIds[2] = nodes[4];
1499 facesWithNodes.elems[3].nodeIds[3] = nodes[7];
1500 facesWithNodes.elems[3].nodeIds[4] = nodes[11];
1501 facesWithNodes.elems[3].nodeIds[5] = nodes[12];
1502 facesWithNodes.elems[3].nbNodes = 6;
1503 facesWithNodes.elems[3].vtkType = VTK_QUADRATIC_TRIANGLE;
1505 facesWithNodes.elems[4].nodeIds[0] = nodes[3];
1506 facesWithNodes.elems[4].nodeIds[1] = nodes[0];
1507 facesWithNodes.elems[4].nodeIds[2] = nodes[4];
1508 facesWithNodes.elems[4].nodeIds[3] = nodes[8];
1509 facesWithNodes.elems[4].nodeIds[4] = nodes[9];
1510 facesWithNodes.elems[4].nodeIds[5] = nodes[12];
1511 facesWithNodes.elems[4].nbNodes = 6;
1512 facesWithNodes.elems[4].vtkType = VTK_QUADRATIC_TRIANGLE;
1515 // ---------------------------------------------------------------------------
1517 SMDS_DownPenta::SMDS_DownPenta(SMDS_UnstructuredGrid *grid) :
1518 SMDS_Down3D(grid, 5)
1520 _cellTypes.push_back(VTK_QUAD);
1521 _cellTypes.push_back(VTK_QUAD);
1522 _cellTypes.push_back(VTK_QUAD);
1523 _cellTypes.push_back(VTK_TRIANGLE);
1524 _cellTypes.push_back(VTK_TRIANGLE);
1527 SMDS_DownPenta::~SMDS_DownPenta()
1531 void SMDS_DownPenta::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1536 void SMDS_DownPenta::addDownCell(int cellId, int lowCellId, unsigned char aType)
1538 //ASSERT((cellId >=0) && (cellId < _maxId));
1539 int *faces = &_cellIds[_nbDownCells * cellId];
1540 if (aType == VTK_QUAD)
1541 for (int i = 0; i < 2; i++)
1545 faces[i] = lowCellId;
1548 if (faces[i] == lowCellId)
1553 //ASSERT(aType == VTK_TRIANGLE);
1554 for (int i = 2; i < _nbDownCells; i++)
1558 faces[i] = lowCellId;
1561 if (faces[i] == lowCellId)
1568 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's.
1569 * A wedge or pentahedron consists of two triangular and three quadrilateral faces
1570 * and is defined by the six points (0-5) where (0,1,2) is the base of the wedge which,
1571 * using the right hand rule, forms a triangle whose normal points outward
1572 * (away from the triangular face (3,4,5)).
1573 * @see vtkWedge.h in Filtering
1574 * @param cellId volumeId in vtkUnstructuredGrid
1575 * @param facesWithNodes vector of face descriptors to be filled
1577 void SMDS_DownPenta::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1579 // --- find point id's of the volume
1582 vtkIdType *nodes; // will refer to the point id's of the volume
1583 _grid->GetCellPoints(cellId, npts, nodes);
1585 // --- create all the ordered list of node id's for each face
1587 facesWithNodes.nbElems = 5;
1589 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1590 facesWithNodes.elems[0].nodeIds[1] = nodes[2];
1591 facesWithNodes.elems[0].nodeIds[2] = nodes[5];
1592 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1593 facesWithNodes.elems[0].nbNodes = 4;
1594 facesWithNodes.elems[0].vtkType = VTK_QUAD;
1596 facesWithNodes.elems[1].nodeIds[0] = nodes[1];
1597 facesWithNodes.elems[1].nodeIds[1] = nodes[2];
1598 facesWithNodes.elems[1].nodeIds[2] = nodes[5];
1599 facesWithNodes.elems[1].nodeIds[3] = nodes[4];
1600 facesWithNodes.elems[1].nbNodes = 4;
1601 facesWithNodes.elems[1].vtkType = VTK_QUAD;
1603 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1604 facesWithNodes.elems[2].nodeIds[1] = nodes[1];
1605 facesWithNodes.elems[2].nodeIds[2] = nodes[4];
1606 facesWithNodes.elems[2].nodeIds[3] = nodes[3];
1607 facesWithNodes.elems[2].nbNodes = 4;
1608 facesWithNodes.elems[2].vtkType = VTK_QUAD;
1610 facesWithNodes.elems[3].nodeIds[0] = nodes[0];
1611 facesWithNodes.elems[3].nodeIds[1] = nodes[1];
1612 facesWithNodes.elems[3].nodeIds[2] = nodes[2];
1613 facesWithNodes.elems[3].nbNodes = 3;
1614 facesWithNodes.elems[3].vtkType = VTK_TRIANGLE;
1616 facesWithNodes.elems[4].nodeIds[0] = nodes[3];
1617 facesWithNodes.elems[4].nodeIds[1] = nodes[4];
1618 facesWithNodes.elems[4].nodeIds[2] = nodes[5];
1619 facesWithNodes.elems[4].nbNodes = 3;
1620 facesWithNodes.elems[4].vtkType = VTK_TRIANGLE;
1623 // ---------------------------------------------------------------------------
1625 SMDS_DownQuadPenta::SMDS_DownQuadPenta(SMDS_UnstructuredGrid *grid) :
1626 SMDS_Down3D(grid, 5)
1628 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1629 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1630 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1631 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1632 _cellTypes.push_back(VTK_QUADRATIC_TRIANGLE);
1635 SMDS_DownQuadPenta::~SMDS_DownQuadPenta()
1639 void SMDS_DownQuadPenta::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1644 void SMDS_DownQuadPenta::addDownCell(int cellId, int lowCellId, unsigned char aType)
1646 //ASSERT((cellId >=0) && (cellId < _maxId));
1647 int *faces = &_cellIds[_nbDownCells * cellId];
1648 if (aType == VTK_QUADRATIC_QUAD)
1649 for (int i = 0; i < 2; i++)
1653 faces[i] = lowCellId;
1656 if (faces[i] == lowCellId)
1661 //ASSERT(aType == VTK_QUADRATIC_TRIANGLE);
1662 for (int i = 2; i < _nbDownCells; i++)
1666 faces[i] = lowCellId;
1669 if (faces[i] == lowCellId)
1676 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1677 * The quadratic wedge (or pentahedron) is defined by fifteen points.
1678 * The ordering of the fifteen points defining the cell is point id's (0-5,6-14)
1679 * where point id's 0-5 are the six corner vertices of the wedge, followed by
1680 * nine mid-edge nodes (6-14). Note that these mid-edge nodes lie on the edges defined by
1681 * (0,1), (1,2), (2,0), (3,4), (4,5), (5,3), (0,3), (1,4), (2,5).
1682 * @see vtkQuadraticWedge.h in Filtering
1683 * @param cellId volumeId in vtkUnstructuredGrid
1684 * @param facesWithNodes vector of face descriptors to be filled
1686 void SMDS_DownQuadPenta::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1688 // --- find point id's of the volume
1691 vtkIdType *nodes; // will refer to the point id's of the volume
1692 _grid->GetCellPoints(cellId, npts, nodes);
1694 // --- create all the ordered list of node id's for each face
1696 facesWithNodes.nbElems = 5;
1698 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1699 facesWithNodes.elems[0].nodeIds[1] = nodes[2];
1700 facesWithNodes.elems[0].nodeIds[2] = nodes[5];
1701 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1702 facesWithNodes.elems[0].nodeIds[4] = nodes[8];
1703 facesWithNodes.elems[0].nodeIds[5] = nodes[14];
1704 facesWithNodes.elems[0].nodeIds[6] = nodes[11];
1705 facesWithNodes.elems[0].nodeIds[7] = nodes[12];
1706 facesWithNodes.elems[0].nbNodes = 8;
1707 facesWithNodes.elems[0].vtkType = VTK_QUADRATIC_QUAD;
1709 facesWithNodes.elems[1].nodeIds[0] = nodes[1];
1710 facesWithNodes.elems[1].nodeIds[1] = nodes[2];
1711 facesWithNodes.elems[1].nodeIds[2] = nodes[5];
1712 facesWithNodes.elems[1].nodeIds[3] = nodes[4];
1713 facesWithNodes.elems[1].nodeIds[4] = nodes[7];
1714 facesWithNodes.elems[1].nodeIds[5] = nodes[14];
1715 facesWithNodes.elems[1].nodeIds[6] = nodes[10];
1716 facesWithNodes.elems[1].nodeIds[7] = nodes[13];
1717 facesWithNodes.elems[1].nbNodes = 8;
1718 facesWithNodes.elems[1].vtkType = VTK_QUADRATIC_QUAD;
1720 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1721 facesWithNodes.elems[2].nodeIds[1] = nodes[1];
1722 facesWithNodes.elems[2].nodeIds[2] = nodes[4];
1723 facesWithNodes.elems[2].nodeIds[3] = nodes[3];
1724 facesWithNodes.elems[2].nodeIds[4] = nodes[6];
1725 facesWithNodes.elems[2].nodeIds[5] = nodes[13];
1726 facesWithNodes.elems[2].nodeIds[6] = nodes[9];
1727 facesWithNodes.elems[2].nodeIds[7] = nodes[12];
1728 facesWithNodes.elems[2].nbNodes = 8;
1729 facesWithNodes.elems[2].vtkType = VTK_QUADRATIC_QUAD;
1731 facesWithNodes.elems[3].nodeIds[0] = nodes[0];
1732 facesWithNodes.elems[3].nodeIds[1] = nodes[1];
1733 facesWithNodes.elems[3].nodeIds[2] = nodes[2];
1734 facesWithNodes.elems[3].nodeIds[3] = nodes[6];
1735 facesWithNodes.elems[3].nodeIds[4] = nodes[7];
1736 facesWithNodes.elems[3].nodeIds[5] = nodes[8];
1737 facesWithNodes.elems[3].nbNodes = 6;
1738 facesWithNodes.elems[3].vtkType = VTK_QUADRATIC_TRIANGLE;
1740 facesWithNodes.elems[4].nodeIds[0] = nodes[3];
1741 facesWithNodes.elems[4].nodeIds[1] = nodes[4];
1742 facesWithNodes.elems[4].nodeIds[2] = nodes[5];
1743 facesWithNodes.elems[4].nodeIds[3] = nodes[9];
1744 facesWithNodes.elems[4].nodeIds[4] = nodes[10];
1745 facesWithNodes.elems[4].nodeIds[5] = nodes[11];
1746 facesWithNodes.elems[4].nbNodes = 6;
1747 facesWithNodes.elems[4].vtkType = VTK_QUADRATIC_TRIANGLE;
1750 // ---------------------------------------------------------------------------
1752 SMDS_DownHexa::SMDS_DownHexa(SMDS_UnstructuredGrid *grid) :
1753 SMDS_Down3D(grid, 6)
1755 _cellTypes.push_back(VTK_QUAD);
1756 _cellTypes.push_back(VTK_QUAD);
1757 _cellTypes.push_back(VTK_QUAD);
1758 _cellTypes.push_back(VTK_QUAD);
1759 _cellTypes.push_back(VTK_QUAD);
1760 _cellTypes.push_back(VTK_QUAD);
1763 SMDS_DownHexa::~SMDS_DownHexa()
1767 void SMDS_DownHexa::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1772 void SMDS_DownHexa::addDownCell(int cellId, int lowCellId, unsigned char aType)
1774 //ASSERT((cellId >=0)&& (cellId < _maxId));
1775 int *faces = &_cellIds[_nbDownCells * cellId];
1776 for (int i = 0; i < _nbDownCells; i++)
1780 faces[i] = lowCellId;
1783 if (faces[i] == lowCellId)
1787 // MESSAGE("-------------------------------------> trop de faces ! " << cellId << " " << lowCellId);
1790 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1791 * The hexahedron is defined by the eight points (0-7), where (0,1,2,3) is the base
1792 * of the hexahedron which, using the right hand rule, forms a quadrilateral whose normal
1793 * points in the direction of the opposite face (4,5,6,7).
1794 * @see vtkHexahedron.h in Filtering
1795 * @param cellId volumeId in vtkUnstructuredGrid
1796 * @param facesWithNodes vector of face descriptors to be filled
1798 void SMDS_DownHexa::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1800 // --- find point id's of the volume
1803 vtkIdType *nodes; // will refer to the point id's of the volume
1804 _grid->GetCellPoints(cellId, npts, nodes);
1806 // --- create all the ordered list of node id's for each face
1808 facesWithNodes.nbElems = 6;
1810 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1811 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1812 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1813 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1814 facesWithNodes.elems[0].nbNodes = 4;
1815 facesWithNodes.elems[0].vtkType = VTK_QUAD;
1817 facesWithNodes.elems[1].nodeIds[0] = nodes[4];
1818 facesWithNodes.elems[1].nodeIds[1] = nodes[5];
1819 facesWithNodes.elems[1].nodeIds[2] = nodes[6];
1820 facesWithNodes.elems[1].nodeIds[3] = nodes[7];
1821 facesWithNodes.elems[1].nbNodes = 4;
1822 facesWithNodes.elems[1].vtkType = VTK_QUAD;
1824 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1825 facesWithNodes.elems[2].nodeIds[1] = nodes[1];
1826 facesWithNodes.elems[2].nodeIds[2] = nodes[5];
1827 facesWithNodes.elems[2].nodeIds[3] = nodes[4];
1828 facesWithNodes.elems[2].nbNodes = 4;
1829 facesWithNodes.elems[2].vtkType = VTK_QUAD;
1831 facesWithNodes.elems[3].nodeIds[0] = nodes[1];
1832 facesWithNodes.elems[3].nodeIds[1] = nodes[2];
1833 facesWithNodes.elems[3].nodeIds[2] = nodes[6];
1834 facesWithNodes.elems[3].nodeIds[3] = nodes[5];
1835 facesWithNodes.elems[3].nbNodes = 4;
1836 facesWithNodes.elems[3].vtkType = VTK_QUAD;
1838 facesWithNodes.elems[4].nodeIds[0] = nodes[2];
1839 facesWithNodes.elems[4].nodeIds[1] = nodes[6];
1840 facesWithNodes.elems[4].nodeIds[2] = nodes[7];
1841 facesWithNodes.elems[4].nodeIds[3] = nodes[3];
1842 facesWithNodes.elems[4].nbNodes = 4;
1843 facesWithNodes.elems[4].vtkType = VTK_QUAD;
1845 facesWithNodes.elems[5].nodeIds[0] = nodes[3];
1846 facesWithNodes.elems[5].nodeIds[1] = nodes[7];
1847 facesWithNodes.elems[5].nodeIds[2] = nodes[4];
1848 facesWithNodes.elems[5].nodeIds[3] = nodes[0];
1849 facesWithNodes.elems[5].nbNodes = 4;
1850 facesWithNodes.elems[5].vtkType = VTK_QUAD;
1853 // ---------------------------------------------------------------------------
1855 SMDS_DownQuadHexa::SMDS_DownQuadHexa(SMDS_UnstructuredGrid *grid) :
1856 SMDS_Down3D(grid, 6)
1858 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1859 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1860 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1861 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1862 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1863 _cellTypes.push_back(VTK_QUADRATIC_QUAD);
1866 SMDS_DownQuadHexa::~SMDS_DownQuadHexa()
1870 void SMDS_DownQuadHexa::getOrderedNodesOfFace(int cellId, std::vector<int>& orderedNodes)
1875 void SMDS_DownQuadHexa::addDownCell(int cellId, int lowCellId, unsigned char aType)
1877 //ASSERT((cellId >=0)&& (cellId < _maxId));
1878 int *faces = &_cellIds[_nbDownCells * cellId];
1879 for (int i = 0; i < _nbDownCells; i++)
1883 faces[i] = lowCellId;
1886 if (faces[i] == lowCellId)
1892 /*! Create a list of faces described by a vtk Type and an ordered set of Node Id's
1893 * The ordering of the twenty points defining the quadratic hexahedron cell is point id's (0-7,8-19)
1894 * where point id's 0-7 are the eight corner vertices of the cube, followed by twelve mid-edge nodes (8-19).
1895 * Note that these mid-edge nodes lie on the edges defined by
1896 * (0,1), (1,2), (2,3), (3,0), (4,5), (5,6), (6,7), (7,4), (0,4), (1,5), (2,6), (3,7).
1897 * @see vtkQuadraticHexahedron.h in Filtering
1898 * @param cellId volumeId in vtkUnstructuredGrid
1899 * @param facesWithNodes vector of face descriptors to be filled
1901 void SMDS_DownQuadHexa::computeFacesWithNodes(int cellId, ListElemByNodesType& facesWithNodes)
1903 // --- find point id's of the volume
1906 vtkIdType *nodes; // will refer to the point id's of the volume
1907 _grid->GetCellPoints(cellId, npts, nodes);
1909 // --- create all the ordered list of node id's for each face
1911 facesWithNodes.nbElems = 6;
1913 facesWithNodes.elems[0].nodeIds[0] = nodes[0];
1914 facesWithNodes.elems[0].nodeIds[1] = nodes[1];
1915 facesWithNodes.elems[0].nodeIds[2] = nodes[2];
1916 facesWithNodes.elems[0].nodeIds[3] = nodes[3];
1917 facesWithNodes.elems[0].nodeIds[4] = nodes[8];
1918 facesWithNodes.elems[0].nodeIds[5] = nodes[9];
1919 facesWithNodes.elems[0].nodeIds[6] = nodes[10];
1920 facesWithNodes.elems[0].nodeIds[7] = nodes[11];
1921 facesWithNodes.elems[0].nbNodes = 8;
1922 facesWithNodes.elems[0].vtkType = VTK_QUADRATIC_QUAD;
1924 facesWithNodes.elems[1].nodeIds[0] = nodes[4];
1925 facesWithNodes.elems[1].nodeIds[1] = nodes[5];
1926 facesWithNodes.elems[1].nodeIds[2] = nodes[6];
1927 facesWithNodes.elems[1].nodeIds[3] = nodes[7];
1928 facesWithNodes.elems[1].nodeIds[4] = nodes[12];
1929 facesWithNodes.elems[1].nodeIds[5] = nodes[13];
1930 facesWithNodes.elems[1].nodeIds[6] = nodes[14];
1931 facesWithNodes.elems[1].nodeIds[7] = nodes[15];
1932 facesWithNodes.elems[1].nbNodes = 8;
1933 facesWithNodes.elems[1].vtkType = VTK_QUADRATIC_QUAD;
1935 facesWithNodes.elems[2].nodeIds[0] = nodes[0];
1936 facesWithNodes.elems[2].nodeIds[1] = nodes[1];
1937 facesWithNodes.elems[2].nodeIds[2] = nodes[5];
1938 facesWithNodes.elems[2].nodeIds[3] = nodes[4];
1939 facesWithNodes.elems[2].nodeIds[4] = nodes[8];
1940 facesWithNodes.elems[2].nodeIds[5] = nodes[17];
1941 facesWithNodes.elems[2].nodeIds[6] = nodes[12];
1942 facesWithNodes.elems[2].nodeIds[7] = nodes[16];
1943 facesWithNodes.elems[2].nbNodes = 8;
1944 facesWithNodes.elems[2].vtkType = VTK_QUADRATIC_QUAD;
1946 facesWithNodes.elems[3].nodeIds[0] = nodes[1];
1947 facesWithNodes.elems[3].nodeIds[1] = nodes[2];
1948 facesWithNodes.elems[3].nodeIds[2] = nodes[6];
1949 facesWithNodes.elems[3].nodeIds[3] = nodes[5];
1950 facesWithNodes.elems[3].nodeIds[4] = nodes[9];
1951 facesWithNodes.elems[3].nodeIds[5] = nodes[18];
1952 facesWithNodes.elems[3].nodeIds[6] = nodes[13];
1953 facesWithNodes.elems[3].nodeIds[7] = nodes[17];
1954 facesWithNodes.elems[3].nbNodes = 8;
1955 facesWithNodes.elems[3].vtkType = VTK_QUADRATIC_QUAD;
1957 facesWithNodes.elems[4].nodeIds[0] = nodes[2];
1958 facesWithNodes.elems[4].nodeIds[1] = nodes[6];
1959 facesWithNodes.elems[4].nodeIds[2] = nodes[7];
1960 facesWithNodes.elems[4].nodeIds[3] = nodes[3];
1961 facesWithNodes.elems[4].nodeIds[4] = nodes[18];
1962 facesWithNodes.elems[4].nodeIds[5] = nodes[14];
1963 facesWithNodes.elems[4].nodeIds[6] = nodes[19];
1964 facesWithNodes.elems[4].nodeIds[7] = nodes[10];
1965 facesWithNodes.elems[4].nbNodes = 8;
1966 facesWithNodes.elems[4].vtkType = VTK_QUADRATIC_QUAD;
1968 facesWithNodes.elems[5].nodeIds[0] = nodes[3];
1969 facesWithNodes.elems[5].nodeIds[1] = nodes[7];
1970 facesWithNodes.elems[5].nodeIds[2] = nodes[4];
1971 facesWithNodes.elems[5].nodeIds[3] = nodes[0];
1972 facesWithNodes.elems[5].nodeIds[4] = nodes[19];
1973 facesWithNodes.elems[5].nodeIds[5] = nodes[15];
1974 facesWithNodes.elems[5].nodeIds[6] = nodes[16];
1975 facesWithNodes.elems[5].nodeIds[7] = nodes[11];
1976 facesWithNodes.elems[5].nbNodes = 8;
1977 facesWithNodes.elems[5].vtkType = VTK_QUADRATIC_QUAD;
1980 // ---------------------------------------------------------------------------