mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2146 Num Flooded PV: Add volume weighted mean for visible cells and current time step
This commit is contained in:
parent
4b2af286e3
commit
49417bbb3a
@ -51,7 +51,6 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -92,10 +91,11 @@ Rim3dOverlayInfoConfig::Rim3dOverlayInfoConfig()
|
||||
CAF_PDM_InitField(&active, "Active", true, "Active", "", "", "");
|
||||
active.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&showAnimProgress, "ShowAnimProgress", true, "Animation progress", "", "", "");
|
||||
CAF_PDM_InitField(&showCaseInfo, "ShowInfoText", true, "Case Info", "", "", "");
|
||||
CAF_PDM_InitField(&showResultInfo, "ShowResultInfo", true, "Result Info", "", "", "");
|
||||
CAF_PDM_InitField(&showHistogram, "ShowHistogram", true, "Histogram", "", "", "");
|
||||
CAF_PDM_InitField(&showAnimProgress, "ShowAnimProgress", true, "Animation progress", "", "", "");
|
||||
CAF_PDM_InitField(&showCaseInfo, "ShowInfoText", true, "Case Info", "", "", "");
|
||||
CAF_PDM_InitField(&showResultInfo, "ShowResultInfo", true, "Result Info", "", "", "");
|
||||
CAF_PDM_InitField(&showHistogram, "ShowHistogram", true, "Histogram", "", "", "");
|
||||
CAF_PDM_InitField(&showVolumeWeightedMean, "ShowVolumeWeightedMean", true, "Mobile Volume Weighted Mean", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_statisticsTimeRange, "StatisticsTimeRange", "Statistics Time Range", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_statisticsCellRange, "StatisticsCellRange", "Statistics Cell Range", "", "", "");
|
||||
@ -125,12 +125,27 @@ void Rim3dOverlayInfoConfig::fieldChangedByUi(const caf::PdmFieldHandle* changed
|
||||
if ( changedField == &m_statisticsCellRange ) m_statisticsCellRange = ALL_CELLS;
|
||||
}
|
||||
|
||||
if (changedField == &showResultInfo)
|
||||
{
|
||||
if (!showResultInfo())
|
||||
{
|
||||
showVolumeWeightedMean = false;
|
||||
showVolumeWeightedMean.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
showVolumeWeightedMean = true;
|
||||
showVolumeWeightedMean.uiCapability()->setUiReadOnly(false);
|
||||
}
|
||||
}
|
||||
|
||||
this->update3DInfo();
|
||||
|
||||
if (m_viewDef && m_viewDef->viewer())
|
||||
{
|
||||
m_viewDef->viewer()->update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -197,6 +212,7 @@ void Rim3dOverlayInfoConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
visGroup->add(&showAnimProgress);
|
||||
visGroup->add(&showCaseInfo);
|
||||
visGroup->add(&showResultInfo);
|
||||
visGroup->add(&showVolumeWeightedMean);
|
||||
visGroup->add(&showHistogram);
|
||||
|
||||
caf::PdmUiGroup* statGroup = uiOrdering.addNewGroup("Statistics Options");
|
||||
@ -228,6 +244,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
double p10 = HUGE_VAL, p90 = HUGE_VAL;
|
||||
double mean = HUGE_VAL;
|
||||
double sum = 0.0;
|
||||
double weightedMean = HUGE_VAL;
|
||||
const std::vector<size_t>* histogram = NULL;
|
||||
|
||||
bool isResultsInfoRelevant = eclipseView->hasUserRequestedAnimation() && eclipseView->cellResult()->hasResult();
|
||||
@ -294,6 +311,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
m_visibleCellStatistics->minMaxCellScalarValues(currentTimeStep, min, max);
|
||||
m_visibleCellStatistics->p10p90CellScalarValues(currentTimeStep, p10, p90);
|
||||
m_visibleCellStatistics->sumCellScalarValues(currentTimeStep, sum);
|
||||
m_visibleCellStatistics->mobileVolumeWeightedMean(currentTimeStep, weightedMean);
|
||||
|
||||
histogram = &(m_visibleCellStatistics->cellScalarValuesHistogram(currentTimeStep));
|
||||
}
|
||||
@ -314,6 +332,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
fldResults->p10p90ScalarValues(resAddr, currentTimeStep, &p10, &p90);
|
||||
fldResults->meanScalarValue(resAddr, currentTimeStep, &mean);
|
||||
fldResults->sumScalarValue(resAddr, currentTimeStep, &sum);
|
||||
|
||||
histogram = &(fldResults->scalarValuesHistogram(resAddr, currentTimeStep));
|
||||
}
|
||||
else if (m_statisticsCellRange == VISIBLE_CELLS)
|
||||
@ -324,6 +343,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
m_visibleCellStatistics->minMaxCellScalarValues(currentTimeStep, min, max);
|
||||
m_visibleCellStatistics->p10p90CellScalarValues(currentTimeStep, p10, p90);
|
||||
m_visibleCellStatistics->sumCellScalarValues(currentTimeStep, sum);
|
||||
m_visibleCellStatistics->mobileVolumeWeightedMean(currentTimeStep, weightedMean);
|
||||
|
||||
histogram = &(m_visibleCellStatistics->cellScalarValuesHistogram(currentTimeStep));
|
||||
}
|
||||
@ -369,7 +389,6 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
|
||||
if (showResultInfo())
|
||||
{
|
||||
|
||||
if (eclipseView->cellResult()->isTernarySaturationSelected())
|
||||
{
|
||||
QString propName = eclipseView->cellResult()->resultVariableUiShortName();
|
||||
@ -392,6 +411,7 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
"<tr> <td>%1</td> <td> %2</td> <td> %3</td> <td> %4</td> <td> %5</td> <td> %6</td> </tr>"
|
||||
"</table>").arg(min).arg(p10).arg(mean).arg(p90).arg(max).arg(sum);
|
||||
|
||||
|
||||
if (eclipseView->faultResultSettings()->hasValidCustomResult())
|
||||
{
|
||||
QString faultMapping;
|
||||
@ -434,6 +454,10 @@ void Rim3dOverlayInfoConfig::updateEclipse3DInfo(RimEclipseView * eclipseView)
|
||||
|
||||
}
|
||||
|
||||
if (showVolumeWeightedMean() && weightedMean != HUGE_VAL)
|
||||
{
|
||||
infoText += QString("<b>Mobile Volume Weighted Mean:</b> %1").arg(weightedMean);
|
||||
}
|
||||
}
|
||||
|
||||
if (!infoText.isEmpty())
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
|
||||
void setReservoirView(RimView* ownerView);
|
||||
|
||||
void setPosition(cvf::Vec2ui position);
|
||||
void setPosition(cvf::Vec2ui position);
|
||||
|
||||
enum StatisticsTimeRangeType
|
||||
{
|
||||
@ -77,6 +77,7 @@ private:
|
||||
caf::PdmField<bool> showAnimProgress;
|
||||
caf::PdmField<bool> showCaseInfo;
|
||||
caf::PdmField<bool> showResultInfo;
|
||||
caf::PdmField<bool> showVolumeWeightedMean;
|
||||
caf::PdmField<bool> showHistogram;
|
||||
|
||||
caf::PdmField<caf::AppEnum<StatisticsTimeRangeType> > m_statisticsTimeRange;
|
||||
|
@ -41,7 +41,6 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -887,6 +886,14 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
|
||||
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::combinedRiAreaNormTranResultName(), false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//Mobile Pore Volume
|
||||
{
|
||||
if (findScalarResultIndex(RiaDefines::STATIC_NATIVE, "PORV") != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
addStaticScalarResult(RiaDefines::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName(), false, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -1065,6 +1072,10 @@ size_t RigCaseCellResultsData::findOrLoadScalarResult(RiaDefines::ResultCatType
|
||||
progressInfo.incrementProgress();
|
||||
}
|
||||
}
|
||||
else if (resultName == RiaDefines::mobilePoreVolumeName())
|
||||
{
|
||||
computeMobilePV();
|
||||
}
|
||||
|
||||
if (type == RiaDefines::GENERATED)
|
||||
{
|
||||
@ -2242,6 +2253,59 @@ double RigCaseCellResultsData::darchysValue()
|
||||
return RiaEclipseUnitTools::darcysConstant(m_ownerCaseData->unitsType());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::computeMobilePV()
|
||||
{
|
||||
std::vector<double> porvDataTemp;
|
||||
std::vector<double> swcrDataTemp;
|
||||
std::vector<double> multpvDataTemp;
|
||||
|
||||
const std::vector<double>* porvResults = nullptr;
|
||||
const std::vector<double>* swcrResults = nullptr;
|
||||
const std::vector<double>* multpvResults = nullptr;
|
||||
|
||||
porvResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "PORV", porvDataTemp);
|
||||
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "SWCR", swcrDataTemp);
|
||||
multpvResults = RigCaseCellResultsData::getResultIndexableStaticResult(this->activeCellInfo(), this, "MULTPV", multpvDataTemp);
|
||||
|
||||
CVF_ASSERT(!porvResults->empty());
|
||||
|
||||
size_t mobPVIdx = this->findOrCreateScalarResultIndex(RiaDefines::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName(), false);
|
||||
|
||||
std::vector<double> &mobPVResults = this->cellScalarResults(mobPVIdx)[0];
|
||||
|
||||
// Set up output container to correct number of results
|
||||
mobPVResults.resize(porvResults->size());
|
||||
|
||||
if (!(multpvResults || swcrResults))
|
||||
{
|
||||
mobPVResults.assign(porvResults->begin(), porvResults->end());
|
||||
}
|
||||
else if (!multpvResults)
|
||||
{
|
||||
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
|
||||
{
|
||||
mobPVResults[vIdx] = (*porvResults)[vIdx] * (1.0 - (*swcrResults)[vIdx]);
|
||||
}
|
||||
}
|
||||
else if (!swcrResults)
|
||||
{
|
||||
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
|
||||
{
|
||||
mobPVResults[vIdx] = (*multpvResults)[vIdx] * (*porvResults)[vIdx];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t vIdx = 0; vIdx < porvResults->size(); ++vIdx)
|
||||
{
|
||||
mobPVResults[vIdx] = (*multpvResults)[vIdx] * (*porvResults)[vIdx] * (1.0 - (*swcrResults)[vIdx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
int reportStepNumber(size_t scalarResultIndex, size_t timeStepIndex) const;
|
||||
std::vector<int> reportStepNumbers(size_t scalarResultIndex) const;
|
||||
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos(size_t scalarResultIndex) const;
|
||||
std::vector<RigEclipseTimeStepInfo> timeStepInfos(size_t scalarResultIndex) const;
|
||||
void setTimeStepInfos(size_t scalarResultIndex, const std::vector<RigEclipseTimeStepInfo>& timeStepInfos);
|
||||
|
||||
size_t findOrLoadScalarResultForTimeStep(RiaDefines::ResultCatType type, const QString& resultName, size_t timeStepIndex);
|
||||
@ -118,26 +118,30 @@ public:
|
||||
bool updateResultName(RiaDefines::ResultCatType resultType, QString& oldName, const QString& newName);
|
||||
|
||||
static const std::vector<double>* getResultIndexableStaticResult(RigActiveCellInfo* actCellInfo,
|
||||
public:
|
||||
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
|
||||
RigCaseCellResultsData* gridCellResults,
|
||||
QString porvResultName,
|
||||
std::vector<double> &activeCellsResultsTempContainer);
|
||||
|
||||
bool mustBeCalculated(size_t scalarResultIndex) const;
|
||||
void setMustBeCalculated(size_t scalarResultIndex);
|
||||
void eraseAllSourSimData();
|
||||
public:
|
||||
const std::vector<RigEclipseResultInfo>& infoForEachResultIndex() { return m_resultInfos;}
|
||||
|
||||
bool mustBeCalculated(size_t scalarResultIndex) const;
|
||||
void setMustBeCalculated(size_t scalarResultIndex);
|
||||
void eraseAllSourSimData();
|
||||
|
||||
|
||||
public:
|
||||
size_t addStaticScalarResult(RiaDefines::ResultCatType type,
|
||||
const QString& resultName,
|
||||
bool needsToBeStored,
|
||||
size_t resultValueCount);
|
||||
size_t addStaticScalarResult(RiaDefines::ResultCatType type,
|
||||
const QString& resultName,
|
||||
bool needsToBeStored,
|
||||
size_t resultValueCount);
|
||||
|
||||
bool
|
||||
findTransmissibilityResults(size_t& tranX, size_t& tranY, size_t& tranZ) const;
|
||||
findTransmissibilityResults(size_t& tranX, size_t& tranY, size_t& tranZ) const;
|
||||
private: // from RimReservoirCellResultsStorage
|
||||
void computeSOILForTimeStep(size_t timeStepIndex);
|
||||
void testAndComputeSgasForTimeStep(size_t timeStepIndex);
|
||||
|
||||
|
||||
void computeRiTransComponent(const QString& riTransComponentResultName);
|
||||
void computeNncCombRiTrans();
|
||||
|
||||
@ -149,19 +153,20 @@ private: // from RimReservoirCellResultsStorage
|
||||
void computeCompletionTypeForTimeStep(size_t timeStep);
|
||||
double darchysValue();
|
||||
|
||||
void computeMobilePV();
|
||||
|
||||
bool isDataPresent(size_t scalarResultIndex) const;
|
||||
|
||||
cvf::ref<RifReaderInterface> m_readerInterface;
|
||||
|
||||
private:
|
||||
std::vector< std::vector< std::vector<double> > > m_cellScalarResults; ///< Scalar results on the complete reservoir for each Result index (ResultVariable) and timestep
|
||||
cvf::Collection<RigStatisticsDataCache> m_statisticsDataCache;
|
||||
|
||||
private:
|
||||
std::vector< std::vector< std::vector<double> > > m_cellScalarResults; ///< Scalar results on the complete reservoir for each Result index (ResultVariable) and timestep
|
||||
cvf::Collection<RigStatisticsDataCache> m_statisticsDataCache;
|
||||
std::vector<RigEclipseResultInfo> m_resultInfos;
|
||||
|
||||
private:
|
||||
std::vector<RigEclipseResultInfo> m_resultInfos;
|
||||
|
||||
RigMainGrid* m_ownerMainGrid;
|
||||
RigEclipseCaseData* m_ownerCaseData;
|
||||
RigActiveCellInfo* m_activeCellInfo;
|
||||
RigMainGrid* m_ownerMainGrid;
|
||||
RigEclipseCaseData* m_ownerCaseData;
|
||||
RigActiveCellInfo* m_activeCellInfo;
|
||||
};
|
||||
|
@ -20,10 +20,12 @@
|
||||
|
||||
#include "RigEclipseNativeVisibleCellsStatCalc.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigWeightedMeanCalc.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -98,4 +100,18 @@ size_t RigEclipseNativeVisibleCellsStatCalc::timeStepCount()
|
||||
return m_caseData->timeStepCount(m_scalarResultIndex);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseNativeVisibleCellsStatCalc::mobileVolumeWeightedMean(size_t timeStepIndex, double &result)
|
||||
{
|
||||
size_t mobPVResultIndex = m_caseData->findOrLoadScalarResult(RiaDefines::ResultCatType::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName());
|
||||
|
||||
const std::vector<double>& weights = m_caseData->cellScalarResults(mobPVResultIndex)[0];
|
||||
const std::vector<double>& values = m_caseData->cellScalarResults(m_scalarResultIndex, timeStepIndex);
|
||||
|
||||
const RigActiveCellInfo* actCellInfo = m_caseData->activeCellInfo();
|
||||
|
||||
RigWeightedMeanCalc::weightedMeanOverCells(&weights, &values, m_cellVisibilities.p(), actCellInfo, m_caseData->isUsingGlobalActiveIndex(m_scalarResultIndex), &result);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,8 @@ 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 &result);
|
||||
|
||||
|
||||
private:
|
||||
RigCaseCellResultsData* m_caseData;
|
||||
|
@ -17,12 +17,17 @@
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "RigFlowDiagVisibleCellsStatCalc.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigStatisticsMath.h"
|
||||
#include "RigWeightedMeanCalc.h"
|
||||
|
||||
#include "RimEclipseResultCase.h"
|
||||
|
||||
#include <math.h>
|
||||
#include "RigStatisticsMath.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -33,7 +38,6 @@ RigFlowDiagVisibleCellsStatCalc::RigFlowDiagVisibleCellsStatCalc(RigFlowDiagResu
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -45,7 +49,6 @@ void RigFlowDiagVisibleCellsStatCalc::minMaxCellScalarValues(size_t timeStepInde
|
||||
max = acc.max;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -69,7 +72,6 @@ void RigFlowDiagVisibleCellsStatCalc::valueSumAndSampleCount(size_t timeStepInde
|
||||
sampleCount = acc.sampleCount;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -96,4 +98,24 @@ size_t RigFlowDiagVisibleCellsStatCalc::timeStepCount()
|
||||
return m_resultsData->timeStepCount();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigFlowDiagVisibleCellsStatCalc::mobileVolumeWeightedMean(size_t timeStepIndex, double &result)
|
||||
{
|
||||
RimEclipseResultCase* eclCase = nullptr;
|
||||
m_resultsData->flowDiagSolution()->firstAncestorOrThisOfType(eclCase);
|
||||
if (!eclCase) return;
|
||||
|
||||
RigCaseCellResultsData* caseCellResultsData = eclCase->results(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
size_t mobPVResultIndex = caseCellResultsData->findOrLoadScalarResult(RiaDefines::ResultCatType::STATIC_NATIVE, RiaDefines::mobilePoreVolumeName());
|
||||
|
||||
const std::vector<double>& weights = caseCellResultsData->cellScalarResults(mobPVResultIndex, 0);
|
||||
const std::vector<double>* values = m_resultsData->resultValues(m_resVarAddr, timeStepIndex);
|
||||
|
||||
const RigActiveCellInfo* actCellInfo = m_resultsData->activeCellInfo(m_resVarAddr);
|
||||
|
||||
RigWeightedMeanCalc::weightedMeanOverCells(&weights, values, m_cellVisibilities.p(), actCellInfo, true, &result);
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,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 &result);
|
||||
|
||||
private:
|
||||
RigFlowDiagResults* m_resultsData;
|
||||
@ -72,8 +73,4 @@ private:
|
||||
if ( cellResultIndex != cvf::UNDEFINED_SIZE_T ) accumulator.addValue((*values)[cellResultIndex]);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfArray.h"
|
||||
|
||||
#include <vector>
|
||||
|
@ -87,6 +87,12 @@ void RigStatisticsCalculator::addDataToHistogramCalculator(RigHistogramCalculato
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsCalculator::mobileVolumeWeightedMean(size_t timeStepIndex, double& mean)
|
||||
{}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -20,8 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "cvfBase.h"
|
||||
#include "cvfObject.h"
|
||||
#include "cvfCollection.h"
|
||||
#include "cvfObject.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -49,5 +49,7 @@ public:
|
||||
|
||||
virtual size_t timeStepCount() = 0;
|
||||
|
||||
static void posNegClosestToZero(const std::vector<double>& values, double& pos, double& neg);
|
||||
virtual void mobileVolumeWeightedMean(size_t timeStepIndex, double& mean);
|
||||
|
||||
static void posNegClosestToZero(const std::vector<double>& values, double& pos, double& neg);
|
||||
};
|
||||
|
@ -275,6 +275,19 @@ const std::vector<int>& RigStatisticsDataCache::uniqueCellScalarValues(size_t ti
|
||||
return m_statsPrTs[timeStepIndex].m_uniqueValues;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::mobileVolumeWeightedMean(size_t timeStepIndex, double& mean)
|
||||
{
|
||||
if (!m_statsPrTs[timeStepIndex].m_isVolumeWeightedMeanCalculated)
|
||||
{
|
||||
m_statisticsCalculator->mobileVolumeWeightedMean(timeStepIndex, m_statsPrTs[timeStepIndex].m_volumeWeightedMean);
|
||||
}
|
||||
|
||||
mean = m_statsPrTs[timeStepIndex].m_volumeWeightedMean;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -57,6 +57,8 @@ public:
|
||||
|
||||
const std::vector<int>& uniqueCellScalarValues();
|
||||
const std::vector<int>& uniqueCellScalarValues(size_t timeStepIndex);
|
||||
|
||||
void mobileVolumeWeightedMean(size_t timeStepIndex, double& mean);
|
||||
|
||||
private:
|
||||
void computeHistogramStatisticsIfNeeded();
|
||||
@ -70,18 +72,20 @@ private:
|
||||
{
|
||||
StatisticsValues()
|
||||
{
|
||||
m_minValue = HUGE_VAL;
|
||||
m_maxValue = -HUGE_VAL;
|
||||
m_isMaxMinCalculated = false;
|
||||
m_meanValue = HUGE_VAL;
|
||||
m_isMeanCalculated = false;
|
||||
m_posClosestToZero = HUGE_VAL;
|
||||
m_negClosestToZero = -HUGE_VAL;
|
||||
m_isClosestToZeroCalculated = false;
|
||||
m_p10 = HUGE_VAL;
|
||||
m_p90 = HUGE_VAL;
|
||||
m_valueSum = 0.0;
|
||||
m_isValueSumCalculated = false;
|
||||
m_minValue = HUGE_VAL;
|
||||
m_maxValue = -HUGE_VAL;
|
||||
m_isMaxMinCalculated = false;
|
||||
m_meanValue = HUGE_VAL;
|
||||
m_isMeanCalculated = false;
|
||||
m_posClosestToZero = HUGE_VAL;
|
||||
m_negClosestToZero = -HUGE_VAL;
|
||||
m_isClosestToZeroCalculated = false;
|
||||
m_p10 = HUGE_VAL;
|
||||
m_p90 = HUGE_VAL;
|
||||
m_valueSum = 0.0;
|
||||
m_isValueSumCalculated = false;
|
||||
m_volumeWeightedMean = HUGE_VAL;
|
||||
m_isVolumeWeightedMeanCalculated = false;
|
||||
}
|
||||
|
||||
double m_minValue;
|
||||
@ -101,6 +105,9 @@ private:
|
||||
double m_valueSum;
|
||||
bool m_isValueSumCalculated;
|
||||
|
||||
double m_volumeWeightedMean;
|
||||
bool m_isVolumeWeightedMeanCalculated;
|
||||
|
||||
std::vector<size_t> m_histogram;
|
||||
std::vector<int> m_uniqueValues;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user