Chase API Update of UDQConfig's Evaluation Functions

The functions no longer use the 'episeodeIdx' or Schedule
parameters.  Update callers accordingly.

While here, split some long lines and remove unneeded local objects.
This commit is contained in:
Bård Skaflestad 2024-11-05 15:57:11 +01:00
parent 2546d2b181
commit ef434a9b59
3 changed files with 17 additions and 17 deletions

View File

@ -289,14 +289,11 @@ void ActionHandler<Scalar>::
evalUDQAssignments(const unsigned episodeIdx, evalUDQAssignments(const unsigned episodeIdx,
UDQState& udq_state) UDQState& udq_state)
{ {
const auto& udq = schedule_[episodeIdx].udq(); this->schedule_[episodeIdx].udq()
.eval_assign(this->schedule_.wellMatcher(episodeIdx),
udq.eval_assign(episodeIdx, this->schedule_.segmentMatcherFactory(episodeIdx),
this->schedule_, this->summaryState_,
this->schedule_.wellMatcher(episodeIdx), udq_state);
this->schedule_.segmentMatcherFactory(episodeIdx),
this->summaryState_,
udq_state);
} }
template class ActionHandler<double>; template class ActionHandler<double>;

View File

@ -677,7 +677,6 @@ evalSummary(const int reportStepNum,
this->schedule_.getUDQConfig(udq_step) this->schedule_.getUDQConfig(udq_step)
.eval(udq_step, .eval(udq_step,
this->schedule_,
this->schedule_.wellMatcher(udq_step), this->schedule_.wellMatcher(udq_step),
this->schedule_.segmentMatcherFactory(udq_step), this->schedule_.segmentMatcherFactory(udq_step),
[es = std::cref(this->eclState_)]() { [es = std::cref(this->eclState_)]() {

View File

@ -462,9 +462,12 @@ public:
.applyActions(episodeIdx, simulator.time() + simulator.timeStepSize(), .applyActions(episodeIdx, simulator.time() + simulator.timeStepSize(),
[this](const bool global) [this](const bool global)
{ {
using TransUpdateQuantities = typename Vanguard::TransmissibilityType::TransUpdateQuantities; using TransUpdateQuantities = typename
Vanguard::TransmissibilityType::TransUpdateQuantities;
this->transmissibilities_ this->transmissibilities_
.update(global, TransUpdateQuantities::All, [&vg = this->simulator().vanguard()] .update(global, TransUpdateQuantities::All,
[&vg = this->simulator().vanguard()]
(const unsigned int i) (const unsigned int i)
{ {
return vg.gridIdxToEquilGridIdx(i); return vg.gridIdxToEquilGridIdx(i);
@ -482,15 +485,15 @@ public:
MICPModule::checkCloggingMICP(model, phi, globalDofIdx); MICPModule::checkCloggingMICP(model, phi, globalDofIdx);
} }
} }
} }
/*! /*!
* \brief Called by the simulator after the end of an episode. * \brief Called by the simulator after the end of an episode.
*/ */
void endEpisode() override void endEpisode() override
{ {
OPM_TIMEBLOCK(endEpisode); OPM_TIMEBLOCK(endEpisode);
const int episodeIdx = this->episodeIndex();
// Rerun UDQ assignents following action processing on the final // Rerun UDQ assignents following action processing on the final
// time step of this episode to make sure that any UDQ ASSIGN // time step of this episode to make sure that any UDQ ASSIGN
// operations triggered in action blocks take effect. This is // operations triggered in action blocks take effect. This is
@ -502,14 +505,15 @@ public:
// assignment would be dropped and the rest of the simulator will // assignment would be dropped and the rest of the simulator will
// never see its effect without this hack. // never see its effect without this hack.
this->actionHandler_ this->actionHandler_
.evalUDQAssignments(episodeIdx, this->simulator().vanguard().udqState()); .evalUDQAssignments(this->episodeIndex(), this->simulator().vanguard().udqState());
FlowProblemType::endEpisode(); FlowProblemType::endEpisode();
} }
void writeReports(const SimulatorTimer& timer) { void writeReports(const SimulatorTimer& timer)
if (enableEclOutput_){ {
eclWriter_->writeReports(timer); if (this->enableEclOutput_) {
this->eclWriter_->writeReports(timer);
} }
} }