From ca943a751a536096c45e0e00cc8ff8a671e7e8b2 Mon Sep 17 00:00:00 2001 From: "Dmitry Yu. Naumov" <github@naumov.de> Date: Thu, 1 Nov 2018 16:37:22 +0100 Subject: [PATCH] [App/U] Add useful messages for not read meshes. --- .../Utils/MeshGeoTools/IdentifySubdomains.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Applications/Utils/MeshGeoTools/IdentifySubdomains.cpp b/Applications/Utils/MeshGeoTools/IdentifySubdomains.cpp index 8d1d3e59294..c97e09e7a98 100644 --- a/Applications/Utils/MeshGeoTools/IdentifySubdomains.cpp +++ b/Applications/Utils/MeshGeoTools/IdentifySubdomains.cpp @@ -26,7 +26,12 @@ std::vector<std::unique_ptr<MeshLib::Mesh>> readMeshes( for (auto const& filename : filenames) { - meshes.emplace_back(MeshLib::IO::readMeshFromFile(filename)); + auto mesh = MeshLib::IO::readMeshFromFile(filename); + if (mesh == nullptr) + { + OGS_FATAL("Could not read mesh from '%s' file.", filename.c_str()); + } + meshes.emplace_back(mesh); } if (meshes.empty()) { @@ -95,6 +100,11 @@ int main(int argc, char* argv[]) // std::unique_ptr<MeshLib::Mesh> bulk_mesh{ MeshLib::IO::readMeshFromFile(bulk_mesh_arg.getValue())}; + if (bulk_mesh == nullptr) + { + OGS_FATAL("Could not read bulk mesh from '%s'", + bulk_mesh_arg.getValue().c_str()); + } // // Read the subdomain meshes. -- GitLab