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

[test][vtk][cleanup] Use structured bindings

parent 3e012335
......@@ -74,25 +74,25 @@ int main(int argc, char** argv) try
}
Dumux::VTKReader::Data reorderedCellData = cellData, reorderedPointData = pointData;
for (const auto& data : cellData)
for (const auto& [name, data] : cellData)
{
auto& reorderedData = reorderedCellData[data.first];
for (unsigned int i = 0; i < data.second.size(); ++i)
reorderedData[elementIndex[i]] = data.second[i];
auto& reorderedData = reorderedCellData[name];
for (unsigned int i = 0; i < data.size(); ++i)
reorderedData[elementIndex[i]] = data[i];
}
for (const auto& data : pointData)
for (const auto& [name, data] : pointData)
{
auto& reorderedData = reorderedPointData[data.first];
for (unsigned int i = 0; i < data.second.size(); ++i)
reorderedData[vertexIndex[i]] = data.second[i];
auto& reorderedData = reorderedPointData[name];
for (unsigned int i = 0; i < data.size(); ++i)
reorderedData[vertexIndex[i]] = data[i];
}
Dune::VTKWriter<Grid::LeafGridView> vtkWriter(gridView);
for (const auto& data : reorderedCellData)
vtkWriter.addCellData(data.second, data.first);
for (const auto& data : reorderedPointData)
vtkWriter.addVertexData(data.second, data.first);
for (const auto& [name, data] : reorderedCellData)
vtkWriter.addCellData(data, name);
for (const auto& [name, data] : reorderedPointData)
vtkWriter.addVertexData(data, name);
vtkWriter.write(std::string(argv[2]));
return 0;
......
Markdown is supported
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