diff --git a/applications/ebos/eclequilinitializer.hh b/applications/ebos/eclequilinitializer.hh index e3dfd288e..ebdb67d89 100644 --- a/applications/ebos/eclequilinitializer.hh +++ b/applications/ebos/eclequilinitializer.hh @@ -76,7 +76,7 @@ public: : simulator_(simulator) { const auto& gridManager = simulator.gridManager(); - const auto& grid = gridManager.grid(); + const auto& equilGrid = gridManager.equilGrid(); // create the data structures which are used by initStateEquil() Opm::parameter::ParameterGroup tmpParam; @@ -84,19 +84,21 @@ public: gridManager.deck(), gridManager.eclState(), materialLawManager, - Opm::UgGridHelpers::numCells(grid), - Opm::UgGridHelpers::globalCell(grid), - Opm::UgGridHelpers::cartDims(grid), + Opm::UgGridHelpers::numCells(equilGrid), + Opm::UgGridHelpers::globalCell(equilGrid), + Opm::UgGridHelpers::cartDims(equilGrid), tmpParam); + const int numElems = equilGrid.size(/*codim=*/0); + assert( int(gridManager.grid().size(/*codim=*/0)) == numElems ); // initialize the boiler plate of opm-core the state structure. Opm::BlackoilState opmBlackoilState; - opmBlackoilState.init(grid.size(/*codim=*/0), + opmBlackoilState.init(numElems, /*numFaces=*/0, // we don't care here numPhases); // do the actual computation. - Opm::initStateEquil(gridManager.grid(), + Opm::initStateEquil(equilGrid, opmBlackoilProps, gridManager.deck(), gridManager.eclState(), @@ -109,7 +111,6 @@ public: const Scalar MO = FluidSystem::molarMass(oilCompIdx); // copy the result into the array of initial fluid states - int numElems = gridManager.gridView().size(/*codim=*/0); initialFluidStates_.resize(numElems); for (int elemIdx = 0; elemIdx < numElems; ++elemIdx) { auto &fluidState = initialFluidStates_[elemIdx]; diff --git a/applications/ebos/eclproblem.hh b/applications/ebos/eclproblem.hh index 5af369ec5..01966c47e 100644 --- a/applications/ebos/eclproblem.hh +++ b/applications/ebos/eclproblem.hh @@ -41,6 +41,7 @@ #include #include +#include #include #include @@ -849,9 +850,6 @@ private: void readEquilInitialCondition_() { -#if EBOS_USE_ALUGRID -#warning "EQUIL-based initialization cannot yet be used with ALUGrid" -#else // The EQUIL initializer also modifies the material law manager according to // SWATINIT (although it does not belong there strictly speaking) typedef Ewoms::EclEquilInitializer EquilInitializer; @@ -868,7 +866,9 @@ private: auto &elemFluidState = initialFluidStates_[elemIdx]; elemFluidState.assign(equilInitializer.initialFluidState(elemIdx)); } -#endif + + // release the equil grid pointer since it's no longer needed. + this->simulator().gridManager().releaseEquilGrid(); } void readExplicitInitialCondition_() diff --git a/ewoms/common/cartesianindexmapper.hh b/ewoms/common/cartesianindexmapper.hh index d0b108b8b..1494b429a 100644 --- a/ewoms/common/cartesianindexmapper.hh +++ b/ewoms/common/cartesianindexmapper.hh @@ -1,3 +1,23 @@ +// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- +// vi: set et ts=4 sw=4 sts=4: +/* + Copyright 2015 IRIS AS + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ #ifndef OPM_CARTESIANINDEXMAPPER_HEADER #define OPM_CARTESIANINDEXMAPPER_HEADER