diff --git a/MeshLib/MeshGenerators/VtkMeshConverter.h b/MeshLib/MeshGenerators/VtkMeshConverter.h index f7ba3cbcab8f880d513db47898491cd905497947..55a0d0b6763db2301473f187819d1bc1eb842a58 100644 --- a/MeshLib/MeshGenerators/VtkMeshConverter.h +++ b/MeshLib/MeshGenerators/VtkMeshConverter.h @@ -104,6 +104,23 @@ private: MeshLib::Properties& properties, MeshLib::MeshItemType type) { + // Keep for debugging purposes, since the vtk array type and the end + // type T are not always the same. + // DBUG( + // "Converting a vtk array '{:s}' with data type '{:s}' of " + // "size {:d} to a type '{:s}' of size {:d}.", + // array.GetName(), array.GetDataTypeAsString(), + // array.GetDataTypeSize(), typeid(T).name(), sizeof(T)); + + if (sizeof(T) != array.GetDataTypeSize()) + { + OGS_FATAL( + "Trying to convert a vtk array '{:s}' with data type '{:s}' of " + "size {:d} to a different sized type '{:s}' of size {:d}.", + array.GetName(), array.GetDataTypeAsString(), + array.GetDataTypeSize(), typeid(T).name(), sizeof(T)); + } + vtkIdType const nTuples(array.GetNumberOfTuples()); int const nComponents(array.GetNumberOfComponents()); char const* const array_name(array.GetName());