Skip to content
Snippets Groups Projects
Commit d52d78eb authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeL] Implement function getBulkIDString()

Using the function avoids the distribution of the magic names 'bulk_node_ids',
'bulk_element_ids', and 'bulk_face_ids' to several places in OGS.
parent 5f228887
No related branches found
No related tags found
No related merge requests found
...@@ -174,4 +174,34 @@ std::map<std::string, PropertyVectorBase*>::size_type Properties::size( ...@@ -174,4 +174,34 @@ std::map<std::string, PropertyVectorBase*>::size_type Properties::size(
[&](auto const p) [&](auto const p)
{ return p.second->getMeshItemType() == mesh_item_type; }); { 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 } // end namespace MeshLib
...@@ -173,6 +173,12 @@ private: ...@@ -173,6 +173,12 @@ private:
template <typename Function> template <typename Function>
void applyToPropertyVectors(Properties const& properties, Function f); 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" #include "Properties-impl.h"
} // end namespace MeshLib } // end namespace MeshLib
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