From a01b81d9ecb6281dd39a15f1957fbadcbf438768 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 19 Jan 2021 10:27:37 +0100 Subject: [PATCH] Use pointers to grid and fieldprops in Schedule construction --- .../eclipse/EclipseState/Schedule/Schedule.hpp | 8 ++++---- .../eclipse/EclipseState/Schedule/Schedule.cpp | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index c186f74a0..0ab74ae67 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -397,8 +397,8 @@ namespace Opm std::size_t load_end, const ParseContext& parseContext, ErrorGuard& errors, - const EclipseGrid& grid, - const FieldPropsManager& fp); + const EclipseGrid* grid, + const FieldPropsManager* fp); void addACTIONX(const Action::ActionX& action); void addGroupToGroup( const std::string& parent_group, const std::string& child_group, std::size_t timeStep); void addGroup(const std::string& groupName , std::size_t timeStep); @@ -410,8 +410,8 @@ namespace Opm const ScheduleBlock& block, const DeckKeyword& keyword, const ParseContext& parseContext, ErrorGuard& errors, - const EclipseGrid& grid, - const FieldPropsManager& fp, + const EclipseGrid* grid, + const FieldPropsManager* fp, std::vector >& rftProperties); template class Map, class Type, class Key> diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index d9909ea17..43e78f4a7 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -121,11 +121,11 @@ namespace { { if (rst) { auto restart_step = rst->header.restart_info().second; - this->iterateScheduleSection( 0, restart_step, parseContext, errors, grid, fp); + this->iterateScheduleSection( 0, restart_step, parseContext, errors, &grid, &fp); this->load_rst(*rst, grid, fp); - this->iterateScheduleSection( restart_step, this->m_sched_deck.size(), parseContext, errors, grid, fp); + this->iterateScheduleSection( restart_step, this->m_sched_deck.size(), parseContext, errors, &grid, &fp); } else - this->iterateScheduleSection( 0, this->m_sched_deck.size(), parseContext, errors, grid, fp); + this->iterateScheduleSection( 0, this->m_sched_deck.size(), parseContext, errors, &grid, &fp); /* The code in the #ifdef SCHEDULE_DEBUG is an enforced integration test @@ -278,8 +278,8 @@ namespace { const DeckKeyword& keyword, const ParseContext& parseContext, ErrorGuard& errors, - const EclipseGrid& grid, - const FieldPropsManager& fp, + const EclipseGrid* grid, + const FieldPropsManager* fp, std::vector >& rftProperties) { static const std::unordered_set require_grid = { @@ -295,8 +295,8 @@ namespace { Schedule section. We therefor single them out very clearly here. */ if (require_grid.count(keyword.name()) > 0) { - handlerContext.grid_ptr = &grid; - handlerContext.fp_ptr = &fp; + handlerContext.grid_ptr = grid; + handlerContext.fp_ptr = fp; } if (handleNormalKeyword(handlerContext, parseContext, errors)) return; @@ -358,8 +358,8 @@ private: void Schedule::iterateScheduleSection(std::size_t load_start, std::size_t load_end, const ParseContext& parseContext , ErrorGuard& errors, - const EclipseGrid& grid, - const FieldPropsManager& fp) { + const EclipseGrid* grid, + const FieldPropsManager* fp) { std::vector > rftProperties; std::string time_unit = this->m_static.m_unit_system.name(UnitSystem::measure::time);