Nektar++
Loading...
Searching...
No Matches
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:
50 LOCAL_REGIONS_EXPORT ~PointExp() override = default;
51
52 inline const Array<OneD, const NekDouble> &GetCoeffs(void) const
53 {
54 return m_coeffs;
55 }
56
57 inline NekDouble GetCoeffs(int i) const
58 {
59 ASSERTL1(i == 0, "index out of range");
60
61 return m_coeffs[i];
62 }
63
64 inline NekDouble GetPhys(int i) const
65 {
66 ASSERTL1(i == 0, "index out of range");
67
68 return m_phys[i];
69 }
70
71 inline NekDouble GetCoeff(int i) const
72 {
73 ASSERTL1(i == 0, "index out of range");
74
75 return m_coeffs[i];
76 }
77
79 {
80 return (m_coeffs);
81 }
82
83 inline void SetCoeff(const NekDouble value)
84 {
85 m_coeffs[0] = value;
86 }
87
88 inline const Array<OneD, const NekDouble> &GetPhys(void) const
89 {
90 return m_phys;
91 }
92
94 {
95 return (m_phys);
96 }
97
98 inline void SetPhys(const NekDouble value)
99 {
100 m_phys[0] = value;
101 }
102
103 inline void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
104 {
105 auto v = static_cast<SpatialDomains::PointGeom *>(m_geom);
106 v->GetCoords(x, y, z);
107 }
108
109 inline const SpatialDomains::PointGeom *GetGeom() const
110 {
111 return static_cast<SpatialDomains::PointGeom *>(m_geom);
112 }
113
114protected:
116 m_coeffs; //!< Array containing expansion coefficients
118 m_phys; //!< Array containing physical point which is likely to be the
119 //!< same as the coefficient but is defined for consistency (It
120 //!< is also used in Robin boundary conditions)
121
122 void v_GetCoords(Array<OneD, NekDouble> &coords_0,
123 Array<OneD, NekDouble> &coords_1,
124 Array<OneD, NekDouble> &coords_2) override;
125
127 Array<OneD, NekDouble> &outarray) override;
128};
129
130typedef std::shared_ptr<PointExp> PointExpSharedPtr;
131typedef std::vector<PointExpSharedPtr> PointExpVector;
132
134} // namespace Nektar::LocalRegions
135
136#endif // POINTEXP_H
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define LOCAL_REGIONS_EXPORT
SpatialDomains::Geometry * m_geom
Definition Expansion.h:279
Array< OneD, NekDouble > & UpdateCoeffs(void)
Definition PointExp.h:78
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition PointExp.h:103
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:52
NekDouble GetCoeff(int i) const
Definition PointExp.h:71
NekDouble GetPhys(int i) const
Definition PointExp.h:64
const Array< OneD, const NekDouble > & GetPhys(void) const
Definition PointExp.h:88
const SpatialDomains::PointGeom * GetGeom() const
Definition PointExp.h:109
void SetPhys(const NekDouble value)
Definition PointExp.h:98
~PointExp() override=default
Array< OneD, NekDouble > m_coeffs
Array containing expansion coefficients.
Definition PointExp.h:116
void v_NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray) override
Definition PointExp.cpp:73
Array< OneD, NekDouble > & UpdatePhys(void)
Definition PointExp.h:93
void SetCoeff(const NekDouble value)
Definition PointExp.h:83
NekDouble GetCoeffs(int i) const
Definition PointExp.h:57
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:118
1D geometry information
Definition Geometry0D.h:47
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition PointGeom.cpp:69
static const Array< OneD, PointExpSharedPtr > NullPointExpSharedPtrArray
Definition PointExp.h:133
std::shared_ptr< PointExp > PointExpSharedPtr
Definition PointExp.h:130
std::vector< PointExpSharedPtr > PointExpVector
Definition PointExp.h:131