mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-11 08:51:55 -06:00
Update to shared_ptr-less parser interface.
This commit is contained in:
parent
144318b567
commit
ad6b77cc15
@ -36,13 +36,13 @@ try
|
|||||||
|
|
||||||
// Read input file
|
// Read input file
|
||||||
ParseContext parseContext;
|
ParseContext parseContext;
|
||||||
Opm::ParserPtr parser(new Opm::Parser());
|
Opm::Parser parser;
|
||||||
Opm::DeckConstPtr deck = parser->parseFile(file_name , parseContext);
|
Opm::Deck deck = parser.parseFile(file_name , parseContext);
|
||||||
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext));
|
Opm::EclipseState eclipseState(deck , parseContext);
|
||||||
std::cout << "Done!" << std::endl;
|
std::cout << "Done!" << std::endl;
|
||||||
|
|
||||||
// Setup grid
|
// Setup grid
|
||||||
GridManager grid(*eclipseState->getInputGrid());
|
GridManager grid(eclipseState.getInputGrid());
|
||||||
|
|
||||||
// Define rock and fluid properties
|
// Define rock and fluid properties
|
||||||
IncompPropertiesFromDeck incomp_properties(deck, eclipseState, *grid.c_grid());
|
IncompPropertiesFromDeck incomp_properties(deck, eclipseState, *grid.c_grid());
|
||||||
|
@ -49,17 +49,17 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
||||||
void SimulatorTimer::init(Opm::TimeMapConstPtr timeMap, size_t report_step)
|
void SimulatorTimer::init(const TimeMap& timeMap, size_t report_step)
|
||||||
{
|
{
|
||||||
total_time_ = timeMap->getTotalTime();
|
total_time_ = timeMap.getTotalTime();
|
||||||
timesteps_.resize(timeMap->numTimesteps());
|
timesteps_.resize(timeMap.numTimesteps());
|
||||||
for ( size_t i = 0; i < timeMap->numTimesteps(); ++i ) {
|
for ( size_t i = 0; i < timeMap.numTimesteps(); ++i ) {
|
||||||
timesteps_[i] = timeMap->getTimeStepLength(i);
|
timesteps_[i] = timeMap.getTimeStepLength(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentStepNum(report_step);
|
setCurrentStepNum(report_step);
|
||||||
|
|
||||||
boost::posix_time::ptime start_time = timeMap->getStartTime(0);
|
boost::posix_time::ptime start_time = timeMap.getStartTime(0);
|
||||||
start_date_ = start_time.date();
|
start_date_ = start_time.date();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ namespace Opm
|
|||||||
void init(const parameter::ParameterGroup& param);
|
void init(const parameter::ParameterGroup& param);
|
||||||
|
|
||||||
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
/// Use the SimulatorTimer as a shim around opm-parser's Opm::TimeMap
|
||||||
void init(TimeMapConstPtr timeMap, size_t report_step = 0);
|
void init(const TimeMap& timeMap, size_t report_step = 0);
|
||||||
|
|
||||||
/// Whether the current step is the first step.
|
/// Whether the current step is the first step.
|
||||||
bool initialStep() const;
|
bool initialStep() const;
|
||||||
|
@ -43,11 +43,11 @@
|
|||||||
BOOST_AUTO_TEST_CASE(CreateTimer)
|
BOOST_AUTO_TEST_CASE(CreateTimer)
|
||||||
{
|
{
|
||||||
const std::string filename1 = "TESTTIMER.DATA";
|
const std::string filename1 = "TESTTIMER.DATA";
|
||||||
Opm::ParserPtr parser(new Opm::Parser() );
|
|
||||||
Opm::ParseContext parseContext;
|
Opm::ParseContext parseContext;
|
||||||
Opm::DeckConstPtr parserDeck = parser->parseFile( filename1 , parseContext);
|
Opm::Parser parser;
|
||||||
|
Opm::Deck parserDeck = parser.parseFile( filename1 , parseContext);
|
||||||
|
|
||||||
Opm::TimeMapPtr timeMap(new Opm::TimeMap(parserDeck));
|
Opm::TimeMap timeMap( parserDeck );
|
||||||
Opm::SimulatorTimer simtimer;
|
Opm::SimulatorTimer simtimer;
|
||||||
|
|
||||||
boost::gregorian::date defaultStartDate( 2012, 1, 1);
|
boost::gregorian::date defaultStartDate( 2012, 1, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user