Load actionx from restart file

This commit is contained in:
Joakim Hove 2021-09-08 09:41:47 +02:00
parent efaa613368
commit bf7d162ce4
3 changed files with 17 additions and 1 deletions

View File

@ -1467,6 +1467,14 @@ namespace {
}
this->snapshots.back().udq_active.update( std::move(udq_active) );
}
if (!rst_state.actions.empty()) {
auto actions = this->snapshots.back().actions();
for (const auto& rst_action : rst_state.actions)
actions.add( Action::ActionX(rst_action) );
this->snapshots.back().actions.update( std::move(actions) );
}
}
std::shared_ptr<const Python> Schedule::python() const

View File

@ -171,3 +171,11 @@ BOOST_AUTO_TEST_CASE(LoadUDQRestartSim) {
}
}
}
BOOST_AUTO_TEST_CASE(LoadActionRestartSim) {
const auto& [sched, restart_sched] = load_schedule_pair("UDQ_ACTIONX.DATA", "UDQ_ACTIONX_RESTART.DATA", "UDQ_ACTIONX.X0007", 7);
const auto& input_actions = sched[7].actions();
const auto& rst_actions = restart_sched[7].actions();
BOOST_CHECK_EQUAL(input_actions.ecl_size(), rst_actions.ecl_size());
}

View File

@ -998,7 +998,7 @@ BOOST_AUTO_TEST_CASE(Declared_Actionx_data)
}
{
auto rst_file = std::make_shared<Opm::EclIO::ERst>("TEST_ACTIONX.UNRST");
auto rst_file = std::make_shared<Opm::EclIO::ERst>("UDQ_ACTIONX_TEST1.UNRST");
auto rst_view = std::make_shared<Opm::EclIO::RestartFileView>(std::move(rst_file), 3);
auto rst_state = Opm::RestartIO::RstState::load(std::move(rst_view), es.runspec(), simCase.parser);
const auto& input_actions = sched[rptStep].actions();