Skip to content
Snippets Groups Projects
Commit a265fa5a authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MeL/VTK] Additional check for type sizes.

parent 95df051c
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,23 @@ private: ...@@ -104,6 +104,23 @@ private:
MeshLib::Properties& properties, MeshLib::Properties& properties,
MeshLib::MeshItemType type) 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()); vtkIdType const nTuples(array.GetNumberOfTuples());
int const nComponents(array.GetNumberOfComponents()); int const nComponents(array.GetNumberOfComponents());
char const* const array_name(array.GetName()); char const* const array_name(array.GetName());
......
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