Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SegExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File SegExp.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: Header file for SegExp routines
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef SEGEXP_H
37 #define SEGEXP_H
38 
39 #include <StdRegions/StdSegExp.h>
41 #include <LocalRegions/MatrixKey.h>
44 
45 //#include <fstream>
46 
47 namespace Nektar
48 {
49  namespace LocalRegions
50  {
51 
52  class SegExp: virtual public StdRegions::StdSegExp, virtual public Expansion1D
53  {
54 
55  public:
57  const LibUtilities::BasisKey &Ba,
59 
60  LOCAL_REGIONS_EXPORT SegExp(const SegExp &S);
61 
63 
64  protected:
65 
66  //----------------------------
67  // Integration Methods
68  //----------------------------
70  const Array<OneD, const NekDouble>& inarray);
71 
72  //-----------------------------
73  // Differentiation Methods
74  //-----------------------------
75  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
76  const Array<OneD, const NekDouble>& inarray,
77  Array<OneD,NekDouble> &out_d0,
78  Array<OneD,NekDouble> &out_d1 = NullNekDouble1DArray,
79  Array<OneD,NekDouble> &out_d2 = NullNekDouble1DArray);
80 
81  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(const int dir,
82  const Array<OneD, const NekDouble>& inarray,
83  Array<OneD, NekDouble> &outarray);
84 
86  const Array<OneD, const NekDouble>& inarray,
87  Array<OneD, NekDouble> &out_ds);
88 
90  const Array<OneD, const NekDouble>& inarray,
91  Array<OneD, NekDouble>& out_dn);
92 
93  //-----------------------------
94  // Transforms
95  //-----------------------------
96  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
97  const Array<OneD, const NekDouble>& inarray,
98  Array<OneD,NekDouble> &outarray);
99 
101  const Array<OneD, const NekDouble>& inarray,
102  Array<OneD, NekDouble> &outarray);
103 
104  //-----------------------------
105  // Inner product functions
106  //-----------------------------
108  const Array<OneD, const NekDouble>& inarray,
109  Array<OneD, NekDouble> &outarray);
110 
112  const Array<OneD, const NekDouble>& base,
113  const Array<OneD, const NekDouble>& inarray,
114  Array<OneD, NekDouble> &outarray,
115  int coll_check);
116 
118  const int dir,
119  const Array<OneD, const NekDouble>& inarray,
120  Array<OneD, NekDouble> & outarray);
121 
123  const Array<OneD, const NekDouble> &Fx,
124  const Array<OneD, const NekDouble> &Fy,
125  Array<OneD, NekDouble> &outarray);
126 
127  //-----------------------------
128  // Evaluation functions
129  //-----------------------------
131  const Array<OneD, const NekDouble> &Lcoord,
132  const Array<OneD, const NekDouble> &physvals);
133 
135  const Array<OneD, const NekDouble>& coord,
136  const Array<OneD, const NekDouble> & physvals);
137 
138  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
139  const Array<OneD, const NekDouble>& Lcoords,
140  Array<OneD,NekDouble> &coords);
141 
142  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
143  Array<OneD, NekDouble> &coords_1,
144  Array<OneD, NekDouble> &coords_2,
145  Array<OneD, NekDouble> &coords_3);
146 
148  const int vertex,
149  const Array<OneD, const NekDouble> &inarray,
150  NekDouble &outarray);
151 
152  //-----------------------------
153  // Helper functions
154  //-----------------------------
155  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
156 
158  Array<OneD, NekDouble> &coeffs,
160 
163  Array<OneD, const NekDouble> &inarray,
164  Array<OneD, NekDouble> &outarray);
165 
166  LOCAL_REGIONS_EXPORT virtual int v_GetNumPoints(const int dir) const;
167 
168  LOCAL_REGIONS_EXPORT virtual int v_GetNcoeffs(void) const;
169 
170  LOCAL_REGIONS_EXPORT virtual const
172 
173  LOCAL_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
174 
175  LOCAL_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
176 
178  const int vertex);
179 
181 
183 
185  const NekDouble *data,
186  const std::vector<unsigned int > &nummodes,
187  const int mode_offset,
188  NekDouble *coeffs);
189 
190  LOCAL_REGIONS_EXPORT virtual const
191  Array<OneD, const NekDouble>& v_GetPhysNormals(void);
192 
193  //-----------------------------
194  // Operator creation functions
195  //-----------------------------
197  const Array<OneD, const NekDouble> &inarray,
198  Array<OneD, NekDouble> &outarray,
199  const StdRegions::StdMatrixKey &mkey);
200 
202  const Array<OneD, const NekDouble> &inarray,
203  Array<OneD, NekDouble> &outarray,
204  const StdRegions::StdMatrixKey &mkey);
205 
206  //-----------------------------
207  // Matrix creation functions
208  //-----------------------------
209 
212 
214 
217 
219  const MatrixKey &mkey);
220 
222  v_GetLocMatrix(const MatrixKey &mkey);
223 
225  v_GetLocStaticCondMatrix(const MatrixKey &mkey);
226 
228  const MatrixKey &mkey);
229 
230  private:
235 
236  SegExp();
237 
239  const Array<OneD,NekDouble> &inarray,
240  Array<OneD,NekDouble> &outarray);
241 
242 
243  /// \todo Same method exists in ExpList and everyone references
244  /// ExpList::MultiplyByElmtInvMass. Remove this one?
246  const Array<OneD, const NekDouble>& inarray,
247  Array<OneD,NekDouble> &outarray);
248 
249  };
250 
251  // type defines for use of SegExp in a boost vector
252  typedef boost::shared_ptr<SegExp> SegExpSharedPtr;
253  typedef std::vector< SegExpSharedPtr > SegExpVector;
255 
256 
257  } //end of namespace
258 } //end of namespace
259 
260 #endif // SEGEXP_H