mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5593 Saturation Pressure Plot: Clamp time step index
This commit is contained in:
@@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include "cafPdmUiDoubleSliderEditor.h"
|
#include "cafPdmUiDoubleSliderEditor.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT( RimPlotCellPropertyFilter, "RimPlotCellPropertyFilter" );
|
CAF_PDM_SOURCE_INIT( RimPlotCellPropertyFilter, "RimPlotCellPropertyFilter" );
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -142,10 +144,12 @@ void RimPlotCellPropertyFilter::updateCellVisibilityFromFilter( size_t timeStepI
|
|||||||
RigCaseCellResultsData* cellResultsData = resDef->currentGridCellResults();
|
RigCaseCellResultsData* cellResultsData = resDef->currentGridCellResults();
|
||||||
if ( !cellResultsData ) return;
|
if ( !cellResultsData ) return;
|
||||||
|
|
||||||
if ( !resDef->currentGridCellResults()->hasResultEntry( resDef->eclipseResultAddress() ) ) return;
|
RigEclipseResultAddress rigEclipseAddress = resDef->eclipseResultAddress();
|
||||||
|
|
||||||
const std::vector<double>& cellResultValues =
|
if ( !resDef->currentGridCellResults()->hasResultEntry( rigEclipseAddress ) ) return;
|
||||||
cellResultsData->cellScalarResults( resDef->eclipseResultAddress(), timeStepIndex );
|
|
||||||
|
size_t clampedIndex = std::min( timeStepIndex, cellResultsData->timeStepCount( rigEclipseAddress ) - 1 );
|
||||||
|
const std::vector<double>& cellResultValues = cellResultsData->cellScalarResults( rigEclipseAddress, clampedIndex );
|
||||||
if ( cellResultValues.empty() ) return;
|
if ( cellResultValues.empty() ) return;
|
||||||
|
|
||||||
const RigActiveCellInfo* actCellInfo = cellResultsData->activeCellInfo();
|
const RigActiveCellInfo* actCellInfo = cellResultsData->activeCellInfo();
|
||||||
@@ -162,12 +166,12 @@ void RimPlotCellPropertyFilter::updateCellVisibilityFromFilter( size_t timeStepI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isUsingGlobalActiveIndex = cellResultsData->isUsingGlobalActiveIndex( resDef->eclipseResultAddress() );
|
bool isUsingGlobalActiveIndex = cellResultsData->isUsingGlobalActiveIndex( rigEclipseAddress );
|
||||||
double lowerBound = m_lowerBound;
|
double lowerBound = m_lowerBound;
|
||||||
double upperBound = m_upperBound;
|
double upperBound = m_upperBound;
|
||||||
size_t cellResultIndex = 0;
|
size_t cellResultIndex = 0;
|
||||||
double scalarValue = 0.0;
|
double scalarValue = 0.0;
|
||||||
FilterModeType currentFilterMode = filterMode();
|
FilterModeType currentFilterMode = filterMode();
|
||||||
|
|
||||||
for ( size_t reservoirCellIndex = 0; reservoirCellIndex < totalReservoirCellCount; ++reservoirCellIndex )
|
for ( size_t reservoirCellIndex = 0; reservoirCellIndex < totalReservoirCellCount; ++reservoirCellIndex )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user