Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StdExpansion3D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File StdExpansion3D.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: Daughter of StdExpansion. This class contains routine
33 // which are common to 3D expansion. Typically this inolves physiocal
34 // space operations.
35 //
36 ///////////////////////////////////////////////////////////////////////////////
37 
38 #ifndef STDEXP3D_H
39 #define STDEXP3D_H
40 
43 
44 namespace Nektar
45 {
46  namespace StdRegions
47  {
48 
50  typedef boost::shared_ptr<StdExpansion3D> StdExpansion3DSharedPtr;
51 
52  class StdExpansion3D: virtual public StdExpansion
53  {
54 
55  public:
58  const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc);
59  STD_REGIONS_EXPORT StdExpansion3D(const StdExpansion3D &T);
61 
62  // Differentiation
63 
64  /** \brief Calculate the 3D derivative in the local
65  * tensor/collapsed coordinate at the physical points
66  *
67  * This function is independent of the expansion basis and can
68  * therefore be defined for all tensor product distribution of
69  * quadrature points in a generic manner. The key operations are:
70  *
71  * - \f$ \frac{d}{d\eta_1} \rightarrow {\bf D^T_0 u } \f$ \n
72  * - \f$ \frac{d}{d\eta_2} \rightarrow {\bf D_1 u } \f$
73  * - \f$ \frac{d}{d\eta_3} \rightarrow {\bf D_2 u } \f$
74  *
75  * \param inarray array of physical points to be differentiated
76  * \param outarray_d1 the resulting array of derivative in the
77  * \f$\eta_1\f$ direction will be stored in outarray_d1 as output
78  * of the function
79  * \param outarray_d2 the resulting array of derivative in the
80  * \f$\eta_2\f$ direction will be stored in outarray_d2 as output
81  * of the function
82  * \param outarray_d3 the resulting array of derivative in the
83  * \f$\eta_3\f$ direction will be stored in outarray_d3 as output
84  * of the function
85  *
86  * Recall that:
87  * \f$
88  * \hspace{1cm} \begin{array}{llll}
89  * \mbox{Shape} & \mbox{Cartesian coordinate range} &
90  * \mbox{Collapsed coord.} &
91  * \mbox{Collapsed coordinate definition}\\
92  * \mbox{Hexahedral} & -1 \leq \xi_1,\xi_2, \xi_3 \leq 1
93  * & -1 \leq \eta_1,\eta_2, \eta_3 \leq 1
94  * & \eta_1 = \xi_1, \eta_2 = \xi_2, \eta_3 = \xi_3 \\
95  * \mbox{Tetrahedral} & -1 \leq \xi_1,\xi_2,\xi_3; \xi_1+\xi_2 +\xi_3 \leq -1
96  * & -1 \leq \eta_1,\eta_2, \eta_3 \leq 1
97  * & \eta_1 = \frac{2(1+\xi_1)}{-\xi_2 -\xi_3}-1, \eta_2 = \frac{2(1+\xi_2)}{1 - \xi_3}-1, \eta_3 = \xi_3 \\
98  * \end{array} \f$
99  */
101  Array<OneD, NekDouble> &outarray_d1,
102  Array<OneD, NekDouble> &outarray_d2,
103  Array<OneD, NekDouble> &outarray_d3);
104 
106  const Array<OneD, const NekDouble>& base0,
107  const Array<OneD, const NekDouble>& base1,
108  const Array<OneD, const NekDouble>& base2,
109  const Array<OneD, const NekDouble>& inarray,
110  Array<OneD, NekDouble>& outarray,
112  bool doCheckCollDir0,
113  bool doCheckCollDir1,
114  bool doCheckCollDir2);
115 
117  const Array<OneD, const NekDouble>& base0,
118  const Array<OneD, const NekDouble>& base1,
119  const Array<OneD, const NekDouble>& base2,
120  const Array<OneD, const NekDouble>& inarray,
121  Array<OneD, NekDouble> &outarray,
123  bool doCheckCollDir0,
124  bool doCheckCollDir1,
125  bool doCheckCollDir2);
126 
127  protected:
128 
129  /** \brief This function evaluates the expansion at a single
130  * (arbitrary) point of the domain
131  *
132  *
133  * Based on the value of the expansion at the quadrature points,
134  * this function calculates the value of the expansion at an
135  * arbitrary single points (with coordinates \f$ \mathbf{x_c}\f$
136  * given by the pointer \a coords). This operation, equivalent to
137  * \f[ u(\mathbf{x_c}) = \sum_p \phi_p(\mathbf{x_c}) \hat{u}_p \f]
138  * is evaluated using Lagrangian interpolants through the quadrature
139  * points:
140  * \f[ u(\mathbf{x_c}) = \sum_p h_p(\mathbf{x_c}) u_p\f]
141  *
142  * This function requires that the physical value array
143  * \f$\mathbf{u}\f$ (implemented as the attribute #phys)
144  * is set.
145  *
146  * \param coords the coordinates of the single point
147  * \return returns the value of the expansion at the single point
148  */
150  const Array<OneD, const NekDouble>& coords,
151  const Array<OneD, const NekDouble>& physvals);
152 
153 
156  const Array<OneD, const NekDouble >& physvals);
157 
159  const Array<OneD, const NekDouble>& base0,
160  const Array<OneD, const NekDouble>& base1,
161  const Array<OneD, const NekDouble>& base2,
162  const Array<OneD, const NekDouble>& inarray,
163  Array<OneD, NekDouble>& outarray,
165  bool doCheckCollDir0,
166  bool doCheckCollDir1,
167  bool doCheckCollDir2) = 0;
168 
170  const Array<OneD, const NekDouble>& base0,
171  const Array<OneD, const NekDouble>& base1,
172  const Array<OneD, const NekDouble>& base2,
173  const Array<OneD, const NekDouble>& inarray,
174  Array<OneD, NekDouble>& outarray,
176  bool doCheckCollDir0,
177  bool doCheckCollDir1,
178  bool doCheckCollDir2) = 0;
179 
181  const Array<OneD, const NekDouble> &inarray,
182  Array<OneD,NekDouble> &outarray,
183  const StdRegions::StdMatrixKey &mkey);
184 
186  const Array<OneD, const NekDouble> &inarray,
187  Array<OneD,NekDouble> &outarray,
188  const StdRegions::StdMatrixKey &mkey);
189 
191  const Array<OneD, const NekDouble>& inarray);
192 
194  const int face);
195 
197  const int face);
198 
199  STD_REGIONS_EXPORT virtual int v_GetTraceNcoeffs(const int i) const
200  {
201  return GetFaceNcoeffs(i);
202  }
203 
204  std::map<int, NormalVector> m_faceNormals;
205  std::map<int, bool> m_negatedNormals;
206 
207  private:
208 
209  virtual int v_GetShapeDimension() const
210  {
211  return 3;
212  }
213 
214  virtual int v_GetCoordim(void)
215  {
216  return 3;
217  }
218  STD_REGIONS_EXPORT const NormalVector & v_GetSurfaceNormal(const int id) const;
219  STD_REGIONS_EXPORT const NormalVector & v_GetFaceNormal(const int face) const;
220 
221  };
222 
224  const int facedir,
225  const LibUtilities::BasisType faceDirBasisType,
226  const int numpoints,
227  const int nummodes);
228 
230  const int facedir,
231  const LibUtilities::BasisType faceDirBasisType,
232  const int numpoints,
233  const int nummodes);
234  } //end of namespace
235 } //end of namespace
236 
237 #endif //STDEXP3D_H
void BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
virtual void v_LaplacianMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
boost::shared_ptr< StdExpansion3D > StdExpansion3DSharedPtr
const NormalVector & v_GetSurfaceNormal(const int id) const
LibUtilities::BasisKey EvaluateTriFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
virtual bool v_FaceNormalNegated(const int face)
virtual void v_BwdTrans_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)=0
std::map< int, bool > m_negatedNormals
void PhysTensorDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray_d1, Array< OneD, NekDouble > &outarray_d2, Array< OneD, NekDouble > &outarray_d3)
Calculate the 3D derivative in the local tensor/collapsed coordinate at the physical points...
The base class for all shapes.
Definition: StdExpansion.h:69
void IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)
LibUtilities::BasisKey EvaluateQuadFaceBasisKey(const int facedir, const LibUtilities::BasisType faceDirBasisType, const int numpoints, const int nummodes)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrates the specified function over the domain.
double NekDouble
std::map< int, NormalVector > m_faceNormals
int GetFaceNcoeffs(const int i) const
This function returns the number of expansion coefficients belonging to the i-th face.
Definition: StdExpansion.h:354
#define STD_REGIONS_EXPORT
const NormalVector & v_GetFaceNormal(const int face) const
virtual void v_NegateFaceNormal(const int face)
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
virtual int v_GetTraceNcoeffs(const int i) const
virtual int v_GetShapeDimension() const
virtual void v_HelmholtzMatrixOp_MatFree(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Describes the specification for a Basis.
Definition: Basis.h:50
virtual void v_IProductWRTBase_SumFacKernel(const Array< OneD, const NekDouble > &base0, const Array< OneD, const NekDouble > &base1, const Array< OneD, const NekDouble > &base2, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp, bool doCheckCollDir0, bool doCheckCollDir1, bool doCheckCollDir2)=0