element.hh

Go to the documentation of this file.
1 
6 #ifndef hpElement3d_h
7 #define hpElement3d_h
8 
9 #include <cstring>
11 #include "geometry/connector.hh"
12 #include "geometry/cell.hh"
13 #include "space/element.hh"
14 #include "space/tmatrix.hh"
15 
16 namespace hp3D {
17 
18  using concepts::Real;
19 
20  // *************************************************************** Element **
21 
28  template<class F>
29  class Element : public concepts::ElementWithCell<F> {
30  public:
36  inline Element(concepts::TColumn<Real>* T, uint p) : T_(T) {
37  p_[0] = p_[1] = p_[2] = p;
38  }
39 
45  inline Element(concepts::TColumn<Real>* T, const ushort* p) : T_(T) {
46  std::memcpy(p_, p, 3*sizeof(ushort));
47  }
48 
51  inline const ushort* p() const { return p_; }
52 
57  virtual const concepts::Connector3& support() const = 0;
58 
59  virtual const concepts::TMatrix<Real>& T() const { return T_; }
60 
63 
68  virtual concepts::Real3d vertex(uint i) const = 0;
69 
73  virtual const concepts::Cell3& cell() const = 0;
74 
76  virtual bool operator<(const Element<F>& elm) const = 0;
77  protected:
78  virtual std::ostream& info(std::ostream& os) const;
79 
82  private:
84  ushort p_[3];
85  };
86 
87 } // namespace hp3d
88 
89 #endif // hpElement3d_h
A column of a T matrix.
Definition: analytical.hh:18
virtual bool operator<(const Element< F > &elm) const =0
Comparison operator for elements.
A 3D element of the topology.
Definition: connector.hh:277
ushort p_[3]
Polynomial degree.
Definition: element.hh:84
concepts::TMatrix< Real > T_
T matrix of the element.
Definition: element.hh:81
virtual concepts::Real3d vertex(uint i) const =0
Returns the coordinates of the ith vertex of this element.
virtual const concepts::Cell3 & cell() const =0
Returns the cell on which the element is built.
Three dimensional cell.
Definition: cell.hh:112
void appendT(concepts::TColumn< Real > *T)
Appends the T columns to the T matrix.
Definition: element.hh:62
virtual std::ostream & info(std::ostream &os) const
virtual const concepts::Connector3 & support() const =0
Returns the topolgical support of the element.
Element with cell.
const ushort * p() const
Returns the polynomial degree.
Definition: element.hh:51
Element(concepts::TColumn< Real > *T, uint p)
Constructor.
Definition: element.hh:36
void append(TColumn< F > *T)
Appends the columns to the matrix.
Element(concepts::TColumn< Real > *T, const ushort *p)
Constructor.
Definition: element.hh:45
virtual const concepts::TMatrix< Real > & T() const
Returns the T matrix of the element.
Definition: element.hh:59
unsigned short ushort
Abbreviation for unsigned short.
Definition: typedefs.hh:48
Abstract class for a 3D FEM element.
Definition: element.hh:29
3D hp-FEM for H1-conforming elements.
Definition: meshDX.hh:23
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich