Nektar++
PrismExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PrismExp.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 PrismExp routines
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #ifndef PRISMEXP_H
37 #define PRISMEXP_H
38 
39 #include <StdRegions/StdPrismExp.h>
41 #include <LocalRegions/MatrixKey.h>
45 
46 namespace Nektar
47 {
48  namespace LocalRegions
49  {
50  class PrismExp : virtual public StdRegions::StdPrismExp,
51  virtual public Expansion3D
52  {
53  public:
54  /// \brief Constructor using BasisKey class for quadrature
55  /// points and order definition
57  const LibUtilities::BasisKey &Bb,
58  const LibUtilities::BasisKey &Bc,
60 
61  LOCAL_REGIONS_EXPORT PrismExp(const PrismExp &T);
62 
64 
65  protected:
66  //-------------------------------
67  // Integration Methods
68  //-------------------------------
70  const Array<OneD, const NekDouble>& inarray);
71 
72 
73  //----------------------------
74  // Differentiation Methods
75  //----------------------------
76  LOCAL_REGIONS_EXPORT virtual void v_PhysDeriv(
77  const Array<OneD, const NekDouble>& inarray,
78  Array<OneD, NekDouble>& out_d0,
79  Array<OneD, NekDouble>& out_d1,
80  Array<OneD, NekDouble>& out_d2);
81 
82 
83  //---------------------------------------
84  // Transforms
85  //---------------------------------------
86  LOCAL_REGIONS_EXPORT virtual void v_FwdTrans(
87  const Array<OneD, const NekDouble> &inarray,
88  Array<OneD, NekDouble> &outarray);
89 
90 
91  //---------------------------------------
92  // Inner product functions
93  //---------------------------------------
95  const Array<OneD, const NekDouble>& inarray,
96  Array<OneD, NekDouble>& outarray);
98  const Array<OneD, const NekDouble>& inarray,
99  Array<OneD, NekDouble>& outarray,
100  bool multiplybyweights = true);
102  const int dir,
103  const Array<OneD, const NekDouble>& inarray,
104  Array<OneD, NekDouble>& outarray);
106  const int dir,
107  const Array<OneD, const NekDouble>& inarray,
108  Array<OneD, NekDouble>& outarray);
109 
110 
111  //---------------------------------------
112  // Evaluation functions
113  //---------------------------------------
114  LOCAL_REGIONS_EXPORT virtual void v_GetCoord(
115  const Array<OneD, const NekDouble> &Lcoords,
116  Array<OneD, NekDouble> &coords);
117 
118  LOCAL_REGIONS_EXPORT virtual void v_GetCoords(
119  Array<OneD, NekDouble> &coords_1,
120  Array<OneD, NekDouble> &coords_2,
121  Array<OneD, NekDouble> &coords_3);
122 
124  const Array<OneD, const NekDouble> &Lcoord,
125  const Array<OneD, const NekDouble> &physvals);
126 
128  const Array<OneD, const NekDouble>& coord,
129  const Array<OneD, const NekDouble>& physvals);
130 
131 
132  //---------------------------------------
133  // Helper functions
134  //---------------------------------------
135 
136  LOCAL_REGIONS_EXPORT virtual
138  LOCAL_REGIONS_EXPORT virtual int v_GetCoordim();
140  const NekDouble *data,
141  const std::vector<unsigned int > &nummodes,
142  const int mode_offset,
143  NekDouble * coeffs);
145  const int face,
146  const StdRegions::StdExpansionSharedPtr &FaceExp,
147  const Array<OneD, const NekDouble> &inarray,
148  Array<OneD, NekDouble> &outarray,
149  StdRegions::Orientation orient);
150 
152  const int face,
153  const StdRegions::StdExpansionSharedPtr &FaceExp,
154  const Array<OneD, const NekDouble> &inarray,
155  Array<OneD, NekDouble> &outarray,
156  StdRegions::Orientation orient);
157 
158  LOCAL_REGIONS_EXPORT void v_ComputeFaceNormal(const int face);
159 
160  //---------------------------------------
161  // Operator creation functions
162  //---------------------------------------
164  const Array<OneD, const NekDouble> &inarray,
165  Array<OneD,NekDouble> &outarray,
166  const StdRegions::StdMatrixKey &mkey);
168  const Array<OneD, const NekDouble> &inarray,
169  Array<OneD,NekDouble> &outarray,
170  const StdRegions::StdMatrixKey &mkey);
172  const int k1,
173  const int k2,
174  const Array<OneD, const NekDouble> &inarray,
175  Array<OneD,NekDouble> &outarray,
176  const StdRegions::StdMatrixKey &mkey);
178  const Array<OneD, const NekDouble> &inarray,
179  Array<OneD, NekDouble> &outarray,
180  const StdRegions::StdMatrixKey &mkey);
182  const Array<OneD, const NekDouble> &inarray,
183  Array<OneD,NekDouble> &outarray,
184  const StdRegions::StdMatrixKey &mkey);
185 
187  Array<OneD, NekDouble> &array,
188  const StdRegions::StdMatrixKey &mkey);
189  //---------------------------------------
190  // Matrix creation functions
191  //---------------------------------------
193  const StdRegions::StdMatrixKey &mkey);
195  const StdRegions::StdMatrixKey &mkey);
197  const MatrixKey &mkey);
199  const MatrixKey &mkey);
201  const MatrixKey &mkey);
203  const MatrixKey &mkey);
205  const MatrixKey &mkey);
206 
209  Array<OneD, int> &conn,
210  bool standard = true);
211 
212 
213  private:
218 
220  const Array<OneD, const NekDouble> &inarray,
221  Array<OneD, NekDouble> &outarray,
223  };
224 
225  // type defines for use of PrismExp in a boost vector
226  typedef boost::shared_ptr<PrismExp> PrismExpSharedPtr;
227  typedef std::vector<PrismExpSharedPtr> PrismExpVector;
229  } //end of namespace
230 } //end of namespace
231 
232 #define H_PRISMEXP
233 #endif
virtual void v_HelmholtzMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1178
virtual void v_GetFacePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Definition: PrismExp.cpp:593
LibUtilities::NekManager< MatrixKey, DNekScalMat, MatrixKey::opLess > m_matrixManager
Definition: PrismExp.h:215
virtual void v_GetCoord(const Array< OneD, const NekDouble > &Lcoords, Array< OneD, NekDouble > &coords)
Get the coordinates #coords at the local coordinates #Lcoords.
Definition: PrismExp.cpp:461
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2, Array< OneD, NekDouble > &coords_3)
Definition: PrismExp.cpp:479
void v_IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product .
Definition: PrismExp.cpp:342
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculate the inner product of inarray with respect to the basis B=base0*base1*base2 and put into out...
Definition: PrismExp.cpp:270
virtual void v_GeneralMatrixOp_MatOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1186
virtual void v_GetSimplexEquiSpacedConnectivity(Array< OneD, int > &conn, bool standard=true)
Definition: PrismExp.cpp:1896
virtual DNekScalBlkMatSharedPtr v_GetLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1281
virtual void v_MassMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1152
boost::shared_ptr< DNekMat > DNekMatSharedPtr
Definition: NekTypeDefs.hpp:70
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
Calculate the derivative of the physical points.
Definition: PrismExp.cpp:135
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Forward transform from physical quadrature space stored in inarray and evaluate the expansion coeffic...
Definition: PrismExp.cpp:215
boost::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
DNekScalMatSharedPtr CreateMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1291
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
Integrate the physical point list inarray over prismatic region and return the value.
Definition: PrismExp.cpp:109
virtual DNekMatSharedPtr v_CreateStdMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1265
virtual NekDouble v_StdPhysEvaluate(const Array< OneD, const NekDouble > &Lcoord, const Array< OneD, const NekDouble > &physvals)
Definition: PrismExp.cpp:492
virtual void v_LaplacianMatrixOp_MatFree_Kernel(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, Array< OneD, NekDouble > &wsp)
Calculate the Laplacian multiplication in a matrix-free manner.
Definition: PrismExp.cpp:1740
LibUtilities::NekManager< MatrixKey, DNekScalBlkMat, MatrixKey::opLess > m_staticCondMatrixManager
Definition: PrismExp.h:217
virtual DNekMatSharedPtr v_GenMatrix(const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1242
std::vector< PrismExpSharedPtr >::iterator PrismExpVectorIter
Definition: PrismExp.h:228
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
Definition: NekTypeDefs.hpp:66
virtual void v_IProductWRTBase_SumFac(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool multiplybyweights=true)
Definition: PrismExp.cpp:277
std::vector< PrismExpSharedPtr > PrismExpVector
Definition: PrismExp.h:227
boost::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
Definition: NekTypeDefs.hpp:74
PrismExp(const LibUtilities::BasisKey &Ba, const LibUtilities::BasisKey &Bb, const LibUtilities::BasisKey &Bc, const SpatialDomains::PrismGeomSharedPtr &geom)
Constructor using BasisKey class for quadrature points and order definition.
Definition: PrismExp.cpp:47
virtual void v_SVVLaplacianFilter(Array< OneD, NekDouble > &array, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1208
void v_DropLocStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1286
virtual void v_GetTracePhysVals(const int face, const StdRegions::StdExpansionSharedPtr &FaceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient)
Returns the physical values at the quadrature points of a face.
Definition: PrismExp.cpp:583
void v_ComputeFaceNormal(const int face)
Get the normals along specficied face Get the face normals interplated to a points0 x points 0 type d...
Definition: PrismExp.cpp:882
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:49
double NekDouble
boost::shared_ptr< PrismExp > PrismExpSharedPtr
Definition: PrismExp.h:226
virtual DNekScalMatSharedPtr v_GetLocMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1276
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
Definition: PrismGeom.h:109
virtual NekDouble v_PhysEvaluate(const Array< OneD, const NekDouble > &coord, const Array< OneD, const NekDouble > &physvals)
This function evaluates the expansion at a single (arbitrary) point of the domain.
Definition: PrismExp.cpp:500
virtual void v_ExtractDataToCoeffs(const NekDouble *data, const std::vector< unsigned int > &nummodes, const int mode_offset, NekDouble *coeffs)
Unpack data from input file assuming it comes from the same expansion type.
Definition: PrismExp.cpp:522
void v_IProductWRTDerivBase_SumFac(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Definition: PrismExp.cpp:350
Used to lookup the create function in NekManager.
Definition: MatrixKey.h:68
#define LOCAL_REGIONS_EXPORT
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
virtual void v_LaplacianMatrixOp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::StdMatrixKey &mkey)
Definition: PrismExp.cpp:1160
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
virtual StdRegions::StdExpansionSharedPtr v_GetStdExp(void) const
Definition: PrismExp.cpp:449
DNekScalBlkMatSharedPtr CreateStaticCondMatrix(const MatrixKey &mkey)
Definition: PrismExp.cpp:1608
Describes the specification for a Basis.
Definition: Basis.h:50