Nektar++
PointExp.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PointExp.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 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Definition of a Point expansion
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef POINTEXP_H
36 #define POINTEXP_H
37 
38 #include <StdRegions/StdPointExp.h>
42 
43 namespace Nektar
44 {
45  namespace LocalRegions
46  {
47  class PointExp: virtual public StdRegions::StdPointExp, virtual public Expansion0D
48  {
49  public:
52 
53  inline const Array<OneD, const NekDouble>& GetCoeffs(void) const
54  {
55  return m_coeffs;
56  }
57 
58  inline NekDouble GetCoeffs(int i) const
59  {
60  ASSERTL1(i == 0,"index out of range");
61 
62  return m_coeffs[i];
63  }
64 
65  inline NekDouble GetPhys(int i) const
66  {
67  ASSERTL1(i == 0,"index out of range");
68 
69  return m_phys[i];
70  }
71 
72  inline NekDouble GetCoeff(int i) const
73  {
74  ASSERTL1(i == 0,"index out of range");
75 
76  return m_coeffs[i];
77  }
78 
80  {
81  return(m_coeffs);
82  }
83 
84  inline void SetCoeff(const NekDouble value)
85  {
86  m_coeffs[0] = value;
87  }
88 
89  inline const Array<OneD, const NekDouble>& GetPhys(void) const
90  {
91  return m_phys;
92  }
93 
95  {
96  return(m_phys);
97  }
98 
99  inline void SetPhys(const NekDouble value)
100  {
101  m_phys[0] = value;
102  }
103 
104  inline void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
105  {
106  SpatialDomains::PointGeomSharedPtr v = std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
107  v->GetCoords(x,y,z);
108  }
109 
111  {
112  return std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
113  }
114 
115  protected:
116  Array<OneD, NekDouble > m_coeffs; //!< Array containing expansion coefficients
117  Array<OneD, NekDouble > m_phys; //!< Array containing physical point which is likely to be the same as the coefficient but is defined for consistency (It is also used in Robin boundary conditions)
118 
119  virtual void v_GetCoords(
120  Array<OneD, NekDouble> &coords_0,
121  Array<OneD, NekDouble> &coords_1,
122  Array<OneD, NekDouble> &coords_2);
123 
124  virtual void v_NormVectorIProductWRTBase(
126  Array<OneD, NekDouble> &outarray);
127  };
128 
129  typedef std::shared_ptr<PointExp> PointExpSharedPtr;
130  typedef std::vector<PointExpSharedPtr> PointExpVector;
131 
133  } //end of namespace
134 } //end of namespace
135 
136 #endif // POINTEXP_H
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
#define LOCAL_REGIONS_EXPORT
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:272
const Array< OneD, const NekDouble > & GetPhys(void) const
Definition: PointExp.h:89
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointExp.h:104
Array< OneD, NekDouble > m_phys
Array containing physical point which is likely to be the same as the coefficient but is defined for ...
Definition: PointExp.h:117
NekDouble GetCoeff(int i) const
Definition: PointExp.h:72
NekDouble GetPhys(int i) const
Definition: PointExp.h:65
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
Definition: PointExp.cpp:56
PointExp(const SpatialDomains::PointGeomSharedPtr &m_geom)
Definition: PointExp.cpp:42
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: PointExp.cpp:83
void SetPhys(const NekDouble value)
Definition: PointExp.h:99
const SpatialDomains::PointGeomSharedPtr GetGeom() const
Definition: PointExp.h:110
Array< OneD, NekDouble > m_coeffs
Array containing expansion coefficients.
Definition: PointExp.h:116
Array< OneD, NekDouble > & UpdatePhys(void)
Definition: PointExp.h:94
Array< OneD, NekDouble > & UpdateCoeffs(void)
Definition: PointExp.h:79
void SetCoeff(const NekDouble value)
Definition: PointExp.h:84
NekDouble GetCoeffs(int i) const
Definition: PointExp.h:58
const Array< OneD, const NekDouble > & GetCoeffs(void) const
Definition: PointExp.h:53
static const Array< OneD, PointExpSharedPtr > NullPointExpSharedPtrArray
Definition: PointExp.h:132
std::shared_ptr< PointExp > PointExpSharedPtr
Definition: PointExp.h:129
std::vector< PointExpSharedPtr > PointExpVector
Definition: PointExp.h:130
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble