mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-08 07:03:25 -06:00
Crash protection
This commit is contained in:
parent
7cf56e1e87
commit
a2acadf3f4
@ -182,8 +182,13 @@ cvf::BoundingBox RimGeoMechContourMapProjection::calculateExpandedPorBarBBox( in
|
||||
RigFemPartResultsCollection* resultCollection = caseData->femPartResults();
|
||||
|
||||
const std::vector<float>& resultValues = resultCollection->resultValues( porBarAddr, 0, timeStep );
|
||||
cvf::BoundingBox boundingBox;
|
||||
|
||||
if ( resultValues.empty() )
|
||||
{
|
||||
return boundingBox;
|
||||
}
|
||||
|
||||
cvf::BoundingBox boundingBox;
|
||||
for ( int i = 0; i < m_femPart->elementCount(); ++i )
|
||||
{
|
||||
size_t resValueIdx = m_femPart->elementNodeResultIdx( (int)i, 0 );
|
||||
@ -227,11 +232,17 @@ void RimGeoMechContourMapProjection::updateGridInformation()
|
||||
if ( m_limitToPorePressureRegions )
|
||||
{
|
||||
m_expandedBoundingBox = calculateExpandedPorBarBBox( view()->currentTimeStep() );
|
||||
if ( !m_expandedBoundingBox.isValid() )
|
||||
{
|
||||
m_limitToPorePressureRegions = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if ( !m_limitToPorePressureRegions )
|
||||
{
|
||||
m_expandedBoundingBox = m_gridBoundingBox;
|
||||
}
|
||||
|
||||
cvf::Vec3d minExpandedPoint = m_expandedBoundingBox.min() - cvf::Vec3d( gridEdgeOffset(), gridEdgeOffset(), 0.0 );
|
||||
cvf::Vec3d maxExpandedPoint = m_expandedBoundingBox.max() + cvf::Vec3d( gridEdgeOffset(), gridEdgeOffset(), 0.0 );
|
||||
if ( m_limitToPorePressureRegions && !m_applyPPRegionLimitVertically )
|
||||
|
@ -1344,6 +1344,11 @@ std::vector<RimContourMapProjection::CellIndexAndResult>
|
||||
std::vector<std::vector<size_t>> kLayerCellIndexVector;
|
||||
kLayerCellIndexVector.resize( kLayers() );
|
||||
|
||||
if ( kLayerCellIndexVector.empty() )
|
||||
{
|
||||
return matchingVisibleCellsAndWeight;
|
||||
}
|
||||
|
||||
for ( size_t globalCellIdx : allCellIndices )
|
||||
{
|
||||
if ( ( *m_cellGridIdxVisibility )[globalCellIdx] )
|
||||
|
Loading…
Reference in New Issue
Block a user