From 3ecec290fd9467e2f9dee1bdd1e83dceb94ff44e Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Wed, 29 Nov 2017 18:04:27 +0100
Subject: [PATCH] [discretization] Introduce resize method in elementsolution

---
 dumux/discretization/box/elementsolution.hh          | 6 ++++++
 dumux/discretization/cellcentered/elementsolution.hh | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/dumux/discretization/box/elementsolution.hh b/dumux/discretization/box/elementsolution.hh
index 62a66c43bc..f4c9e312b9 100644
--- a/dumux/discretization/box/elementsolution.hh
+++ b/dumux/discretization/box/elementsolution.hh
@@ -82,6 +82,12 @@ public:
             priVars_[scv.indexInElement()] = sol[scv.dofIndex()];
     }
 
+    //! resize method
+    void resize(std::size_t size)
+    {
+        priVars_.resize(size);
+    }
+
     //! bracket operator const access
     template<typename IndexType>
     const PrimaryVariables& operator [](IndexType i) const
diff --git a/dumux/discretization/cellcentered/elementsolution.hh b/dumux/discretization/cellcentered/elementsolution.hh
index 3e22982cad..58795d6481 100644
--- a/dumux/discretization/cellcentered/elementsolution.hh
+++ b/dumux/discretization/cellcentered/elementsolution.hh
@@ -84,6 +84,12 @@ public:
         return priVars_;
     }
 
+    //! resize method
+    void resize(std::size_t size)
+    {
+        assert(size == 1 && "Cell-centered element solution can only have one entry." );
+    }
+
 private:
     PrimaryVariables priVars_;
 };
-- 
GitLab