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

[vtk][fix] Fix the runtime size checks to check actual vector size

parent 9ea3a18c
......@@ -306,9 +306,9 @@ public:
// also register additional (non-standardized) user fields
for (std::size_t i = 0; i < scalarFields_.size(); ++i)
{
if (scalarFields_[i].second.size() == std::size_t(problem_.gridView().size(0)))
if (scalarFields_[i].first.size() == std::size_t(problem_.gridView().size(0)))
sequenceWriter_.addCellData(scalarFields_[i].first, scalarFields_[i].second);
else if (scalarFields_[i].second.size() == std::size_t(problem_.gridView().size(dim)))
else if (scalarFields_[i].first.size() == std::size_t(problem_.gridView().size(dim)))
sequenceWriter_.addVertexData(scalarFields_[i].first, scalarFields_[i].second);
else
DUNE_THROW(Dune::RangeError, "Cannot add wrongly sized vtk scalar field!");
......@@ -316,14 +316,14 @@ public:
for (std::size_t i = 0; i < vectorFields_.size(); ++i)
{
if (scalarFields_[i].second.size() == std::size_t(problem_.gridView().size(0)))
if (scalarFields_[i].first.size() == std::size_t(problem_.gridView().size(0)))
{
using NestedFunction = VtkNestedFunction<GridView, ElementMapper, std::vector<GlobalPosition>>;
sequenceWriter_.addCellData(std::make_shared<NestedFunction>(vectorFields_[i].second,
problem_.gridView(), problem_.elementMapper(),
vectorFields_[i].first, 0, dimWorld));
}
else if (scalarFields_[i].second.size() == std::size_t(problem_.gridView().size(dim)))
else if (scalarFields_[i].first.size() == std::size_t(problem_.gridView().size(dim)))
{
using NestedFunction = VtkNestedFunction<GridView, VertexMapper, std::vector<GlobalPosition>>;
sequenceWriter_.addVertexData(std::make_shared<NestedFunction>(vectorFields_[i].second,
......
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