mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3089 Non-Darcy longitudinal : Use weighted average calculator
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
#include "RiaWeightedAverageCalculator.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -32,6 +34,8 @@ RiaWeightedAverageCalculator::RiaWeightedAverageCalculator()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaWeightedAverageCalculator::addValueAndWeight(double value, double weight)
|
||||
{
|
||||
CVF_ASSERT(weight >= 0.0);
|
||||
|
||||
m_aggregatedValue += value * weight;
|
||||
m_aggregatedWeight += weight;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user