mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 16:00:01 -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
|
||||
ParseContext parseContext;
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::DeckConstPtr deck = parser->parseFile(file_name , parseContext);
|
||||
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(*deck , parseContext));
|
||||
Opm::Parser parser;
|
||||
Opm::Deck deck = parser.parseFile(file_name , parseContext);
|
||||
Opm::EclipseState eclipseState(deck , parseContext);
|
||||
std::cout << "Done!" << std::endl;
|
||||
|
||||
// Setup grid
|
||||
GridManager grid(*eclipseState->getInputGrid());
|
||||
GridManager grid(eclipseState.getInputGrid());
|
||||
|
||||
// Define rock and fluid properties
|
||||
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
|
||||
void SimulatorTimer::init(Opm::TimeMapConstPtr timeMap, size_t report_step)
|
||||
void SimulatorTimer::init(const TimeMap& timeMap, size_t report_step)
|
||||
{
|
||||
total_time_ = timeMap->getTotalTime();
|
||||
timesteps_.resize(timeMap->numTimesteps());
|
||||
for ( size_t i = 0; i < timeMap->numTimesteps(); ++i ) {
|
||||
timesteps_[i] = timeMap->getTimeStepLength(i);
|
||||
total_time_ = timeMap.getTotalTime();
|
||||
timesteps_.resize(timeMap.numTimesteps());
|
||||
for ( size_t i = 0; i < timeMap.numTimesteps(); ++i ) {
|
||||
timesteps_[i] = timeMap.getTimeStepLength(i);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace Opm
|
||||
void init(const parameter::ParameterGroup& param);
|
||||
|
||||
/// 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.
|
||||
bool initialStep() const;
|
||||
|
@ -43,11 +43,11 @@
|
||||
BOOST_AUTO_TEST_CASE(CreateTimer)
|
||||
{
|
||||
const std::string filename1 = "TESTTIMER.DATA";
|
||||
Opm::ParserPtr parser(new Opm::Parser() );
|
||||
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;
|
||||
|
||||
boost::gregorian::date defaultStartDate( 2012, 1, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user