|
MeshKernel
|
The class used to interpolate based on averaging. More...
#include <AveragingInterpolation.hpp>
Public Types | |
| enum class | Method { SimpleAveraging = 1 , Closest = 2 , Max = 3 , Min = 4 , InverseWeightedDistance = 5 , 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. | |
| 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. | |
| double | GetEdgeResult (UInt edge) const |
| Gets the interpolation value at a specific edge. | |
| double | GetFaceResult (UInt face) const |
| Gets the interpolation value at a specific face. | |
| const std::vector< double > & | GetNodeResults () const |
| Gets all interpolated values at nodes. | |
| const std::vector< double > & | GetEdgeResults () const |
| Gets all interpolated values at edges. | |
| const std::vector< double > & | GetFaceResults () const |
| Gets all interpolated values at faces. | |
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. | |
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:
|
strong |
Averaging methods.
| 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.
| [in] | mesh | The input mesh |
| [in] | samples | The samples with x,y locations and values |
| [in] | method | The averaging method to use |
| [in] | locationType | The location type (faces, edges, nodes). |
| [in] | relativeSearchRadius | The relative search radius, used to enlarge the search area when looking for samples. |
| [in] | useClosestSampleIfNoneAvailable | If no samples are found, use the closest one. |
| [in] | subtractSampleValues | For some algorithms (e.g. refinement based on levels) we need to subtract 1 to the sample value. |
| [in] | minNumSamples | The minimum a of samples used for certain interpolation algorithms |
|
overridevirtual |
Compute interpolation.
Implements meshkernel::MeshInterpolation.