Fix crash due to global/local grid index mixup when creating fractures on SimWellPaths.

* Introduces a convenience method on the main grid
* Also converts some callers to use the convenience method.
This commit is contained in:
Gaute Lindkvist
2018-05-08 14:37:23 +02:00
parent 0ebedc844f
commit f24fb4aaec
6 changed files with 48 additions and 21 deletions

View File

@@ -853,11 +853,8 @@ void RiuViewerCommands::findCellAndGridIndex(const RivIntersectionSourceInfo* cr
crossSectionSourceInfo->crossSection()->firstAncestorOrThisOfType(eclipseView);
size_t globalCellIndex = crossSectionSourceInfo->triangleToCellIndex()[firstPartTriangleIndex];
const RigCell& cell = eclipseView->mainGrid()->globalCellArray()[globalCellIndex];
*cellIndex = cell.gridLocalCellIndex();
*gridIndex = cell.hostGrid()->gridIndex();
const RigGridBase* hostGrid = eclipseView->mainGrid()->gridAndGridLocalIdxFromGlobalCellIdx(globalCellIndex, cellIndex);
*gridIndex = hostGrid->gridIndex();
}
else if (geomCase)
{