mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Thermal Fracture: fix incorrect weighting when interpolating.
This commit is contained in:
committed by
Magne Sjaastad
parent
54ac7568cb
commit
803c9505b9
@@ -521,14 +521,14 @@ double RigThermalFractureResultUtil::interpolateProperty( const cvf::Vec3d&
|
|||||||
// Sort by distance
|
// Sort by distance
|
||||||
std::sort( distances.begin(), distances.end() );
|
std::sort( distances.begin(), distances.end() );
|
||||||
|
|
||||||
// Create distance-weighthed mean of first few points
|
// Create inverse-distance-weighthed mean of first few points
|
||||||
size_t numPoints = 3;
|
size_t numPoints = 3;
|
||||||
RiaWeightedMeanCalculator<double> calc;
|
RiaWeightedMeanCalculator<double> calc;
|
||||||
for ( size_t i = 0; i < numPoints; i++ )
|
for ( size_t i = 0; i < numPoints; i++ )
|
||||||
{
|
{
|
||||||
auto [distance, nodeIndex] = distances[i];
|
auto [distance, nodeIndex] = distances[i];
|
||||||
double value = fractureDefinition->getPropertyValue( propertyIndex, nodeIndex, static_cast<int>( timeStepIndex ) );
|
double value = fractureDefinition->getPropertyValue( propertyIndex, nodeIndex, static_cast<int>( timeStepIndex ) );
|
||||||
calc.addValueAndWeight( value, distance );
|
calc.addValueAndWeight( value, std::pow( 1.0 / distance, 2.0 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
return calc.weightedMean();
|
return calc.weightedMean();
|
||||||
|
|||||||
Reference in New Issue
Block a user