mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#2146 Num Flooded PV: Add allTimeSteps for all active native cells
This commit is contained in:
parent
931bc71deb
commit
f5290f020b
@ -224,6 +224,7 @@ Rim3dOverlayInfoConfig::HistogramData Rim3dOverlayInfoConfig::histogramData(RimE
|
||||
eclipseView->currentGridCellResults()->p10p90CellScalarValues(scalarIndex, histData.p10, histData.p90);
|
||||
eclipseView->currentGridCellResults()->meanCellScalarValues(scalarIndex, histData.mean);
|
||||
eclipseView->currentGridCellResults()->sumCellScalarValues(scalarIndex, histData.sum);
|
||||
eclipseView->currentGridCellResults()->mobileVolumeWeightedMean(scalarIndex, histData.weightedMean);
|
||||
histData.histogram = &(eclipseView->currentGridCellResults()->cellScalarValuesHistogram(scalarIndex));
|
||||
}
|
||||
else if (m_statisticsTimeRange == CURRENT_TIMESTEP)
|
||||
@ -648,6 +649,8 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
||||
RimGeoMechView * geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
||||
if (geoMechView)
|
||||
{
|
||||
showVolumeWeightedMean = false;
|
||||
|
||||
updateGeoMech3DInfo(geoMechView);
|
||||
|
||||
// Update statistics dialog
|
||||
@ -675,7 +678,12 @@ void Rim3dOverlayInfoConfig::defineUiOrdering(QString uiConfigName, caf::PdmUiOr
|
||||
visGroup->add(&showAnimProgress);
|
||||
visGroup->add(&showCaseInfo);
|
||||
visGroup->add(&showResultInfo);
|
||||
visGroup->add(&showVolumeWeightedMean);
|
||||
RimGeoMechView * geoMechView = dynamic_cast<RimGeoMechView*>(m_viewDef.p());
|
||||
if (!geoMechView)
|
||||
{
|
||||
visGroup->add(&showVolumeWeightedMean);
|
||||
}
|
||||
|
||||
visGroup->add(&showHistogram);
|
||||
|
||||
caf::PdmUiGroup* statGroup = uiOrdering.addNewGroup("Statistics Options");
|
||||
|
@ -165,6 +165,14 @@ void RigCaseCellResultsData::sumCellScalarValues(size_t scalarResultIndex, size_
|
||||
m_statisticsDataCache[scalarResultIndex]->sumCellScalarValues(timeStepIndex, sumValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigCaseCellResultsData::mobileVolumeWeightedMean(size_t scalarResultIndex, double& meanValue)
|
||||
{
|
||||
m_statisticsDataCache[scalarResultIndex]->mobileVolumeWeightedMean(meanValue);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -69,6 +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, double& meanValue);
|
||||
void mobileVolumeWeightedMean(size_t scalarResultIndex, size_t timeStepIndex, double& meanValue);
|
||||
// Access meta-information about the results
|
||||
size_t resultCount() const;
|
||||
|
@ -93,6 +93,25 @@ void RigStatisticsCalculator::addDataToHistogramCalculator(RigHistogramCalculato
|
||||
void RigStatisticsCalculator::mobileVolumeWeightedMean(size_t timeStepIndex, double& mean)
|
||||
{}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsCalculator::mobileVolumeWeightedMean(double& mean)
|
||||
{
|
||||
double sum = 0.0;
|
||||
size_t tsCount = this->timeStepCount();
|
||||
for (size_t tIdx = 0; tIdx < tsCount; tIdx++)
|
||||
{
|
||||
double meanForTimeStep;
|
||||
this->mobileVolumeWeightedMean(tIdx, meanForTimeStep);
|
||||
sum += meanForTimeStep;
|
||||
}
|
||||
if (tsCount != 0)
|
||||
{
|
||||
mean = sum / tsCount;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
|
||||
virtual size_t timeStepCount() = 0;
|
||||
|
||||
virtual void mobileVolumeWeightedMean(double& mean);
|
||||
virtual void mobileVolumeWeightedMean(size_t timeStepIndex, double& mean);
|
||||
|
||||
static void posNegClosestToZero(const std::vector<double>& values, double& pos, double& neg);
|
||||
|
@ -293,6 +293,21 @@ void RigStatisticsDataCache::mobileVolumeWeightedMean(size_t timeStepIndex, doub
|
||||
mean = m_statsPrTs[timeStepIndex].m_volumeWeightedMean;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigStatisticsDataCache::mobileVolumeWeightedMean(double& mean)
|
||||
{
|
||||
if (!m_statsAllTimesteps.m_isVolumeWeightedMeanCalculated)
|
||||
{
|
||||
m_statisticsCalculator->mobileVolumeWeightedMean(m_statsAllTimesteps.m_volumeWeightedMean);
|
||||
|
||||
m_statsAllTimesteps.m_isVolumeWeightedMeanCalculated = true;
|
||||
}
|
||||
|
||||
mean = m_statsAllTimesteps.m_volumeWeightedMean;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
const std::vector<int>& uniqueCellScalarValues();
|
||||
const std::vector<int>& uniqueCellScalarValues(size_t timeStepIndex);
|
||||
|
||||
void mobileVolumeWeightedMean(double& mean);
|
||||
void mobileVolumeWeightedMean(size_t timeStepIndex, double& mean);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user