diff --git a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp index c236111c5e85f444d8c7de36137925211607cdcd..096f6a512a30229815b1d597d6df62c97ddc2988 100644 --- a/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp +++ b/MeshLib/IO/MPI_IO/NodePartitionedMeshReader.cpp @@ -23,8 +23,8 @@ #include "BaseLib/FileTools.h" #include "BaseLib/RunTime.h" - #include "MeshLib/Elements/Elements.h" +#include "MeshLib/MeshEnums.h" #include "MeshLib/Properties.h" // Check if the value can by converted to given type without overflow. @@ -409,37 +409,79 @@ void NodePartitionedMeshReader::setElements( for(unsigned long k = 0; k < nnodes; k++) elem_nodes[k] = mesh_nodes[ elem_data[id_offset_elem++] ]; - // The element types below are defined by the mesh_partition tool - // available at https://github.com/ufz/mesh_partition . - switch (e_type) + // The element types below are defined by the MeshLib::CellType. + switch (static_cast<CellType const>(e_type)) { - case 1: + case CellType::POINT1: mesh_elems[i + id_offset_ghost] = new MeshLib::Point(elem_nodes); break; - case 2: + case CellType::LINE2: mesh_elems[i + id_offset_ghost] = new MeshLib::Line(elem_nodes); break; - case 6: + case CellType::LINE3: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Line3(elem_nodes); + break; + case CellType::QUAD4: mesh_elems[i + id_offset_ghost] = new MeshLib::Quad(elem_nodes); break; - case 11: + case CellType::QUAD8: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Quad8(elem_nodes); + break; + case CellType::QUAD9: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Quad9(elem_nodes); + break; + case CellType::HEX8: mesh_elems[i + id_offset_ghost] = new MeshLib::Hex(elem_nodes); break; - case 4: + case CellType::HEX20: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Hex20(elem_nodes); + break; + case CellType::HEX27: + OGS_FATAL( + "NodePartitionedMeshReader: construction of HEX27 element " + "with id {:d} is not implemented.", + i); + break; + case CellType::TRI3: mesh_elems[i + id_offset_ghost] = new MeshLib::Tri(elem_nodes); break; - case 9: + case CellType::TRI6: + mesh_elems[i + id_offset_ghost] = new MeshLib::Tri6(elem_nodes); + break; + case CellType::TET4: mesh_elems[i + id_offset_ghost] = new MeshLib::Tet(elem_nodes); break; - case 14: + case CellType::TET10: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Tet10(elem_nodes); + break; + case CellType::PRISM6: mesh_elems[i + id_offset_ghost] = new MeshLib::Prism(elem_nodes); break; - case 17: + case CellType::PRISM15: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Prism15(elem_nodes); + break; + case CellType::PYRAMID5: mesh_elems[i + id_offset_ghost] = new MeshLib::Pyramid(elem_nodes); break; + case CellType::PYRAMID13: + mesh_elems[i + id_offset_ghost] = + new MeshLib::Pyramid13(elem_nodes); + break; + case CellType::INVALID: + OGS_FATAL( + "NodePartitionedMeshReader: construction of INVALID " + "element type with id {:d} is not possible.", + i); + break; default: OGS_FATAL( "NodePartitionedMeshReader: construction of element type "