Minor refactor of function
This commit is contained in:
parent
618595e538
commit
25731a67dd
@ -274,23 +274,19 @@ bool higherLevelProdCMode_NotNoneFld(const Opm::Schedule& sched,
|
||||
const Opm::Group& group,
|
||||
const size_t simStep)
|
||||
{
|
||||
bool ctrl_mode_not_none_fld = false;
|
||||
if (group.defined( simStep )) {
|
||||
auto current = group;
|
||||
while (current.name() != "FIELD" && ctrl_mode_not_none_fld == false) {
|
||||
while (current.name() != "FIELD") {
|
||||
current = sched.getGroup(current.parent(), simStep);
|
||||
const auto& prod_cmode = group.gconprod_cmode();
|
||||
if ((prod_cmode != Opm::Group::ProductionCMode::FLD) && (prod_cmode!= Opm::Group::ProductionCMode::NONE)) {
|
||||
ctrl_mode_not_none_fld = true;
|
||||
}
|
||||
}
|
||||
return ctrl_mode_not_none_fld;
|
||||
}
|
||||
else {
|
||||
std::stringstream str;
|
||||
str << "actual group has not been defined at report time: " << simStep;
|
||||
throw std::invalid_argument(str.str());
|
||||
|
||||
if (prod_cmode != Opm::Group::ProductionCMode::FLD)
|
||||
return true;
|
||||
|
||||
if (prod_cmode != Opm::Group::ProductionCMode::NONE)
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int higherLevelInjCMode_NotNoneFld_SeqIndex(const Opm::Schedule& sched,
|
||||
|
Loading…
Reference in New Issue
Block a user