Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TriExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File TriExp.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: Expansion for triangular elements.
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef TRIEXP_H
37 #define TRIEXP_H
38 
39 #include <StdRegions/StdTriExp.h>
40 #include <SpatialDomains/TriGeom.h>
42 #include <LocalRegions/MatrixKey.h>
45 
46 namespace Nektar
47 {
48  namespace LocalRegions
49  {
50 
51  class TriExp: virtual public StdRegions::StdTriExp,
52  virtual public Expansion2D
53  {
54 
55  public:
56  /**
57  * @brief Constructor using BasisKey class for quadrature
58  * points and order definition
59  */
61  const LibUtilities::BasisKey &Ba,
62  const LibUtilities::BasisKey &Bb,
64 
65  LOCAL_REGIONS_EXPORT TriExp(const TriExp &T);
66 
68 
69  protected:
70  //-------------------------------
71  // Integration Methods
72  //-------------------------------
74  const Array<OneD, const NekDouble> &inarray);
75 
76  //----------------------------
77  // Differentiation Methods
78  //----------------------------
79  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
80  const Array<OneD, const NekDouble> &inarray,
81  Array<OneD, NekDouble> &out_d0,
82  Array<OneD, NekDouble> &out_d1,
83  Array<OneD, NekDouble> &out_d2
85  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
86  const int dir,
87  const Array<OneD, const NekDouble> &inarray,
88  Array<OneD, NekDouble> &outarray);
90  const Array<OneD, const NekDouble> &inarray,
91  const Array<OneD, const NekDouble> &direction,
92  Array<OneD, NekDouble> &out);
93 
94  //---------------------------------------
95  // Transforms
96  //---------------------------------------
97  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
98  const Array<OneD, const NekDouble> &inarray,
99  Array<OneD, NekDouble> &outarray);
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);
111  const int dir,
112  const Array<OneD, const NekDouble>& inarray,
113  Array<OneD, NekDouble> & outarray);
115  const Array<OneD, const NekDouble>& inarray,
116  Array<OneD, NekDouble> &outarray);
118  const Array<OneD, const NekDouble>& inarray,
119  Array<OneD, NekDouble> &outarray);
121  const int dir,
122  const Array<OneD, const NekDouble>& inarray,
123  Array<OneD, NekDouble> & outarray);
125  const int dir,
126  const Array<OneD, const NekDouble>& inarray,
127  Array<OneD, NekDouble> & outarray);
128 
130  const Array<OneD, const NekDouble> &Fx,
131  const Array<OneD, const NekDouble> &Fy,
132  const Array<OneD, const NekDouble> &Fz,
133  Array< OneD, NekDouble> &outarray);
134 
135  //---------------------------------------
136  // Evaluation functions
137  //---------------------------------------
138  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
139  const Array<OneD, const NekDouble>& Lcoords,
140  Array<OneD,NekDouble> &coords);
141  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
142  Array<OneD, NekDouble> &coords_1,
143  Array<OneD, NekDouble> &coords_2,
144  Array<OneD, NekDouble> &coords_3);
146  const Array<OneD, const NekDouble> &Lcoord,
147  const Array<OneD, const NekDouble> &physvals);
149  const Array<OneD, const NekDouble> &coord,
150  const Array<OneD, const NekDouble> & physvals);
152  const int edge,
153  const StdRegions::StdExpansionSharedPtr &EdgeExp,
154  const Array<OneD, const NekDouble> &inarray,
155  Array<OneD,NekDouble> &outarray);
157  const int edge,
158  const StdRegions::StdExpansionSharedPtr &EdgeExp,
159  const Array<OneD, const NekDouble> &inarray,
160  Array<OneD,NekDouble> &outarray,
161  StdRegions::Orientation orient);
163  const int edge,
164  const Array<OneD, const NekDouble> &inarray,
165  Array<OneD,NekDouble> &outarray);
167  const int edge,
168  Array<OneD, NekDouble> &outarray);
170  const int edge);
171 
172  //---------------------------------------
173  // Helper functions
174  //---------------------------------------
175  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
177  const NekDouble *data,
178  const std::vector<unsigned int > &nummodes,
179  const int mode_offset,
180  NekDouble *coeffs);
181  LOCAL_REGIONS_EXPORT virtual
183  LOCAL_REGIONS_EXPORT virtual
185  LOCAL_REGIONS_EXPORT virtual const
188  const int dir) const;
189 
190 
191  //---------------------------------------
192  // Matrix creation functions
193  //---------------------------------------
194  LOCAL_REGIONS_EXPORT virtual
196  const StdRegions::StdMatrixKey &mkey);
197  LOCAL_REGIONS_EXPORT virtual
199  const StdRegions::StdMatrixKey &mkey);
200  LOCAL_REGIONS_EXPORT virtual
202  const MatrixKey &mkey);
203  LOCAL_REGIONS_EXPORT virtual
205  const MatrixKey &mkey);
206  LOCAL_REGIONS_EXPORT virtual
208  const MatrixKey &mkey);
209  LOCAL_REGIONS_EXPORT virtual
211  const MatrixKey &mkey);
212 
214  const MatrixKey &mkey);
215 
216 
218  const Array<OneD, const NekDouble> &inarray,
219  Array<OneD,NekDouble> &outarray,
220  const StdRegions::StdMatrixKey &mkey);
222  const Array<OneD, const NekDouble> &inarray,
223  Array<OneD,NekDouble> &outarray,
224  const StdRegions::StdMatrixKey &mkey);
226  const int k1,
227  const int k2,
228  const Array<OneD, const NekDouble> &inarray,
229  Array<OneD,NekDouble> &outarray,
230  const StdRegions::StdMatrixKey &mkey);
232  const int i,
233  const Array<OneD, const NekDouble> &inarray,
234  Array<OneD,NekDouble> &outarray,
235  const StdRegions::StdMatrixKey &mkey);
237  const Array<OneD, const NekDouble> &inarray,
238  Array<OneD,NekDouble> &outarray,
239  const StdRegions::StdMatrixKey &mkey);
241  const Array<OneD, const NekDouble> &inarray,
242  Array<OneD,NekDouble> &outarray,
243  const StdRegions::StdMatrixKey &mkey);
245  const Array<OneD, const NekDouble> &inarray,
246  Array<OneD,NekDouble> &outarray,
247  const StdRegions::StdMatrixKey &mkey);
249  const Array<OneD, const NekDouble> &inarray,
250  Array<OneD,NekDouble> &outarray,
251  const StdRegions::StdMatrixKey &mkey);
253  const Array<OneD, const NekDouble> &inarray,
254  Array<OneD, NekDouble> &outarray,
255  Array<OneD, NekDouble> &wsp);
257  int numMin,
258  const Array<OneD, const NekDouble> &inarray,
259  Array<OneD,NekDouble> &outarray);
260 
262 
263  private:
266 
267  TriExp();
268  };
269 
270  // type defines for use of TriExp in a boost vector
271  typedef boost::shared_ptr<TriExp> TriExpSharedPtr;
272  typedef std::vector< TriExpSharedPtr > TriExpVector;
274 
275  }
276 }
277 
278 #endif