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
78 const T expInField, T &expOutField, NekDouble def_value = 0.,
80
81 /// Interpolate from an expansion to a pts field
83 const T expInField, LibUtilities::PtsFieldSharedPtr &ptsOutField,
84 NekDouble def_value = 0., NekDouble tolerance = 1.E-5);
85
86 /// Interpolate from a pts field to an expansion
88 const LibUtilities::PtsFieldSharedPtr ptsInField, T &expOutField);
89
90 /// Interpolate from a pts field to a pts field
92 const LibUtilities::PtsFieldSharedPtr ptsInField,
94
95protected:
96 /// input field
98 /// output field
100};
101
102typedef std::shared_ptr<
105
106} // namespace Nektar::FieldUtils
107
108#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., NekDouble tolerance=NekConstants::kFindDistanceMin)
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
static const NekDouble kFindDistanceMin
double NekDouble