mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 17:02:02 -05:00
fix segfault when no well report is registred
This commit is contained in:
1 parent
2cc22f99cb
commit
4c4921c6b2
1 file changed
+8
-2
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user