Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AdjointAdvection.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File AdjointAdvection.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 // License for the specific language governing rights and limitations under
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: TBA
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef NEKTAR_SOLVERS_ADJOINTADVECTION_H
37 #define NEKTAR_SOLVERS_ADJOINTADVECTION_H
38 
41 
42 namespace Nektar
43 {
44 
45 
46 /// Advection for the adjoint form of the linearised Navier-Stokes equations
48 {
50  {
53  };
54 
55  /// A map between matrix keys and their associated block matrices.
56  typedef map< FloquetMatType, DNekBlkMatSharedPtr> FloquetBlockMatrixMap;
57  /// A shared pointer to a BlockMatrixMap.
58  typedef boost::shared_ptr<FloquetBlockMatrixMap> FloquetBlockMatrixMapShPtr;
59 
60  public:
62 
63  /// Creates an instance of this class
66  }
67 
68  /// Name of class
69  static std::string className;
70 
71  protected:
73 
76  int m_expdim;
77 
78  /// Storage for base flow
79  Array<OneD, Array<OneD, NekDouble> > m_baseflow;
80 
81  //number of slices
82  int m_slices;
83  //period length
85  //interpolation vector
86  Array<OneD, Array<OneD, NekDouble> > m_interp;
87  //auxiliary variables
89  Array<OneD,NekDouble> m_tmpIN;
90  Array<OneD,NekDouble> m_tmpOUT;
91  bool m_useFFTW;
92 
93  /// flag to determine if use single mode or not
95  /// flag to determine if use half mode or not
96  bool m_HalfMode;
97  /// flag to determine if use multiple mode or not
101 
103  FloquetMatType mattype,
104  bool UseContCoeffs = false) const;
105 
107  FloquetMatType mattype,
108  bool UseContCoeffs = false) const;
109 
111 
113 
114  virtual ~AdjointAdvection();
115 
116  virtual void v_InitObject(
118  Array<OneD, MultiRegions::ExpListSharedPtr> pFields);
119 
120  virtual void v_Advect(
121  const int nConvectiveFields,
122  const Array<OneD, MultiRegions::ExpListSharedPtr> &fields,
123  const Array<OneD, Array<OneD, NekDouble> > &advVel,
124  const Array<OneD, Array<OneD, NekDouble> > &inarray,
125  Array<OneD, Array<OneD, NekDouble> > &outarray,
126  const NekDouble &time);
127 
128  virtual void v_SetBaseFlow(
129  const Array<OneD, Array<OneD, NekDouble> > &inarray);
130 
131  void UpdateBase(
132  const NekDouble m_slices,
133  const Array<OneD, const NekDouble> &inarray,
134  Array<OneD, NekDouble> &outarray,
135  const NekDouble m_time,
136  const NekDouble m_period);
137 
138  void DFT(
139  const string file,
140  Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
141  const NekDouble m_slices);
142 
143 
144  /// Import Base flow
145  void ImportFldBase(
146  std::string pInfile,
147  Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
148  int slice);
149 
150 
151  private:
152  ///Parameter for homogeneous expansions
154  {
159  };
160 
161  /// flag to determine if use or not the FFT for transformations
162  bool m_useFFT;
163 
165 
166  NekDouble m_LhomX; ///< physical length in X direction (if homogeneous)
167  NekDouble m_LhomY; ///< physical length in Y direction (if homogeneous)
168  NekDouble m_LhomZ; ///< physical length in Z direction (if homogeneous)
169 
170  int m_npointsX; ///< number of points in X direction (if homogeneous)
171  int m_npointsY; ///< number of points in Y direction (if homogeneous)
172  int m_npointsZ; ///< number of points in Z direction (if homogeneous)
173 
174  int m_HomoDirec; ///< number of homogenous directions
175 
176  int m_NumMode; ///< Mode to use in case of single mode analysis
177 
179 };
180 
181 }
182 
183 #endif //NEKTAR_SOLVERS_INCNAVIERSTOKES_H