mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-24 05:06:25 -06:00
Using getInputGrid API from Parser
This commit is contained in:
parent
d9787f7593
commit
18f6672df0
@ -208,7 +208,7 @@ public:
|
||||
/*****************************************************************/
|
||||
|
||||
void initOPMTrans(TransGraph& opmTrans, DeckConstPtr deck, std::shared_ptr<const EclipseState> eclipseState) {
|
||||
std::shared_ptr<GridManager> grid = std::make_shared<GridManager>( eclipseState->getEclipseGrid(),
|
||||
std::shared_ptr<GridManager> grid = std::make_shared<GridManager>( eclipseState->getInputGrid(),
|
||||
eclipseState->get3DProperties().getDoubleGridProperty( "PORV" ).getData() );
|
||||
const struct UnstructuredGrid * cGrid = grid->c_grid();
|
||||
std::shared_ptr<BlackoilPropsAdInterface> props;
|
||||
|
@ -106,7 +106,7 @@ try
|
||||
eclipseState.reset(new EclipseState(deck, parseContext));
|
||||
|
||||
// Grid init
|
||||
grid.reset(new GridManager(deck));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
{
|
||||
const UnstructuredGrid& ug_grid = *(grid->c_grid());
|
||||
state.reset( new BlackoilState( UgGridHelpers::numCells( ug_grid ) , UgGridHelpers::numFaces( ug_grid ) ,2));
|
||||
|
@ -117,7 +117,7 @@ try
|
||||
deck = parser->parseFile(deck_filename , parseContext);
|
||||
eclipseState.reset( new EclipseState(deck, parseContext));
|
||||
// Grid init
|
||||
grid.reset(new GridManager(deck));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
{
|
||||
const UnstructuredGrid& ug_grid = *(grid->c_grid());
|
||||
// Rock and fluid init
|
||||
|
@ -118,7 +118,7 @@ try
|
||||
eclipseState.reset(new EclipseState(deck , parseContext));
|
||||
|
||||
// Grid init
|
||||
grid.reset(new GridManager(deck));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
{
|
||||
const UnstructuredGrid& ug_grid = *(grid->c_grid());
|
||||
|
||||
|
@ -105,7 +105,7 @@ try
|
||||
eclipseState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
|
||||
// Grid init
|
||||
grid.reset(new GridManager(deck));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
{
|
||||
const UnstructuredGrid& ug_grid = *(grid->c_grid());
|
||||
|
||||
|
@ -105,7 +105,7 @@ try
|
||||
eclipseState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
|
||||
// Grid init
|
||||
grid.reset(new GridManager(deck));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
{
|
||||
const UnstructuredGrid& ug_grid = *(grid->c_grid());
|
||||
// Rock and fluid init
|
||||
|
@ -168,9 +168,9 @@ try
|
||||
|
||||
if (eclipseState->get3DProperties().hasDeckDoubleGridProperty("PORV")) {
|
||||
const auto& porv = eclipseState->get3DProperties().getDoubleGridProperty("PORV").getData();
|
||||
grid.reset(new GridManager(eclipseState->getEclipseGrid(), porv));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid(), porv));
|
||||
} else {
|
||||
grid.reset(new GridManager(eclipseState->getEclipseGrid()));
|
||||
grid.reset(new GridManager(eclipseState->getInputGrid()));
|
||||
}
|
||||
auto &cGrid = *grid->c_grid();
|
||||
const PhaseUsage pu = Opm::phaseUsageFromDeck(deck);
|
||||
|
@ -107,7 +107,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
// Get grid from parser.
|
||||
EclipseGridConstPtr eclgrid = eclState->getEclipseGrid();
|
||||
EclipseGridConstPtr eclgrid = eclState->getInputGrid();
|
||||
|
||||
// Pore volume.
|
||||
// New keywords MINPVF will add some PV due to OPM cpgrid process algorithm.
|
||||
@ -277,7 +277,7 @@ namespace Opm
|
||||
int numCells = Opm::AutoDiffGrid::numCells(grid);
|
||||
const int* global_cell = Opm::UgGridHelpers::globalCell(grid);
|
||||
const int* cartdims = Opm::UgGridHelpers::cartDims(grid);
|
||||
EclipseGridConstPtr eclgrid = eclState->getEclipseGrid();
|
||||
EclipseGridConstPtr eclgrid = eclState->getInputGrid();
|
||||
const auto& porv = eclState->get3DProperties().getDoubleGridProperty("PORV").getData();
|
||||
for (int cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
||||
const int nx = cartdims[0];
|
||||
|
@ -54,7 +54,7 @@ namespace Opm
|
||||
public:
|
||||
/// Initialize from a deck and/or an eclipse state and (logical cartesian) specified pore volumes.
|
||||
GridInit(DeckConstPtr, EclipseStateConstPtr eclipse_state, const std::vector<double>& porv)
|
||||
: grid_manager_(eclipse_state->getEclipseGrid(), porv)
|
||||
: grid_manager_(eclipse_state->getInputGrid(), porv)
|
||||
{
|
||||
}
|
||||
/// Access the created grid.
|
||||
|
@ -71,7 +71,7 @@ struct TestFixture : public Setup
|
||||
{
|
||||
TestFixture()
|
||||
: Setup()
|
||||
, grid (deck)
|
||||
, grid (eclState->getInputGrid())
|
||||
, boprops_ad(deck, eclState, *grid.c_grid(), param.getDefault("init_rock", false))
|
||||
{
|
||||
}
|
||||
@ -89,7 +89,7 @@ struct TestFixtureAd : public Setup
|
||||
{
|
||||
TestFixtureAd()
|
||||
: Setup()
|
||||
, grid (deck)
|
||||
, grid (eclState->getInputGrid())
|
||||
, props(deck, eclState, *grid.c_grid(),
|
||||
param.getDefault("init_rock", false))
|
||||
{
|
||||
|
@ -71,7 +71,7 @@ struct TestFixture : public Setup
|
||||
{
|
||||
TestFixture()
|
||||
: Setup()
|
||||
, grid (deck)
|
||||
, grid (eclState->getInputGrid())
|
||||
, ad_props(deck, eclState, *grid.c_grid(), param.getDefault("init_rock", false))
|
||||
{
|
||||
}
|
||||
|
@ -46,9 +46,9 @@ BOOST_AUTO_TEST_CASE(CreateSimulationConfig) {
|
||||
typedef UnstructuredGrid Grid;
|
||||
DeckPtr deck = createDeckSimConfig();
|
||||
EclipseState state(deck, parseContext);
|
||||
EclipseGridConstPtr eclipseGrid = state.getEclipseGrid();
|
||||
EclipseGridConstPtr eclipseGrid = state.getInputGrid();
|
||||
std::vector<double> porv = eclipseState->getDoubleGridProperty("PORV")->getData();
|
||||
GridManager gridManager( eclipseState->getEclipseGrid(), porv );
|
||||
GridManager gridManager( eclipseState->getInputGrid(), porv );
|
||||
const Grid& grid = *(gridManager.c_grid());
|
||||
|
||||
std::vector<double> threshold_pressures = thresholdPressures(parseContext, eclipseState, grid);
|
||||
|
@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseContext));
|
||||
|
||||
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getEclipseGrid());
|
||||
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getInputGrid());
|
||||
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck, origEclipseState, *(origGridManager->c_grid()));
|
||||
|
||||
Opm::DerivedGeology origGeology(*(origGridManager->c_grid()), *origProps, origEclipseState, false);
|
||||
@ -176,7 +176,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseContext));
|
||||
|
||||
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getEclipseGrid());
|
||||
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getInputGrid());
|
||||
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *(multGridManager->c_grid()));
|
||||
|
||||
Opm::DerivedGeology multGeology(*(multGridManager->c_grid()), *multProps, multEclipseState, false);
|
||||
@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck , parseContext));
|
||||
|
||||
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getEclipseGrid());
|
||||
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getInputGrid());
|
||||
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *(multMinusGridManager->c_grid()));
|
||||
|
||||
Opm::DerivedGeology multMinusGeology(*(multMinusGridManager->c_grid()), *multMinusProps, multMinusEclipseState, false);
|
||||
@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseContext));
|
||||
|
||||
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getEclipseGrid());
|
||||
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getInputGrid());
|
||||
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *(ntgGridManager->c_grid()));
|
||||
|
||||
Opm::DerivedGeology ntgGeology(*(ntgGridManager->c_grid()), *ntgProps, ntgEclipseState, false);
|
||||
@ -281,7 +281,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseContext));
|
||||
|
||||
auto origGrid = std::make_shared<Dune::CpGrid>();
|
||||
origGrid->processEclipseFormat(origEclipseState->getEclipseGrid(), 0.0, false);
|
||||
origGrid->processEclipseFormat(origEclipseState->getInputGrid(), 0.0, false);
|
||||
|
||||
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck,
|
||||
origEclipseState,
|
||||
@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseContext));
|
||||
|
||||
auto multGrid = std::make_shared<Dune::CpGrid>();
|
||||
multGrid->processEclipseFormat(multEclipseState->getEclipseGrid(), 0.0, false);
|
||||
multGrid->processEclipseFormat(multEclipseState->getInputGrid(), 0.0, false);
|
||||
|
||||
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *multGrid);
|
||||
|
||||
@ -310,7 +310,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck, parseContext));
|
||||
|
||||
auto multMinusGrid = std::make_shared<Dune::CpGrid>();
|
||||
multMinusGrid->processEclipseFormat(multMinusEclipseState->getEclipseGrid(), 0.0, false);
|
||||
multMinusGrid->processEclipseFormat(multMinusEclipseState->getInputGrid(), 0.0, false);
|
||||
|
||||
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *multMinusGrid);
|
||||
|
||||
@ -324,7 +324,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseContext));
|
||||
|
||||
auto ntgGrid = std::make_shared<Dune::CpGrid>();
|
||||
ntgGrid->processEclipseFormat(ntgEclipseState->getEclipseGrid(), 0.0, false);
|
||||
ntgGrid->processEclipseFormat(ntgEclipseState->getInputGrid(), 0.0, false);
|
||||
|
||||
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *ntgGrid);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user