Avoid exception for non-group nodes

This commit is contained in:
Vegard Kippe
2023-10-26 19:34:08 +02:00
parent 5fbf981af8
commit f137565bb6

View File

@@ -912,12 +912,13 @@ BlackoilWellModelGeneric::
assignNodeValues(std::map<std::string, data::NodeData>& nodevalues, const int reportStepIdx) const
{
nodevalues.clear();
if (reportStepIdx < 0) return;
for (const auto& [node, pressure] : node_pressures_) {
nodevalues.emplace(node, data::NodeData{pressure});
// Assign node values of group to GPR:WELLNAME
const auto& group = schedule().getGroup(node, reportStepIdx);
// Assign node values of well groups to GPR:WELLNAME
const auto& sched = schedule();
if (!sched.hasGroup(node, reportStepIdx)) continue;
const auto& group = sched.getGroup(node, reportStepIdx);
for (const std::string& wellname : group.wells()) {
nodevalues.emplace(wellname, data::NodeData{pressure});
}