Made EclipseConfig.SimulationConfig and .InitConfig references
This commit is contained in:
@@ -39,8 +39,8 @@ namespace Opm {
|
||||
const Schedule& schedule,
|
||||
const ParseContext& parseContext) :
|
||||
m_ioConfig( std::make_shared<IOConfig>(deck)),
|
||||
m_initConfig( std::make_shared<const InitConfig>(deck)),
|
||||
m_simulationConfig(std::make_shared<const SimulationConfig>(deck, eclipse3DProperties)),
|
||||
m_initConfig( deck),
|
||||
m_simulationConfig(deck, eclipse3DProperties),
|
||||
m_summaryConfig( deck, schedule, eclipse3DProperties, parseContext , inputGrid.getNXYZ())
|
||||
{
|
||||
m_ioConfig->initFirstRFTOutput(schedule);
|
||||
@@ -58,11 +58,11 @@ namespace Opm {
|
||||
return m_ioConfig;
|
||||
}
|
||||
|
||||
InitConfigConstPtr EclipseConfig::getInitConfig() const {
|
||||
const InitConfig& EclipseConfig::getInitConfig() const {
|
||||
return m_initConfig;
|
||||
}
|
||||
|
||||
SimulationConfigConstPtr EclipseConfig::getSimulationConfig() const {
|
||||
const SimulationConfig& EclipseConfig::getSimulationConfig() const {
|
||||
return m_simulationConfig;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/InitConfig/InitConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -30,8 +32,6 @@ namespace Opm {
|
||||
class GridDims;
|
||||
class Eclipse3DProperties;
|
||||
class IOConfig;
|
||||
class InitConfig;
|
||||
class SimulationConfig;
|
||||
class ParseContext;
|
||||
|
||||
class EclipseConfig
|
||||
@@ -45,14 +45,14 @@ namespace Opm {
|
||||
|
||||
std::shared_ptr< const IOConfig > getIOConfigConst() const;
|
||||
std::shared_ptr< IOConfig > getIOConfig() const;
|
||||
std::shared_ptr< const InitConfig > getInitConfig() const;
|
||||
std::shared_ptr< const SimulationConfig > getSimulationConfig() const;
|
||||
const InitConfig& getInitConfig() const;
|
||||
const SimulationConfig & getSimulationConfig() const;
|
||||
const SummaryConfig& getSummaryConfig() const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<IOConfig> m_ioConfig;
|
||||
std::shared_ptr<const InitConfig> m_initConfig;
|
||||
std::shared_ptr<const SimulationConfig> m_simulationConfig;
|
||||
const InitConfig m_initConfig;
|
||||
const SimulationConfig m_simulationConfig;
|
||||
SummaryConfig m_summaryConfig;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Opm {
|
||||
return m_eclipseConfig.getIOConfig();
|
||||
}
|
||||
|
||||
InitConfigConstPtr EclipseState::getInitConfig() const {
|
||||
const InitConfig& EclipseState::getInitConfig() const {
|
||||
return m_eclipseConfig.getInitConfig();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Opm {
|
||||
return m_eclipseConfig;
|
||||
}
|
||||
|
||||
SimulationConfigConstPtr EclipseState::getSimulationConfig() const {
|
||||
const SimulationConfig& EclipseState::getSimulationConfig() const {
|
||||
return m_eclipseConfig.getSimulationConfig();
|
||||
}
|
||||
|
||||
|
||||
@@ -72,8 +72,9 @@ namespace Opm {
|
||||
std::shared_ptr< const Schedule > getSchedule() const;
|
||||
std::shared_ptr< const IOConfig > getIOConfigConst() const;
|
||||
std::shared_ptr< IOConfig > getIOConfig() const;
|
||||
std::shared_ptr< const InitConfig > getInitConfig() const;
|
||||
std::shared_ptr< const SimulationConfig > getSimulationConfig() const;
|
||||
|
||||
const InitConfig& getInitConfig() const;
|
||||
const SimulationConfig& getSimulationConfig() const;
|
||||
const SummaryConfig& getSummaryConfig() const;
|
||||
|
||||
std::shared_ptr< const EclipseGrid > getInputGrid() const;
|
||||
|
||||
@@ -242,11 +242,11 @@ BOOST_AUTO_TEST_CASE(CreateSimulationConfig) {
|
||||
|
||||
DeckPtr deck = createDeckSimConfig();
|
||||
EclipseState state(*deck, ParseContext());
|
||||
SimulationConfigConstPtr simConf = state.getSimulationConfig();
|
||||
const auto& simConf = state.getSimulationConfig();
|
||||
|
||||
BOOST_CHECK(simConf->hasThresholdPressure());
|
||||
BOOST_CHECK(simConf.hasThresholdPressure());
|
||||
|
||||
std::shared_ptr<const ThresholdPressure> thresholdPressure = simConf->getThresholdPressure();
|
||||
std::shared_ptr<const ThresholdPressure> thresholdPressure = simConf.getThresholdPressure();
|
||||
BOOST_CHECK_EQUAL(thresholdPressure->size(), 3);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user