Revision 4493964f6780e2ccbcdda9771965af2237d98187 authored by Tom Fischer on 20 September 2021, 06:56:57 UTC, committed by Tom Fischer on 20 September 2021, 06:56:57 UTC
[MeL/Mesh] Improves the memory footprint of the mesh. See merge request ogs/ogs!3785
VtkOGSEnum.cpp
/**
* \file
* \copyright
* Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "VtkOGSEnum.h"
#include <vtkCellType.h>
#include "BaseLib/Error.h"
int OGSToVtkCellType(MeshLib::CellType ogs)
{
switch (ogs)
{
case MeshLib::CellType::POINT1:
return VTK_VERTEX;
case MeshLib::CellType::LINE2:
return VTK_LINE;
case MeshLib::CellType::LINE3:
return VTK_QUADRATIC_EDGE;
case MeshLib::CellType::TRI3:
return VTK_TRIANGLE;
case MeshLib::CellType::TRI6:
return VTK_QUADRATIC_TRIANGLE;
case MeshLib::CellType::QUAD4:
return VTK_QUAD;
case MeshLib::CellType::QUAD8:
return VTK_QUADRATIC_QUAD;
case MeshLib::CellType::QUAD9:
return VTK_BIQUADRATIC_QUAD;
case MeshLib::CellType::HEX8:
return VTK_HEXAHEDRON;
case MeshLib::CellType::HEX20:
return VTK_QUADRATIC_HEXAHEDRON;
case MeshLib::CellType::HEX27:
return VTK_TRIQUADRATIC_HEXAHEDRON;
case MeshLib::CellType::TET4:
return VTK_TETRA;
case MeshLib::CellType::TET10:
return VTK_QUADRATIC_TETRA;
case MeshLib::CellType::PRISM6:
return VTK_WEDGE;
case MeshLib::CellType::PRISM15:
return VTK_QUADRATIC_WEDGE;
case MeshLib::CellType::PRISM18:
return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
case MeshLib::CellType::PYRAMID5:
return VTK_PYRAMID;
case MeshLib::CellType::PYRAMID13:
return VTK_QUADRATIC_PYRAMID;
case MeshLib::CellType::INVALID:
return -1;
default:
OGS_FATAL(
"Unknown cell type in conversion from OGS to VTK. Given cell "
"type value is {:d}.",
ogs);
}
}
Computing file changes ...