This commit is contained in:
Tor Harald Sandve
2021-11-23 12:56:03 +00:00
parent 43fd50e355
commit 50ab26c330
4 changed files with 11 additions and 14 deletions

View File

@@ -2378,15 +2378,14 @@ runWellPIScaling(const int timeStepIdx,
bool
BlackoilWellModelGeneric::
guideRateUpdateIsNeeded() const {
int update = 0;
for (const auto& well : well_container_generic_) {
if (well->changedToOpenThisStep()) {
update = 1;
break;
}
}
update = comm_.max(update);
return update;
const auto need_update =
std::any_of(this->well_container_generic_.begin(),
this->well_container_generic_.end(),
[](const WellInterfaceGeneric* well)
{
return well->changedToOpenThisStep();
});
return this->comm_.max(static_cast<int>(need_update));
}