From c2ec3a43da85c20ebfb2e935001d0ba7900acedc Mon Sep 17 00:00:00 2001 From: Wenqing Wang <wenqing.wang@ufz.de> Date: Wed, 4 Mar 2020 15:19:03 +0100 Subject: [PATCH] [VtkMappedMeshSource::RequestData] Corrected an error. --- MeshLib/Vtk/VtkMappedMeshSource.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/MeshLib/Vtk/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp index 34bc9eba8b3..c31e9dfbd80 100644 --- a/MeshLib/Vtk/VtkMappedMeshSource.cpp +++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp @@ -144,35 +144,43 @@ int VtkMappedMeshSource::RequestData(vtkInformation* /*request*/, std::vector<std::string> const& propertyNames = properties.getPropertyVectorNames(); - for (auto name = propertyNames.cbegin(); name != propertyNames.cend(); - ++name) + for (auto const& name : propertyNames) { - if (addProperty<double>(properties, *name)) + if (addProperty<double>(properties, name)) { continue; } - if (addProperty<float>(properties, *name)) + if (addProperty<float>(properties, name)) { continue; } - if (addProperty<int>(properties, *name)) + if (addProperty<int>(properties, name)) { continue; } - if (addProperty<unsigned>(properties, *name)) + if (addProperty<unsigned>(properties, name)) { continue; } - if (addProperty<std::size_t>(properties, *name)) + if (addProperty<std::size_t>(properties, name)) { continue; } - if (addProperty<char>(properties, *name)) + if (addProperty<char>(properties, name)) { continue; } - DBUG("Mesh property '%s' with unknown data type.", *name->c_str()); + OGS_FATAL( + "Mesh property '%s' with unknown data type. Please check the data " + "type of the mesh properties. The available data types are:" + "\n\t double," + "\n\t float," + "\n\t int," + "\n\t unsigned," + "\n\t size_t," + "\n\t char.", + name.data()); } output->GetPointData()->ShallowCopy(this->PointData.GetPointer()); -- GitLab