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 
41 #include <StdRegions/StdPointExp.h>
42 
43 namespace Nektar
44 {
45 namespace LocalRegions
46 {
47 class PointExp : virtual public StdRegions::StdPointExp,
48  virtual public Expansion0D
49 {
50 public:
53  LOCAL_REGIONS_EXPORT virtual ~PointExp() override = default;
54 
55  inline const Array<OneD, const NekDouble> &GetCoeffs(void) const
56  {
57  return m_coeffs;
58  }
59 
60  inline NekDouble GetCoeffs(int i) const
61  {
62  ASSERTL1(i == 0, "index out of range");
63 
64  return m_coeffs[i];
65  }
66 
67  inline NekDouble GetPhys(int i) const
68  {
69  ASSERTL1(i == 0, "index out of range");
70 
71  return m_phys[i];
72  }
73 
74  inline NekDouble GetCoeff(int i) const
75  {
76  ASSERTL1(i == 0, "index out of range");
77 
78  return m_coeffs[i];
79  }
80 
82  {
83  return (m_coeffs);
84  }
85 
86  inline void SetCoeff(const NekDouble value)
87  {
88  m_coeffs[0] = value;
89  }
90 
91  inline const Array<OneD, const NekDouble> &GetPhys(void) const
92  {
93  return m_phys;
94  }
95 
97  {
98  return (m_phys);
99  }
100 
101  inline void SetPhys(const NekDouble value)
102  {
103  m_phys[0] = value;
104  }
105 
106  inline void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
107  {
109  std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
110  v->GetCoords(x, y, z);
111  }
112 
114  {
115  return std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
116  }
117 
118 protected:
120  m_coeffs; //!< Array containing expansion coefficients
122  m_phys; //!< Array containing physical point which is likely to be the
123  //!< same as the coefficient but is defined for consistency (It
124  //!< is also used in Robin boundary conditions)
125 
126  virtual void v_GetCoords(Array<OneD, NekDouble> &coords_0,
127  Array<OneD, NekDouble> &coords_1,
128  Array<OneD, NekDouble> &coords_2) override;
129 
130  virtual void v_NormVectorIProductWRTBase(
132  Array<OneD, NekDouble> &outarray) override;
133 };
134 
135 typedef std::shared_ptr<PointExp> PointExpSharedPtr;
136 typedef std::vector<PointExpSharedPtr> PointExpVector;
137 
139 } // namespace LocalRegions
140 } // namespace Nektar
141 
142 #endif // POINTEXP_H
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:249
#define LOCAL_REGIONS_EXPORT
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:275
const Array< OneD, const NekDouble > & GetPhys(void) const
Definition: PointExp.h:91
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointExp.h:106
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
Definition: PointExp.cpp:49
NekDouble GetCoeff(int i) const
Definition: PointExp.h:74
NekDouble GetPhys(int i) const
Definition: PointExp.h:67
PointExp(const SpatialDomains::PointGeomSharedPtr &m_geom)
Definition: PointExp.cpp:42
void SetPhys(const NekDouble value)
Definition: PointExp.h:101
const SpatialDomains::PointGeomSharedPtr GetGeom() const
Definition: PointExp.h:113
Array< OneD, NekDouble > & UpdatePhys(void)
Definition: PointExp.h:96
Array< OneD, NekDouble > m_coeffs
Array containing expansion coefficients.
Definition: PointExp.h:120
virtual void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray) override
Definition: PointExp.cpp:76
Array< OneD, NekDouble > & UpdateCoeffs(void)
Definition: PointExp.h:81
void SetCoeff(const NekDouble value)
Definition: PointExp.h:86
NekDouble GetCoeffs(int i) const
Definition: PointExp.h:60
const Array< OneD, const NekDouble > & GetCoeffs(void) const
Definition: PointExp.h:55
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:122
virtual ~PointExp() override=default
static const Array< OneD, PointExpSharedPtr > NullPointExpSharedPtrArray
Definition: PointExp.h:138
std::shared_ptr< PointExp > PointExpSharedPtr
Definition: PointExp.h:135
std::vector< PointExpSharedPtr > PointExpVector
Definition: PointExp.h:136
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble