Class documentation of Concepts

Loading...
Searching...
No Matches
elementPair.hh
Go to the documentation of this file.
1
6#ifndef elementPairDG2D_hh
7#define elementPairDG2D_hh
8
10#include "edgeInfo.hh"
11
12// debugging
13#include "basics/debug.hh"
14
15#define DGElementPair2dConstr_D 0
16
17namespace linDG2D {
18
19 using concepts::Real;
20
21 // *********************************************************** ElementPair **
22
27 class ElementPair : public concepts::ElementPair<Real> {
28 public:
35 const EdgeInfo& edgeInfo) :
36 elm1_(elm1), elm2_(elm2), edgeInfo_(edgeInfo) {
37 DEBUGL(DGElementPair2dConstr_D, elm1 << ", " << elm2);
38 idxs_[0] = &(elm1.cell()) == edgeInfo.cell(0) ?
39 edgeInfo.idx(0) : edgeInfo.idx(1);
40 idxs_[1] = &(elm2.cell()) == edgeInfo.cell(0) ?
41 edgeInfo.idx(0) : edgeInfo.idx(1);
42 }
44 virtual const Triangle& elm1() const { return elm1_; }
46 virtual const Triangle& elm2() const { return elm2_; }
48 const EdgeInfo& edgeInfo() const { return edgeInfo_; }
55 Real shapeFct(uint e, uint i, Real xi) const {
56 const Triangle& elm = e == 0 ? elm1_ : elm2_;
57 Real xim = &(elm.cell()) == edgeInfo_.cell(0) ? xi : 1.0 - xi;
58 switch(idxs_[e]) {
59 case 0: return elm.shapeFct(i, xim, 0.0);
60 case 1: return elm.shapeFct(i, 1.0, xim);
61 case 2: return elm.shapeFct(i, 1.0-xim, 1.0-xim);
62 default: conceptsAssert(false, concepts::Assertion()); return 0.0;
63 }
64 }
65 private:
66 const Triangle& elm1_;
67 const Triangle& elm2_;
68 const EdgeInfo& edgeInfo_;
69 uint idxs_[2];
70 };
71
72}
73
74#endif // elementPairDG2D_hh
uint idx(uint i) const
Definition edgeInfo.hh:46
const concepts::Triangle2d * cell(uint i) const
Definition edgeInfo.hh:42
virtual const Triangle & elm2() const
Returns the second element.
const EdgeInfo & edgeInfo() const
Returns the edge information object.
ElementPair(const Triangle &elm1, const Triangle &elm2, const EdgeInfo &edgeInfo)
virtual const Triangle & elm1() const
Returns the first element.
Real shapeFct(uint e, uint i, Real xi) const
virtual const concepts::Triangle2d & cell() const
Returns the underlying geometrical triangle.
Definition triangle.hh:45
virtual Real shapeFct(const uint i, const Real xi1, const Real xi2) const =0
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
Definition debug.hh:40
double Real
Definition typedefs.hh:39