mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3600 Fix crash with 2d Maps and LGRs.
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include "RiaWeightedMeanCalculator.h"
|
#include "RiaWeightedMeanCalculator.h"
|
||||||
|
|
||||||
#include "RigActiveCellInfo.h"
|
#include "RigActiveCellInfo.h"
|
||||||
|
#include "RigCell.h"
|
||||||
#include "RigEclipseCaseData.h"
|
#include "RigEclipseCaseData.h"
|
||||||
#include "RigHexIntersectionTools.h"
|
#include "RigHexIntersectionTools.h"
|
||||||
#include "RigMainGrid.h"
|
#include "RigMainGrid.h"
|
||||||
@@ -474,12 +475,13 @@ std::vector<std::pair<size_t, float>> Rim2dGridProjection::visibleCellsAndWeight
|
|||||||
|
|
||||||
cvf::Vec3d hexCorners[8];
|
cvf::Vec3d hexCorners[8];
|
||||||
for (size_t globalCellIdx : allCellIndices)
|
for (size_t globalCellIdx : allCellIndices)
|
||||||
{
|
|
||||||
if ((*m_cellVisibility)[globalCellIdx])
|
|
||||||
{
|
{
|
||||||
size_t localCellIdx = 0u;
|
size_t localCellIdx = 0u;
|
||||||
RigGridBase* localGrid = mainGrid()->gridAndGridLocalIdxFromGlobalCellIdx(globalCellIdx, &localCellIdx);
|
RigGridBase* localGrid = mainGrid()->gridAndGridLocalIdxFromGlobalCellIdx(globalCellIdx, &localCellIdx);
|
||||||
|
if (localGrid == mainGrid())
|
||||||
|
{
|
||||||
|
if ((*m_cellVisibility)[globalCellIdx])
|
||||||
|
{
|
||||||
localGrid->cellCornerVertices(localCellIdx, hexCorners);
|
localGrid->cellCornerVertices(localCellIdx, hexCorners);
|
||||||
std::vector<HexIntersectionInfo> intersections;
|
std::vector<HexIntersectionInfo> intersections;
|
||||||
float weight = 1.0f;
|
float weight = 1.0f;
|
||||||
@@ -490,6 +492,7 @@ std::vector<std::pair<size_t, float>> Rim2dGridProjection::visibleCellsAndWeight
|
|||||||
matchingVisibleCellsAndWeight.push_back(std::make_pair(globalCellIdx, weight));
|
matchingVisibleCellsAndWeight.push_back(std::make_pair(globalCellIdx, weight));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return matchingVisibleCellsAndWeight;
|
return matchingVisibleCellsAndWeight;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user