Class documentation of Concepts

Loading...
Searching...
No Matches
element.hh
Go to the documentation of this file.
1
6#ifndef dgElement_hh
7#define dgElement_hh
8
9#include "basics/typedefs.hh"
10#include "space/element.hh"
11#include "geometry/cell3D.hh"
13#include "function/vector.hh"
14#include "space/tmatrix.hh"
16#include "space/postProcess.hh"
17#include "graphics/dataDX.hh"
18
19namespace linDG3D {
20
21 using concepts::Real;
22
23 // Forward declarations
24 class FvdgP0TetGraphics;
25 class FvdgP1TetGraphics;
26
27 // ************************************************************** Elements **
32 public:
34 FvdgElement(const concepts::Tetrahedron3d& cell, uint idx[], uint m);
36 const concepts::Tetrahedron& support() const { return cell_.connector(); }
38 const concepts::TMatrixBase<Real>& T() const { return *T_; }
40 const concepts::Real3d vertex(const uint i) const {
41 return cell_.vertex(i);
42 }
44 virtual const concepts::Tetrahedron3d& cell() const { return cell_; }
49 virtual Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const
50 = 0;
56 virtual Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx)
57 const = 0;
63 virtual Real shapeFctVertex(const uint fctIdx, const uint vtxIdx)
64 const = 0;
69 virtual concepts::Real3d shapeFctGradient(const uint fctIdx) const = 0;
76 const concepts::Real3d xi) const;
83 const uint edgeIdx) const = 0;
89 virtual Real solutionVertex(const concepts::Vector<Real>& sol,
90 const uint vertexIdx) const = 0;
95 concepts::Real3d edgeCenter(uint edgeIdx) const;
97 virtual const concepts::ElementGraphics<Real>* graphics() const = 0;
98 protected:
100 virtual std::ostream& info(std::ostream& os) const;
101
102 std::unique_ptr<concepts::TMatrixBase<Real> > T_;
103 const concepts::Tetrahedron3d& cell_;
104 static Real eta_[6][3];
105 };
106
107 //********************************************************** FvdgP0TetElem **
111 class FvdgP0TetElem : public FvdgElement {
112 public:
122 Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const {
123 return 1.0;
124 }
130 Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx) const {
131 return 1.0;
132 }
138 Real shapeFctVertex(const uint fctIdx, const uint vtxIdx) const {
139 return 1.0;
140 }
145 concepts::Real3d shapeFctGradient(const uint fctIdx) const {
146 return concepts::Real3d(0.0, 0.0, 0.0);
147 }
154 const uint edgeIdx) const {
155 return sol(T_->index(0));
156 }
163 const uint vertexIdx) const {
164 return sol(T_->index(0));
165 }
168 protected:
170 virtual std::ostream& info(std::ostream& os) const;
172 static std::unique_ptr<FvdgP0TetGraphics> graphics_;
173 };
174
175 //********************************************************** FvdgP1TetElem **
179 class FvdgP1TetElem : public FvdgElement {
180 public:
190 Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const;
196 Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx) const {
197 conceptsAssert(edgeIdx < 6, concepts::Assertion());
198 conceptsAssert(fctIdx < 4, concepts::Assertion());
199 return shapeFctEdgeCenter_[edgeIdx][fctIdx];
200 }
206 Real shapeFctVertex(const uint fctIdx, const uint vtxIdx) const {
207 conceptsAssert(vtxIdx < 4, concepts::Assertion());
208 conceptsAssert(fctIdx < 4, concepts::Assertion());
209 return shapeFctVertex_[vtxIdx][fctIdx];
210 }
215 concepts::Real3d shapeFctGradient(const uint fctIdx) const;
222 const uint edgeIdx) const;
229 const uint vertexIdx) const;
232 protected:
234 virtual std::ostream& info(std::ostream& os) const;
236 static Real shapeFctEdgeCenter_[6][4];
238 static Real shapeFctGradient_[3][4];
240 static uint nonVanishingNbr_[6];
242 static Real nonVanishingSign_[6];
244 static Real shapeFctVertex_[4][4];
246 static std::unique_ptr<FvdgP1TetGraphics> graphics_;
247 };
248
249 // *************************************************** TetrahedronGraphics **
250
255 public:
256 virtual void operator()(const concepts::Element<Real>& elm,
257 enum graphicsType type,
259 protected:
260 virtual std::ostream& info(std::ostream& os) const;
261 };
262
267 public:
268 virtual void operator()(const concepts::Element<Real>& elm,
269 enum graphicsType type,
271 protected:
272 virtual std::ostream& info(std::ostream& os) const;
273 };
274} // namespace linDG3D
275
276#endif
Tetrahedron & connector() const
Returns the connector.
Definition cell3D.hh:100
Real3d vertex(uint i) const
Returns the coordinates of the ith vertex.
const concepts::TMatrixBase< Real > & T() const
Returns the T matrix of this element.
Definition element.hh:38
virtual const concepts::Tetrahedron3d & cell() const
Returns the geometrical cell of this element.
Definition element.hh:44
virtual std::ostream & info(std::ostream &os) const
Returns cell and T matrix of this element.
FvdgElement(const concepts::Tetrahedron3d &cell, uint idx[], uint m)
Constructor.
virtual concepts::Real3d shapeFctGradient(const uint fctIdx) const =0
virtual Real solutionVertex(const concepts::Vector< Real > &sol, const uint vertexIdx) const =0
virtual Real solutionEdgeCenter(const concepts::Vector< Real > &sol, const uint edgeIdx) const =0
virtual const concepts::ElementGraphics< Real > * graphics() const =0
Returns the graphics object for the element.
virtual Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const =0
virtual Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx) const =0
Real solution(const concepts::Vector< Real > &sol, const concepts::Real3d xi) const
virtual Real shapeFctVertex(const uint fctIdx, const uint vtxIdx) const =0
const concepts::Real3d vertex(const uint i) const
Returns the vertex with local index i in this element.
Definition element.hh:40
concepts::Real3d edgeCenter(uint edgeIdx) const
const concepts::Tetrahedron & support() const
Returns the topological support of this element.
Definition element.hh:36
Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx) const
Definition element.hh:130
FvdgP0TetElem(const concepts::Tetrahedron3d &cell, uint idx[])
const concepts::ElementGraphics< Real > * graphics() const
Returns the graphics object for the element.
Real shapeFctVertex(const uint fctIdx, const uint vtxIdx) const
Definition element.hh:138
virtual std::ostream & info(std::ostream &os) const
Returns cell and T matrix of this element.
Real solutionVertex(const concepts::Vector< Real > &sol, const uint vertexIdx) const
Definition element.hh:162
Real solutionEdgeCenter(const concepts::Vector< Real > &sol, const uint edgeIdx) const
Definition element.hh:153
static std::unique_ptr< FvdgP0TetGraphics > graphics_
Graphics object of the element.
Definition element.hh:172
Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const
Definition element.hh:122
concepts::Real3d shapeFctGradient(const uint fctIdx) const
Definition element.hh:145
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
static uint nonVanishingNbr_[6]
Number of non vanishing shape function at edge centers.
Definition element.hh:240
static Real shapeFctEdgeCenter_[6][4]
Values of shape functions at edge centers.
Definition element.hh:236
static Real shapeFctGradient_[3][4]
Values of shape function gradients.
Definition element.hh:238
Real shapeFctEdgeCenter(const uint fctIdx, const uint edgeIdx) const
Definition element.hh:196
static std::unique_ptr< FvdgP1TetGraphics > graphics_
Graphics object of the element.
Definition element.hh:246
FvdgP1TetElem(const concepts::Tetrahedron3d &cell, uint idx[])
const concepts::ElementGraphics< Real > * graphics() const
Returns the graphics object for the element.
static Real shapeFctVertex_[4][4]
Values of shape functions at vertices.
Definition element.hh:244
virtual std::ostream & info(std::ostream &os) const
Returns cell and T matrix of this element.
Real shapeFctVertex(const uint fctIdx, const uint vtxIdx) const
Definition element.hh:206
concepts::Real3d shapeFctGradient(const uint fctIdx) const
static Real nonVanishingSign_[6]
Value of non vanishing shape function at edge centers.
Definition element.hh:242
Real shapeFct(const uint fctIdx, const concepts::Real3d xi) const
Real solutionEdgeCenter(const concepts::Vector< Real > &sol, const uint edgeIdx) const
Real solutionVertex(const concepts::Vector< Real > &sol, const uint vertexIdx) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
#define conceptsAssert(cond, exc)
double Real
Definition typedefs.hh:39