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

@@ -33,12 +33,11 @@ RigCompletionDataGridCell::RigCompletionDataGridCell(size_t globalCellIndex, con
{
if (mainGrid)
{
const RigCell& cell = mainGrid->globalCellArray()[globalCellIndex];
RigGridBase* grid = cell.hostGrid();
size_t gridLocalCellIndex;
const RigGridBase* grid = mainGrid->gridAndGridLocalIdxFromGlobalCellIdx(globalCellIndex, &gridLocalCellIndex);
if (grid)
{
size_t gridLocalCellIndex = cell.gridLocalCellIndex();
size_t i = 0;
size_t j = 0;
size_t k = 0;