From 3a35a495a827af9bb6b84601c6d807f04c9ef852 Mon Sep 17 00:00:00 2001 From: Robert Kloefkorn Date: Wed, 29 Nov 2017 23:25:56 +0100 Subject: [PATCH] [bugfix] make code compile when GridView is not Grid::LeafGridView. --- opm/autodiff/FlowMainEbos.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/opm/autodiff/FlowMainEbos.hpp b/opm/autodiff/FlowMainEbos.hpp index 18994afde..4158dc2bd 100755 --- a/opm/autodiff/FlowMainEbos.hpp +++ b/opm/autodiff/FlowMainEbos.hpp @@ -481,7 +481,7 @@ namespace Opm const SummaryConfig& summaryConfig() const { return ebosSimulator_->gridManager().summaryConfig(); } - + // Initialise the reservoir state. Updated fluid props for SWATINIT. // Writes to: // state_ @@ -827,11 +827,14 @@ namespace Opm if( output && output_ecl && grid().comm().size() > 1 ) { + typedef typename Grid::LeafGridView GridView; + using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper; // Get the owner rank number for each cell - using ElementMapper = Dune::MultipleCodimMultipleGeomTypeMapper; using Handle = CellOwnerDataHandle; - ElementMapper globalMapper(this->globalGrid().leafGridView()); - const auto globalSize = this->globalGrid().size(0); + const Grid& globalGrid = this->globalGrid(); + const auto& globalGridView = globalGrid.leafGridView(); + ElementMapper globalMapper(globalGridView); + const auto globalSize = globalGrid.size(0); std::vector ranks(globalSize, -1); Handle handle(globalMapper, ranks); this->grid().gatherData(handle);