From a920699e1ad74a78c4b643755655e5be5f34010d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 10 Jan 2023 10:45:02 +0100 Subject: [PATCH 1/2] add missing WellMatcher.hpp includes --- ebos/eclactionhandler.cc | 1 + ebos/eclgenericwriter.cc | 1 + ebos/eclproblem.hh | 1 + 3 files changed, 3 insertions(+) diff --git a/ebos/eclactionhandler.cc b/ebos/eclactionhandler.cc index cdb693473..29245a671 100644 --- a/ebos/eclactionhandler.cc +++ b/ebos/eclactionhandler.cc @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/ebos/eclgenericwriter.cc b/ebos/eclgenericwriter.cc index 0b31cab0a..cc1bc24e2 100644 --- a/ebos/eclgenericwriter.cc +++ b/ebos/eclgenericwriter.cc @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index 00e414b6f..ee6619672 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include From b320716b174930e046e97ee8f5c161b4478768f5 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 10 Jan 2023 11:13:58 +0100 Subject: [PATCH 2/2] move UDQ evaluation to EclActionHandler thus we can avoid include of WellMatcher.hpp in eclproblem.hh --- ebos/eclactionhandler.cc | 8 ++++++++ ebos/eclactionhandler.hh | 5 +++++ ebos/eclproblem.hh | 7 +------ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ebos/eclactionhandler.cc b/ebos/eclactionhandler.cc index 29245a671..bcbd6e0f4 100644 --- a/ebos/eclactionhandler.cc +++ b/ebos/eclactionhandler.cc @@ -245,4 +245,12 @@ EclActionHandler::fetchWellPI(const int reportStep, return wellpi; } +void EclActionHandler::evalUDQAssignments(const unsigned episodeIdx, + UDQState& udq_state) +{ + const auto& udq = schedule_[episodeIdx].udq(); + const auto& well_matcher = schedule_.wellMatcher(episodeIdx); + udq.eval_assign(episodeIdx, well_matcher, summaryState_, udq_state); +} + } // namespace Opm diff --git a/ebos/eclactionhandler.hh b/ebos/eclactionhandler.hh index 06ff76a52..a758f9750 100644 --- a/ebos/eclactionhandler.hh +++ b/ebos/eclactionhandler.hh @@ -43,6 +43,7 @@ class EclipseState; class Schedule; struct SimulatorUpdate; class SummaryState; +class UDQState; //! \brief Class handling Action support in simulator class EclActionHandler @@ -62,6 +63,10 @@ public: double sim_time, const TransFunc& updateTrans); + //! \brief Evaluates UDQ assign statements. + void evalUDQAssignments(const unsigned episodeIdx, + UDQState& udq_state); + private: /* This function is run after applyAction has been completed in the Schedule diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index ee6619672..d4d99bd06 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -78,7 +78,6 @@ #include #include #include -#include #include #include #include @@ -1028,11 +1027,7 @@ public: // Evaluate UDQ assign statements to make sure the settings are // available as UDA controls for the current report step. - const auto& udq = schedule[episodeIdx].udq(); - const auto& well_matcher = schedule.wellMatcher(episodeIdx); - auto& summary_state = simulator.vanguard().summaryState(); - auto& udq_state = simulator.vanguard().udqState(); - udq.eval_assign(episodeIdx, well_matcher, summary_state, udq_state); + actionHandler_.evalUDQAssignments(episodeIdx, simulator.vanguard().udqState()); } /*!