Fix crash in RimWellPathValve when perforation is larger than wellpath

* This is the case with the Completions_msw Regression test
This commit is contained in:
Gaute Lindkvist
2018-12-07 12:56:32 +01:00
parent c51b938d03
commit 539914a541
3 changed files with 11 additions and 5 deletions

View File

@@ -144,9 +144,13 @@ void RimMultipleValveLocations::computeRangesAndLocations()
double firstWellPathMD = rigWellPathGeo->m_measuredDepths.front();
double lastWellPathMD = rigWellPathGeo->m_measuredDepths.back();
for (auto md : locationsFromStartSpacingAndCount(m_rangeStart, m_rangeValveSpacing, m_rangeValveCount))
double overlapStart = std::max(firstWellPathMD, m_rangeStart());
double overlapEnd = std::min(lastWellPathMD, m_rangeEnd());
double overlap = std::max(0.0, overlapEnd - overlapStart);
if (overlap)
{
if (md >= firstWellPathMD && md <= lastWellPathMD)
for (auto md : locationsFromStartSpacingAndCount(overlapStart, m_rangeValveSpacing, m_rangeValveCount))
{
validMeasuredDepths.push_back(md);
}
@@ -333,7 +337,7 @@ void RimMultipleValveLocations::fieldChangedByUi(const caf::PdmFieldHandle* chan
}
else if (valve)
{
valve->geometryUpdated();
valve->multipleValveGeometryUpdated();
}
}