#2146 Num Flooded PV: Add allVisibleCells for native

This commit is contained in:
Rebecca Cox 2017-11-16 15:28:12 +01:00
parent 204ee2162a
commit 6347c9d716
5 changed files with 28 additions and 2 deletions

View File

@ -216,7 +216,6 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimE
if (scalarIndex != cvf::UNDEFINED_SIZE_T)
{
if (m_statisticsCellRange == ALL_CELLS)
{
if (m_statisticsTimeRange == ALL_TIMESTEPS)
@ -239,6 +238,8 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimE
eclipseView->currentGridCellResults()->p10p90CellScalarValues(scalarIndex, currentTimeStep, histData.p10, histData.p90);
eclipseView->currentGridCellResults()->meanCellScalarValues(scalarIndex, currentTimeStep, histData.mean);
eclipseView->currentGridCellResults()->sumCellScalarValues(scalarIndex, currentTimeStep, histData.sum);
eclipseView->currentGridCellResults()->mobileVolumeWeightedMean(scalarIndex, currentTimeStep, histData.weightedMean);
histData.histogram = &(eclipseView->currentGridCellResults()->cellScalarValuesHistogram(scalarIndex, currentTimeStep));
}
else

View File

@ -165,6 +165,14 @@ void RigCaseCellResultsData::sumCellScalarValues(size_t scalarResultIndex, size_
m_statisticsDataCache[scalarResultIndex]->sumCellScalarValues(timeStepIndex, sumValue);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigCaseCellResultsData::mobileVolumeWeightedMean(size_t scalarResultIndex, size_t timeStepIndex, double& meanValue)
{
m_statisticsDataCache[scalarResultIndex]->mobileVolumeWeightedMean(timeStepIndex, meanValue);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -69,7 +69,7 @@ public:
const std::vector<int>& uniqueCellScalarValues(size_t scalarResultIndex);
void sumCellScalarValues(size_t scalarResultIndex, double& sumValue);
void sumCellScalarValues(size_t scalarResultIndex, size_t timeStepIndex, double& sumValue);
void mobileVolumeWeightedMean(size_t scalarResultIndex, size_t timeStepIndex, double& meanValue);
// Access meta-information about the results
size_t resultCount() const;
size_t timeStepCount(size_t scalarResultIndex) const;

View File

@ -22,6 +22,7 @@
#include "RigStatisticsMath.h"
#include "RigCaseCellResultsData.h"
#include "RigStatisticsMath.h"
#include "RigWeightedMeanCalc.h"
#include <cmath> // Needed for HUGE_VAL on Linux
@ -94,3 +95,18 @@ size_t RigEclipseNativeStatCalc::timeStepCount()
{
return m_resultsData->timeStepCount(m_scalarResultIndex);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigEclipseNativeStatCalc::mobileVolumeWeightedMean(size_t timeStepIndex, double& mean)
{
size_t mobPVResultIndex = m_resultsData->findOrLoadScalarResult(RiaDefines::ResultCatType::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName());
const std::vector<double>& weights = m_resultsData->cellScalarResults(mobPVResultIndex, 0);
const std::vector<double>& values = m_resultsData->cellScalarResults(m_scalarResultIndex, timeStepIndex);
const RigActiveCellInfo* actCellInfo = m_resultsData->activeCellInfo();
RigWeightedMeanCalc::weightedMeanOverCells(&weights, &values, nullptr, false, actCellInfo, m_resultsData->isUsingGlobalActiveIndex(m_scalarResultIndex), &mean);
}

View File

@ -41,6 +41,7 @@ public:
virtual void addDataToHistogramCalculator(size_t timeStepIndex, RigHistogramCalculator& histogramCalculator);
virtual void uniqueValues(size_t timeStepIndex, std::set<int>& values);
virtual size_t timeStepCount();
virtual void mobileVolumeWeightedMean(size_t timeStepIndex, double& mean);
private:
RigCaseCellResultsData* m_resultsData;