Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StdTetExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdTetExp.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 field for tetrahedral routines built upon
33 // StdExpansion3D
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIB_STDREGIONS_STDTETEXP_H
38 #define NEKTAR_LIB_STDREGIONS_STDTETEXP_H
39 
43 
44 namespace Nektar
45 {
46  namespace StdRegions
47  {
48  class StdMatrixKey;
49 
50 
51  class StdTetExp : virtual public StdExpansion3D
52  {
53 
54  public:
55 
58  const LibUtilities::BasisKey &Ba,
59  const LibUtilities::BasisKey &Bb,
60  const LibUtilities::BasisKey &Bc);
62  const LibUtilities::BasisKey &Ba,
63  const LibUtilities::BasisKey &Bb,
64  const LibUtilities::BasisKey &Bc,
65  NekDouble *coeffs,
66  NekDouble *phys);
67  STD_REGIONS_EXPORT StdTetExp(const StdTetExp &T);
69 
71  {
73  }
74 
75 
76  /** \brief Single Point Evaluation */
77  STD_REGIONS_EXPORT NekDouble PhysEvaluate3D(const Array<OneD, const NekDouble>& coords, const Array<OneD, const NekDouble> & physvals);
78 
79 
80  protected:
81  //----------------------------
82  // Differentiation Methods
83  //----------------------------
84  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
85  const Array<OneD, const NekDouble>& inarray,
86  Array<OneD, NekDouble>& out_dx,
87  Array<OneD, NekDouble>& out_dy,
88  Array<OneD, NekDouble>& out_dz);
89  STD_REGIONS_EXPORT virtual void v_PhysDeriv(
90  const int dir,
91  const Array<OneD, const NekDouble>& inarray,
92  Array<OneD, NekDouble>& outarray);
94  const Array<OneD, const NekDouble>& inarray,
95  Array<OneD, NekDouble>& out_d0,
96  Array<OneD, NekDouble>& out_d1,
97  Array<OneD, NekDouble>& out_d2);
99  const int dir,
100  const Array<OneD, const NekDouble>& inarray,
101  Array<OneD, NekDouble>& outarray);
102 
103  //---------------------------------------
104  // Transforms
105  //---------------------------------------
106  STD_REGIONS_EXPORT virtual void v_BwdTrans(
107  const Array<OneD, const NekDouble>& inarray,
108  Array<OneD, NekDouble>& outarray);
110  const Array<OneD, const NekDouble>& inarray,
111  Array<OneD, NekDouble>& outarray);
113  const Array<OneD, const NekDouble>& base0,
114  const Array<OneD, const NekDouble>& base1,
115  const Array<OneD, const NekDouble>& base2,
116  const Array<OneD, const NekDouble>& inarray,
117  Array<OneD, NekDouble>& outarray,
118  Array<OneD, NekDouble>& wsp,
119  bool doCheckCollDir0,
120  bool doCheckCollDir1,
121  bool doCheckCollDir2);
122  STD_REGIONS_EXPORT virtual void v_FwdTrans(
123  const Array<OneD, const NekDouble>& inarray,
124  Array<OneD, NekDouble>& outarray );
125 
126  //---------------------------------------
127  // Inner product functions
128  //---------------------------------------
130  const Array<OneD, const NekDouble>& inarray,
131  Array<OneD, NekDouble>& outarray);
133  const Array<OneD, const NekDouble>& inarray,
134  Array<OneD, NekDouble>& outarray);
136  const Array<OneD, const NekDouble>& inarray,
137  Array<OneD, NekDouble>& outarray);
139  const Array<OneD, const NekDouble>& base0,
140  const Array<OneD, const NekDouble>& base1,
141  const Array<OneD, const NekDouble>& base2,
142  const Array<OneD, const NekDouble>& inarray,
143  Array<OneD, NekDouble>& outarray,
144  Array<OneD, NekDouble>& wsp,
145  bool doCheckCollDir0,
146  bool doCheckCollDir1,
147  bool doCheckCollDir2);
149  const int dir,
150  const Array<OneD, const NekDouble>& inarray,
151  Array<OneD, NekDouble>& outarray);
153  const int dir,
154  const Array<OneD, const NekDouble>& inarray,
155  Array<OneD, NekDouble>& outarray);
157  const int dir,
158  const Array<OneD, const NekDouble>& inarray,
159  Array<OneD, NekDouble>& outarray);
160 
161 
162  //---------------------------------------
163  // Evaluation functions
164  //---------------------------------------
166  const Array<OneD, const NekDouble>& xi,
167  Array<OneD, NekDouble>& eta);
168  STD_REGIONS_EXPORT virtual void v_GetCoords(
169  Array<OneD, NekDouble> &coords_x,
170  Array<OneD, NekDouble> &coords_y,
171  Array<OneD, NekDouble> &coords_z);
172  STD_REGIONS_EXPORT virtual void v_FillMode(
173  const int mode,
174  Array<OneD, NekDouble>& outarray);
175 
176 
177  //---------------------------
178  // Helper functions
179  //---------------------------
180  STD_REGIONS_EXPORT virtual int v_GetNverts() const;
181  STD_REGIONS_EXPORT virtual int v_GetNedges() const;
182  STD_REGIONS_EXPORT virtual int v_GetNfaces() const;
184  STD_REGIONS_EXPORT virtual int v_NumBndryCoeffs() const;
185  STD_REGIONS_EXPORT virtual int v_NumDGBndryCoeffs() const;
186  STD_REGIONS_EXPORT virtual int v_GetEdgeNcoeffs(const int i) const;
187  STD_REGIONS_EXPORT virtual int v_GetTotalEdgeIntNcoeffs() const;
188  STD_REGIONS_EXPORT virtual int v_GetFaceNcoeffs(const int i) const;
190  const int i) const;
191  STD_REGIONS_EXPORT virtual int v_GetTotalFaceIntNcoeffs() const;
192  STD_REGIONS_EXPORT virtual int v_GetFaceNumPoints(const int i) const;
194  const int i, const int j) const;
196  const std::vector<unsigned int> &nummodes,
197  int &modes_offset);
199  v_DetFaceBasisKey(const int i, const int k) const;
201  const int i) const;
203 
204 
205  //--------------------------
206  // Mappings
207  //--------------------------
209  const int fid,
210  const Orientation faceOrient,
211  Array<OneD, unsigned int> &maparray,
212  Array<OneD, int> &signarray,
213  int nummodesA = -1,
214  int nummodesB = -1);
215  STD_REGIONS_EXPORT virtual int v_GetVertexMap(int localVertexId,
216  bool useCoeffPacking = false); STD_REGIONS_EXPORT virtual void v_GetEdgeInteriorMap(const int eid,
217  const Orientation edgeOrient,
218  Array<OneD, unsigned int> &maparray,
219  Array<OneD, int> &signarray);
221  const int fid,
222  const Orientation faceOrient,
223  Array<OneD, unsigned int> &maparray,
224  Array<OneD, int>& signarray);
226  Array<OneD, unsigned int>& outarray);
228  Array<OneD, unsigned int>& outarray);
229 
230  //---------------------------------------
231  // Wrapper functions
232  //---------------------------------------
234  const StdMatrixKey &mkey);
236  const StdMatrixKey &mkey);
237 
239  const Array<OneD, const NekDouble>& inarray,
240  Array<OneD, NekDouble>& outarray);
241 
242  STD_REGIONS_EXPORT virtual void v_SVVLaplacianFilter(Array<OneD, NekDouble> &array, const StdMatrixKey &mkey);
243  private:
244  //---------------------------------------
245  // Private helper functions
246  //---------------------------------------
247  STD_REGIONS_EXPORT int GetMode(const int i, const int j, const int k);
248  };
249 
250  typedef boost::shared_ptr<StdTetExp> StdTetExpSharedPtr;
251  } //end of namespace
252 } //end of namespace
253 
254 #endif //STDTETEXP_H