From 50351deb8bb9720e8a2539be660ed339575434b3 Mon Sep 17 00:00:00 2001 From: Bernd Flemisch <bernd@iws.uni-stuttgart.de> Date: Tue, 17 Sep 2013 15:07:40 +0000 Subject: [PATCH] VariableClassAdaptive: get rid of DUNE 2.3 warnings due to use of deprecated PersistentContainer functions git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@11487 2fb0f335-1f38-0410-981e-8018bf24f1b0 --- .../decoupled/common/variableclassadaptive.hh | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/dumux/decoupled/common/variableclassadaptive.hh b/dumux/decoupled/common/variableclassadaptive.hh index 6b39eccff1..5df836bcc1 100644 --- a/dumux/decoupled/common/variableclassadaptive.hh +++ b/dumux/decoupled/common/variableclassadaptive.hh @@ -19,9 +19,9 @@ #ifndef DUMUX_VARIABLECLASS_ADAPTIVE_HH #define DUMUX_VARIABLECLASS_ADAPTIVE_HH - -#include "variableclass.hh" +#include <dune/common/version.hh> #include <dune/grid/utility/persistentcontainer.hh> +#include "variableclass.hh" /** * @file @@ -56,10 +56,11 @@ private: typedef typename Grid::LevelGridView LevelGridView; typedef typename LevelGridView::template Codim<0>::Iterator LevelIterator; typedef typename GridView::Traits::template Codim<0>::EntityPointer ElementPointer; + typedef Dune::PersistentContainer<Grid, AdaptedValues> PersistentContainer; private: const Grid& grid_; - Dune::PersistentContainer<Grid, AdaptedValues> adaptationMap_; + PersistentContainer adaptationMap_; public: //! Constructs an adaptive VariableClass object @@ -87,7 +88,12 @@ public: */ void storePrimVars(const Problem& problem) { +#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3) + adaptationMap_.resize(); +#else adaptationMap_.reserve(); +#endif + // loop over all levels of the grid for (int level = grid_.maxLevel(); level >= 0; level--) { @@ -138,7 +144,11 @@ public: */ void reconstructPrimVars(const Problem& problem) { +#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3) + adaptationMap_.resize(); +#else adaptationMap_.reserve(); +#endif for (int level = 0; level <= grid_.maxLevel(); level++) { @@ -188,7 +198,13 @@ public: } // reset entries in restrictionmap +#if DUNE_VERSION_NEWER(DUNE_GRID, 2, 3) + adaptationMap_.resize( typename PersistentContainer::Value() ); + adaptationMap_.shrinkToFit(); + adaptationMap_.fill( typename PersistentContainer::Value() ); +#else adaptationMap_.clear(); +#endif } }; -- GitLab