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
44{
45namespace FieldUtils
46{
47
48/// A class that contains algorithms for interpolation between pts fields,
49/// expansions and different meshes
50template <typename T> class Interpolator : public LibUtilities::Interpolator
51{
52public:
53 /**
54 * @brief Constructor of the Interpolator class
55 *
56 * @param method interpolation method, defaults to a sensible value if
57 * not set
58 * @param coordId coordinate id along which the interpolation should be
59 * performed
60 * @param filtWidth filter width, required by some algorithms such as eGauss
61 * @param maxPts limit number of considered points
62 *
63 * if method is not specified, the best algorithm is chosen autpomatically.
64 *
65 * If coordId is not specified, a full 1D/2D/3D interpolation is performed
66 * without
67 * collapsing any coordinate.
68 *
69 * filtWidth must be specified for the eGauss algorithm only.
70 */
72 short int coordId = -1, NekDouble filtWidth = 0.0,
73 int maxPts = 1000)
74 : LibUtilities::Interpolator(method, coordId, filtWidth, maxPts)
75 {
76 }
77
78 /// Interpolate from an expansion to an expansion
79 FIELD_UTILS_EXPORT void Interpolate(const T expInField, T &expOutField,
80 NekDouble def_value = 0.0);
81
82 /// Interpolate from an expansion to a pts field
84 const T expInField, LibUtilities::PtsFieldSharedPtr &ptsOutField,
85 NekDouble def_value = 0.0);
86
87 /// Interpolate from a pts field to an expansion
89 const LibUtilities::PtsFieldSharedPtr ptsInField, T &expOutField);
90
91 /// Interpolate from a pts field to a pts field
93 const LibUtilities::PtsFieldSharedPtr ptsInField,
95
96protected:
97 /// input field
99 /// output field
101};
102
103typedef std::shared_ptr<
106
107} // namespace FieldUtils
108} // namespace Nektar
109
110#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:190
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble