Nektar++
Interp.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: Interp.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Definition of interpolation routines
32//
33///////////////////////////////////////////////////////////////////////////////
34
35#ifndef NEKTAR_LIB_UTILTIES_FOUNDATIONS_INTERP_H
36#define NEKTAR_LIB_UTILTIES_FOUNDATIONS_INTERP_H
37
41
42namespace Nektar
43{
44template <typename Dim, typename DataType> class Array;
45}
46
48{
49
50// Physical Space Interpolation methods
51
52/** \brief this function interpolates a 1D function \f$f\f$ evaluated
53 * at the quadrature points of the basis \a fbasis0 to the
54 * function values at the quadrature points of the basis \a tbasis0
55 *
56 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
57 * of the basis \a fbasis0, this routine calculates, using
58 * \a (Q-1)th order polynomial interpolation, the function values
59 * at the \a Q2 quadrature points of the basis \a tbasis0.
60 *
61 * \param fbasis0 the basis at which's quadrature points the
62 * function is given
63 * \param from the array containg the function \f$ f\f$ evaluated
64 * at the quadrature points of \a fbasis0
65 * \param tbasis0 the basis to which's quadrature points the
66 * function should be interpolated
67 * \param to the array containg the function \f$ f\f$ evaluated
68 * at the quadrature points of \a tbasis0 (output of the function)
69 */
70// 1D Interpolation
71LIB_UTILITIES_EXPORT void Interp1D(const BasisKey &fbasis0,
72 const Array<OneD, const NekDouble> &from,
73 const BasisKey &tbasis0,
74 Array<OneD, NekDouble> &to);
75
76LIB_UTILITIES_EXPORT void Interp1D(const PointsKey &fpoints0,
77 const Array<OneD, const NekDouble> &from,
78 const PointsKey &tpoints0,
79 Array<OneD, NekDouble> &to);
80
81LIB_UTILITIES_EXPORT void Interp1D(const BasisKey &fbasis0,
82 const NekDouble *from,
83 const BasisKey &tbasis0, NekDouble *to);
84
85LIB_UTILITIES_EXPORT void Interp1D(const PointsKey &fpoints0,
86 const NekDouble *from,
87 const PointsKey &tpoints0, NekDouble *to);
88
89/** \brief this function interpolates a 2D function \f$f\f$ evaluated
90 * at the quadrature points of the 2D basis, constructed by
91 * \a fbasis0 and \a fbasis1, to the function values at the
92 * quadrature points of the 2D basis, constructed by \a tbasis0 and
93 * \a tbasis1
94 *
95 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
96 * of the first expansion basis, this routine calculates, using
97 * \a (Q-1)th order polynomial interpolation, the function values
98 * at the \a Q2 quadrature points of the second basis.
99 *
100 * \param fbasis0 the basis at which's quadrature points the
101 * function is given
102 * \param from the array containg the function \f$ f\f$ evaluated
103 * at the quadrature points of \a fbasis0
104 * \param tbasis0 the basis to which's quadrature points the
105 * function should be interpolated
106 * \param to the array containg the function \f$ f\f$ evaluated
107 * at the quadrature points of \a tbasis0 (output of the function)
108 */
109// 2D Interpolation
110LIB_UTILITIES_EXPORT void Interp2D(const BasisKey &fbasis0,
111 const BasisKey &fbasis1,
112 const Array<OneD, const NekDouble> &from,
113 const BasisKey &tbasis0,
114 const BasisKey &tbasis1,
115 Array<OneD, NekDouble> &to);
116
117LIB_UTILITIES_EXPORT void Interp2D(const PointsKey &fpoints0,
118 const PointsKey &fpoints1,
119 const Array<OneD, const NekDouble> &from,
120 const PointsKey &tpoints0,
121 const PointsKey &tpoints1,
122 Array<OneD, NekDouble> &to);
123
124LIB_UTILITIES_EXPORT void Interp2D(const PointsKey &fpoints0,
125 const PointsKey &fpoints1,
126 const NekDouble *from,
127 const PointsKey &tpoints0,
128 const PointsKey &tpoints1, NekDouble *to);
129
130/** \brief this function interpolates a 3D function \f$f\f$ evaluated
131 * at the quadrature points of the 3D basis, constructed by
132 * \a fbasis0, \a fbasis1, and \a fbasis2 to the function values at the
133 * quadrature points of the 3D basis, constructed by \a tbasis0,
134 * \a tbasis1, and \a tbasis2.
135 *
136 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
137 * of the first expansion basis, this routine calculates, using
138 * \a (Q-1)th order polynomial interpolation, the function values
139 * at the \a Q2 quadrature points of the second basis, and the function
140 * values at the \a Q3 quadrature points of the third basis.
141 *
142 * \param fbasis0 the basis at which's quadrature points the
143 * function is given
144 * \param from the array containg the function \f$ f\f$ evaluated
145 * at the quadrature points of \a fbasis0
146 * \param tbasis0 the basis to which's quadrature points the
147 * function should be interpolated
148 * \param to the array containg the function \f$ f\f$ evaluated
149 * at the quadrature points of \a tbasis0 (output of the function)
150 */
151// 3D interpolation
153 const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2,
154 const Array<OneD, const NekDouble> &from, const BasisKey &tbasis0,
155 const BasisKey &tbasis1, const BasisKey &tbasis2,
156 Array<OneD, NekDouble> &to);
157
159 const PointsKey &fpoints0, const PointsKey &fpoints1,
160 const PointsKey &fpoints2, const Array<OneD, const NekDouble> &from,
161 const PointsKey &tpoints0, const PointsKey &tpoints1,
162 const PointsKey &tpoints2, Array<OneD, NekDouble> &to);
163
165 const PointsKey &fpoints0, const PointsKey &fpoints1,
166 const PointsKey &fpoints2, const NekDouble *from, const PointsKey &tpoints0,
167 const PointsKey &tpoints1, const PointsKey &tpoints2, NekDouble *to);
168
169} // namespace Nektar::LibUtilities
170
171#endif // FOUNDATIONS_H
#define LIB_UTILITIES_EXPORT
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function evaluated at the quadrature points of the basis fbasis0 to ...
Definition: Interp.cpp:47
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis,...
Definition: Interp.cpp:162
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
Definition: Interp.cpp:101
double NekDouble