Nektar++
Expansion0D.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File Expansion0D.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: Header file for Expansion0D routines
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef EXPANSION0D_H
36 #define EXPANSION0D_H
37 
38 #include <LocalRegions/Expansion.h>
43 
44 namespace Nektar
45 {
46  namespace LocalRegions
47  {
48  class Expansion0D;
49  typedef std::shared_ptr<Expansion0D> Expansion0DSharedPtr;
50  typedef std::vector< Expansion0DSharedPtr > Expansion0DVector;
51 
52  class Expansion0D: virtual public Expansion,
53  virtual public StdRegions::StdExpansion0D
54  {
55  public:
58 
60 
62 
64 
65  inline int GetLeftAdjacentElementVertex() const;
66 
67  inline int GetRightAdjacentElementVertex() const;
68 
69  inline void SetAdjacentElementExp(
70  int vertex,
72 
74 
75  protected:
76 
77  private:
82  };
83 
86  {
87  ASSERTL1(m_elementLeft.lock().get(),
88  "Left adjacent element not set.");
89 
90  return m_elementLeft.lock();
91  }
92 
95  {
96  ASSERTL1(m_elementLeft.lock().get(),
97  "Right adjacent element not set.");
98 
99  return m_elementRight.lock();
100  }
101 
103  {
104  return m_elementVertexLeft;
105  }
106 
108  {
109  return m_elementVertexRight;
110  }
111 
113  int vertex,
115  {
116  if (m_elementLeft.lock().get())
117  {
118  //ASSERTL1(!m_elementRight.lock().get(),
119  // "Both adjacent elements already set.");
120  m_elementRight = v;
121  m_elementVertexRight = vertex;
122  }
123  else
124  {
125  m_elementLeft = v;
126  m_elementVertexLeft = vertex;
127  }
128  }
129 
132  {
133  return std::dynamic_pointer_cast<SpatialDomains::
134  Geometry0D>(m_geom);
135 
136  }
137  } //end of namespace
138 } //end of namespace
139 
140 #endif
Expansion0D(SpatialDomains::Geometry0DSharedPtr pGeom)
Definition: Expansion0D.cpp:41
std::weak_ptr< Expansion1D > Expansion1DWeakPtr
Definition: Expansion1D.h:53
SpatialDomains::GeometrySharedPtr m_geom
Definition: Expansion.h:127
void SetAdjacentElementExp(int vertex, Expansion1DSharedPtr &v)
Definition: Expansion0D.h:112
Expansion1DSharedPtr GetLeftAdjacentElementExp() const
Definition: Expansion0D.h:85
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
Definition: Expansion0D.h:48
Expansion1DWeakPtr m_elementLeft
Definition: Expansion0D.h:78
Expansion1DWeakPtr m_elementRight
Definition: Expansion0D.h:79
Expansion1DSharedPtr GetRightAdjacentElementExp() const
Definition: Expansion0D.h:94
std::shared_ptr< Geometry0D > Geometry0DSharedPtr
Definition: Geometry0D.h:45
std::vector< Expansion0DSharedPtr > Expansion0DVector
Definition: Expansion0D.h:50
SpatialDomains::Geometry0DSharedPtr GetGeom0D() const
Definition: Expansion0D.h:131
#define LOCAL_REGIONS_EXPORT
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:51