Make RiaWeightedAverageCalculator a template class.

This commit is contained in:
Gaute Lindkvist
2018-09-06 19:58:28 +02:00
parent 51434dd304
commit 11253f2dbd
5 changed files with 48 additions and 28 deletions

View File

@@ -477,8 +477,8 @@ FractureWidthAndConductivity
nameUnit.first, nameUnit.second, m_activeTimeStepIndex, fractureTemplateUnit());
}
RiaWeightedAverageCalculator widthCalc;
RiaWeightedAverageCalculator conductivityCalc;
RiaWeightedAverageCalculator<double> widthCalc;
RiaWeightedAverageCalculator<double> conductivityCalc;
RigWellPathStimplanIntersector intersector(rimWellPath->wellPathGeometry(), fractureInstance);
for (const auto& v : intersector.intersections())
@@ -497,10 +497,15 @@ FractureWidthAndConductivity
intersectionLength);
}
}
weightedConductivity = conductivityCalc.weightedAverage();
weightedWidth = widthCalc.weightedAverage();
totalLength = widthCalc.aggregatedWeight();
if (conductivityCalc.validAggregatedWeight())
{
weightedConductivity = conductivityCalc.weightedAverage();
}
if (widthCalc.validAggregatedWeight())
{
weightedWidth = widthCalc.weightedAverage();
totalLength = widthCalc.aggregatedWeight();
}
}
if (totalLength > 1e-7)