mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1871 from totto82/fix_segfault
fix segfault when no well report is registred
This commit is contained in:
commit
8ae671eb86
@ -491,7 +491,14 @@ namespace Opm {
|
|||||||
std::ostringstream msg;
|
std::ostringstream msg;
|
||||||
msg << " Excessive chopping detected in report step "
|
msg << " Excessive chopping detected in report step "
|
||||||
<< sr.back().report_step << ", substep " << sr.back().current_step << "\n";
|
<< sr.back().report_step << ", substep " << sr.back().current_step << "\n";
|
||||||
assert(!sr.back().report.empty());
|
|
||||||
|
std::set<std::string> failing_wells;
|
||||||
|
|
||||||
|
// return empty set if no report exists
|
||||||
|
// well failures in assembly is not yet registred
|
||||||
|
if(sr.back().report.empty())
|
||||||
|
return failing_wells;
|
||||||
|
|
||||||
const auto& wfs = sr.back().report.back().wellFailures();
|
const auto& wfs = sr.back().report.back().wellFailures();
|
||||||
for (const auto& wf : wfs) {
|
for (const auto& wf : wfs) {
|
||||||
msg << " Well that failed: " << wf.wellName() << "\n";
|
msg << " Well that failed: " << wf.wellName() << "\n";
|
||||||
@ -504,7 +511,6 @@ namespace Opm {
|
|||||||
const int rep_step = sr.back().report_step;
|
const int rep_step = sr.back().report_step;
|
||||||
const int sub_step = sr.back().current_step;
|
const int sub_step = sr.back().current_step;
|
||||||
const int sr_size = sr.size();
|
const int sr_size = sr.size();
|
||||||
std::set<std::string> failing_wells;
|
|
||||||
for (const auto& wf : wfs) {
|
for (const auto& wf : wfs) {
|
||||||
failing_wells.insert(wf.wellName());
|
failing_wells.insert(wf.wellName());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user