Skip to content
Snippets Groups Projects
Commit d0c66c4a authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL/IO] Handle all element types from partmesh.

parent f5d6bb75
No related branches found
No related tags found
No related merge requests found
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include "BaseLib/FileTools.h" #include "BaseLib/FileTools.h"
#include "BaseLib/RunTime.h" #include "BaseLib/RunTime.h"
#include "MeshLib/Elements/Elements.h" #include "MeshLib/Elements/Elements.h"
#include "MeshLib/MeshEnums.h"
#include "MeshLib/Properties.h" #include "MeshLib/Properties.h"
// Check if the value can by converted to given type without overflow. // Check if the value can by converted to given type without overflow.
...@@ -409,37 +409,79 @@ void NodePartitionedMeshReader::setElements( ...@@ -409,37 +409,79 @@ void NodePartitionedMeshReader::setElements(
for(unsigned long k = 0; k < nnodes; k++) for(unsigned long k = 0; k < nnodes; k++)
elem_nodes[k] = mesh_nodes[ elem_data[id_offset_elem++] ]; elem_nodes[k] = mesh_nodes[ elem_data[id_offset_elem++] ];
// The element types below are defined by the mesh_partition tool // The element types below are defined by the MeshLib::CellType.
// available at https://github.com/ufz/mesh_partition . switch (static_cast<CellType const>(e_type))
switch (e_type)
{ {
case 1: case CellType::POINT1:
mesh_elems[i + id_offset_ghost] = mesh_elems[i + id_offset_ghost] =
new MeshLib::Point(elem_nodes); new MeshLib::Point(elem_nodes);
break; break;
case 2: case CellType::LINE2:
mesh_elems[i + id_offset_ghost] = new MeshLib::Line(elem_nodes); mesh_elems[i + id_offset_ghost] = new MeshLib::Line(elem_nodes);
break; 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); mesh_elems[i + id_offset_ghost] = new MeshLib::Quad(elem_nodes);
break; 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); mesh_elems[i + id_offset_ghost] = new MeshLib::Hex(elem_nodes);
break; 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); mesh_elems[i + id_offset_ghost] = new MeshLib::Tri(elem_nodes);
break; 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); mesh_elems[i + id_offset_ghost] = new MeshLib::Tet(elem_nodes);
break; 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] = mesh_elems[i + id_offset_ghost] =
new MeshLib::Prism(elem_nodes); new MeshLib::Prism(elem_nodes);
break; 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] = mesh_elems[i + id_offset_ghost] =
new MeshLib::Pyramid(elem_nodes); new MeshLib::Pyramid(elem_nodes);
break; 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: default:
OGS_FATAL( OGS_FATAL(
"NodePartitionedMeshReader: construction of element type " "NodePartitionedMeshReader: construction of element type "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment