#3089 Non-Darcy longitudinal : Use weighted average calculator

This commit is contained in:
Magne Sjaastad
2018-08-15 15:52:00 +02:00
parent 2e78bddaf6
commit fa25f448a1
2 changed files with 39 additions and 32 deletions

View File

@@ -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;
}