From 6eab1b99549be22eaceecc899b4ccd06e87a2622 Mon Sep 17 00:00:00 2001 From: Joakim Hove <joakim.hove@gmail.com> Date: Wed, 31 Aug 2016 10:02:24 +0200 Subject: [PATCH] shared_ptr<EclipseGrid> -> const EclipseGrid& --- examples/compute_initial_state.cpp | 2 +- examples/diagnose_relperm.cpp | 2 +- tests/test_blackoilstate.cpp | 6 +++--- tests/test_pinchprocessor.cpp | 2 +- tests/test_relpermdiagnostics.cpp | 2 +- tests/test_stoppedwells.cpp | 2 +- tests/test_wellsmanager.cpp | 10 +++++----- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/compute_initial_state.cpp b/examples/compute_initial_state.cpp index 2eb27d1f4..d4e009f78 100644 --- a/examples/compute_initial_state.cpp +++ b/examples/compute_initial_state.cpp @@ -92,7 +92,7 @@ try Opm::DeckConstPtr deck = parser->parseFile(deck_filename , parseContext); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); const double grav = param.getDefault("gravity", unit::gravity); - GridManager gm(eclipseState->getInputGrid()); + GridManager gm(*eclipseState->getInputGrid()); const UnstructuredGrid& grid = *gm.c_grid(); BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param); warnIfUnusedParams(param); diff --git a/examples/diagnose_relperm.cpp b/examples/diagnose_relperm.cpp index 99158109d..3f3def444 100644 --- a/examples/diagnose_relperm.cpp +++ b/examples/diagnose_relperm.cpp @@ -78,7 +78,7 @@ try Opm::DeckConstPtr deck(parser->parseFile(eclipseFilename, parseContext)); eclState.reset(new EclipseState(*deck, parseContext)); - GridManager gm(eclState->getInputGrid()); + GridManager gm(*eclState->getInputGrid()); const UnstructuredGrid& grid = *gm.c_grid(); using boost::filesystem::path; path fpath(eclipseFilename); diff --git a/tests/test_blackoilstate.cpp b/tests/test_blackoilstate.cpp index 25d41c82c..bb94eb550 100644 --- a/tests/test_blackoilstate.cpp +++ b/tests/test_blackoilstate.cpp @@ -48,10 +48,10 @@ BOOST_AUTO_TEST_CASE(EqualsDifferentDeckReturnFalse) { const auto es2 = Opm::Parser::parse(filename2); auto eg2 = es2.getInputGrid(); - GridManager gridManager1(eg1); + GridManager gridManager1(*eg1); const UnstructuredGrid& grid1 = *gridManager1.c_grid(); - GridManager gridManager2(eg2); + GridManager gridManager2(*eg2); const UnstructuredGrid& grid2 = *gridManager2.c_grid(); BlackoilState state1( UgGridHelpers::numCells( grid1 ) , UgGridHelpers::numFaces( grid1 ) , 3); @@ -73,7 +73,7 @@ BOOST_AUTO_TEST_CASE(EqualsNumericalDifferenceReturnFalse) { std::vector<int> actnum = get_testBlackoilStateActnum(); eg->resetACTNUM(actnum.data()); - GridManager gridManager(eg); + GridManager gridManager(*eg); const UnstructuredGrid& grid = *gridManager.c_grid(); BlackoilState state1( UgGridHelpers::numCells( grid ) , UgGridHelpers::numFaces( grid ) , 3); diff --git a/tests/test_pinchprocessor.cpp b/tests/test_pinchprocessor.cpp index 78659b8fe..2cb0bed30 100644 --- a/tests/test_pinchprocessor.cpp +++ b/tests/test_pinchprocessor.cpp @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(Processing) const int nc_initial = eclgrid->getNumActive(); - Opm::GridManager gridM(eclgrid, porv); + Opm::GridManager gridM(*eclgrid, porv); typedef UnstructuredGrid Grid; const Grid& grid = *(gridM.c_grid()); const int* global_cell = Opm::UgGridHelpers::globalCell(grid); diff --git a/tests/test_relpermdiagnostics.cpp b/tests/test_relpermdiagnostics.cpp index 814fc073c..8814ed01f 100644 --- a/tests/test_relpermdiagnostics.cpp +++ b/tests/test_relpermdiagnostics.cpp @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(diagnosis) }); Opm::DeckConstPtr deck(parser->parseFile("../tests/relpermDiagnostics.DATA", parseContext)); eclState.reset(new EclipseState(*deck, parseContext)); - GridManager gm(eclState->getInputGrid()); + GridManager gm(*eclState->getInputGrid()); const UnstructuredGrid& grid = *gm.c_grid(); std::shared_ptr<CounterLog> counterLog = std::make_shared<CounterLog>(Log::DefaultMessageTypes); OpmLog::addBackend( "COUNTERLOG" , counterLog ); diff --git a/tests/test_stoppedwells.cpp b/tests/test_stoppedwells.cpp index 219377d7f..3c2a09a9b 100644 --- a/tests/test_stoppedwells.cpp +++ b/tests/test_stoppedwells.cpp @@ -48,7 +48,7 @@ BOOST_AUTO_TEST_CASE(TestStoppedWells) Opm::DeckConstPtr deck(parser->parseFile(filename , parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); double target_surfacerate_inj; double target_surfacerate_prod; diff --git a/tests/test_wellsmanager.cpp b/tests/test_wellsmanager.cpp index cb8cd7ad0..649fd6cb0 100644 --- a/tests/test_wellsmanager.cpp +++ b/tests/test_wellsmanager.cpp @@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) { Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); { Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL); @@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE(WellsEqual) { Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); Opm::WellsManager wellsManager0(eclipseState, 0, *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager1(eclipseState, 1, *gridManager.c_grid(), NULL); @@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) { Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); Opm::WellsManager wellsManager0(eclipseState, 0, *gridManager.c_grid(), NULL); Opm::WellsManager wellsManager1(eclipseState, 1, *gridManager.c_grid(), NULL); @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(WellShutOK) { Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); Opm::WellsManager wellsManager2(eclipseState, 2, *gridManager.c_grid(), NULL); @@ -275,7 +275,7 @@ BOOST_AUTO_TEST_CASE(WellSTOPOK) { Opm::DeckConstPtr deck(parser->parseFile(filename, parseContext)); Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); - Opm::GridManager gridManager(eclipseState->getInputGrid()); + Opm::GridManager gridManager(*eclipseState->getInputGrid()); Opm::WellsManager wellsManager(eclipseState, 0, *gridManager.c_grid(), NULL);