Skip to content
Snippets Groups Projects
Commit c6360609 authored by Ansgar Burchardt's avatar Ansgar Burchardt
Browse files

VTKBasisGridFunction: do not check size in constructor

With a Dune::VTKSequenceWriter I would like to have code like

    Vector x;
    VTKSequenceWriter<...> writer(...);
    VTKBasisGridFunction<...> function(..., x, ...);
    writer.addVertexData(function);

    for (int i = 0; i < level; ++i) {
        ... // refine grid, solve PDE, change size of x
        writer.write(static_cast<double>(i));
    }

As the size of "x" is only correct in the for-loop, it cannot be checked
when constructing the "writer". However the "function" needs to be setup
outside the loop as well. So the VTKBasisGridFunction constructor should
not check the size of "x".
parent a05b81c7
No related branches found
No related tags found
No related merge requests found
......@@ -34,8 +34,7 @@ public:
coeffs_(v),
s_( s )
{
if (v.size() !=basis_.size())
DUNE_THROW(Dune::IOError, "VTKGridFunction: Coefficient vector is not matching the basis");
/* Nothing. */
}
/** \brief Get the number of components the function has. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment