Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PointExp.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PointExp.cpp
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: Definition of a Point expansion
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #include <LocalRegions/PointExp.h>
37 
38 namespace Nektar
39 {
40  namespace LocalRegions
41  {
42 
44  StdExpansion (1,0),
45  StdExpansion0D(),
46  StdRegions::StdPointExp(),
47  Expansion (geom),
48  Expansion0D (geom)
49  {
50  m_ncoeffs = 1;
51  }
52 
54  {
55  }
56 
58  Array<OneD, NekDouble> &coords_1,
59  Array<OneD, NekDouble> &coords_2)
60  {
61  ASSERTL1(coords_0.num_elements() > 0,
62  "Coords_0 is of insufficient size.");
63  ASSERTL1(GetCoordim() < 2 || coords_1.num_elements() > 0,
64  "Coords_1 is of insufficient size.");
65  ASSERTL1(GetCoordim() < 3 || coords_2.num_elements() > 0,
66  "Coords_2 is of insufficient size.");
67 
69  NekDouble tmp;
70  switch(GetCoordim())
71  {
72  case 1:
73  v->GetCoords(coords_0[0], tmp, tmp);
74  break;
75  case 2:
76  v->GetCoords(coords_0[0], coords_1[0], tmp);
77  break;
78  case 3:
79  v->GetCoords(coords_0[0], coords_1[0], coords_2[0]);
80  break;
81  }
82  }
83 
86  Array<OneD, NekDouble> &outarray)
87  {
88  int nq = m_base[0]->GetNumPoints();
90 
92  &normals =
95  Vmath::Vmul (nq, &Fx[0], 1, &normals[0][0], 1, &Fn[0], 1);
96 
97  v_IProductWRTBase(Fn,outarray);
98  }
99 
100  }
101 }
PointExp(const SpatialDomains::PointGeomSharedPtr &m_geom)
Definition: PointExp.cpp:43
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointGeom.cpp:122
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Calculates the inner product of a given function f with the different modes of the expansion...
Expansion1DSharedPtr GetLeftAdjacentElementExp() const
Definition: Expansion0D.h:88
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:125
const NormalVector & GetVertexNormal(const int vertex) const
double NekDouble
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: PointExp.cpp:84
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
Definition: PointExp.cpp:57
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:218
Array< OneD, LibUtilities::BasisSharedPtr > m_base
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:169