MeshKernel
Public Types | Public Member Functions | List of all members
meshkernel::AveragingInterpolation Class Reference

The class used to interpolate based on averaging. More...

#include <AveragingInterpolation.hpp>

Inheritance diagram for meshkernel::AveragingInterpolation:
meshkernel::MeshInterpolation

Public Types

enum  Method {
  Method::SimpleAveraging = 1, Method::Closest = 2, Method::Max = 3, Method::Min = 4,
  Method::InverseWeightedDistance = 5, Method::MinAbsValue = 6
}
 Averaging methods. More...
 

Public Member Functions

 AveragingInterpolation (Mesh2D &mesh, std::vector< Sample > &samples, Method method, Location locationType, double relativeSearchRadius, bool useClosestSampleIfNoneAvailable, bool subtractSampleValues, UInt minNumSamples)
 Interpolation based on averaging. More...
 
void Compute () override
 Compute interpolation.
 
- Public Member Functions inherited from meshkernel::MeshInterpolation
virtual ~MeshInterpolation ()=default
 Virtual destructor.
 
double GetNodeResult (UInt node) const
 Gets the interpolation value at a specific node. More...
 
double GetEdgeResult (UInt edge) const
 Gets the interpolation value at a specific edge. More...
 
double GetFaceResult (UInt face) const
 Gets the interpolation value at a specific face. More...
 
const std::vector< double > & GetNodeResults () const
 Gets all interpolated values at nodes. More...
 
const std::vector< double > & GetEdgeResults () const
 Gets all interpolated values at edges. More...
 
const std::vector< double > & GetFaceResults () const
 Gets all interpolated values at faces. More...
 

Additional Inherited Members

- Protected Attributes inherited from meshkernel::MeshInterpolation
std::vector< double > m_nodeResults
 The interpolation results at nodes.
 
std::vector< double > m_edgeResults
 The interpolation results at edges.
 
std::vector< double > m_faceResults
 The interpolation results at faces.
 

Detailed Description

The class used to interpolate based on averaging.

The averaging interpolation operates on three specific Location - Faces (m_facesMassCenters), Nodes, and Edges(m_edgesCenters). The idea is to collect all samples close to the locations and perform a mathematical operation on their values. The Method enum describes available operations.

The algorithm operates as follow:

Member Enumeration Documentation

◆ Method

Averaging methods.

Enumerator
SimpleAveraging 

Computes a simple mean.

Closest 

Takes the value of the closest sample to the interpolation location.

Max 

Takes the maximum sample value.

Min 

Takes the minimum sample value.

InverseWeightedDistance 

Computes the inverse weighted sample mean.

MinAbsValue 

Computes the minimum absolute value.

Constructor & Destructor Documentation

◆ AveragingInterpolation()

meshkernel::AveragingInterpolation::AveragingInterpolation ( Mesh2D mesh,
std::vector< Sample > &  samples,
Method  method,
Location  locationType,
double  relativeSearchRadius,
bool  useClosestSampleIfNoneAvailable,
bool  subtractSampleValues,
UInt  minNumSamples 
)

Interpolation based on averaging.

Parameters
[in]meshThe input mesh
[in]samplesThe samples with x,y locations and values
[in]methodThe averaging method to use
[in]locationTypeThe location type (faces, edges, nodes).
[in]relativeSearchRadiusThe relative search radius, used to enlarge the search area when looking for samples.
[in]useClosestSampleIfNoneAvailableIf no samples are found, use the closest one.
[in]subtractSampleValuesFor some algorithms (e.g. refinement based on levels) we need to subtract 1 to the sample value.
[in]minNumSamplesThe minimum a of samples used for certain interpolation algorithms

The documentation for this class was generated from the following file: