ScheduleDeck constructed with time_point argument

This commit is contained in:
Joakim Hove 2021-11-26 08:46:08 +01:00
parent 2d0e92750d
commit c4bdff2b39
4 changed files with 5 additions and 5 deletions

View File

@ -123,7 +123,7 @@ namespace Opm {
class ScheduleDeck {
public:
explicit ScheduleDeck(const Runspec& runspec, const Deck& deck, const ScheduleRestartInfo& rst_info);
explicit ScheduleDeck(time_point start_time, const Deck& deck, const ScheduleRestartInfo& rst_info);
ScheduleDeck();
void add_block(ScheduleTimeType time_type, const time_point& t, ScheduleDeckContext& context, const KeywordLocation& location);
void add_TSTEP(const DeckKeyword& TSTEPKeyword, ScheduleDeckContext& context);

View File

@ -158,7 +158,7 @@ namespace Opm {
const RestartIO::RstState * rst)
try :
m_static( python, ScheduleRestartInfo(rst, deck), deck, runspec, output_interval, parseContext, errors ),
m_sched_deck(runspec, deck, m_static.rst_info ),
m_sched_deck(TimeService::from_time_t(runspec.start_time()), deck, m_static.rst_info ),
completed_cells(ecl_grid.getNX(), ecl_grid.getNY(), ecl_grid.getNZ())
{
this->restart_output.resize(this->m_sched_deck.size());

View File

@ -199,9 +199,8 @@ std::size_t ScheduleDeck::restart_offset() const {
}
ScheduleDeck::ScheduleDeck(const Runspec& runspec, const Deck& deck, const ScheduleRestartInfo& rst_info) {
ScheduleDeck::ScheduleDeck(time_point start_time, const Deck& deck, const ScheduleRestartInfo& rst_info) {
const std::unordered_set<std::string> skiprest_include = {"VFPPROD", "VFPINJ", "RPTSCHED", "RPTRST", "TUNING", "MESSAGES"};
time_point start_time = TimeService::from_time_t(runspec.start_time());
this->m_restart_time = TimeService::from_time_t(rst_info.time);
this->m_restart_offset = rst_info.report_step;

View File

@ -4687,7 +4687,8 @@ BOOST_AUTO_TEST_CASE(ScheduleDeckTest) {
{
Parser parser;
auto deck = parser.parseString( createDeckWTEST() );
ScheduleDeck sched_deck( Runspec{deck}, deck, {} );
Runspec runspec{deck};
ScheduleDeck sched_deck( TimeService::from_time_t(runspec.start_time()), deck, {} );
BOOST_CHECK_EQUAL( sched_deck.size(), 6 );
std::vector<std::string> first_kw = {"WELSPECS", "WTEST", "SUMTHIN", "WCONINJH", "WELOPEN", "WCONINJH"};