mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 09:10:59 -06:00
[bugfix] Do not unconditionally dereference std::optional.
In WellGroupHelpers we unconditional referenced the region member of GPMaint. Unfortunately, that is a std:optional and doing this can create quite some havoc. Now we stop processing if it is unset.
This commit is contained in:
parent
d8c0057601
commit
9cb6d53dcb
@ -682,7 +682,11 @@ namespace WellGroupHelpers
|
||||
if (!gpm)
|
||||
return;
|
||||
|
||||
const auto [name, number] = *gpm->region();
|
||||
const auto& region = gpm->region();
|
||||
if (!region)
|
||||
return;
|
||||
|
||||
const auto [name, number] = *region;
|
||||
const double error = gpm->pressure_target() - regional_values.pressure(number);
|
||||
double current_rate = 0.0;
|
||||
const auto& pu = well_state.phaseUsage();
|
||||
|
Loading…
Reference in New Issue
Block a user