35#include "MeshKernel/AveragingInterpolation.hpp"
36#include "MeshKernel/AveragingStrategies/AveragingStrategy.hpp"
37#include "MeshKernel/AveragingStrategies/AveragingStrategyFactory.hpp"
38#include "MeshKernel/Constants.hpp"
39#include "MeshKernel/Definitions.hpp"
40#include "MeshKernel/Entities.hpp"
41#include "MeshKernel/Exceptions.hpp"
42#include "MeshKernel/Mesh2D.hpp"
43#include "MeshKernel/MeshTriangulation.hpp"
44#include "MeshKernel/Operations.hpp"
45#include "MeshKernel/Point.hpp"
46#include "MeshKernel/SampleInterpolator.hpp"
47#include "MeshKernel/Utilities/RTreeFactory.hpp"
77 const std::span<const double> yNodes,
90 void Interpolate(
const int propertyId,
const std::span<const Point> iterpolationNodes, std::span<double> result)
const override;
102 static constexpr UInt MaximumNumberOfEdgesPerNode = 16;
105 static std::vector<Point> CombineCoordinates(
const std::span<const double> xNodes,
const std::span<const double> yNodes);
108 double InterpolateOnElement(
const UInt elementId,
const Point& interpolationPoint,
const std::vector<double>& sampleValues)
const;
111 double ComputeOnPolygon(
const int propertyId,
112 std::vector<Point>& polygon,
113 const Point& interpolationPoint,
115 std::vector<Sample>& sampleCache)
const;
118 double GetSearchRadiusSquared(
const std::vector<Point>& searchPolygon,
119 const Point& interpolationPoint,
123 void GenerateSearchPolygon(
const double relativeSearchRadius,
124 const Point& interpolationPoint,
125 std::vector<Point>& polygon,
129 double GetSampleValueFromRTree(
const int propertyId,
const UInt index)
const;
132 double ComputeInterpolationResultFromNeighbors(
const int propertyId,
133 const Point& interpolationPoint,
134 const std::vector<Point>& searchPolygon,
136 std::vector<Sample>& sampleCache)
const;
139 void InterpolateAtNodes(
const int propertyId,
const Mesh2D& mesh, std::span<double>& result)
const;
142 void InterpolateAtEdgeCentres(
const Mesh2D& mesh,
143 const std::span<double>& nodeResult,
144 std::span<double>& result)
const;
147 void InterpolateAtFaces(
const int propertyId,
const Mesh2D& mesh, std::span<double>& result)
const;
150 std::vector<Point> m_samplePoints;
155 Projection m_projection = Projection::cartesian;
161 std::unique_ptr<averaging::AveragingStrategy> m_strategy;
164 std::map<int, std::vector<double>> m_sampleData;
167 std::unique_ptr<RTreeBase> m_nodeRTree;
174 return static_cast<UInt>(m_samplePoints.size());
Method
Averaging methods.
Definition AveragingInterpolation.hpp:80
@ SimpleAveraging
Computes a simple mean.
A class derived from Mesh, which describes unstructures 2d meshes.
Definition Mesh2D.hpp:58
A struct describing a point in a two-dimensional space.
Definition Point.hpp:41
Interpolator for sample data using an averaging scheme.
Definition SampleAveragingInterpolator.hpp:73
SampleAveragingInterpolator(const std::span< const Point > nodes, const Projection projection, const InterpolationParameters &interpolationParameters)
Constructor.
double InterpolateValue(const int propertyId, const Point &evaluationPoint) const override
Interpolate the sample data set at a single interpolation point.
void Interpolate(const int propertyId, const Mesh2D &mesh, const Location location, std::span< double > result) const override
Interpolate the sample data set at the locationd defined.
SampleAveragingInterpolator(const std::span< const double > xNodes, const std::span< const double > yNodes, const Projection projection, const InterpolationParameters &interpolationParameters)
Constructor.
UInt Size() const override
Get the number of nodes of size of the sample data.
Definition SampleAveragingInterpolator.hpp:172
void Interpolate(const int propertyId, const std::span< const Point > iterpolationNodes, std::span< double > result) const override
Interpolate the sample data set at the interpolation nodes.
Interface for sample interpolation.
Definition SampleInterpolator.hpp:53
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
Projection
Enumerator describing the supported projections.
Definition Definitions.hpp:43
Location
Mesh locations enumeration.
Definition Definitions.hpp:76
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39
Parameters used by the averaging interpolation.
Definition SampleAveragingInterpolator.hpp:54
double m_relativeSearchRadius
The relative search radius.
Definition SampleAveragingInterpolator.hpp:62
UInt m_minimumNumberOfSamples
The minimum number of samples for several averaging methods.
Definition SampleAveragingInterpolator.hpp:68
AveragingInterpolation::Method m_method
Which averaging method should be used.
Definition SampleAveragingInterpolator.hpp:56
bool m_useClosestIfNoneFound
If no point is found in polygon then just used the closest point.
Definition SampleAveragingInterpolator.hpp:65
double m_absoluteSearchRadius
The absolute search radius.
Definition SampleAveragingInterpolator.hpp:59