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 
40 #include <MultiRegions/ExpList.h>
42 
43 namespace Nektar
44 {
45 namespace FieldUtils
46 {
47 
48 /// A class that contains algorithms for interpolation between pts fields,
49 /// expansions and different meshes
51 {
52 public:
53  /**
54  * @brief Constructor of the Interpolator class
55  *
56  * @param method interpolation method, defaults to a sensible value if not
57  * 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,
73  NekDouble filtWidth = 0.0,
74  int maxPts = 1000)
75  : LibUtilities::Interpolator(method, coordId, filtWidth, maxPts)
76  {
77  }
78 
79  /// Interpolate from an expansion to an expansion
81  const std::vector<MultiRegions::ExpListSharedPtr> expInField,
82  std::vector<MultiRegions::ExpListSharedPtr> &expOutField,
83  NekDouble def_value = 0.0);
84 
85  /// Interpolate from an expansion to a pts field
87  const std::vector<MultiRegions::ExpListSharedPtr> expInField,
89  NekDouble def_value = 0.0);
90 
91  /// Interpolate from a pts field to an expansion
93  const LibUtilities::PtsFieldSharedPtr ptsInField,
94  std::vector<MultiRegions::ExpListSharedPtr> &expOutField);
95 
96  /// Interpolate from a pts field to a pts field
98  const LibUtilities::PtsFieldSharedPtr ptsInField,
99  LibUtilities::PtsFieldSharedPtr &ptsOutField);
100 
101 protected:
102  /// input field
103  std::vector<MultiRegions::ExpListSharedPtr> m_expInField;
104  /// output field
105  std::vector<MultiRegions::ExpListSharedPtr> m_expOutField;
106 };
107 
108 typedef std::shared_ptr<Interpolator> InterpolatorSharedPtr;
109 
110 }
111 }
112 
113 #endif
#define FIELD_UTILS_EXPORT
A class that contains algorithms for interpolation between pts fields, expansions and different meshe...
std::vector< MultiRegions::ExpListSharedPtr > m_expInField
input field
Interpolator(LibUtilities::InterpMethod method=LibUtilities::eNoMethod, short int coordId=-1, NekDouble filtWidth=0.0, int maxPts=1000)
Constructor of the Interpolator class.
FIELD_UTILS_EXPORT void Interpolate(const std::vector< MultiRegions::ExpListSharedPtr > expInField, std::vector< MultiRegions::ExpListSharedPtr > &expOutField, NekDouble def_value=0.0)
Interpolate from an expansion to an expansion.
std::vector< MultiRegions::ExpListSharedPtr > m_expOutField
output field
A class that contains algorithms for interpolation between pts fields, expansions and different meshe...
std::shared_ptr< Interpolator > InterpolatorSharedPtr
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:182
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble