From a74a4d2f6e147380196f1e7bebba5cd496c3177b Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Fri, 12 Dec 2014 13:54:32 +0100 Subject: [PATCH] fix the dune 2.4 deprecation warnings mainly this boils down to mapper.map(e) -> mapper.index(e) --- examples/problems/lensgridmanager.hh | 17 ++++++++++------- tests/models/test_quadrature.cpp | 4 ++++ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/examples/problems/lensgridmanager.hh b/examples/problems/lensgridmanager.hh index 879528ef5..22acc4f72 100644 --- a/examples/problems/lensgridmanager.hh +++ b/examples/problems/lensgridmanager.hh @@ -125,10 +125,9 @@ public: Dune::FieldVector cellRes; #endif - Dune::FieldVector upperRight; - Dune::FieldVector lowerLeft; + typedef double GridScalar; + Dune::FieldVector upperRight; - lowerLeft[1] = 0.0; upperRight[0] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeX); upperRight[1] = EWOMS_GET_PARAM(TypeTag, Scalar, DomainSizeY); @@ -140,13 +139,17 @@ public: } unsigned numRefinements = EWOMS_GET_PARAM(TypeTag, unsigned, GridGlobalRefinements); +#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4) + gridPtr_.reset(new Dune::YaspGrid(upperRight, cellRes)); +#else gridPtr_.reset(new Dune::YaspGrid( #ifdef HAVE_MPI - /*mpiCommunicator=*/Dune::MPIHelper::getCommunicator(), + /*mpiCommunicator=*/Dune::MPIHelper::getCommunicator(), +#endif + /*upperRightCorner=*/upperRight, + /*numCells=*/cellRes, isPeriodic, + /*overlap=*/1)); #endif - /*upperRightCorner=*/upperRight, - /*numCells=*/cellRes, isPeriodic, - /*overlap=*/1)); gridPtr_->globalRefine(numRefinements); this->finalizeInit_(); diff --git a/tests/models/test_quadrature.cpp b/tests/models/test_quadrature.cpp index e6109cfbb..17124296e 100644 --- a/tests/models/test_quadrature.cpp +++ b/tests/models/test_quadrature.cpp @@ -281,6 +281,9 @@ void testQuadrature() typedef Dune::YaspGrid Grid; typedef Grid::LeafGridView GridView; +#if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 4) + Grid grid(upperRight, cellRes); +#else Grid grid( #ifdef HAVE_MPI Dune::MPIHelper::getCommunicator(), @@ -288,6 +291,7 @@ void testQuadrature() upperRight, // upper right cellRes, // number of cells isPeriodic, 0); // overlap +#endif // compute approximate integral #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 3)