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 // 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 #ifndef POINTEXP_H
37 #define POINTEXP_H
38 
39 #include <StdRegions/StdPointExp.h>
43 
44 namespace Nektar
45 {
46  namespace LocalRegions
47  {
48  class PointExp: virtual public StdRegions::StdPointExp, virtual public Expansion0D
49  {
50  public:
53 
54  inline const Array<OneD, const NekDouble>& GetCoeffs(void) const
55  {
56  return m_coeffs;
57  }
58 
59  inline NekDouble GetCoeffs(int i) const
60  {
61  ASSERTL1(i == 0,"index out of range");
62 
63  return m_coeffs[i];
64  }
65 
66  inline NekDouble GetPhys(int i) const
67  {
68  ASSERTL1(i == 0,"index out of range");
69 
70  return m_phys[i];
71  }
72 
73  inline NekDouble GetCoeff(int i) const
74  {
75  ASSERTL1(i == 0,"index out of range");
76 
77  return m_coeffs[i];
78  }
79 
81  {
82  return(m_coeffs);
83  }
84 
85  inline void SetCoeff(const NekDouble value)
86  {
87  m_coeffs[0] = value;
88  }
89 
90  inline const Array<OneD, const NekDouble>& GetPhys(void) const
91  {
92  return m_phys;
93  }
94 
96  {
97  return(m_phys);
98  }
99 
100  inline void SetPhys(const NekDouble value)
101  {
102  m_phys[0] = value;
103  }
104 
105  inline void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
106  {
107  SpatialDomains::PointGeomSharedPtr v = boost::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
108  v->GetCoords(x,y,z);
109  }
110 
112  {
113  return boost::dynamic_pointer_cast<SpatialDomains::PointGeom>(m_geom);
114  }
115 
116  protected:
117  Array<OneD, NekDouble > m_coeffs; //!< Array containing expansion coefficients
118  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)
119 
120  virtual void v_GetCoords(
121  Array<OneD, NekDouble> &coords_0,
122  Array<OneD, NekDouble> &coords_1,
123  Array<OneD, NekDouble> &coords_2);
124  };
125 
126  // type defines for use of PointExp in a boost vector
127  typedef boost::shared_ptr<PointExp> PointExpSharedPtr;
128  typedef std::vector<PointExpSharedPtr> PointExpVector;
130 
132  } //end of namespace
133 } //end of namespace
134 
135 #endif // POINTEXP_H
PointExp(const SpatialDomains::PointGeomSharedPtr &m_geom)
Definition: PointExp.cpp:43
NekDouble GetCoeff(int i) const
Definition: PointExp.h:73
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointGeom.cpp:122
const Array< OneD, const NekDouble > & GetPhys(void) const
Definition: PointExp.h:90
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:125
void SetCoeff(const NekDouble value)
Definition: PointExp.h:85
const SpatialDomains::PointGeomSharedPtr GetGeom() const
Definition: PointExp.h:111
void SetPhys(const NekDouble value)
Definition: PointExp.h:100
Array< OneD, NekDouble > m_coeffs
Array containing expansion coefficients.
Definition: PointExp.h:117
boost::shared_ptr< PointExp > PointExpSharedPtr
Definition: PointExp.h:127
std::vector< PointExpSharedPtr > PointExpVector
Definition: PointExp.h:128
double NekDouble
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void GetCoords(NekDouble &x, NekDouble &y, NekDouble &z)
Definition: PointExp.h:105
Array< OneD, NekDouble > & UpdateCoeffs(void)
Definition: PointExp.h:80
virtual void v_GetCoords(Array< OneD, NekDouble > &coords_0, Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2)
Definition: PointExp.cpp:57
const Array< OneD, const NekDouble > & GetCoeffs(void) const
Definition: PointExp.h:54
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
#define LOCAL_REGIONS_EXPORT
std::vector< PointExpSharedPtr >::iterator PointExpVectorIter
Definition: PointExp.h:129
Array< OneD, NekDouble > & UpdatePhys(void)
Definition: PointExp.h:95
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:191
NekDouble GetPhys(int i) const
Definition: PointExp.h:66
static const Array< OneD, PointExpSharedPtr > NullPointExpSharedPtrArray
Definition: PointExp.h:131
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
NekDouble GetCoeffs(int i) const
Definition: PointExp.h:59