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
42
44{
45class PointExp : virtual public StdRegions::StdPointExp,
46 virtual public Expansion0D
47{
48public:
51 LOCAL_REGIONS_EXPORT ~PointExp() override = default;
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
105 {
107 std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
108 v->GetCoords(x, y, z);
109 }
110
112 {
113 return std::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
114 }
115
116protected:
118 m_coeffs; //!< Array containing expansion coefficients
120 m_phys; //!< Array containing physical point which is likely to be the
121 //!< same as the coefficient but is defined for consistency (It
122 //!< is also used in Robin boundary conditions)
123
124 void v_GetCoords(Array<OneD, NekDouble> &coords_0,
125 Array<OneD, NekDouble> &coords_1,
126 Array<OneD, NekDouble> &coords_2) override;
127
129 Array<OneD, NekDouble> &outarray) override;
130};
131
132typedef std::shared_ptr<PointExp> PointExpSharedPtr;
133typedef std::vector<PointExpSharedPtr> PointExpVector;
134
136} // namespace Nektar::LocalRegions
137
138#endif // POINTEXP_H
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:242
#define LOCAL_REGIONS_EXPORT
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:273
Array< OneD, NekDouble > & UpdateCoeffs(void)
Definition: PointExp.h:79
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointExp.h:104
void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2) override
Definition: PointExp.cpp:47
const Array< OneD, const NekDouble > & GetCoeffs(void) const
Definition: PointExp.h:53
NekDouble GetCoeff(int i) const
Definition: PointExp.h:72
NekDouble GetPhys(int i) const
Definition: PointExp.h:65
const Array< OneD, const NekDouble > & GetPhys(void) const
Definition: PointExp.h:89
PointExp(const SpatialDomains::PointGeomSharedPtr &m_geom)
Definition: PointExp.cpp:40
void SetPhys(const NekDouble value)
Definition: PointExp.h:99
const SpatialDomains::PointGeomSharedPtr GetGeom() const
Definition: PointExp.h:111
~PointExp() override=default
Array< OneD, NekDouble > m_coeffs
Array containing expansion coefficients.
Definition: PointExp.h:118
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray) override
Definition: PointExp.cpp:74
Array< OneD, NekDouble > & UpdatePhys(void)
Definition: PointExp.h:94
void SetCoeff(const NekDouble value)
Definition: PointExp.h:84
NekDouble GetCoeffs(int i) const
Definition: PointExp.h:58
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:120
static const Array< OneD, PointExpSharedPtr > NullPointExpSharedPtrArray
Definition: PointExp.h:135
std::shared_ptr< PointExp > PointExpSharedPtr
Definition: PointExp.h:132
std::vector< PointExpSharedPtr > PointExpVector
Definition: PointExp.h:133
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:57
std::vector< double > z(NPUPPER)
double NekDouble