Commit bb10b205 authored by Timo Koch's avatar Timo Koch
Browse files

[test][vtk][io] Add hasData to the vtk reader unit test

parent b429ca33
......@@ -76,6 +76,10 @@ int main(int argc, char** argv) try
Dumux::VTKReader::Data reorderedCellData = cellData, reorderedPointData = pointData;
for (const auto& [name, data] : cellData)
{
// sanity check
if (!vtkReader->hasData(name, Dumux::VTKReader::DataType::cellData))
DUNE_THROW(Dune::Exception, "Array " << name << " exists but hasData returns false!");
auto& reorderedData = reorderedCellData[name];
for (unsigned int i = 0; i < data.size(); ++i)
reorderedData[elementIndex[i]] = data[i];
......@@ -83,6 +87,10 @@ int main(int argc, char** argv) try
for (const auto& [name, data] : pointData)
{
// sanity check
if (!vtkReader->hasData(name, Dumux::VTKReader::DataType::pointData))
DUNE_THROW(Dune::Exception, "Array " << name << " exists but hasData returns false!");
auto& reorderedData = reorderedPointData[name];
for (unsigned int i = 0; i < data.size(); ++i)
reorderedData[vertexIndex[i]] = data[i];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment