edge.hh

Go to the documentation of this file.
1 
8 #ifndef hp2dedge_hh
9 #define hp2dedge_hh
10 
11 #include <iostream>
12 #include <memory>
13 #include "basics/typedefs.hh"
14 #include "basics/outputOperator.hh"
16 #include "geometry/cell1D.hh"
17 #include "geometry/elementMaps.hh"
18 #include "geometry/integral.hh"
19 #include "geometry/normalVector.hh"
20 #include "integration/quadRule.hh"
21 #include "space/tmatrix.hh"
22 #include "space/hpMethod.hh"
23 #include "space/integral.hh"
24 #include "hp1D/element.hh"
26 
27 
28 namespace hp2D {
29 
30  using concepts::Real;
31  using concepts::Z2;
32 
33  // forward declaration
34  template<typename F>
35  class Quad;
36 
37  // ************************************************************ QuadEdgeBase **
38 
49  public:
56  normalVectorRule = concepts::EdgeNormalVectorRule())
57  : normalVectorRule_(normalVectorRule.clone())
58  {}
59 
77  template<class F>
78  std::pair<hp1D::Element<F>*,concepts::Edge2d*>
79  edge(const Quad<F>& elm, const ushort k, bool emptyElm = true,
80  hp1D::Element<F>* edge = 0);
81  protected:
82  virtual std::ostream& info(std::ostream& os) const;
83 
85  std::unique_ptr<const concepts::EdgeNormalVectorRule> normalVectorRule_;
86 
97  virtual Real weight_(bool first, Z2 dir) const = 0;
98  private:
99 
111  template<class F>
112  void transferDof_(const ushort* p, const ushort k, const bool rho,
113  const bool first, const Z2 dir,
114  const concepts::TMatrix<F>& T,
116 
125  bool edgeDof_(const ushort* p, const ushort k, const bool rho,
126  const uint dofQuad, uint& dofEdge);
127  };
128 
129  // *********************************************************** QuadEdgeFirst **
130 
131  class QuadEdgeFirst : public QuadEdgeBase {
132  public:
134  normalVectorRule = concepts::EdgeNormalVectorRule())
135  : QuadEdgeBase(normalVectorRule) {}
136  protected:
137  virtual std::ostream& info(std::ostream& os) const;
138  private:
139  virtual Real weight_(bool first, Z2 dir) const;
140  };
141 
142  // ************************************************************ QuadEdgeMean **
143 
144  class QuadEdgeMean : public QuadEdgeBase {
145  public:
147  normalVectorRule = concepts::EdgeNormalVectorRule())
148  : QuadEdgeBase(normalVectorRule) {}
149  protected:
150  virtual std::ostream& info(std::ostream& os) const;
151  private:
152  virtual Real weight_(bool first, Z2 dir) const;
153  };
154 
155  // ************************************************************ QuadEdgeJump **
156 
157  class QuadEdgeJump : public QuadEdgeBase {
158  public:
160  normalVectorRule = concepts::EdgeNormalVectorRule())
161  : QuadEdgeBase(normalVectorRule) {}
162  protected:
163  virtual std::ostream& info(std::ostream& os) const;
164  private:
165  virtual Real weight_(bool first, Z2 dir) const;
166  };
167 
168 } // namespace hp2D
169 
170 #endif // hp2dedge_hh
void transferDof_(const ushort *p, const ushort k, const bool rho, const bool first, const Z2 dir, const concepts::TMatrix< F > &T, hp1D::Element< F > &edge)
Transfer the quad dof on the particular edge to edge dof.
bool edgeDof_(const ushort *p, const ushort k, const bool rho, const uint dofQuad, uint &dofEdge)
Compute the index of a dof on an edge.
QuadEdgeMean(const concepts::EdgeNormalVectorRule &normalVectorRule=concepts::EdgeNormalVectorRule())
Definition: edge.hh:146
A T matrix in sparse notation.
Definition: edgeTest.hh:17
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
QuadEdgeBase(const concepts::EdgeNormalVectorRule &normalVectorRule=concepts::EdgeNormalVectorRule())
Constructor.
Definition: edge.hh:55
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
A 1D cell: edge in 2D.
Definition: cell1D.hh:189
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
2D hp-FEM for H1-conforming elements.
std::pair< hp1D::Element< F > *, concepts::Edge2d * > edge(const Quad< F > &elm, const ushort k, bool emptyElm=true, hp1D::Element< F > *edge=0)
Returns the element and the geometrical cell as pair belonging to the k th edge in the quadrilateral ...
1D generic element.
Definition: element.hh:225
Base class for defining rules in which direction the normal vector should point for created edges fro...
Definition: normalVector.hh:31
Static class to construct an element hp1D::Element out of an hp2D::Quad.
Definition: edge.hh:48
QuadEdgeJump(const concepts::EdgeNormalVectorRule &normalVectorRule=concepts::EdgeNormalVectorRule())
Definition: edge.hh:159
virtual Real weight_(bool first, Z2 dir) const =0
Returns the weight of the contribution of this cell to the edge.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Real weight_(bool first, Z2 dir) const
Returns the weight of the contribution of this cell to the edge.
QuadEdgeFirst(const concepts::EdgeNormalVectorRule &normalVectorRule=concepts::EdgeNormalVectorRule())
Definition: edge.hh:133
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
virtual Real weight_(bool first, Z2 dir) const
Returns the weight of the contribution of this cell to the edge.
A 2D FEM element: a quad.
Definition: bf_advection.hh:44
std::unique_ptr< const concepts::EdgeNormalVectorRule > normalVectorRule_
Rule for defining the direction of the normal vector for new edges.
Definition: edge.hh:85
Binary group (algebraic): only the values 0 and 1 are represented.
Definition: Zm.hh:16
Class providing an output operator.
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
virtual Real weight_(bool first, Z2 dir) const
Returns the weight of the contribution of this cell to the edge.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich