From 18f6672df0f5d96fcb78ef4187789739fb4da448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Gr=C3=B8n=C3=A5s=20Drange?= Date: Tue, 19 Apr 2016 17:03:41 +0200 Subject: [PATCH] Using getInputGrid API from Parser --- examples/opm_init_check.cpp | 2 +- examples/sim_2p_comp_reorder.cpp | 2 +- examples/sim_2p_incomp.cpp | 2 +- examples/sim_2p_incomp_ad.cpp | 2 +- examples/sim_poly2p_comp_reorder.cpp | 2 +- examples/sim_poly2p_incomp_reorder.cpp | 2 +- examples/sim_poly_fi2p_comp_ad.cpp | 4 ++-- opm/autodiff/GeoProps.hpp | 4 ++-- opm/autodiff/GridInit.hpp | 2 +- tests/test_boprops_ad.cpp | 4 ++-- tests/test_rateconverter.cpp | 2 +- tests/test_thresholdpressure.cpp | 4 ++-- tests/test_transmissibilitymultipliers.cpp | 16 ++++++++-------- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/examples/opm_init_check.cpp b/examples/opm_init_check.cpp index f2563c727..586320358 100644 --- a/examples/opm_init_check.cpp +++ b/examples/opm_init_check.cpp @@ -208,7 +208,7 @@ public: /*****************************************************************/ void initOPMTrans(TransGraph& opmTrans, DeckConstPtr deck, std::shared_ptr eclipseState) { - std::shared_ptr grid = std::make_shared( eclipseState->getEclipseGrid(), + std::shared_ptr grid = std::make_shared( eclipseState->getInputGrid(), eclipseState->get3DProperties().getDoubleGridProperty( "PORV" ).getData() ); const struct UnstructuredGrid * cGrid = grid->c_grid(); std::shared_ptr props; diff --git a/examples/sim_2p_comp_reorder.cpp b/examples/sim_2p_comp_reorder.cpp index b42016339..0c8359d1c 100644 --- a/examples/sim_2p_comp_reorder.cpp +++ b/examples/sim_2p_comp_reorder.cpp @@ -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)); diff --git a/examples/sim_2p_incomp.cpp b/examples/sim_2p_incomp.cpp index de13d2a60..eeca23ce1 100644 --- a/examples/sim_2p_incomp.cpp +++ b/examples/sim_2p_incomp.cpp @@ -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 diff --git a/examples/sim_2p_incomp_ad.cpp b/examples/sim_2p_incomp_ad.cpp index 8e671a6ee..edd568b1b 100644 --- a/examples/sim_2p_incomp_ad.cpp +++ b/examples/sim_2p_incomp_ad.cpp @@ -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()); diff --git a/examples/sim_poly2p_comp_reorder.cpp b/examples/sim_poly2p_comp_reorder.cpp index b4fd352ce..5e801d1fa 100644 --- a/examples/sim_poly2p_comp_reorder.cpp +++ b/examples/sim_poly2p_comp_reorder.cpp @@ -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()); diff --git a/examples/sim_poly2p_incomp_reorder.cpp b/examples/sim_poly2p_incomp_reorder.cpp index 3826a06d8..00ef71e48 100644 --- a/examples/sim_poly2p_incomp_reorder.cpp +++ b/examples/sim_poly2p_incomp_reorder.cpp @@ -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 diff --git a/examples/sim_poly_fi2p_comp_ad.cpp b/examples/sim_poly_fi2p_comp_ad.cpp index f68b6aa97..3630294c1 100644 --- a/examples/sim_poly_fi2p_comp_ad.cpp +++ b/examples/sim_poly_fi2p_comp_ad.cpp @@ -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); diff --git a/opm/autodiff/GeoProps.hpp b/opm/autodiff/GeoProps.hpp index 202ccd32d..c19e37049 100644 --- a/opm/autodiff/GeoProps.hpp +++ b/opm/autodiff/GeoProps.hpp @@ -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]; diff --git a/opm/autodiff/GridInit.hpp b/opm/autodiff/GridInit.hpp index a81394f5e..a66a6b109 100644 --- a/opm/autodiff/GridInit.hpp +++ b/opm/autodiff/GridInit.hpp @@ -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& porv) - : grid_manager_(eclipse_state->getEclipseGrid(), porv) + : grid_manager_(eclipse_state->getInputGrid(), porv) { } /// Access the created grid. diff --git a/tests/test_boprops_ad.cpp b/tests/test_boprops_ad.cpp index 20f0a21cf..455475291 100644 --- a/tests/test_boprops_ad.cpp +++ b/tests/test_boprops_ad.cpp @@ -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)) { diff --git a/tests/test_rateconverter.cpp b/tests/test_rateconverter.cpp index 15ec67aee..2947656ac 100644 --- a/tests/test_rateconverter.cpp +++ b/tests/test_rateconverter.cpp @@ -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)) { } diff --git a/tests/test_thresholdpressure.cpp b/tests/test_thresholdpressure.cpp index c582335fb..d717e1c94 100644 --- a/tests/test_thresholdpressure.cpp +++ b/tests/test_thresholdpressure.cpp @@ -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 porv = eclipseState->getDoubleGridProperty("PORV")->getData(); - GridManager gridManager( eclipseState->getEclipseGrid(), porv ); + GridManager gridManager( eclipseState->getInputGrid(), porv ); const Grid& grid = *(gridManager.c_grid()); std::vector threshold_pressures = thresholdPressures(parseContext, eclipseState, grid); diff --git a/tests/test_transmissibilitymultipliers.cpp b/tests/test_transmissibilitymultipliers.cpp index cb65bb782..b6816901f 100644 --- a/tests/test_transmissibilitymultipliers.cpp +++ b/tests/test_transmissibilitymultipliers.cpp @@ -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(origEclipseState->getEclipseGrid()); + auto origGridManager = std::make_shared(origEclipseState->getInputGrid()); auto origProps = std::make_shared(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(multEclipseState->getEclipseGrid()); + auto multGridManager = std::make_shared(multEclipseState->getInputGrid()); auto multProps = std::make_shared(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(multMinusEclipseState->getEclipseGrid()); + auto multMinusGridManager = std::make_shared(multMinusEclipseState->getInputGrid()); auto multMinusProps = std::make_shared(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(ntgEclipseState->getEclipseGrid()); + auto ntgGridManager = std::make_shared(ntgEclipseState->getInputGrid()); auto ntgProps = std::make_shared(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(); - origGrid->processEclipseFormat(origEclipseState->getEclipseGrid(), 0.0, false); + origGrid->processEclipseFormat(origEclipseState->getInputGrid(), 0.0, false); auto origProps = std::make_shared(origDeck, origEclipseState, @@ -296,7 +296,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid) Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseContext)); auto multGrid = std::make_shared(); - multGrid->processEclipseFormat(multEclipseState->getEclipseGrid(), 0.0, false); + multGrid->processEclipseFormat(multEclipseState->getInputGrid(), 0.0, false); auto multProps = std::make_shared(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(); - multMinusGrid->processEclipseFormat(multMinusEclipseState->getEclipseGrid(), 0.0, false); + multMinusGrid->processEclipseFormat(multMinusEclipseState->getInputGrid(), 0.0, false); auto multMinusProps = std::make_shared(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(); - ntgGrid->processEclipseFormat(ntgEclipseState->getEclipseGrid(), 0.0, false); + ntgGrid->processEclipseFormat(ntgEclipseState->getInputGrid(), 0.0, false); auto ntgProps = std::make_shared(ntgDeck, ntgEclipseState, *ntgGrid);