diff --git a/MeshLib/Properties.cpp b/MeshLib/Properties.cpp index 7b3d9de170c8afe8e27c1621945602d4a63d8b93..ab46c0179f1688df3a72ca991ce4bd62fe996019 100644 --- a/MeshLib/Properties.cpp +++ b/MeshLib/Properties.cpp @@ -174,4 +174,34 @@ std::map<std::string, PropertyVectorBase*>::size_type Properties::size( [&](auto const p) { return p.second->getMeshItemType() == mesh_item_type; }); } + +std::string getBulkIDString(MeshItemType mesh_item_type) +{ + switch (mesh_item_type) + { + case MeshItemType::Node: + return "bulk_node_ids"; + break; + case MeshItemType::Cell: + return "bulk_element_ids"; + break; + case MeshItemType::Edge: + return "bulk_edge_ids"; + break; + case MeshItemType::Face: + return "bulk_face_ids"; + break; + case MeshItemType::IntegrationPoint: + OGS_FATAL("MeshItemType::IntegrationPoint is not handled."); + return ""; + break; + default: + OGS_FATAL( + "Unknown mesh item type. At the moment only for mesh item " + "types 'Node', 'Cell', and 'Face' mapping names are " + "specified."); + return ""; + } +} + } // end namespace MeshLib diff --git a/MeshLib/Properties.h b/MeshLib/Properties.h index 51d1155bd1a3e573281c033e7e7b99d5fd603843..1e4b0ca46a76e97958e9d9500d3e77e3dd790b15 100644 --- a/MeshLib/Properties.h +++ b/MeshLib/Properties.h @@ -173,6 +173,12 @@ private: template <typename Function> void applyToPropertyVectors(Properties const& properties, Function f); +/// Returns the mapping MeshItemType -> bulk ID property name, i.e. +/// MeshItemType::Node -> bulk_node_ids +/// MeshItemType::Cell -> bulk_element_ids +/// MeshItemType::Face -> bulk_face_ids +std::string getBulkIDString(MeshItemType mesh_item_type); + #include "Properties-impl.h" } // end namespace MeshLib