From 877bd70c546ddd7de5ce70eec93b7cf012dad35e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A5l=20Gr=C3=B8n=C3=A5s=20Drange?= Date: Mon, 8 Aug 2016 10:02:53 +0200 Subject: [PATCH] transmult and initconfig are ref's, use ref for EclipseState constructor --- examples/compute_initial_state.cpp | 2 +- opm/core/simulator/initStateEquil.hpp | 2 +- tests/test_equil.cpp | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/compute_initial_state.cpp b/examples/compute_initial_state.cpp index 356f3f42d..2eb27d1f4 100644 --- a/examples/compute_initial_state.cpp +++ b/examples/compute_initial_state.cpp @@ -90,7 +90,7 @@ try Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser() ); Opm::DeckConstPtr deck = parser->parseFile(deck_filename , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck, parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); const double grav = param.getDefault("gravity", unit::gravity); GridManager gm(eclipseState->getInputGrid()); const UnstructuredGrid& grid = *gm.c_grid(); diff --git a/opm/core/simulator/initStateEquil.hpp b/opm/core/simulator/initStateEquil.hpp index b03d488a0..cbda500ee 100644 --- a/opm/core/simulator/initStateEquil.hpp +++ b/opm/core/simulator/initStateEquil.hpp @@ -200,7 +200,7 @@ namespace Opm std::vector getEquil(const Opm::EclipseState& state) { - const auto& init = *state.getInitConfig(); + const auto& init = state.getInitConfig(); if( !init.hasEquil() ) { OPM_THROW(std::domain_error, "Deck does not provide equilibration data."); diff --git a/tests/test_equil.cpp b/tests/test_equil.cpp index ed7f74ffa..caedd0af9 100644 --- a/tests/test_equil.cpp +++ b/tests/test_equil.cpp @@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE (DeckAllDead) Opm::ParseContext parseContext; Opm::ParserPtr parser(new Opm::Parser() ); Opm::DeckConstPtr deck = parser->parseFile("deadfluids.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck, parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck, parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, *grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, *grid, 10.0); const auto& pressures = comp.press(); @@ -394,7 +394,7 @@ BOOST_AUTO_TEST_CASE (CapillaryInversion) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); // Test the capillary inversion for oil-water. @@ -448,7 +448,7 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillary) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("capillary.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 10.0); @@ -489,7 +489,7 @@ BOOST_AUTO_TEST_CASE (DeckWithCapillaryOverlap) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("capillary_overlap.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -552,7 +552,7 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("equil_liveoil.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -632,7 +632,7 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveGas) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("equil_livegas.DATA" , parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665); @@ -715,7 +715,7 @@ BOOST_AUTO_TEST_CASE (DeckWithRSVDAndRVVD) Opm::ParserPtr parser(new Opm::Parser() ); Opm::ParseContext parseContext; Opm::DeckConstPtr deck = parser->parseFile("equil_rsvd_and_rvvd.DATA", parseContext); - Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck , parseContext)); + Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext)); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, false); Opm::EQUIL::DeckDependent::InitialStateComputer comp(props, deck, eclipseState, grid, 9.80665);