From c6360609ddde4cfa2a963e93224793f7f6ad55fb Mon Sep 17 00:00:00 2001
From: Ansgar Burchardt <Ansgar.Burchardt@tu-dresden.de>
Date: Tue, 20 Oct 2015 14:56:12 +0200
Subject: [PATCH] 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".
---
 dune/fufem/functions/vtkbasisgridfunction.hh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dune/fufem/functions/vtkbasisgridfunction.hh b/dune/fufem/functions/vtkbasisgridfunction.hh
index e7ccd23b..33365863 100644
--- a/dune/fufem/functions/vtkbasisgridfunction.hh
+++ b/dune/fufem/functions/vtkbasisgridfunction.hh
@@ -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. */
-- 
GitLab