diff --git a/InSituLib/VtkMappedMesh.cpp b/InSituLib/VtkMappedMesh.cpp index 64cd4fdea73e9e4a12784f05789b0314e0b59d9b..78eaf1845afa4329fc4a9ed3d45c445d00c32edf 100644 --- a/InSituLib/VtkMappedMesh.cpp +++ b/InSituLib/VtkMappedMesh.cpp @@ -60,31 +60,61 @@ vtkIdType VtkMappedMeshImpl::GetNumberOfCells() int VtkMappedMeshImpl::GetCellType(vtkIdType cellId) { int type = 0; - switch ((*_elements)[cellId]->getGeomType()) + switch ((*_elements)[cellId]->getCellType()) { - case MeshElemType::INVALID: + case CellType::INVALID: break; - case MeshElemType::LINE: + case CellType::LINE2: type = VTK_LINE; break; - case MeshElemType::TRIANGLE: + case CellType::LINE3: + type = VTK_QUADRATIC_EDGE; + break; + case CellType::TRI3: type = VTK_TRIANGLE; break; - case MeshElemType::QUAD: + case CellType::TRI6: + type = VTK_QUADRATIC_TRIANGLE; + break; + case CellType::QUAD4: type = VTK_QUAD; break; - case MeshElemType::HEXAHEDRON: + case CellType::QUAD8: + type = VTK_QUADRATIC_QUAD; + break; + case CellType::QUAD9: + type = VTK_BIQUADRATIC_QUAD; + break; + case CellType::HEX8: type = VTK_HEXAHEDRON; break; - case MeshElemType::TETRAHEDRON: + case CellType::HEX20: + type = VTK_QUADRATIC_HEXAHEDRON; + break; + case CellType::HEX27: + type = VTK_TRIQUADRATIC_HEXAHEDRON; + break; + case CellType::TET4: type = VTK_TETRA; break; - case MeshElemType::PRISM: + case CellType::TET10: + type = VTK_QUADRATIC_TETRA; + break; + case CellType::PRISM6: type = VTK_WEDGE; break; - case MeshElemType::PYRAMID: + case CellType::PRISM15: + type = VTK_QUADRATIC_WEDGE; + break; + case CellType::PRISM18: + type = VTK_BIQUADRATIC_QUADRATIC_WEDGE; + break; + case CellType::PYRAMID5: type = VTK_PYRAMID; break; + case CellType::PYRAMID13: + type = VTK_QUADRATIC_PYRAMID; + break; } return type; } @@ -133,16 +163,16 @@ void VtkMappedMeshImpl::GetIdsOfCellsOfType(int type, vtkIdTypeArray *array) for (auto elem(_elements->begin()); elem != _elements->end(); ++elem) { - if ((*elem)->getGeomType() == VtkCellTypeToOGS(type)) + if ((*elem)->getCellType() == VtkCellTypeToOGS(type)) array->InsertNextValue((*elem)->getID()); } } int VtkMappedMeshImpl::IsHomogeneous() { - MeshElemType type = (*(_elements->begin()))->getGeomType(); + CellType type = (*(_elements->begin()))->getCellType(); for (auto elem(_elements->begin()); elem != _elements->end(); ++elem) - if((*elem)->getGeomType() != type) + if((*elem)->getCellType() != type) return 0; return 1; } diff --git a/InSituLib/VtkMappedMesh.h b/InSituLib/VtkMappedMesh.h index 5ad05d2b332041a275bba16797bf5a3fd941aa24..26c20a7f445a5584bfdfb79fd53c29c1e6ff7e45 100644 --- a/InSituLib/VtkMappedMesh.h +++ b/InSituLib/VtkMappedMesh.h @@ -71,34 +71,64 @@ private: const std::vector<MeshLib::Element*>* _elements; vtkIdType NumberOfCells; - static MeshElemType VtkCellTypeToOGS(int type) + static CellType VtkCellTypeToOGS(int type) { - MeshElemType ogs; + CellType ogs; switch (type) { case VTK_LINE: - ogs = MeshElemType::LINE; + ogs = CellType::LINE2; + break; + case VTK_QUADRATIC_EDGE: + ogs = CellType::LINE3; break; case VTK_TRIANGLE: - ogs = MeshElemType::TRIANGLE; + ogs = CellType::TRI3; + break; + case VTK_QUADRATIC_TRIANGLE: + ogs = CellType::TRI6; break; case VTK_QUAD: - ogs = MeshElemType::QUAD; + ogs = CellType::QUAD4; + break; + case VTK_QUADRATIC_QUAD: + ogs = CellType::QUAD8; + break; + case VTK_BIQUADRATIC_QUAD: + ogs = CellType::QUAD9; break; case VTK_HEXAHEDRON: - ogs = MeshElemType::HEXAHEDRON; + ogs = CellType::HEX8; + break; + case VTK_QUADRATIC_HEXAHEDRON: + ogs = CellType::HEX20; + break; + case VTK_TRIQUADRATIC_HEXAHEDRON: + ogs = CellType::HEX27; break; case VTK_TETRA: - ogs = MeshElemType::TETRAHEDRON; + ogs = CellType::TET4; + break; + case VTK_QUADRATIC_TETRA: + ogs = CellType::TET10; break; case VTK_WEDGE: - ogs = MeshElemType::PRISM; + ogs = CellType::PRISM6; + break; + case VTK_QUADRATIC_WEDGE: + ogs = CellType::PRISM15; + break; + case VTK_BIQUADRATIC_QUADRATIC_WEDGE: + ogs = CellType::PRISM18; break; case VTK_PYRAMID: - ogs = MeshElemType::PYRAMID; + ogs = CellType::PYRAMID5; + break; + case VTK_QUADRATIC_PYRAMID: + ogs = CellType::PYRAMID13; break; default: - ogs = MeshElemType::INVALID; + ogs = CellType::INVALID; break; } return ogs;