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
47namespace Nektar
48{
49namespace LibUtilities
50{
51
52// Physical Space Interpolation methods
53
54/** \brief this function interpolates a 1D function \f$f\f$ evaluated
55 * at the quadrature points of the basis \a fbasis0 to the
56 * function values at the quadrature points of the basis \a tbasis0
57 *
58 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
59 * of the basis \a fbasis0, this routine calculates, using
60 * \a (Q-1)th order polynomial interpolation, the function values
61 * at the \a Q2 quadrature points of the basis \a tbasis0.
62 *
63 * \param fbasis0 the basis at which's quadrature points the
64 * function is given
65 * \param from the array containg the function \f$ f\f$ evaluated
66 * at the quadrature points of \a fbasis0
67 * \param tbasis0 the basis to which's quadrature points the
68 * function should be interpolated
69 * \param to the array containg the function \f$ f\f$ evaluated
70 * at the quadrature points of \a tbasis0 (output of the function)
71 */
72// 1D Interpolation
73LIB_UTILITIES_EXPORT void Interp1D(const BasisKey &fbasis0,
74 const Array<OneD, const NekDouble> &from,
75 const BasisKey &tbasis0,
76 Array<OneD, NekDouble> &to);
77
78LIB_UTILITIES_EXPORT void Interp1D(const PointsKey &fpoints0,
79 const Array<OneD, const NekDouble> &from,
80 const PointsKey &tpoints0,
81 Array<OneD, NekDouble> &to);
82
83LIB_UTILITIES_EXPORT void Interp1D(const BasisKey &fbasis0,
84 const NekDouble *from,
85 const BasisKey &tbasis0, NekDouble *to);
86
87LIB_UTILITIES_EXPORT void Interp1D(const PointsKey &fpoints0,
88 const NekDouble *from,
89 const PointsKey &tpoints0, NekDouble *to);
90
91/** \brief this function interpolates a 2D function \f$f\f$ evaluated
92 * at the quadrature points of the 2D basis, constructed by
93 * \a fbasis0 and \a fbasis1, to the function values at the
94 * quadrature points of the 2D basis, constructed by \a tbasis0 and
95 * \a tbasis1
96 *
97 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
98 * of the first expansion basis, this routine calculates, using
99 * \a (Q-1)th order polynomial interpolation, the function values
100 * at the \a Q2 quadrature points of the second basis.
101 *
102 * \param fbasis0 the basis at which's quadrature points the
103 * function is given
104 * \param from the array containg the function \f$ f\f$ evaluated
105 * at the quadrature points of \a fbasis0
106 * \param tbasis0 the basis to which's quadrature points the
107 * function should be interpolated
108 * \param to the array containg the function \f$ f\f$ evaluated
109 * at the quadrature points of \a tbasis0 (output of the function)
110 */
111// 2D Interpolation
112LIB_UTILITIES_EXPORT void Interp2D(const BasisKey &fbasis0,
113 const BasisKey &fbasis1,
114 const Array<OneD, const NekDouble> &from,
115 const BasisKey &tbasis0,
116 const BasisKey &tbasis1,
117 Array<OneD, NekDouble> &to);
118
119LIB_UTILITIES_EXPORT void Interp2D(const PointsKey &fpoints0,
120 const PointsKey &fpoints1,
121 const Array<OneD, const NekDouble> &from,
122 const PointsKey &tpoints0,
123 const PointsKey &tpoints1,
124 Array<OneD, NekDouble> &to);
125
126LIB_UTILITIES_EXPORT void Interp2D(const PointsKey &fpoints0,
127 const PointsKey &fpoints1,
128 const NekDouble *from,
129 const PointsKey &tpoints0,
130 const PointsKey &tpoints1, NekDouble *to);
131
132/** \brief this function interpolates a 3D function \f$f\f$ evaluated
133 * at the quadrature points of the 3D basis, constructed by
134 * \a fbasis0, \a fbasis1, and \a fbasis2 to the function values at the
135 * quadrature points of the 3D basis, constructed by \a tbasis0,
136 * \a tbasis1, and \a tbasis2.
137 *
138 * Given a function \f$ f\f$ evaluated at the \a Q quadrature points
139 * of the first expansion basis, this routine calculates, using
140 * \a (Q-1)th order polynomial interpolation, the function values
141 * at the \a Q2 quadrature points of the second basis, and the function
142 * values at the \a Q3 quadrature points of the third basis.
143 *
144 * \param fbasis0 the basis at which's quadrature points the
145 * function is given
146 * \param from the array containg the function \f$ f\f$ evaluated
147 * at the quadrature points of \a fbasis0
148 * \param tbasis0 the basis to which's quadrature points the
149 * function should be interpolated
150 * \param to the array containg the function \f$ f\f$ evaluated
151 * at the quadrature points of \a tbasis0 (output of the function)
152 */
153// 3D interpolation
155 const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2,
156 const Array<OneD, const NekDouble> &from, const BasisKey &tbasis0,
157 const BasisKey &tbasis1, const BasisKey &tbasis2,
158 Array<OneD, NekDouble> &to);
159
161 const PointsKey &fpoints0, const PointsKey &fpoints1,
162 const PointsKey &fpoints2, const Array<OneD, const NekDouble> &from,
163 const PointsKey &tpoints0, const PointsKey &tpoints1,
164 const PointsKey &tpoints2, Array<OneD, NekDouble> &to);
165
167 const PointsKey &fpoints0, const PointsKey &fpoints1,
168 const PointsKey &fpoints2, const NekDouble *from, const PointsKey &tpoints0,
169 const PointsKey &tpoints1, const PointsKey &tpoints2, NekDouble *to);
170
171} // namespace LibUtilities
172} // namespace Nektar
173
174#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:49
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:164
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:103
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble