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

[MeL/Properties] Use string_view in getBulkIDString

parent 4ee6d73b
No related branches found
No related tags found
No related merge requests found
......@@ -175,33 +175,4 @@ std::map<std::string, PropertyVectorBase*>::size_type Properties::size(
{ 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
......@@ -177,7 +177,34 @@ void applyToPropertyVectors(Properties const& properties, Function f);
/// MeshItemType::Node -> bulk_node_ids
/// MeshItemType::Cell -> bulk_element_ids
/// MeshItemType::Face -> bulk_face_ids
std::string getBulkIDString(MeshItemType mesh_item_type);
constexpr std::string_view 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 "";
}
}
#include "Properties-impl.h"
......
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