#4210 Fix crash when creating contour map

This commit is contained in:
Gaute Lindkvist
2019-03-22 08:49:39 +01:00
parent 64fc6447f4
commit 4c3c01a661
7 changed files with 82 additions and 42 deletions

View File

@@ -202,7 +202,11 @@ std::vector<double> RimEclipseContourMapProjection::generateResults(int timeStep
else
{
m_currentResultName = cellColors->resultVariable();
gridResultValues = resultData->cellScalarResults(RigEclipseResultAddress( cellColors->resultType(), cellColors->resultVariable()), timeStep);
RigEclipseResultAddress resAddr(cellColors->resultType(), cellColors->resultVariable());
if (resAddr.isValid() && resultData->hasResultEntry(resAddr))
{
gridResultValues = resultData->cellScalarResults(resAddr, timeStep);
}
}
if (!gridResultValues.empty())
@@ -393,11 +397,13 @@ double RimEclipseContourMapProjection::calculateOverlapVolume(size_t globalCellI
localGrid->cellCornerVertices(localCellIdx, hexCorners.data());
cvf::BoundingBox overlapBBox;
std::array<cvf::Vec3d, 8> overlapCorners =
RigCellGeometryTools::estimateHexOverlapWithBoundingBox(hexCorners, bbox, &overlapBBox);
double overlapVolume = RigCellGeometryTools::calculateCellVolume(overlapCorners);
return overlapVolume;
std::array<cvf::Vec3d, 8> overlapCorners;
if (RigCellGeometryTools::estimateHexOverlapWithBoundingBox(hexCorners, bbox, &overlapCorners, &overlapBBox))
{
double overlapVolume = RigCellGeometryTools::calculateCellVolume(overlapCorners);
return overlapVolume;
}
return 0.0;
}
//--------------------------------------------------------------------------------------------------