Make sure well has been defined before creating PAvgCalculator
This commit is contained in:
parent
1ac1582f12
commit
de6a067906
@ -2904,9 +2904,11 @@ internal_store(const SummaryState& st, const int report_step)
|
||||
Opm::PAvgCalculatorCollection Opm::out::Summary::SummaryImplementation::wbp_calculators(std::size_t report_step) const {
|
||||
Opm::PAvgCalculatorCollection calculators;
|
||||
for (const auto& wname : this->wbp_wells) {
|
||||
const auto& well = this->sched_.get().getWell(wname, report_step);
|
||||
if (well.getStatus() == Opm::Well::Status::OPEN)
|
||||
calculators.add(well.pavg_calculator(this->grid_));
|
||||
if (this->sched_.get().hasWell(wname, report_step)) {
|
||||
const auto& well = this->sched_.get().getWell(wname, report_step);
|
||||
if (well.getStatus() == Opm::Well::Status::OPEN)
|
||||
calculators.add(well.pavg_calculator(this->grid_));
|
||||
}
|
||||
}
|
||||
return calculators;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user