fix all Dune 2.6 related compiler warnings in ebos

This commit is contained in:
Andreas Lauser 2018-01-08 12:23:57 +01:00
parent c8d7be3848
commit 4957a301f1
4 changed files with 34 additions and 9 deletions

View File

@ -198,10 +198,14 @@ namespace Ewoms
typedef typename GridManager::EquilGrid::LeafGridView EquilGridView;
const EquilGridView equilGridView = gridManager.equilGrid().leafGridView() ;
typedef Dune::MultipleCodimMultipleGeomTypeMapper< EquilGridView, Dune::MCMGElementLayout>
EquilElementMapper;
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
typedef Dune::MultipleCodimMultipleGeomTypeMapper<EquilGridView> EquilElementMapper;
EquilElementMapper equilElemMapper(equilGridView, Dune::mcmgElementLayout());
#else
typedef Dune::MultipleCodimMultipleGeomTypeMapper<EquilGridView, Dune::MCMGElementLayout> EquilElementMapper;
EquilElementMapper equilElemMapper(equilGridView);
#endif
EquilElementMapper equilElemMapper( equilGridView );
// the I/O rank needs a picture of the global grid, here we
// use equilGrid which represents a view on the global grid
@ -242,10 +246,13 @@ namespace Ewoms
typedef typename GridManager::GridView LocalGridView;
const LocalGridView localGridView = gridManager.gridView() ;
typedef Dune::MultipleCodimMultipleGeomTypeMapper< LocalGridView, Dune::MCMGElementLayout>
ElementMapper;
ElementMapper elemMapper( localGridView );
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
typedef Dune::MultipleCodimMultipleGeomTypeMapper<LocalGridView> ElementMapper;
ElementMapper elemMapper(localGridView, Dune::mcmgElementLayout());
#else
typedef Dune::MultipleCodimMultipleGeomTypeMapper<LocalGridView, Dune::MCMGElementLayout> ElementMapper;
ElementMapper elemMapper(localGridView);
#endif
for( auto it = localGridView.template begin< 0, Dune::Interior_Partition >(),
end = localGridView.template end< 0, Dune::Interior_Partition >(); it != end; ++it )

View File

@ -32,6 +32,8 @@
#include <dune/grid/CpGrid.hpp>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/common/version.hh>
namespace Ewoms {
@ -157,7 +159,11 @@ public:
const auto& gridView = grid_->leafGridView();
unsigned numFaces = grid_->numFaces();
std::vector<double> faceTrans(numFaces, 0.0);
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
ElementMapper elemMapper(this->gridView(), Dune::mcmgElementLayout());
#else
ElementMapper elemMapper(this->gridView());
#endif
auto elemIt = gridView.template begin</*codim=*/0>();
const auto& elemEndIt = gridView.template end</*codim=*/0>();
for (; elemIt != elemEndIt; ++ elemIt) {

View File

@ -35,15 +35,18 @@
#include <opm/parser/eclipse/EclipseState/Grid/GridProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
#include <dune/grid/CpGrid.hpp>
#include <opm/common/ErrorMacros.hpp>
#include <opm/common/Exceptions.hpp>
#include <dune/grid/common/mcmgmapper.hh>
#include <dune/common/version.hh>
#include <dune/common/fvector.hh>
#include <dune/common/fmatrix.hh>
#include <dune/grid/CpGrid.hpp>
#include <array>
#include <vector>
#include <unordered_map>
@ -109,7 +112,11 @@ public:
const auto& eclState = gridManager_.eclState();
const auto& eclGrid = eclState.getInputGrid();
auto& transMult = eclState.getTransMult();
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
ElementMapper elemMapper(gridView, Dune::mcmgElementLayout());
#else
ElementMapper elemMapper(gridView);
#endif
// get the ntg values, the ntg values are modified for the cells merged with minpv
std::vector<double> ntg;

View File

@ -134,8 +134,13 @@ public:
EclWriter(const Simulator& simulator)
: simulator_(simulator)
, gridView_(simulator_.gridView())
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
, elementMapper_(gridView_, Dune::mcmgElementLayout())
, vertexMapper_(gridView_, Dune::mcmgVertexLayout())
#else
, elementMapper_(gridView_)
, vertexMapper_(gridView_)
#endif
, collectToIORank_( simulator_.gridManager() )
{
reportStepIdx_ = 0;