mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
TransMult, Init, and SimConfig are references, applyModifierDeck takes reference, and EclipseState constructor too
This commit is contained in:
@@ -51,7 +51,7 @@ struct SetupSimple {
|
||||
Opm::ParseContext parseContext;
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
deck = parser->parseFile("fluid.data", parseContext);
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
|
||||
param.disableOutput();
|
||||
param.insertParameter("init_rock" , "false" );
|
||||
|
||||
@@ -72,7 +72,7 @@ struct SetupMSW {
|
||||
Opm::ParseContext parse_context;
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckConstPtr deck = parser->parseFile("msw.data", parse_context);
|
||||
Opm::EclipseStateConstPtr ecl_state(new Opm::EclipseState(deck , parse_context));
|
||||
Opm::EclipseStateConstPtr ecl_state(new Opm::EclipseState(*deck , parse_context));
|
||||
|
||||
// Create grid.
|
||||
const std::vector<double>& porv =
|
||||
|
||||
@@ -51,7 +51,7 @@ struct SetupSimple {
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::ParseContext parseContext;
|
||||
deck = parser->parseFile("fluid.data" , parseContext);
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
|
||||
param.disableOutput();
|
||||
param.insertParameter("init_rock" , "false" );
|
||||
|
||||
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(Construction)
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
std::vector<int> global_ind = {0 , 1 , 2};
|
||||
Opm::SolventPropsAdFromDeck solventprops(deck, eclState, 3, global_ind.data());
|
||||
}
|
||||
@@ -105,7 +105,7 @@ BOOST_AUTO_TEST_CASE(SolventData)
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
std::vector<int> global_ind = {0 , 1 , 2};
|
||||
Opm::SolventPropsAdFromDeck solventprops(deck, eclState, 3, global_ind.data());
|
||||
|
||||
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(PMISC)
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData + pmiscData, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
const Opm::SolventPropsAdFromDeck::Cells cells(3, 0);
|
||||
typedef Opm::SolventPropsAdFromDeck::V V;
|
||||
std::vector<int> global_ind = {0 , 1 , 2};
|
||||
@@ -164,7 +164,7 @@ BOOST_AUTO_TEST_CASE(TLPMIXPA)
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData + tlpmixpaData, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
const Opm::SolventPropsAdFromDeck::Cells cells(3, 0);
|
||||
typedef Opm::SolventPropsAdFromDeck::V V;
|
||||
const int* global_ind = new int[3] {0 , 1 , 2};
|
||||
@@ -189,7 +189,7 @@ BOOST_AUTO_TEST_CASE(TLPMIXPA_NOT_SPECIFIED)
|
||||
// no pmisc data and default tlpmixdata i.e it should throw
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
const Opm::SolventPropsAdFromDeck::Cells cells(3, 0);
|
||||
const int* global_ind = new int[3] {0 , 1 , 2};
|
||||
Opm::SolventPropsAdFromDeck solventprops(deck, eclState, 3, global_ind);
|
||||
@@ -218,7 +218,7 @@ BOOST_AUTO_TEST_CASE(TLPMIXPA_DEFAULT)
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData + pmiscData + tlpmixpaDataDefault, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
const Opm::SolventPropsAdFromDeck::Cells cells(3, 0);
|
||||
typedef Opm::SolventPropsAdFromDeck::V V;
|
||||
const int* global_ind = new int[3] {0 , 1 , 2};
|
||||
@@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(TLPMIXPA_DEFAULT_NOPMISC)
|
||||
// no pmisc data and default tlpmixdata i.e it should throw
|
||||
Opm::DeckPtr deck = parser->parseString(deckData + solventData + tlpmixpaDataDefault, parseContext);
|
||||
Opm::EclipseStateConstPtr eclState;
|
||||
eclState.reset(new Opm::EclipseState(deck , parseContext));
|
||||
eclState.reset(new Opm::EclipseState(*deck , parseContext));
|
||||
const Opm::SolventPropsAdFromDeck::Cells cells(3, 0);
|
||||
const int* global_ind = new int[3] {0 , 1 , 2};
|
||||
BOOST_CHECK_THROW(Opm::SolventPropsAdFromDeck solventprops(deck, eclState, 3, global_ind), std::invalid_argument);
|
||||
|
||||
@@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE(CreateSimulationConfig) {
|
||||
ParseContext parseContext;
|
||||
typedef UnstructuredGrid Grid;
|
||||
DeckPtr deck = createDeckSimConfig();
|
||||
EclipseState state(deck, parseContext);
|
||||
EclipseState state(*deck, parseContext);
|
||||
EclipseGridConstPtr eclipseGrid = state.getInputGrid();
|
||||
std::vector<double> porv = eclipseState->getDoubleGridProperty("PORV")->getData();
|
||||
GridManager gridManager( eclipseState->getInputGrid(), porv );
|
||||
|
||||
@@ -163,7 +163,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
/////
|
||||
// create a DerivedGeology object without any multipliers involved
|
||||
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseContext));
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(*origDeck , parseContext));
|
||||
|
||||
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getInputGrid());
|
||||
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck, origEclipseState, *(origGridManager->c_grid()));
|
||||
@@ -174,7 +174,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
/////
|
||||
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
||||
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseContext));
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(*multDeck, parseContext));
|
||||
|
||||
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getInputGrid());
|
||||
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *(multGridManager->c_grid()));
|
||||
@@ -186,7 +186,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
||||
// the negative faces
|
||||
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck , parseContext));
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(*multMinusDeck , parseContext));
|
||||
|
||||
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getInputGrid());
|
||||
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *(multMinusGridManager->c_grid()));
|
||||
@@ -197,7 +197,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
|
||||
/////
|
||||
// create a DerivedGeology object with the NTG keyword involved
|
||||
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseContext));
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(*ntgDeck, parseContext));
|
||||
|
||||
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getInputGrid());
|
||||
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *(ntgGridManager->c_grid()));
|
||||
@@ -278,7 +278,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
/////
|
||||
// create a DerivedGeology object without any multipliers involved
|
||||
Opm::DeckConstPtr origDeck = parser->parseString(origDeckString , parseContext);
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(origDeck , parseContext));
|
||||
Opm::EclipseStateConstPtr origEclipseState(new Opm::EclipseState(*origDeck , parseContext));
|
||||
|
||||
auto origGrid = std::make_shared<Dune::CpGrid>();
|
||||
origGrid->processEclipseFormat(origEclipseState->getInputGrid(), 0.0, false);
|
||||
@@ -293,7 +293,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
/////
|
||||
// create a DerivedGeology object _with_ transmissibility multipliers involved
|
||||
Opm::DeckConstPtr multDeck = parser->parseString(multDeckString,parseContext);
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(multDeck, parseContext));
|
||||
Opm::EclipseStateConstPtr multEclipseState(new Opm::EclipseState(*multDeck, parseContext));
|
||||
|
||||
auto multGrid = std::make_shared<Dune::CpGrid>();
|
||||
multGrid->processEclipseFormat(multEclipseState->getInputGrid(), 0.0, false);
|
||||
@@ -307,7 +307,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
// create a DerivedGeology object _with_ transmissibility multipliers involved for
|
||||
// the negative faces
|
||||
Opm::DeckConstPtr multMinusDeck = parser->parseString(multMinusDeckString , parseContext);
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(multMinusDeck, parseContext));
|
||||
Opm::EclipseStateConstPtr multMinusEclipseState(new Opm::EclipseState(*multMinusDeck, parseContext));
|
||||
|
||||
auto multMinusGrid = std::make_shared<Dune::CpGrid>();
|
||||
multMinusGrid->processEclipseFormat(multMinusEclipseState->getInputGrid(), 0.0, false);
|
||||
@@ -321,7 +321,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersCpGrid)
|
||||
/////
|
||||
// create a DerivedGeology object with the NTG keyword involved
|
||||
Opm::DeckConstPtr ntgDeck = parser->parseString(ntgDeckString, parseContext);
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(ntgDeck, parseContext));
|
||||
Opm::EclipseStateConstPtr ntgEclipseState(new Opm::EclipseState(*ntgDeck, parseContext));
|
||||
|
||||
auto ntgGrid = std::make_shared<Dune::CpGrid>();
|
||||
ntgGrid->processEclipseFormat(ntgEclipseState->getInputGrid(), 0.0, false);
|
||||
|
||||
Reference in New Issue
Block a user