mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
rename the "grid manager" to "vanguard"
IMO the term "vanguard" expresses better what these classes are supposed to do: level the ground for the cavalry. Normally this simply means to create and distribute a grid object, but it can become quite a bit more complicated, as exemplified by the vanguard classes of ebos..
This commit is contained in:
parent
61461dd61c
commit
436c9f8791
@ -45,11 +45,11 @@
|
||||
|
||||
namespace Ewoms
|
||||
{
|
||||
template < class GridManager >
|
||||
template < class Vanguard >
|
||||
class CollectDataToIORank
|
||||
{
|
||||
public:
|
||||
typedef typename GridManager :: Grid Grid;
|
||||
typedef typename Vanguard :: Grid Grid;
|
||||
typedef typename Grid :: CollectiveCommunication CollectiveCommunication;
|
||||
|
||||
// global id
|
||||
@ -172,9 +172,9 @@ namespace Ewoms
|
||||
enum { ioRank = 0 };
|
||||
|
||||
static const bool needsReordering = ! std::is_same<
|
||||
typename GridManager::Grid, typename GridManager::EquilGrid > :: value ;
|
||||
typename Vanguard::Grid, typename Vanguard::EquilGrid > :: value ;
|
||||
|
||||
CollectDataToIORank( const GridManager& gridManager )
|
||||
CollectDataToIORank( const Vanguard& vanguard )
|
||||
: toIORankComm_( )
|
||||
{
|
||||
// index maps only have to be build when reordering is needed
|
||||
@ -183,12 +183,12 @@ namespace Ewoms
|
||||
return ;
|
||||
}
|
||||
|
||||
const CollectiveCommunication& comm = gridManager.grid().comm();
|
||||
const CollectiveCommunication& comm = vanguard.grid().comm();
|
||||
|
||||
{
|
||||
std::set< int > send, recv;
|
||||
typedef typename GridManager::EquilGrid::LeafGridView EquilGridView;
|
||||
const EquilGridView equilGridView = gridManager.equilGrid().leafGridView() ;
|
||||
typedef typename Vanguard::EquilGrid::LeafGridView EquilGridView;
|
||||
const EquilGridView equilGridView = vanguard.equilGrid().leafGridView() ;
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
|
||||
typedef Dune::MultipleCodimMultipleGeomTypeMapper<EquilGridView> EquilElementMapper;
|
||||
@ -200,16 +200,16 @@ namespace Ewoms
|
||||
|
||||
// We need a mapping from local to global grid, here we
|
||||
// use equilGrid which represents a view on the global grid
|
||||
const size_t globalSize = gridManager.equilGrid().leafGridView().size( 0 );
|
||||
const size_t globalSize = vanguard.equilGrid().leafGridView().size( 0 );
|
||||
// reserve memory
|
||||
globalCartesianIndex_.resize(globalSize, -1);
|
||||
|
||||
// loop over all elements (global grid) and store Cartesian index
|
||||
auto elemIt = gridManager.equilGrid().leafGridView().template begin<0>();
|
||||
const auto& elemEndIt = gridManager.equilGrid().leafGridView().template end<0>();
|
||||
auto elemIt = vanguard.equilGrid().leafGridView().template begin<0>();
|
||||
const auto& elemEndIt = vanguard.equilGrid().leafGridView().template end<0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
int elemIdx = equilElemMapper.index(*elemIt );
|
||||
int cartElemIdx = gridManager.equilCartesianIndexMapper().cartesianIndex(elemIdx);
|
||||
int cartElemIdx = vanguard.equilCartesianIndexMapper().cartesianIndex(elemIdx);
|
||||
globalCartesianIndex_[elemIdx] = cartElemIdx;
|
||||
}
|
||||
|
||||
@ -230,15 +230,15 @@ namespace Ewoms
|
||||
}
|
||||
|
||||
localIndexMap_.clear();
|
||||
const size_t gridSize = gridManager.grid().size( 0 );
|
||||
const size_t gridSize = vanguard.grid().size( 0 );
|
||||
localIndexMap_.reserve( gridSize );
|
||||
|
||||
// store the local Cartesian index
|
||||
IndexMapType distributedCartesianIndex;
|
||||
distributedCartesianIndex.resize(gridSize, -1);
|
||||
|
||||
typedef typename GridManager::GridView LocalGridView;
|
||||
const LocalGridView localGridView = gridManager.gridView() ;
|
||||
typedef typename Vanguard::GridView LocalGridView;
|
||||
const LocalGridView localGridView = vanguard.gridView() ;
|
||||
|
||||
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
|
||||
typedef Dune::MultipleCodimMultipleGeomTypeMapper<LocalGridView> ElementMapper;
|
||||
@ -254,7 +254,7 @@ namespace Ewoms
|
||||
{
|
||||
const auto element = *it ;
|
||||
int elemIdx = elemMapper.index( element );
|
||||
distributedCartesianIndex[elemIdx] = gridManager.cartesianIndex( elemIdx );
|
||||
distributedCartesianIndex[elemIdx] = vanguard.cartesianIndex( elemIdx );
|
||||
|
||||
// only store interior element for collection
|
||||
//assert( element.partitionType() == Dune :: InteriorEntity );
|
||||
|
@ -22,12 +22,12 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Ewoms::EclAluGridManager
|
||||
* \copydoc Ewoms::EclAluGridVanguard
|
||||
*/
|
||||
#ifndef EWOMS_ECL_ALU_GRID_MANAGER_HH
|
||||
#define EWOMS_ECL_ALU_GRID_MANAGER_HH
|
||||
#ifndef EWOMS_ECL_ALU_GRID_VANGUARD_HH
|
||||
#define EWOMS_ECL_ALU_GRID_VANGUARD_HH
|
||||
|
||||
#include "eclbasegridmanager.hh"
|
||||
#include "eclbasevanguard.hh"
|
||||
#include "alucartesianindexmapper.hh"
|
||||
|
||||
#include <dune/alugrid/grid.hh>
|
||||
@ -36,15 +36,15 @@
|
||||
|
||||
namespace Ewoms {
|
||||
template <class TypeTag>
|
||||
class EclAluGridManager;
|
||||
class EclAluGridVanguard;
|
||||
|
||||
namespace Properties {
|
||||
NEW_TYPE_TAG(EclAluGridManager, INHERITS_FROM(EclBaseGridManager));
|
||||
NEW_TYPE_TAG(EclAluGridVanguard, INHERITS_FROM(EclBaseVanguard));
|
||||
|
||||
// declare the properties
|
||||
SET_TYPE_PROP(EclAluGridManager, GridManager, Ewoms::EclAluGridManager<TypeTag>);
|
||||
SET_TYPE_PROP(EclAluGridManager, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>);
|
||||
SET_TYPE_PROP(EclAluGridManager, EquilGrid, Dune::CpGrid);
|
||||
SET_TYPE_PROP(EclAluGridVanguard, Vanguard, Ewoms::EclAluGridVanguard<TypeTag>);
|
||||
SET_TYPE_PROP(EclAluGridVanguard, Grid, Dune::ALUGrid<3, 3, Dune::cube, Dune::nonconforming>);
|
||||
SET_TYPE_PROP(EclAluGridVanguard, EquilGrid, Dune::CpGrid);
|
||||
} // namespace Properties
|
||||
|
||||
/*!
|
||||
@ -55,10 +55,10 @@ SET_TYPE_PROP(EclAluGridManager, EquilGrid, Dune::CpGrid);
|
||||
* This class uses Dune::ALUGrid as the simulation grid.
|
||||
*/
|
||||
template <class TypeTag>
|
||||
class EclAluGridManager : public EclBaseGridManager<TypeTag>
|
||||
class EclAluGridVanguard : public EclBaseVanguard<TypeTag>
|
||||
{
|
||||
friend class EclBaseGridManager<TypeTag>;
|
||||
typedef EclBaseGridManager<TypeTag> ParentType;
|
||||
friend class EclBaseVanguard<TypeTag>;
|
||||
typedef EclBaseVanguard<TypeTag> ParentType;
|
||||
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
@ -78,9 +78,9 @@ public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseGridManager<TypeTag>::EclBaseGridManager;
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
|
||||
~EclAluGridManager()
|
||||
~EclAluGridVanguard()
|
||||
{
|
||||
delete cartesianIndexMapper_;
|
||||
delete equilCartesianIndexMapper_;
|
@ -22,12 +22,12 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Ewoms::EclBaseGridManager
|
||||
* \copydoc Ewoms::EclBaseVanguard
|
||||
*/
|
||||
#ifndef EWOMS_ECL_BASE_GRID_MANAGER_HH
|
||||
#define EWOMS_ECL_BASE_GRID_MANAGER_HH
|
||||
#ifndef EWOMS_ECL_BASE_VANGUARD_HH
|
||||
#define EWOMS_ECL_BASE_VANGUARD_HH
|
||||
|
||||
#include <ewoms/io/basegridmanager.hh>
|
||||
#include <ewoms/io/basevanguard.hh>
|
||||
#include <ewoms/common/propertysystem.hh>
|
||||
#include <ewoms/common/parametersystem.hh>
|
||||
|
||||
@ -50,18 +50,18 @@
|
||||
|
||||
namespace Ewoms {
|
||||
template <class TypeTag>
|
||||
class EclBaseGridManager;
|
||||
class EclBaseVanguard;
|
||||
|
||||
namespace Properties {
|
||||
NEW_TYPE_TAG(EclBaseGridManager);
|
||||
NEW_TYPE_TAG(EclBaseVanguard);
|
||||
|
||||
// declare the properties required by the for the ecl grid manager
|
||||
// declare the properties required by the for the ecl simulator vanguard
|
||||
NEW_PROP_TAG(Grid);
|
||||
NEW_PROP_TAG(EquilGrid);
|
||||
NEW_PROP_TAG(Scalar);
|
||||
NEW_PROP_TAG(EclDeckFileName);
|
||||
|
||||
SET_STRING_PROP(EclBaseGridManager, EclDeckFileName, "ECLDECK.DATA");
|
||||
SET_STRING_PROP(EclBaseVanguard, EclDeckFileName, "ECLDECK.DATA");
|
||||
} // namespace Properties
|
||||
|
||||
/*!
|
||||
@ -70,10 +70,10 @@ SET_STRING_PROP(EclBaseGridManager, EclDeckFileName, "ECLDECK.DATA");
|
||||
* \brief Helper class for grid instantiation of ECL file-format using problems.
|
||||
*/
|
||||
template <class TypeTag>
|
||||
class EclBaseGridManager : public BaseGridManager<TypeTag>
|
||||
class EclBaseVanguard : public BaseVanguard<TypeTag>
|
||||
{
|
||||
typedef BaseGridManager<TypeTag> ParentType;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridManager) Implementation;
|
||||
typedef BaseVanguard<TypeTag> ParentType;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Implementation;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
|
||||
@ -86,7 +86,7 @@ protected:
|
||||
|
||||
public:
|
||||
/*!
|
||||
* \brief Register all run-time parameters for the grid manager.
|
||||
* \brief Register the common run-time parameters for all ECL simulator vanguards.
|
||||
*/
|
||||
static void registerParameters()
|
||||
{
|
||||
@ -96,13 +96,13 @@ public:
|
||||
|
||||
/*!
|
||||
* \brief Set the Opm::EclipseState and the Opm::Deck object which ought to be used
|
||||
* when the grid manager is instantiated.
|
||||
* when the simulator vanguard is instantiated.
|
||||
*
|
||||
* This is basically an optimization: In cases where the ECL input deck must be
|
||||
* examined to decide which simulator ought to be used, this avoids having to parse
|
||||
* the input twice. When this method is used, the caller is responsible for lifetime
|
||||
* management of these two objects, i.e., they are not allowed to be deleted as long
|
||||
* as the grid manager object is alive.
|
||||
* as the simulator vanguard object is alive.
|
||||
*/
|
||||
static void setExternalDeck(Opm::Deck* deck, Opm::EclipseState* eclState, Opm::Schedule* schedule, Opm::SummaryConfig* summaryConfig)
|
||||
{
|
||||
@ -118,7 +118,7 @@ public:
|
||||
* This is the file format used by the commercial ECLiPSE simulator. Usually it uses
|
||||
* a cornerpoint description of the grid.
|
||||
*/
|
||||
EclBaseGridManager(Simulator& simulator)
|
||||
EclBaseVanguard(Simulator& simulator)
|
||||
: ParentType(simulator)
|
||||
{
|
||||
int myRank = 0;
|
||||
@ -336,16 +336,16 @@ private:
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
Opm::Deck* EclBaseGridManager<TypeTag>::externalDeck_ = nullptr;
|
||||
Opm::Deck* EclBaseVanguard<TypeTag>::externalDeck_ = nullptr;
|
||||
|
||||
template <class TypeTag>
|
||||
Opm::EclipseState* EclBaseGridManager<TypeTag>::externalEclState_;
|
||||
Opm::EclipseState* EclBaseVanguard<TypeTag>::externalEclState_;
|
||||
|
||||
template <class TypeTag>
|
||||
Opm::Schedule* EclBaseGridManager<TypeTag>::externalSchedule_ = nullptr;
|
||||
Opm::Schedule* EclBaseVanguard<TypeTag>::externalSchedule_ = nullptr;
|
||||
|
||||
template <class TypeTag>
|
||||
Opm::SummaryConfig* EclBaseGridManager<TypeTag>::externalSummaryConfig_ = nullptr;
|
||||
Opm::SummaryConfig* EclBaseVanguard<TypeTag>::externalSummaryConfig_ = nullptr;
|
||||
|
||||
|
||||
} // namespace Ewoms
|
@ -22,12 +22,12 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Ewoms::EclCpGridManager
|
||||
* \copydoc Ewoms::EclCpGridVanguard
|
||||
*/
|
||||
#ifndef EWOMS_ECL_CP_GRID_MANAGER_HH
|
||||
#define EWOMS_ECL_CP_GRID_MANAGER_HH
|
||||
#ifndef EWOMS_ECL_CP_GRID_VANGUARD_HH
|
||||
#define EWOMS_ECL_CP_GRID_VANGUARD_HH
|
||||
|
||||
#include "eclbasegridmanager.hh"
|
||||
#include "eclbasevanguard.hh"
|
||||
#include "ecltransmissibility.hh"
|
||||
|
||||
#include <dune/grid/CpGrid.hpp>
|
||||
@ -39,18 +39,18 @@
|
||||
|
||||
namespace Ewoms {
|
||||
template <class TypeTag>
|
||||
class EclCpGridManager;
|
||||
class EclCpGridVanguard;
|
||||
|
||||
namespace Properties {
|
||||
NEW_TYPE_TAG(EclCpGridManager, INHERITS_FROM(EclBaseGridManager));
|
||||
NEW_TYPE_TAG(EclCpGridVanguard, INHERITS_FROM(EclBaseVanguard));
|
||||
|
||||
NEW_PROP_TAG(ExportGlobalTransmissibility);
|
||||
|
||||
// declare the properties
|
||||
SET_TYPE_PROP(EclCpGridManager, GridManager, Ewoms::EclCpGridManager<TypeTag>);
|
||||
SET_TYPE_PROP(EclCpGridManager, Grid, Dune::CpGrid);
|
||||
SET_TYPE_PROP(EclCpGridManager, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
||||
SET_BOOL_PROP(EclCpGridManager, ExportGlobalTransmissibility, false);
|
||||
SET_TYPE_PROP(EclCpGridVanguard, Vanguard, Ewoms::EclCpGridVanguard<TypeTag>);
|
||||
SET_TYPE_PROP(EclCpGridVanguard, Grid, Dune::CpGrid);
|
||||
SET_TYPE_PROP(EclCpGridVanguard, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
||||
SET_BOOL_PROP(EclCpGridVanguard, ExportGlobalTransmissibility, false);
|
||||
} // namespace Properties
|
||||
|
||||
/*!
|
||||
@ -61,10 +61,10 @@ SET_BOOL_PROP(EclCpGridManager, ExportGlobalTransmissibility, false);
|
||||
* This class uses Dune::CpGrid as the simulation grid.
|
||||
*/
|
||||
template <class TypeTag>
|
||||
class EclCpGridManager : public EclBaseGridManager<TypeTag>
|
||||
class EclCpGridVanguard : public EclBaseVanguard<TypeTag>
|
||||
{
|
||||
friend class EclBaseGridManager<TypeTag>;
|
||||
typedef EclBaseGridManager<TypeTag> ParentType;
|
||||
friend class EclBaseVanguard<TypeTag>;
|
||||
typedef EclBaseVanguard<TypeTag> ParentType;
|
||||
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, ElementMapper) ElementMapper;
|
||||
@ -81,9 +81,9 @@ public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseGridManager<TypeTag>::EclBaseGridManager;
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
|
||||
~EclCpGridManager()
|
||||
~EclCpGridVanguard()
|
||||
{
|
||||
delete cartesianIndexMapper_;
|
||||
delete equilCartesianIndexMapper_;
|
@ -87,21 +87,21 @@ public:
|
||||
EclMaterialLawManager& materialLawManager)
|
||||
: simulator_(simulator)
|
||||
{
|
||||
const auto& gridManager = simulator.gridManager();
|
||||
const auto& vanguard = simulator.vanguard();
|
||||
|
||||
unsigned numElems = gridManager.grid().size(0);
|
||||
unsigned numCartesianElems = gridManager.cartesianSize();
|
||||
unsigned numElems = vanguard.grid().size(0);
|
||||
unsigned numCartesianElems = vanguard.cartesianSize();
|
||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||
|
||||
EQUIL::DeckDependent::InitialStateComputer<TypeTag> initialState(materialLawManager,
|
||||
gridManager.eclState(),
|
||||
gridManager.grid(),
|
||||
vanguard.eclState(),
|
||||
vanguard.grid(),
|
||||
simulator.problem().gravity()[dimWorld - 1]);
|
||||
|
||||
// copy the result into the array of initial fluid states
|
||||
initialFluidStates_.resize(numCartesianElems);
|
||||
for (unsigned int elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartesianElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartesianElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
auto& fluidState = initialFluidStates_[cartesianElemIdx];
|
||||
|
||||
// get the PVT region index of the current element
|
||||
@ -147,9 +147,9 @@ public:
|
||||
*/
|
||||
const ScalarFluidState& initialFluidState(unsigned elemIdx) const
|
||||
{
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
|
||||
unsigned cartesianElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartesianElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
return initialFluidStates_[cartesianElemIdx];
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
createLocalFipnum_();
|
||||
|
||||
// Summary output is for all steps
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.gridManager().summaryConfig();
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
||||
|
||||
// Initialize block output
|
||||
for( const auto& node : summaryConfig ) {
|
||||
@ -132,10 +132,10 @@ public:
|
||||
return;
|
||||
|
||||
// Summary output is for all steps
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.gridManager().summaryConfig();
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
||||
|
||||
// Only output RESTART_AUXILIARY asked for by the user.
|
||||
const Opm::RestartConfig& restartConfig = simulator_.gridManager().eclState().getRestartConfig();
|
||||
const Opm::RestartConfig& restartConfig = simulator_.vanguard().eclState().getRestartConfig();
|
||||
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
||||
for (auto& keyValue : rstKeywords) {
|
||||
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
|
||||
@ -440,7 +440,7 @@ public:
|
||||
bubblePointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::bubblePointPressure(fs, intQuants.pvtRegionIndex()));
|
||||
}
|
||||
catch (const Opm::NumericalIssue& e) {
|
||||
const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx];
|
||||
const auto globalIdx = elemCtx.simulator().vanguard().grid().globalCell()[globalDofIdx];
|
||||
failedCellsPb_.push_back(globalIdx);
|
||||
}
|
||||
}
|
||||
@ -450,7 +450,7 @@ public:
|
||||
dewPointPressure_[globalDofIdx] = Opm::getValue(FluidSystem::dewPointPressure(fs, intQuants.pvtRegionIndex()));
|
||||
}
|
||||
catch (const Opm::NumericalIssue& e) {
|
||||
const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx];
|
||||
const auto globalIdx = elemCtx.simulator().vanguard().grid().globalCell()[globalDofIdx];
|
||||
failedCellsPd_.push_back(globalIdx);
|
||||
}
|
||||
}
|
||||
@ -523,7 +523,7 @@ public:
|
||||
updateFluidInPlace_(elemCtx, dofIdx);
|
||||
|
||||
// Adding block values
|
||||
const auto globalIdx = elemCtx.simulator().gridManager().grid().globalCell()[globalDofIdx];
|
||||
const auto globalIdx = elemCtx.simulator().vanguard().grid().globalCell()[globalDofIdx];
|
||||
for( auto& val : blockValues_ ) {
|
||||
const auto& key = val.first;
|
||||
int global_index = key.second - 1;
|
||||
@ -765,7 +765,7 @@ public:
|
||||
// the original Fip values are stored on the first step
|
||||
// TODO: Store initial Fip in the init file and restore them
|
||||
// and use them here.
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.gridManager().summaryConfig();
|
||||
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
||||
if ( isIORank_()) {
|
||||
// Field summary output
|
||||
for (int i = 0; i<FipDataType::numFipValues; i++) {
|
||||
@ -1069,9 +1069,9 @@ private:
|
||||
|
||||
void createLocalFipnum_()
|
||||
{
|
||||
const std::vector<int>& fipnum_global = simulator_.gridManager().eclState().get3DProperties().getIntGridProperty("FIPNUM").getData();
|
||||
const std::vector<int>& fipnum_global = simulator_.vanguard().eclState().get3DProperties().getIntGridProperty("FIPNUM").getData();
|
||||
// Get compressed cell fipnum.
|
||||
const auto& gridView = simulator_.gridManager().gridView();
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
unsigned numElements = gridView.size(/*codim=*/0);
|
||||
fipnum_.resize(numElements, 0.0);
|
||||
if (!fipnum_global.empty()) {
|
||||
@ -1085,7 +1085,7 @@ private:
|
||||
|
||||
elemCtx.updatePrimaryStencil(elem);
|
||||
const unsigned elemIdx = elemCtx.globalSpaceIndex(/*spaceIdx=*/0, /*timeIdx=*/0);
|
||||
fipnum_[elemIdx] = fipnum_global[simulator_.gridManager().cartesianIndex( elemIdx )];
|
||||
fipnum_[elemIdx] = fipnum_global[simulator_.vanguard().cartesianIndex( elemIdx )];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1139,7 +1139,7 @@ private:
|
||||
|
||||
void fipUnitConvert_(ScalarBuffer& fip)
|
||||
{
|
||||
const Opm::UnitSystem& units = simulator_.gridManager().eclState().getUnits();
|
||||
const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits();
|
||||
if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) {
|
||||
fip[FipDataType::WaterInPlace] = Opm::unit::convert::to(fip[FipDataType::WaterInPlace], Opm::unit::stb);
|
||||
fip[FipDataType::OilInPlace] = Opm::unit::convert::to(fip[FipDataType::OilInPlace], Opm::unit::stb);
|
||||
@ -1159,7 +1159,7 @@ private:
|
||||
}
|
||||
|
||||
void pressureUnitConvert_(Scalar& pav) {
|
||||
const Opm::UnitSystem& units = simulator_.gridManager().eclState().getUnits();
|
||||
const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits();
|
||||
if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_FIELD) {
|
||||
pav = Opm::unit::convert::to(pav, Opm::unit::psia);
|
||||
} else if (units.getType() == Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC) {
|
||||
@ -1172,7 +1172,7 @@ private:
|
||||
|
||||
void outputRegionFluidInPlace_(const ScalarBuffer& oip, const ScalarBuffer& cip, const Scalar& pav, const int reg)
|
||||
{
|
||||
const Opm::UnitSystem& units = simulator_.gridManager().eclState().getUnits();
|
||||
const Opm::UnitSystem& units = simulator_.vanguard().eclState().getUnits();
|
||||
std::ostringstream ss;
|
||||
if (!reg) {
|
||||
ss << " ===================================================\n"
|
||||
|
@ -22,26 +22,26 @@
|
||||
*/
|
||||
/*!
|
||||
* \file
|
||||
* \copydoc Ewoms::EclPolyhedralGridManager
|
||||
* \copydoc Ewoms::EclPolyhedralGridVanguard
|
||||
*/
|
||||
#ifndef EWOMS_ECL_POLYHEDRAL_GRID_MANAGER_HH
|
||||
#define EWOMS_ECL_POLYHEDRAL_GRID_MANAGER_HH
|
||||
#ifndef EWOMS_ECL_POLYHEDRAL_GRID_VANGUARD_HH
|
||||
#define EWOMS_ECL_POLYHEDRAL_GRID_VANGUARD_HH
|
||||
|
||||
#include "eclbasegridmanager.hh"
|
||||
#include "eclbasevanguard.hh"
|
||||
|
||||
#include <dune/grid/polyhedralgrid.hh>
|
||||
|
||||
namespace Ewoms {
|
||||
template <class TypeTag>
|
||||
class EclPolyhedralGridManager;
|
||||
class EclPolyhedralGridVanguard;
|
||||
|
||||
namespace Properties {
|
||||
NEW_TYPE_TAG(EclPolyhedralGridManager, INHERITS_FROM(EclBaseGridManager));
|
||||
NEW_TYPE_TAG(EclPolyhedralGridVanguard, INHERITS_FROM(EclBaseVanguard));
|
||||
|
||||
// declare the properties
|
||||
SET_TYPE_PROP(EclPolyhedralGridManager, GridManager, Ewoms::EclPolyhedralGridManager<TypeTag>);
|
||||
SET_TYPE_PROP(EclPolyhedralGridManager, Grid, Dune::PolyhedralGrid<3, 3>);
|
||||
SET_TYPE_PROP(EclPolyhedralGridManager, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
||||
SET_TYPE_PROP(EclPolyhedralGridVanguard, Vanguard, Ewoms::EclPolyhedralGridVanguard<TypeTag>);
|
||||
SET_TYPE_PROP(EclPolyhedralGridVanguard, Grid, Dune::PolyhedralGrid<3, 3>);
|
||||
SET_TYPE_PROP(EclPolyhedralGridVanguard, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
||||
} // namespace Properties
|
||||
|
||||
/*!
|
||||
@ -52,10 +52,10 @@ SET_TYPE_PROP(EclPolyhedralGridManager, EquilGrid, typename GET_PROP_TYPE(TypeTa
|
||||
* This class uses Dune::PolyhedralGrid as the simulation grid.
|
||||
*/
|
||||
template <class TypeTag>
|
||||
class EclPolyhedralGridManager : public EclBaseGridManager<TypeTag>
|
||||
class EclPolyhedralGridVanguard : public EclBaseVanguard<TypeTag>
|
||||
{
|
||||
friend class EclBaseGridManager<TypeTag>;
|
||||
typedef EclBaseGridManager<TypeTag> ParentType;
|
||||
friend class EclBaseVanguard<TypeTag>;
|
||||
typedef EclBaseVanguard<TypeTag> ParentType;
|
||||
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
@ -75,9 +75,9 @@ public:
|
||||
/*!
|
||||
* \brief Inherit the constructors from the base class.
|
||||
*/
|
||||
using EclBaseGridManager<TypeTag>::EclBaseGridManager;
|
||||
using EclBaseVanguard<TypeTag>::EclBaseVanguard;
|
||||
|
||||
~EclPolyhedralGridManager()
|
||||
~EclPolyhedralGridVanguard()
|
||||
{
|
||||
delete cartesianIndexMapper_;
|
||||
delete grid_;
|
@ -46,10 +46,10 @@
|
||||
#endif
|
||||
|
||||
#if EBOS_USE_ALUGRID
|
||||
#include "eclalugridmanager.hh"
|
||||
#include "eclalugridvanguard.hh"
|
||||
#else
|
||||
//#include "eclpolyhedralgridmanager.hh"
|
||||
#include "eclcpgridmanager.hh"
|
||||
//#include "eclpolyhedralgridvanguard.hh"
|
||||
#include "eclcpgridvanguard.hh"
|
||||
#endif
|
||||
#include "eclwellmanager.hh"
|
||||
#include "eclequilinitializer.hh"
|
||||
@ -99,10 +99,10 @@ class EclProblem;
|
||||
|
||||
namespace Properties {
|
||||
#if EBOS_USE_ALUGRID
|
||||
NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclAluGridManager, EclOutputBlackOil));
|
||||
NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclAluGridVanguard, EclOutputBlackOil));
|
||||
#else
|
||||
NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclCpGridManager, EclOutputBlackOil));
|
||||
//NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclPolyhedralGridManager, EclOutputBlackOil));
|
||||
NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclCpGridVanguard, EclOutputBlackOil));
|
||||
//NEW_TYPE_TAG(EclBaseProblem, INHERITS_FROM(EclPolyhedralGridVanguard, EclOutputBlackOil));
|
||||
#endif
|
||||
|
||||
// Write all solutions for visualization, not just the ones for the
|
||||
@ -336,15 +336,15 @@ public:
|
||||
*/
|
||||
EclProblem(Simulator& simulator)
|
||||
: ParentType(simulator)
|
||||
, transmissibilities_(simulator.gridManager())
|
||||
, transmissibilities_(simulator.vanguard())
|
||||
, thresholdPressures_(simulator)
|
||||
, wellManager_(simulator)
|
||||
, pffDofData_(simulator.gridView(), this->elementMapper())
|
||||
{
|
||||
// Tell the extra modules to initialize its internal data structures
|
||||
const auto& gridManager = simulator.gridManager();
|
||||
SolventModule::initFromDeck(gridManager.deck(), gridManager.eclState());
|
||||
PolymerModule::initFromDeck(gridManager.deck(), gridManager.eclState());
|
||||
const auto& vanguard = simulator.vanguard();
|
||||
SolventModule::initFromDeck(vanguard.deck(), vanguard.eclState());
|
||||
PolymerModule::initFromDeck(vanguard.deck(), vanguard.eclState());
|
||||
|
||||
if (EWOMS_GET_PARAM(TypeTag, bool, EnableEclOutput)) {
|
||||
// retrieve the location where the output is supposed to go
|
||||
@ -364,7 +364,7 @@ public:
|
||||
|
||||
// specify the directory output. This is not a very nice mechanism because
|
||||
// the eclState is supposed to be immutable here, IMO.
|
||||
auto& eclState = this->simulator().gridManager().eclState();
|
||||
auto& eclState = this->simulator().vanguard().eclState();
|
||||
auto& ioConfig = eclState.getIOConfig();
|
||||
ioConfig.setOutputDir(outputDir);
|
||||
|
||||
@ -389,7 +389,7 @@ public:
|
||||
this->gravity_ = 0.0;
|
||||
|
||||
// the "NOGRAV" keyword from Frontsim disables gravity...
|
||||
const auto& deck = simulator.gridManager().deck();
|
||||
const auto& deck = simulator.vanguard().deck();
|
||||
if (!deck.hasKeyword("NOGRAV") && EWOMS_GET_PARAM(TypeTag, bool, EnableGravity))
|
||||
this->gravity_[dim - 1] = 9.80665;
|
||||
|
||||
@ -446,7 +446,7 @@ public:
|
||||
readInitialCondition_();
|
||||
|
||||
// Set the start time of the simulation
|
||||
const auto& timeMap = simulator.gridManager().schedule().getTimeMap();
|
||||
const auto& timeMap = simulator.vanguard().schedule().getTimeMap();
|
||||
simulator.setStartTime( timeMap.getStartTime(/*timeStepIdx=*/0) );
|
||||
|
||||
// We want the episode index to be the same as the report step index to make
|
||||
@ -460,8 +460,8 @@ public:
|
||||
updatePffDofData_();
|
||||
|
||||
if (GET_PROP_VALUE(TypeTag, EnablePolymer)) {
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& gridView = gridManager.gridView();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& gridView = vanguard.gridView();
|
||||
int numElements = gridView.size(/*codim=*/0);
|
||||
maxPolymerAdsorption_.resize(numElements, 0.0);
|
||||
}
|
||||
@ -507,8 +507,8 @@ public:
|
||||
{
|
||||
// Proceed to the next report step
|
||||
Simulator& simulator = this->simulator();
|
||||
auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& schedule = this->simulator().gridManager().schedule();
|
||||
auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& schedule = this->simulator().vanguard().schedule();
|
||||
const auto& events = schedule.getEvents();
|
||||
const auto& timeMap = schedule.getTimeMap();
|
||||
|
||||
@ -566,8 +566,8 @@ public:
|
||||
|
||||
if (!GET_PROP_VALUE(TypeTag, DisableWells))
|
||||
// set up the wells
|
||||
wellManager_.beginEpisode(this->simulator().gridManager().eclState(),
|
||||
this->simulator().gridManager().schedule(), isOnRestart);
|
||||
wellManager_.beginEpisode(this->simulator().vanguard().eclState(),
|
||||
this->simulator().vanguard().schedule(), isOnRestart);
|
||||
|
||||
if (doInvalidate)
|
||||
this->model().invalidateIntensiveQuantitiesCache(/*timeIdx=*/0);
|
||||
@ -641,7 +641,7 @@ public:
|
||||
void endEpisode()
|
||||
{
|
||||
auto& simulator = this->simulator();
|
||||
const auto& schedule = simulator.gridManager().schedule();
|
||||
const auto& schedule = simulator.vanguard().schedule();
|
||||
|
||||
int episodeIdx = simulator.episodeIndex();
|
||||
|
||||
@ -989,7 +989,7 @@ public:
|
||||
* \copydoc FvBaseProblem::name
|
||||
*/
|
||||
std::string name() const
|
||||
{ return this->simulator().gridManager().caseName(); }
|
||||
{ return this->simulator().vanguard().caseName(); }
|
||||
|
||||
/*!
|
||||
* \copydoc FvBaseMultiPhaseProblem::temperature
|
||||
@ -1052,7 +1052,7 @@ public:
|
||||
// initialize the wells. Note that this needs to be done after initializing the
|
||||
// intrinsic permeabilities and the after applying the initial solution because
|
||||
// the well model uses these...
|
||||
wellManager_.init(this->simulator().gridManager().eclState(), this->simulator().gridManager().schedule());
|
||||
wellManager_.init(this->simulator().vanguard().eclState(), this->simulator().vanguard().schedule());
|
||||
}
|
||||
|
||||
// the initialSolutionApplied is called recursively by readEclRestartSolution_()
|
||||
@ -1065,7 +1065,7 @@ public:
|
||||
// the initial solution.
|
||||
thresholdPressures_.finishInit();
|
||||
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& initconfig = eclState.getInitConfig();
|
||||
if(initconfig.restartRequested()) {
|
||||
restartApplied = true;
|
||||
@ -1074,7 +1074,7 @@ public:
|
||||
}
|
||||
|
||||
// release the memory of the EQUIL grid since it's no longer needed after this point
|
||||
this->simulator().gridManager().releaseEquilGrid();
|
||||
this->simulator().vanguard().releaseEquilGrid();
|
||||
|
||||
updateCompositionChangeLimits_();
|
||||
}
|
||||
@ -1199,8 +1199,8 @@ private:
|
||||
|
||||
void updateElementDepths_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& gridView = gridManager.gridView();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& gridView = vanguard.gridView();
|
||||
const auto& elemMapper = this->elementMapper();;
|
||||
|
||||
int numElements = gridView.size(/*codim=*/0);
|
||||
@ -1223,9 +1223,9 @@ private:
|
||||
// and overlap regions
|
||||
if (drsdtActive_) {
|
||||
ElementContext elemCtx(this->simulator());
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
const Element& elem = *elemIt;
|
||||
|
||||
@ -1252,9 +1252,9 @@ private:
|
||||
// and overlap regions
|
||||
if (drvdtActive_) {
|
||||
ElementContext elemCtx(this->simulator());
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
const Element& elem = *elemIt;
|
||||
|
||||
@ -1280,9 +1280,9 @@ private:
|
||||
// we use VAPPARS
|
||||
if (vapparsActive_) {
|
||||
ElementContext elemCtx(this->simulator());
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
const Element& elem = *elemIt;
|
||||
|
||||
@ -1308,9 +1308,9 @@ private:
|
||||
|
||||
void readRockParameters_()
|
||||
{
|
||||
const auto& deck = this->simulator().gridManager().deck();
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& deck = this->simulator().vanguard().deck();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
// the ROCK keyword has not been specified, so we don't need
|
||||
// to read rock parameters
|
||||
@ -1354,10 +1354,10 @@ private:
|
||||
|
||||
const std::vector<int>& tablenumData =
|
||||
eclState.get3DProperties().getIntGridProperty(propName).getData();
|
||||
unsigned numElem = gridManager.gridView().size(0);
|
||||
unsigned numElem = vanguard.gridView().size(0);
|
||||
rockTableIdx_.resize(numElem);
|
||||
for (size_t elemIdx = 0; elemIdx < numElem; ++ elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
|
||||
// reminder: Eclipse uses FORTRAN-style indices
|
||||
rockTableIdx_[elemIdx] = tablenumData[cartElemIdx] - 1;
|
||||
@ -1366,9 +1366,9 @@ private:
|
||||
|
||||
void readMaterialParameters_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& deck = gridManager.deck();
|
||||
const auto& eclState = gridManager.eclState();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& deck = vanguard.deck();
|
||||
const auto& eclState = vanguard.eclState();
|
||||
|
||||
// the PVT and saturation region numbers
|
||||
updatePvtnum_();
|
||||
@ -1389,7 +1389,7 @@ private:
|
||||
size_t numDof = this->model().numGridDof();
|
||||
std::vector<int> compressedToCartesianElemIdx(numDof);
|
||||
for (unsigned elemIdx = 0; elemIdx < numDof; ++elemIdx)
|
||||
compressedToCartesianElemIdx[elemIdx] = gridManager.cartesianIndex(elemIdx);
|
||||
compressedToCartesianElemIdx[elemIdx] = vanguard.cartesianIndex(elemIdx);
|
||||
|
||||
materialLawManager_ = std::make_shared<EclMaterialLawManager>();
|
||||
materialLawManager_->initFromDeck(deck, eclState, compressedToCartesianElemIdx);
|
||||
@ -1398,8 +1398,8 @@ private:
|
||||
|
||||
void updatePorosity_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& eclState = gridManager.eclState();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& eclState = vanguard.eclState();
|
||||
const auto& eclGrid = eclState.getInputGrid();
|
||||
const auto& props = eclState.get3DProperties();
|
||||
|
||||
@ -1415,7 +1415,7 @@ private:
|
||||
int nx = eclGrid.getNX();
|
||||
int ny = eclGrid.getNY();
|
||||
for (size_t dofIdx = 0; dofIdx < numDof; ++ dofIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(dofIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(dofIdx);
|
||||
Scalar poreVolume = porvData[cartElemIdx];
|
||||
|
||||
// sum up the pore volume of the active cell and all inactive ones above it
|
||||
@ -1452,17 +1452,17 @@ private:
|
||||
|
||||
void initFluidSystem_()
|
||||
{
|
||||
const auto& deck = this->simulator().gridManager().deck();
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& deck = this->simulator().vanguard().deck();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
|
||||
FluidSystem::initFromDeck(deck, eclState);
|
||||
}
|
||||
|
||||
void readInitialCondition_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
const auto& deck = gridManager.deck();
|
||||
const auto& deck = vanguard.deck();
|
||||
if (!deck.hasKeyword("EQUIL"))
|
||||
readExplicitInitialCondition_();
|
||||
else
|
||||
@ -1523,8 +1523,8 @@ private:
|
||||
|
||||
void readExplicitInitialCondition_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& eclState = gridManager.eclState();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& eclState = vanguard.eclState();
|
||||
const auto& eclProps = eclState.get3DProperties();
|
||||
|
||||
// the values specified in the deck do not need to be consistent,
|
||||
@ -1553,7 +1553,7 @@ private:
|
||||
|
||||
initialFluidStates_.resize(numDof);
|
||||
|
||||
const auto& cartSize = this->simulator().gridManager().cartesianDimensions();
|
||||
const auto& cartSize = this->simulator().vanguard().cartesianDimensions();
|
||||
size_t numCartesianCells = cartSize[0] * cartSize[1] * cartSize[2];
|
||||
|
||||
std::vector<double> waterSaturationData;
|
||||
@ -1596,7 +1596,7 @@ private:
|
||||
auto& dofFluidState = initialFluidStates_[dofIdx];
|
||||
|
||||
dofFluidState.setPvtRegionIndex(pvtRegionIndex(dofIdx));
|
||||
size_t cartesianDofIdx = gridManager.cartesianIndex(dofIdx);
|
||||
size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
||||
assert(0 <= cartesianDofIdx);
|
||||
assert(cartesianDofIdx <= numCartesianCells);
|
||||
|
||||
@ -1650,15 +1650,15 @@ private:
|
||||
|
||||
void readBlackoilExtentionsInitialConditions_()
|
||||
{
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& eclState = gridManager.eclState();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
const auto& eclState = vanguard.eclState();
|
||||
size_t numDof = this->model().numGridDof();
|
||||
|
||||
if (enableSolvent) {
|
||||
const std::vector<double>& solventSaturationData = eclState.get3DProperties().getDoubleGridProperty("SSOL").getData();
|
||||
solventSaturation_.resize(numDof,0.0);
|
||||
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
||||
size_t cartesianDofIdx = gridManager.cartesianIndex(dofIdx);
|
||||
size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
||||
assert(0 <= cartesianDofIdx);
|
||||
assert(cartesianDofIdx <= solventSaturationData.size());
|
||||
solventSaturation_[dofIdx] = solventSaturationData[cartesianDofIdx];
|
||||
@ -1669,7 +1669,7 @@ private:
|
||||
const std::vector<double>& polyConcentrationData = eclState.get3DProperties().getDoubleGridProperty("SPOLY").getData();
|
||||
polymerConcentration_.resize(numDof,0.0);
|
||||
for (size_t dofIdx = 0; dofIdx < numDof; ++dofIdx) {
|
||||
size_t cartesianDofIdx = gridManager.cartesianIndex(dofIdx);
|
||||
size_t cartesianDofIdx = vanguard.cartesianIndex(dofIdx);
|
||||
assert(0 <= cartesianDofIdx);
|
||||
assert(cartesianDofIdx <= polyConcentrationData.size());
|
||||
polymerConcentration_[dofIdx] = polyConcentrationData[cartesianDofIdx];
|
||||
@ -1688,9 +1688,9 @@ private:
|
||||
// we need to update the hysteresis data for _all_ elements (i.e., not just the
|
||||
// interior ones) to avoid desynchronization of the processes in the parallel case!
|
||||
ElementContext elemCtx(this->simulator());
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
const Element& elem = *elemIt;
|
||||
|
||||
@ -1708,9 +1708,9 @@ private:
|
||||
{
|
||||
// we need to update the max polymer adsoption data for all elements
|
||||
ElementContext elemCtx(this->simulator());
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
auto elemIt = gridManager.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = gridManager.gridView().template end</*codim=*/0>();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
auto elemIt = vanguard.gridView().template begin</*codim=*/0>();
|
||||
const auto& elemEndIt = vanguard.gridView().template end</*codim=*/0>();
|
||||
for (; elemIt != elemEndIt; ++elemIt) {
|
||||
const Element& elem = *elemIt;
|
||||
|
||||
@ -1726,76 +1726,76 @@ private:
|
||||
|
||||
void updatePvtnum_()
|
||||
{
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& eclProps = eclState.get3DProperties();
|
||||
|
||||
if (!eclProps.hasDeckIntGridProperty("PVTNUM"))
|
||||
return;
|
||||
|
||||
const auto& pvtnumData = eclProps.getIntGridProperty("PVTNUM").getData();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
unsigned numElems = gridManager.gridView().size(/*codim=*/0);
|
||||
unsigned numElems = vanguard.gridView().size(/*codim=*/0);
|
||||
pvtnum_.resize(numElems);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
pvtnum_[elemIdx] = pvtnumData[cartElemIdx] - 1;
|
||||
}
|
||||
}
|
||||
|
||||
void updateSatnum_()
|
||||
{
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& eclProps = eclState.get3DProperties();
|
||||
|
||||
if (!eclProps.hasDeckIntGridProperty("SATNUM"))
|
||||
return;
|
||||
|
||||
const auto& satnumData = eclProps.getIntGridProperty("SATNUM").getData();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
unsigned numElems = gridManager.gridView().size(/*codim=*/0);
|
||||
unsigned numElems = vanguard.gridView().size(/*codim=*/0);
|
||||
satnum_.resize(numElems);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
satnum_[elemIdx] = satnumData[cartElemIdx] - 1;
|
||||
}
|
||||
}
|
||||
|
||||
void updateMiscnum_()
|
||||
{
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& eclProps = eclState.get3DProperties();
|
||||
|
||||
if (!eclProps.hasDeckIntGridProperty("MISCNUM"))
|
||||
return;
|
||||
|
||||
const auto& miscnumData = eclProps.getIntGridProperty("MISCNUM").getData();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
unsigned numElems = gridManager.gridView().size(/*codim=*/0);
|
||||
unsigned numElems = vanguard.gridView().size(/*codim=*/0);
|
||||
miscnum_.resize(numElems);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
miscnum_[elemIdx] = miscnumData[cartElemIdx] - 1;
|
||||
}
|
||||
}
|
||||
|
||||
void updatePlmixnum_()
|
||||
{
|
||||
const auto& eclState = this->simulator().gridManager().eclState();
|
||||
const auto& eclState = this->simulator().vanguard().eclState();
|
||||
const auto& eclProps = eclState.get3DProperties();
|
||||
|
||||
if (!eclProps.hasDeckIntGridProperty("PLMIXNUM"))
|
||||
return;
|
||||
|
||||
const auto& plmixnumData = eclProps.getIntGridProperty("PLMIXNUM").getData();
|
||||
const auto& gridManager = this->simulator().gridManager();
|
||||
const auto& vanguard = this->simulator().vanguard();
|
||||
|
||||
unsigned numElems = gridManager.gridView().size(/*codim=*/0);
|
||||
unsigned numElems = vanguard.gridView().size(/*codim=*/0);
|
||||
plmixnum_.resize(numElems);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElems; ++elemIdx) {
|
||||
unsigned cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
unsigned cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
plmixnum_[elemIdx] = plmixnumData[cartElemIdx] - 1;
|
||||
}
|
||||
}
|
||||
|
@ -101,8 +101,8 @@ public:
|
||||
// sorry!
|
||||
assert(simulator_.model().numGridDof() == numElements);
|
||||
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const auto& eclState = gridManager.eclState();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
const auto& eclState = vanguard.eclState();
|
||||
const auto& simConfig = eclState.getSimulationConfig();
|
||||
|
||||
enableThresholdPressure_ = simConfig.hasThresholdPressure();
|
||||
@ -125,7 +125,7 @@ public:
|
||||
eclState.get3DProperties().getIntGridProperty("EQLNUM").getData();
|
||||
elemEquilRegion_.resize(numElements, 0);
|
||||
for (unsigned elemIdx = 0; elemIdx < numElements; ++elemIdx) {
|
||||
int cartElemIdx = gridManager.cartesianIndex(elemIdx);
|
||||
int cartElemIdx = vanguard.cartesianIndex(elemIdx);
|
||||
|
||||
// ECL uses Fortran-style indices but we want C-style ones!
|
||||
elemEquilRegion_[elemIdx] = equilRegionData[cartElemIdx] - 1;
|
||||
@ -161,8 +161,8 @@ private:
|
||||
// compute the defaults of the threshold pressures using the initial condition
|
||||
void computeDefaultThresholdPressures_()
|
||||
{
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const auto& gridView = gridManager.gridView();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
const auto& gridView = vanguard.gridView();
|
||||
|
||||
typedef Opm::MathToolbox<Evaluation> Toolbox;
|
||||
// loop over the whole grid and compute the maximum gravity adjusted pressure
|
||||
@ -233,10 +233,10 @@ private:
|
||||
// THPRES keyword.
|
||||
void applyExplicitThresholdPressures_()
|
||||
{
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const auto& gridView = gridManager.gridView();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
const auto& gridView = vanguard.gridView();
|
||||
const auto& elementMapper = simulator_.model().elementMapper();
|
||||
const auto& eclState = simulator_.gridManager().eclState();
|
||||
const auto& eclState = simulator_.vanguard().eclState();
|
||||
const Opm::SimulationConfig& simConfig = eclState.getSimulationConfig();
|
||||
const auto& thpres = simConfig.getThresholdPressure();
|
||||
|
||||
|
@ -53,7 +53,7 @@
|
||||
namespace Ewoms {
|
||||
namespace Properties {
|
||||
NEW_PROP_TAG(Scalar);
|
||||
NEW_PROP_TAG(GridManager);
|
||||
NEW_PROP_TAG(Vanguard);
|
||||
NEW_PROP_TAG(Grid);
|
||||
NEW_PROP_TAG(GridView);
|
||||
NEW_PROP_TAG(ElementMapper);
|
||||
@ -71,7 +71,7 @@ class EclTransmissibility
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, ElementMapper) ElementMapper;
|
||||
typedef typename GridView::Intersection Intersection;
|
||||
|
||||
@ -82,8 +82,8 @@ class EclTransmissibility
|
||||
typedef Dune::FieldVector<Scalar, dimWorld> DimVector;
|
||||
|
||||
public:
|
||||
EclTransmissibility(const GridManager& gridManager)
|
||||
: gridManager_(gridManager)
|
||||
EclTransmissibility(const Vanguard& vanguard)
|
||||
: vanguard_(vanguard)
|
||||
{}
|
||||
|
||||
/*!
|
||||
@ -106,9 +106,9 @@ public:
|
||||
|
||||
void update()
|
||||
{
|
||||
const auto& gridView = gridManager_.gridView();
|
||||
const auto& cartMapper = gridManager_.cartesianIndexMapper();
|
||||
const auto& eclState = gridManager_.eclState();
|
||||
const auto& gridView = vanguard_.gridView();
|
||||
const auto& cartMapper = vanguard_.cartesianIndexMapper();
|
||||
const auto& eclState = vanguard_.eclState();
|
||||
const auto& eclGrid = eclState.getInputGrid();
|
||||
auto& transMult = eclState.getTransMult();
|
||||
#if DUNE_VERSION_NEWER(DUNE_GRID, 2,6)
|
||||
@ -305,16 +305,16 @@ private:
|
||||
std::true_type ) const
|
||||
{
|
||||
int faceIdx = intersection.id();
|
||||
faceCenterInside = gridManager_.grid().faceCenterEcl(insideElemIdx,insideFaceIdx);
|
||||
faceCenterOutside = gridManager_.grid().faceCenterEcl(outsideElemIdx,outsideFaceIdx);
|
||||
faceAreaNormal = gridManager_.grid().faceAreaNormalEcl(faceIdx);
|
||||
faceCenterInside = vanguard_.grid().faceCenterEcl(insideElemIdx,insideFaceIdx);
|
||||
faceCenterOutside = vanguard_.grid().faceCenterEcl(outsideElemIdx,outsideFaceIdx);
|
||||
faceAreaNormal = vanguard_.grid().faceAreaNormalEcl(faceIdx);
|
||||
}
|
||||
|
||||
void extractPermeability_()
|
||||
{
|
||||
const auto& props = gridManager_.eclState().get3DProperties();
|
||||
const auto& props = vanguard_.eclState().get3DProperties();
|
||||
|
||||
unsigned numElem = gridManager_.gridView().size(/*codim=*/0);
|
||||
unsigned numElem = vanguard_.gridView().size(/*codim=*/0);
|
||||
permeability_.resize(numElem);
|
||||
|
||||
// read the intrinsic permeabilities from the eclState. Note that all arrays
|
||||
@ -332,7 +332,7 @@ private:
|
||||
permzData = props.getDoubleGridProperty("PERMZ").getData();
|
||||
|
||||
for (size_t dofIdx = 0; dofIdx < numElem; ++ dofIdx) {
|
||||
unsigned cartesianElemIdx = gridManager_.cartesianIndex(dofIdx);
|
||||
unsigned cartesianElemIdx = vanguard_.cartesianIndex(dofIdx);
|
||||
permeability_[dofIdx] = 0.0;
|
||||
permeability_[dofIdx][0][0] = permxData[cartesianElemIdx];
|
||||
permeability_[dofIdx][1][1] = permyData[cartesianElemIdx];
|
||||
@ -446,14 +446,14 @@ private:
|
||||
|
||||
// compute volume weighted arithmetic average of NTG for
|
||||
// cells merged as an result of minpv.
|
||||
const auto& eclState = gridManager_.eclState();
|
||||
const auto& eclState = vanguard_.eclState();
|
||||
const auto& eclGrid = eclState.getInputGrid();
|
||||
const auto& porv = eclState.get3DProperties().getDoubleGridProperty("PORV").getData();
|
||||
const auto& actnum = eclState.get3DProperties().getIntGridProperty("ACTNUM").getData();
|
||||
const std::vector<double>& ntg =
|
||||
eclState.get3DProperties().getDoubleGridProperty("NTG").getData();
|
||||
|
||||
const auto& cartMapper = gridManager_.cartesianIndexMapper();
|
||||
const auto& cartMapper = vanguard_.cartesianIndexMapper();
|
||||
const auto& cartDims = cartMapper.cartesianDimensions();
|
||||
assert(dimWorld > 1);
|
||||
const size_t nxny = cartDims[0] * cartDims[1];
|
||||
@ -490,7 +490,7 @@ private:
|
||||
|
||||
|
||||
|
||||
const GridManager& gridManager_;
|
||||
const Vanguard& vanguard_;
|
||||
std::vector<DimMatrix> permeability_;
|
||||
std::unordered_map<std::uint64_t, Scalar> trans_;
|
||||
};
|
||||
|
@ -393,7 +393,7 @@ public:
|
||||
wells_[wellIdx]->beginIterationPreProcess();
|
||||
|
||||
// call the accumulation routines
|
||||
ThreadedEntityIterator<GridView, /*codim=*/0> threadedElemIt(simulator_.gridManager().gridView());
|
||||
ThreadedEntityIterator<GridView, /*codim=*/0> threadedElemIt(simulator_.vanguard().gridView());
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
@ -547,7 +547,7 @@ public:
|
||||
void deserialize(Restarter& res OPM_UNUSED)
|
||||
{
|
||||
// initialize the wells for the current episode
|
||||
beginEpisode(simulator_.gridManager().eclState(), simulator_.gridManager().schedule(), /*wasRestarted=*/true);
|
||||
beginEpisode(simulator_.vanguard().eclState(), simulator_.vanguard().schedule(), /*wasRestarted=*/true);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -601,7 +601,7 @@ protected:
|
||||
std::vector<bool>& gridDofIsPenetrated) const
|
||||
{
|
||||
auto& model = simulator_.model();
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
|
||||
// first, remove all wells from the reservoir
|
||||
model.clearAuxiliaryModules();
|
||||
@ -614,7 +614,7 @@ protected:
|
||||
|
||||
//////
|
||||
// tell the active wells which DOFs they contain
|
||||
const auto gridView = simulator_.gridManager().gridView();
|
||||
const auto gridView = simulator_.vanguard().gridView();
|
||||
|
||||
gridDofIsPenetrated.resize(model.numGridDof());
|
||||
std::fill(gridDofIsPenetrated.begin(), gridDofIsPenetrated.end(), false);
|
||||
@ -631,7 +631,7 @@ protected:
|
||||
elemCtx.updateStencil(elem);
|
||||
for (unsigned dofIdx = 0; dofIdx < elemCtx.numPrimaryDof(/*timeIdx=*/0); ++ dofIdx) {
|
||||
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
||||
unsigned cartesianDofIdx = gridManager.cartesianIndex(globalDofIdx);
|
||||
unsigned cartesianDofIdx = vanguard.cartesianIndex(globalDofIdx);
|
||||
|
||||
if (wellCompletions.count(cartesianDofIdx) == 0)
|
||||
// the current DOF is not contained in any well, so we must skip
|
||||
@ -658,14 +658,14 @@ protected:
|
||||
|
||||
void computeWellCompletionsMap_(unsigned reportStepIdx OPM_UNUSED, WellCompletionsMap& cartesianIdxToCompletionMap)
|
||||
{
|
||||
const auto& deckSchedule = simulator_.gridManager().schedule();
|
||||
const auto& deckSchedule = simulator_.vanguard().schedule();
|
||||
|
||||
#ifndef NDEBUG
|
||||
const auto& eclState = simulator_.gridManager().eclState();
|
||||
const auto& eclState = simulator_.vanguard().eclState();
|
||||
const auto& eclGrid = eclState.getInputGrid();
|
||||
assert( int(eclGrid.getNX()) == simulator_.gridManager().cartesianDimensions()[ 0 ] );
|
||||
assert( int(eclGrid.getNY()) == simulator_.gridManager().cartesianDimensions()[ 1 ] );
|
||||
assert( int(eclGrid.getNZ()) == simulator_.gridManager().cartesianDimensions()[ 2 ] );
|
||||
assert( int(eclGrid.getNX()) == simulator_.vanguard().cartesianDimensions()[ 0 ] );
|
||||
assert( int(eclGrid.getNY()) == simulator_.vanguard().cartesianDimensions()[ 1 ] );
|
||||
assert( int(eclGrid.getNZ()) == simulator_.vanguard().cartesianDimensions()[ 2 ] );
|
||||
#endif
|
||||
|
||||
// compute the mapping from logically Cartesian indices to the well the
|
||||
@ -678,7 +678,7 @@ protected:
|
||||
if (!hasWell(wellName))
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
if( simulator_.gridManager().grid().comm().size() == 1 )
|
||||
if( simulator_.vanguard().grid().comm().size() == 1 )
|
||||
{
|
||||
std::cout << "Well '" << wellName << "' suddenly appears in the completions "
|
||||
<< "for the report step, but has not been previously specified. "
|
||||
@ -696,7 +696,7 @@ protected:
|
||||
cartesianCoordinate[ 0 ] = completion.getI();
|
||||
cartesianCoordinate[ 1 ] = completion.getJ();
|
||||
cartesianCoordinate[ 2 ] = completion.getK();
|
||||
unsigned cartIdx = simulator_.gridManager().cartesianIndex( cartesianCoordinate );
|
||||
unsigned cartIdx = simulator_.vanguard().cartesianIndex( cartesianCoordinate );
|
||||
|
||||
// in this code we only support each cell to be part of at most a single
|
||||
// well. TODO (?) change this?
|
||||
@ -710,7 +710,7 @@ protected:
|
||||
|
||||
void updateWellParameters_(unsigned reportStepIdx, const WellCompletionsMap& wellCompletions)
|
||||
{
|
||||
const auto& deckSchedule = simulator_.gridManager().schedule();
|
||||
const auto& deckSchedule = simulator_.vanguard().schedule();
|
||||
const std::vector<const Opm::Well*>& deckWells = deckSchedule.getWells(reportStepIdx);
|
||||
|
||||
// set the reference depth for all wells
|
||||
@ -727,8 +727,8 @@ protected:
|
||||
|
||||
// associate the well completions with grid cells and register them in the
|
||||
// Peaceman well object
|
||||
const auto& gridManager = simulator_.gridManager();
|
||||
const GridView gridView = gridManager.gridView();
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
const GridView gridView = vanguard.gridView();
|
||||
|
||||
ElementContext elemCtx(simulator_);
|
||||
auto elemIt = gridView.template begin</*codim=*/0>();
|
||||
@ -744,7 +744,7 @@ protected:
|
||||
{
|
||||
assert( elemCtx.numPrimaryDof(/*timeIdx=*/0) == 1 );
|
||||
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
||||
unsigned cartesianDofIdx = gridManager.cartesianIndex(globalDofIdx);
|
||||
unsigned cartesianDofIdx = vanguard.cartesianIndex(globalDofIdx);
|
||||
|
||||
if (wellCompletions.count(cartesianDofIdx) == 0)
|
||||
// the current DOF is not contained in any well, so we must skip
|
||||
|
@ -77,7 +77,7 @@ template <class TypeTag>
|
||||
class EclWriter
|
||||
{
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridManager) GridManager;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Vanguard;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
|
||||
@ -86,22 +86,22 @@ class EclWriter
|
||||
typedef typename GridView::template Codim<0>::Entity Element;
|
||||
typedef typename GridView::template Codim<0>::Iterator ElementIterator;
|
||||
|
||||
typedef CollectDataToIORank< GridManager > CollectDataToIORankType;
|
||||
typedef CollectDataToIORank< Vanguard > CollectDataToIORankType;
|
||||
|
||||
typedef std::vector<Scalar> ScalarBuffer;
|
||||
|
||||
public:
|
||||
EclWriter(const Simulator& simulator)
|
||||
: simulator_(simulator)
|
||||
, collectToIORank_(simulator_.gridManager())
|
||||
, collectToIORank_(simulator_.vanguard())
|
||||
, eclOutputModule_(simulator, collectToIORank_)
|
||||
{
|
||||
globalGrid_ = simulator_.gridManager().grid();
|
||||
globalGrid_ = simulator_.vanguard().grid();
|
||||
globalGrid_.switchToGlobalView();
|
||||
eclIO_.reset(new Opm::EclipseIO(simulator_.gridManager().eclState(),
|
||||
Opm::UgGridHelpers::createEclipseGrid( globalGrid_ , simulator_.gridManager().eclState().getInputGrid() ),
|
||||
simulator_.gridManager().schedule(),
|
||||
simulator_.gridManager().summaryConfig()));
|
||||
eclIO_.reset(new Opm::EclipseIO(simulator_.vanguard().eclState(),
|
||||
Opm::UgGridHelpers::createEclipseGrid( globalGrid_ , simulator_.vanguard().eclState().getInputGrid() ),
|
||||
simulator_.vanguard().schedule(),
|
||||
simulator_.vanguard().summaryConfig()));
|
||||
}
|
||||
|
||||
~EclWriter()
|
||||
@ -134,7 +134,7 @@ public:
|
||||
#else
|
||||
|
||||
int episodeIdx = simulator_.episodeIndex() + 1;
|
||||
const auto& gridView = simulator_.gridManager().gridView();
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
int numElements = gridView.size(/*codim=*/0);
|
||||
bool log = collectToIORank_.isIORank();
|
||||
eclOutputModule_.allocBuffers(numElements, episodeIdx, substep, log);
|
||||
@ -212,7 +212,7 @@ public:
|
||||
};
|
||||
|
||||
unsigned episodeIdx = simulator_.episodeIndex();
|
||||
const auto& gridView = simulator_.gridManager().gridView();
|
||||
const auto& gridView = simulator_.vanguard().gridView();
|
||||
unsigned numElements = gridView.size(/*codim=*/0);
|
||||
eclOutputModule_.allocBuffers(numElements, episodeIdx, /*substep=*/false, /*log=*/false);
|
||||
|
||||
@ -235,7 +235,7 @@ private:
|
||||
|
||||
Opm::data::Solution computeTrans_() const
|
||||
{
|
||||
const auto& cartMapper = simulator_.gridManager().cartesianIndexMapper();
|
||||
const auto& cartMapper = simulator_.vanguard().cartesianIndexMapper();
|
||||
const auto& cartDims = cartMapper.cartesianDimensions();
|
||||
const int globalSize = cartDims[0]*cartDims[1]*cartDims[2];
|
||||
|
||||
@ -261,7 +261,7 @@ private:
|
||||
|
||||
const auto& cartesianCellIdx = globalGrid_.globalCell();
|
||||
|
||||
const auto* globalTrans = &(simulator_.gridManager().globalTransmissibility());
|
||||
const auto* globalTrans = &(simulator_.vanguard().globalTransmissibility());
|
||||
if (!collectToIORank_.isParallel()) {
|
||||
// in the sequential case we must use the transmissibilites defined by
|
||||
// the problem. (because in the sequential case, the grid manager does
|
||||
@ -334,7 +334,7 @@ private:
|
||||
ElementMapper globalElemMapper(globalGridView);
|
||||
#endif
|
||||
|
||||
const auto* globalTrans = &(simulator_.gridManager().globalTransmissibility());
|
||||
const auto* globalTrans = &(simulator_.vanguard().globalTransmissibility());
|
||||
if (!collectToIORank_.isParallel()) {
|
||||
// in the sequential case we must use the transmissibilites defined by
|
||||
// the problem. (because in the sequential case, the grid manager does
|
||||
@ -386,7 +386,7 @@ private:
|
||||
}
|
||||
|
||||
const Opm::EclipseState& eclState() const
|
||||
{ return simulator_.gridManager().eclState(); }
|
||||
{ return simulator_.vanguard().eclState(); }
|
||||
|
||||
const Simulator& simulator_;
|
||||
CollectDataToIORankType collectToIORank_;
|
||||
|
@ -231,13 +231,13 @@ void test_PhasePressure()
|
||||
std::make_shared<Ewoms::EQUIL::Miscibility::NoMixing>(),
|
||||
0);
|
||||
|
||||
std::vector<int> cells(simulator->gridManager().grid().size(0));
|
||||
std::vector<int> cells(simulator->vanguard().grid().size(0));
|
||||
std::iota(cells.begin(), cells.end(), 0);
|
||||
|
||||
const double grav = 10;
|
||||
const PPress ppress = Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region, cells, grav);
|
||||
const PPress ppress = Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->vanguard().grid(), region, cells, grav);
|
||||
|
||||
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
||||
const int first = 0, last = simulator->vanguard().grid().size(0) - 1;
|
||||
const double reltol = 1.0e-8;
|
||||
CHECK_CLOSE(ppress[0][first] , 90e3 , reltol);
|
||||
CHECK_CLOSE(ppress[0][last ] , 180e3 , reltol);
|
||||
@ -253,7 +253,7 @@ void test_CellSubset()
|
||||
typedef TTAG(TestEquilTypeTag) TypeTag;
|
||||
typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_base.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
initDefaultFluidSystem<TypeTag>();
|
||||
@ -289,7 +289,7 @@ void test_CellSubset()
|
||||
for (std::size_t d = 1; d < 3; ++d) { ncoarse *= cdim[d]; }
|
||||
|
||||
std::vector< std::vector<int> > cells(ncoarse);
|
||||
for (int c = 0; c < simulator->gridManager().grid().size(0); ++c) {
|
||||
for (int c = 0; c < simulator->vanguard().grid().size(0); ++c) {
|
||||
int ci = c;
|
||||
const int i = ci % grid.cartdims[0]; ci /= grid.cartdims[0];
|
||||
const int j = ci % grid.cartdims[1];
|
||||
@ -304,7 +304,7 @@ void test_CellSubset()
|
||||
cells[ix].push_back(c);
|
||||
}
|
||||
|
||||
PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0));
|
||||
PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0));
|
||||
for (std::vector< std::vector<int> >::const_iterator
|
||||
r = cells.begin(), e = cells.end();
|
||||
r != e; ++r)
|
||||
@ -312,7 +312,7 @@ void test_CellSubset()
|
||||
const int rno = int(r - cells.begin());
|
||||
const double grav = 10;
|
||||
const PPress p =
|
||||
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region[rno], *r, grav);
|
||||
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->vanguard().grid(), region[rno], *r, grav);
|
||||
|
||||
PVal::size_type i = 0;
|
||||
for (std::vector<int>::const_iterator
|
||||
@ -326,7 +326,7 @@ void test_CellSubset()
|
||||
}
|
||||
}
|
||||
|
||||
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
||||
const int first = 0, last = simulator->vanguard().grid().size(0) - 1;
|
||||
const double reltol = 1.0e-8;
|
||||
CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
||||
CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
||||
@ -370,7 +370,7 @@ void test_RegMapping()
|
||||
0)
|
||||
};
|
||||
|
||||
std::vector<int> eqlnum(simulator->gridManager().grid().size(0));
|
||||
std::vector<int> eqlnum(simulator->vanguard().grid().size(0));
|
||||
// [ 0 1; 2 3]
|
||||
{
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
@ -393,14 +393,14 @@ void test_RegMapping()
|
||||
|
||||
Ewoms::RegionMapping<> eqlmap(eqlnum);
|
||||
|
||||
PPress ppress(2, PVal(simulator->gridManager().grid().size(0), 0));
|
||||
PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0));
|
||||
for (const auto& r : eqlmap.activeRegions()) {
|
||||
const auto& rng = eqlmap.cells(r);
|
||||
|
||||
const int rno = r;
|
||||
const double grav = 10;
|
||||
const PPress p =
|
||||
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->gridManager().grid(), region[rno], rng, grav);
|
||||
Ewoms::EQUIL::phasePressures<FluidSystem>(simulator->vanguard().grid(), region[rno], rng, grav);
|
||||
|
||||
PVal::size_type i = 0;
|
||||
for (const auto& c : rng) {
|
||||
@ -413,7 +413,7 @@ void test_RegMapping()
|
||||
}
|
||||
}
|
||||
|
||||
const int first = 0, last = simulator->gridManager().grid().size(0) - 1;
|
||||
const int first = 0, last = simulator->vanguard().grid().size(0) - 1;
|
||||
const double reltol = 1.0e-8;
|
||||
CHECK_CLOSE(ppress[0][first] , 105e3 , reltol);
|
||||
CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol);
|
||||
@ -425,11 +425,11 @@ void test_DeckAllDead()
|
||||
{
|
||||
typedef TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_deadfluids.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -500,11 +500,11 @@ void test_DeckWithCapillary()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_capillary.DATA");
|
||||
auto& eclipseState = simulator->gridManager().eclState();
|
||||
auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 10.0);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0);
|
||||
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
@ -538,11 +538,11 @@ void test_DeckWithCapillaryOverlap()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_capillary_overlap.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -597,12 +597,12 @@ void test_DeckWithLiveOil()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_liveoil.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
// Initialize the fluid system
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -674,11 +674,11 @@ void test_DeckWithLiveGas()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_livegas.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -754,11 +754,11 @@ void test_DeckWithRSVDAndRVVD()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_rsvd_and_rvvd.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -854,11 +854,11 @@ void test_DeckWithPBVDAndPDVD()
|
||||
{
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_pbvd_and_pdvd.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.80665);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665);
|
||||
const auto& pressures = comp.press();
|
||||
REQUIRE(pressures.size() == 3);
|
||||
REQUIRE(int(pressures[0].size()) == grid.number_of_cells);
|
||||
@ -945,7 +945,7 @@ void test_DeckWithSwatinit()
|
||||
#if 0
|
||||
typedef typename TTAG(TestEquilTypeTag) TypeTag;
|
||||
auto simulator = initSimulator<TypeTag>("data/equil_capillary_swatinit.DATA");
|
||||
const auto& eclipseState = simulator->gridManager().eclState();
|
||||
const auto& eclipseState = simulator->vanguard().eclState();
|
||||
Opm::GridManager gm(eclipseState.getInputGrid());
|
||||
const UnstructuredGrid& grid = *(gm.c_grid());
|
||||
|
||||
@ -1029,9 +1029,9 @@ void test_DeckWithSwatinit()
|
||||
|
||||
// compute the initial state
|
||||
// apply swatinit
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compScaled(materialLawManagerScaled, eclipseState, simulator->gridManager().grid(), 9.81, true);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compScaled(materialLawManagerScaled, eclipseState, simulator->vanguard().grid(), 9.81, true);
|
||||
// don't apply swatinit
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->gridManager().grid(), 9.81, false);
|
||||
Ewoms::EQUIL::DeckDependent::InitialStateComputer<TypeTag> compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.81, false);
|
||||
|
||||
// compute pc
|
||||
std::vector<double> pc_scaled(numCells * FluidSystem::numPhases);
|
||||
|
Loading…
Reference in New Issue
Block a user