Nektar++
FieldUtils/Interpolator.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Interpolator.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2016 Kilian Lackhove
10// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11// Department of Aeronautics, Imperial College London (UK), and Scientific
12// Computing and Imaging Institute, University of Utah (USA).
13//
14// Permission is hereby granted, free of charge, to any person obtaining a
15// copy of this software and associated documentation files (the "Software"),
16// to deal in the Software without restriction, including without limitation
17// the rights to use, copy, modify, merge, publish, distribute, sublicense,
18// and/or sell copies of the Software, and to permit persons to whom the
19// Software is furnished to do so, subject to the following conditions:
20//
21// The above copyright notice and this permission notice shall be included
22// in all copies or substantial portions of the Software.
23//
24// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30// DEALINGS IN THE SOFTWARE.
31//
32// Description: Interpolator
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef FIELDUTILS_INTERPOLATOR_H
37#define FIELDUTILS_INTERPOLATOR_H
38
42
43namespace Nektar::FieldUtils
44{
45
46/// A class that contains algorithms for interpolation between pts fields,
47/// expansions and different meshes
48template <typename T> class Interpolator : public LibUtilities::Interpolator
49{
50public:
51 /**
52 * @brief Constructor of the Interpolator class
53 *
54 * @param method interpolation method, defaults to a sensible value if
55 * not set
56 * @param coordId coordinate id along which the interpolation should be
57 * performed
58 * @param filtWidth filter width, required by some algorithms such as eGauss
59 * @param maxPts limit number of considered points
60 *
61 * if method is not specified, the best algorithm is chosen autpomatically.
62 *
63 * If coordId is not specified, a full 1D/2D/3D interpolation is performed
64 * without
65 * collapsing any coordinate.
66 *
67 * filtWidth must be specified for the eGauss algorithm only.
68 */
70 short int coordId = -1, NekDouble filtWidth = 0.0,
71 int maxPts = 1000)
72 : LibUtilities::Interpolator(method, coordId, filtWidth, maxPts)
73 {
74 }
75
76 /// Interpolate from an expansion to an expansion
77 FIELD_UTILS_EXPORT void Interpolate(const T expInField, T &expOutField,
78 NekDouble def_value = 0.0);
79
80 /// Interpolate from an expansion to a pts field
82 const T expInField, LibUtilities::PtsFieldSharedPtr &ptsOutField,
83 NekDouble def_value = 0.0);
84
85 /// Interpolate from a pts field to an expansion
87 const LibUtilities::PtsFieldSharedPtr ptsInField, T &expOutField);
88
89 /// Interpolate from a pts field to a pts field
91 const LibUtilities::PtsFieldSharedPtr ptsInField,
93
94protected:
95 /// input field
97 /// output field
99};
100
101typedef std::shared_ptr<
104
105} // namespace Nektar::FieldUtils
106
107#endif
#define FIELD_UTILS_EXPORT
A class that contains algorithms for interpolation between pts fields, expansions and different meshe...
FIELD_UTILS_EXPORT void Interpolate(const T expInField, T &expOutField, NekDouble def_value=0.0)
Interpolate from an expansion to an expansion.
Interpolator(LibUtilities::InterpMethod method=LibUtilities::eNoMethod, short int coordId=-1, NekDouble filtWidth=0.0, int maxPts=1000)
Constructor of the Interpolator class.
A class that contains algorithms for interpolation between pts fields, expansions and different meshe...
std::shared_ptr< Interpolator< std::vector< MultiRegions::ExpListSharedPtr > > > InterpolatorSharedPtr
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:184
double NekDouble