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

[App] Print warn message if mesh names aren't unique

parent a0f0ff2a
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,9 @@
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
#include <cctype>
#include <range/v3/action/sort.hpp>
#include <range/v3/action/unique.hpp>
#include <range/v3/range/conversion.hpp>
#include <set>
#ifdef OGS_USE_PYTHON
......@@ -223,6 +226,20 @@ std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes(
std::back_inserter(meshes));
}
auto mesh_names = MeshLib::views::names | ranges::to<std::vector>() |
ranges::actions::sort;
auto const sorted_names = meshes | mesh_names;
auto const unique_names = meshes | mesh_names | ranges::actions::unique;
if (unique_names.size() < sorted_names.size())
{
WARN(
"Mesh names aren't unique. From project file read mesh names are:");
for (auto const& name : meshes | MeshLib::views::names)
{
INFO("- {}", name);
}
}
MeshLib::setMeshSpaceDimension(meshes);
return meshes;
......
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