diff --git a/dumux/common/intersectionmapper.hh b/dumux/common/intersectionmapper.hh index dcee8ab505f7253f58a363cab865c383a6ca760f..fadbd0422fd8400c7cf98665c2566a09b55777d7 100644 --- a/dumux/common/intersectionmapper.hh +++ b/dumux/common/intersectionmapper.hh @@ -24,6 +24,8 @@ #include <dune/grid/common/mcmgmapper.hh> #include <dune/grid/common/rangegenerators.hh> +#include <dune/common/version.hh> + /*! * \file * \brief defines an intersection mapper for mapping of global DOFs assigned @@ -44,7 +46,11 @@ class IntersectionMapper enum {dim=Grid::dimension}; typedef typename Grid::template Codim<0>::Entity Element; typedef typename GridView::Intersection Intersection; - typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper; +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; +#else + using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>; +#endif public: IntersectionMapper(const GridView& gridview) diff --git a/dumux/implicit/problem.hh b/dumux/implicit/problem.hh index 81e9c326597abafd8cabf469588c1d76d38718fb..d940ba1e144178feaa4a36aa95e21cc45f752361 100644 --- a/dumux/implicit/problem.hh +++ b/dumux/implicit/problem.hh @@ -30,6 +30,8 @@ #include <dumux/implicit/adaptive/gridadapt.hh> #include <dumux/common/boundingboxtree.hh> +#include <dune/common/version.hh> + namespace Dumux { /*! @@ -103,11 +105,17 @@ public: : gridView_(gridView) , bBoxMin_(std::numeric_limits<double>::max()) , bBoxMax_(-std::numeric_limits<double>::max()) +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + , elementMapper_(gridView, Dune::mcmgElementLayout()) + , vertexMapper_(gridView, Dune::mcmgVertexLayout()) +#else , elementMapper_(gridView) , vertexMapper_(gridView) +#endif , timeManager_(&timeManager) , newtonMethod_(asImp_()) , newtonCtl_(asImp_()) + { // calculate the bounding box of the local partition of the grid view for (const auto& vertex : vertices(gridView)) { diff --git a/dumux/implicit/propertydefaults.hh b/dumux/implicit/propertydefaults.hh index 8cc5e846ac9b8deaaaed63d62d56cb42a41489f9..b83e553f49fdc37db8df41e111aa72bc88382989 100644 --- a/dumux/implicit/propertydefaults.hh +++ b/dumux/implicit/propertydefaults.hh @@ -41,6 +41,8 @@ #include "localjacobian.hh" #include "volumevariables.hh" +#include <dune/common/version.hh> + namespace Dumux { // forward declarations @@ -71,16 +73,29 @@ SET_TYPE_PROP(ImplicitBase, NewtonMethod, NewtonMethod<TypeTag>); SET_TYPE_PROP(ImplicitBase, NewtonController, NewtonController<TypeTag>); //! Mapper for the grid view's vertices. +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) +SET_TYPE_PROP(ImplicitBase, + VertexMapper, + Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView)>); +#else SET_TYPE_PROP(ImplicitBase, VertexMapper, Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView), Dune::MCMGVertexLayout>); +#endif + //! Mapper for the grid view's elements. +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) +SET_TYPE_PROP(ImplicitBase, + ElementMapper, + Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView)>); +#else SET_TYPE_PROP(ImplicitBase, ElementMapper, Dune::MultipleCodimMultipleGeomTypeMapper<typename GET_PROP_TYPE(TypeTag, GridView), Dune::MCMGElementLayout>); +#endif //! Set the BaseModel to ImplicitModel SET_TYPE_PROP(ImplicitBase, BaseModel, ImplicitModel<TypeTag>); diff --git a/dumux/io/vtkmultiwriter.hh b/dumux/io/vtkmultiwriter.hh index cb7597643f129578d7e8fa2c0e49250915f45203..c7e67441953eca54848f0ada55ccd8fa869c5060 100644 --- a/dumux/io/vtkmultiwriter.hh +++ b/dumux/io/vtkmultiwriter.hh @@ -38,6 +38,8 @@ #include <dumux/common/valgrind.hh> +#include <dune/common/version.hh> + #if HAVE_MPI #include <mpi.h> #endif @@ -56,8 +58,13 @@ class VtkMultiWriter { enum { dim = GridView::dimension }; +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView> VertexMapper; + typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView> ElementMapper; +#else typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout> VertexMapper; typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper; +#endif public: typedef Dune::VTKWriter<GridView> VtkWriter; @@ -65,8 +72,13 @@ public: const std::string &simName = "", std::string multiFileName = "") : gridView_(gridView) +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + , elementMapper_(gridView, Dune::mcmgElementLayout()) + , vertexMapper_(gridView, Dune::mcmgVertexLayout()) +#else , elementMapper_(gridView) , vertexMapper_(gridView) +#endif { simName_ = (simName.empty())?"sim":simName; multiFileName_ = multiFileName; diff --git a/dumux/material/spatialparams/gstatrandomfield.hh b/dumux/material/spatialparams/gstatrandomfield.hh index c7dbe5e552a26776e65d54f4752e5235b58c2f7b..fbe0924f757563a7d072c36504f13d395019d3eb 100644 --- a/dumux/material/spatialparams/gstatrandomfield.hh +++ b/dumux/material/spatialparams/gstatrandomfield.hh @@ -30,6 +30,8 @@ #include <dune/grid/common/mcmgmapper.hh> #include <dune/grid/io/file/vtk.hh> +#include <dune/common/version.hh> + namespace Dumux { @@ -54,7 +56,11 @@ class GstatRandomField using DataVector = std::vector<Scalar>; using Element = typename GridView::Traits::template Codim<0>::Entity; +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; +#else using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout>; +#endif public: // Add field types if you want to implement e.g. tensor permeabilities. @@ -66,7 +72,12 @@ public: * \param gridView the used gridView */ GstatRandomField(const GridView& gridView) - : gridView_(gridView), elementMapper_(gridView), + : gridView_(gridView), +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + elementMapper_(gridView, Dune::mcmgElementLayout()), +#else + elementMapper_(gridView), +#endif data_(gridView.size(0)) {} /*! diff --git a/dumux/porousmediumflow/sequential/properties.hh b/dumux/porousmediumflow/sequential/properties.hh index 09cfaa0a7abf0528e0a8df2f8a6a2a658a424a59..205cdaf30ca53f7efdb8d417a84743490939ce7c 100644 --- a/dumux/porousmediumflow/sequential/properties.hh +++ b/dumux/porousmediumflow/sequential/properties.hh @@ -24,6 +24,8 @@ #include <dumux/porousmediumflow/sequential/gridadaptproperties.hh> #include <dumux/porousmediumflow/sequential/gridadaptinitializationindicatordefault.hh> +#include <dune/common/version.hh> + /*! * \ingroup Sequential * \ingroup IMPETProperties @@ -136,12 +138,20 @@ public: /*! * \brief Mapper for the grid view's vertices. */ +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + using VertexMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; +#else typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGVertexLayout> VertexMapper; +#endif /*! * \brief Mapper for the grid view's elements. */ +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>; +#else typedef Dune::MultipleCodimMultipleGeomTypeMapper<GridView, Dune::MCMGElementLayout> ElementMapper; +#endif /*! * \brief The type of a solution at a fixed time. diff --git a/dumux/porousmediumflow/sequential/variableclass.hh b/dumux/porousmediumflow/sequential/variableclass.hh index 25a1e17554f3a892a13ccec99bf92a3d6b2cae59..289b1659fd1acb7b6d0d40c80747cdcbb1d9828b 100644 --- a/dumux/porousmediumflow/sequential/variableclass.hh +++ b/dumux/porousmediumflow/sequential/variableclass.hh @@ -21,6 +21,8 @@ #include "properties.hh" +#include <dune/common/version.hh> + // for parallelization //#include <dumux/parallel/elementhandles.hh> @@ -77,10 +79,16 @@ public: * @param gridView a DUNE gridview object corresponding to diffusion and transport equation */ VariableClass(const GridView& gridView) : - gridView_(gridView), elementMapper_(gridView), vertexMapper_(gridView) + gridView_(gridView), +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + elementMapper_(gridView, Dune::mcmgElementLayout()), + vertexMapper_(gridView, Dune::mcmgVertexLayout()) +#else + elementMapper_(gridView), + vertexMapper_(gridView) +#endif {} - //! Initializes the variable class /*! Method initializes the cellData vector. * Should be called from problem init() diff --git a/test/geomechanics/el2p/el2pproblem.hh b/test/geomechanics/el2p/el2pproblem.hh index ae4f7fe3feca429a5fa025468a5be3215b39807a..f87399f2e411b405035e2678850471f5f6ffaa60 100644 --- a/test/geomechanics/el2p/el2pproblem.hh +++ b/test/geomechanics/el2p/el2pproblem.hh @@ -34,6 +34,8 @@ #include "el2pco2tables.hh" #include "el2pspatialparams.hh" +#include <dune/common/version.hh> + namespace Dumux { template<class TypeTag> @@ -764,7 +766,14 @@ public: * * \param gridView The grid view */ - InitialPressSat(const GridView & gridView) : BaseT(gridView) , gridView_(gridView), vertexMapper_(gridView) + InitialPressSat(const GridView & gridView) + : BaseT(gridView) + , gridView_(gridView) +#if DUNE_VERSION_NEWER(DUNE_COMMON,2,6) + , vertexMapper_(gridView, Dune::mcmgVertexLayout()) +#else + , vertexMapper_(gridView) +#endif { // resize the pressure field vector with the number of vertices pInit_.resize(gridView.size(GridView::dimension));