Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
MeshInterpolation.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2021.
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation version 3.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17// contact: delft3d.support@deltares.nl
18// Stichting Deltares
19// P.O. Box 177
20// 2600 MH Delft, The Netherlands
21//
22// All indications and logos of, and references to, "Delft3D" and "Deltares"
23// are registered trademarks of Stichting Deltares, and remain the property of
24// Stichting Deltares. All rights reserved.
25//
26//------------------------------------------------------------------------------
27
28#pragma once
29
30#include "MeshKernel/Constants.hpp"
31
32namespace meshkernel
33{
40
43 {
44 public:
46 virtual ~MeshInterpolation() = default;
47
49 virtual void Compute() = 0;
50
54 [[nodiscard]] double GetNodeResult(UInt node) const { return m_nodeResults[node]; }
55
59 [[nodiscard]] double GetEdgeResult(UInt edge) const { return m_edgeResults[edge]; }
60
64 [[nodiscard]] double GetFaceResult(UInt face) const { return m_faceResults[face]; }
65
68 [[nodiscard]] const std::vector<double>& GetNodeResults() const { return m_nodeResults; }
69
72 [[nodiscard]] const std::vector<double>& GetEdgeResults() const { return m_edgeResults; }
73
76 [[nodiscard]] const std::vector<double>& GetFaceResults() const { return m_faceResults; }
77
78 protected:
79 std::vector<double> m_nodeResults;
80 std::vector<double> m_edgeResults;
81 std::vector<double> m_faceResults;
82 };
83} // namespace meshkernel
The class used to interpolate based on averaging.
Definition AveragingInterpolation.hpp:76
A class for performing bilinear interpolation on gridded samples.
Definition BilinearInterpolationOnGriddedSamples.hpp:49
Interface for interpolation methods.
Definition MeshInterpolation.hpp:43
virtual void Compute()=0
Compute.
double GetFaceResult(UInt face) const
Gets the interpolation value at a specific face.
Definition MeshInterpolation.hpp:64
double GetNodeResult(UInt node) const
Gets the interpolation value at a specific node.
Definition MeshInterpolation.hpp:54
const std::vector< double > & GetEdgeResults() const
Gets all interpolated values at edges.
Definition MeshInterpolation.hpp:72
const std::vector< double > & GetNodeResults() const
Gets all interpolated values at nodes.
Definition MeshInterpolation.hpp:68
virtual ~MeshInterpolation()=default
Virtual destructor.
std::vector< double > m_faceResults
The interpolation results at faces.
Definition MeshInterpolation.hpp:81
std::vector< double > m_edgeResults
The interpolation results at edges.
Definition MeshInterpolation.hpp:80
std::vector< double > m_nodeResults
The interpolation results at nodes.
Definition MeshInterpolation.hpp:79
double GetEdgeResult(UInt edge) const
Gets the interpolation value at a specific edge.
Definition MeshInterpolation.hpp:59
const std::vector< double > & GetFaceResults() const
Gets all interpolated values at faces.
Definition MeshInterpolation.hpp:76
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
Interpolants
The interpolant types.
Definition MeshInterpolation.hpp:36
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39