MeshKernel
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 
32 namespace meshkernel
33 {
35  enum class Interpolants
36  {
39  };
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
meshkernel::MeshInterpolation::GetFaceResults
const std::vector< double > & GetFaceResults() const
Gets all interpolated values at faces.
Definition: MeshInterpolation.hpp:76
meshkernel::MeshInterpolation::~MeshInterpolation
virtual ~MeshInterpolation()=default
Virtual destructor.
meshkernel::MeshInterpolation
Interface for interpolation methods.
Definition: MeshInterpolation.hpp:42
meshkernel::MeshInterpolation::GetFaceResult
double GetFaceResult(UInt face) const
Gets the interpolation value at a specific face.
Definition: MeshInterpolation.hpp:64
meshkernel::MeshInterpolation::GetEdgeResults
const std::vector< double > & GetEdgeResults() const
Gets all interpolated values at edges.
Definition: MeshInterpolation.hpp:72
meshkernel::AveragingInterpolation
The class used to interpolate based on averaging.
Definition: AveragingInterpolation.hpp:75
meshkernel::MeshInterpolation::m_edgeResults
std::vector< double > m_edgeResults
The interpolation results at edges.
Definition: MeshInterpolation.hpp:80
meshkernel
Contains the logic of the C++ static library.
Definition: AveragingInterpolation.hpp:36
meshkernel::Interpolants
Interpolants
The interpolant types.
Definition: MeshInterpolation.hpp:35
meshkernel::MeshInterpolation::GetEdgeResult
double GetEdgeResult(UInt edge) const
Gets the interpolation value at a specific edge.
Definition: MeshInterpolation.hpp:59
meshkernel::MeshInterpolation::Compute
virtual void Compute()=0
Compute.
meshkernel::UInt
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition: Definitions.hpp:38
meshkernel::BilinearInterpolationOnGriddedSamples
A class for performing bilinear interpolation on gridded samples.
Definition: BilinearInterpolationOnGriddedSamples.hpp:48
meshkernel::MeshInterpolation::m_nodeResults
std::vector< double > m_nodeResults
The interpolation results at nodes.
Definition: MeshInterpolation.hpp:79
meshkernel::MeshInterpolation::GetNodeResult
double GetNodeResult(UInt node) const
Gets the interpolation value at a specific node.
Definition: MeshInterpolation.hpp:54
meshkernel::MeshInterpolation::GetNodeResults
const std::vector< double > & GetNodeResults() const
Gets all interpolated values at nodes.
Definition: MeshInterpolation.hpp:68
meshkernel::MeshInterpolation::m_faceResults
std::vector< double > m_faceResults
The interpolation results at faces.
Definition: MeshInterpolation.hpp:81