function.hh

Go to the documentation of this file.
1 
7 #ifndef hpFunction2dedge_hh
8 #define hpFunction2dedge_hh
9 
10 #include "hp2D/formula.hh"
11 #include "hp2D/functionBase.hh"
12 #include "quad.hh"
13 
14 namespace hp2Dedge {
15 
16  using concepts::Real;
17  using concepts::Real2d;
18 
19  // ***************************************************************** Value **
20 
26  template<typename F = Real, typename G = Real,
27  typename H = typename concepts::Realtype<F>::type>
28  class Value : public hp2D::ElementFunction<2, F, Quad<H> > {
29  public:
30  Value();
32  virtual Value<F,G,H>* clone() const {
33  if (f_.get()) return new Value(*f_.get());
34  return new Value();
35  }
36  protected:
37  virtual std::ostream& info(std::ostream& os) const;
38  private:
40  std::unique_ptr<const concepts::ElementFormula<G,H> > f_;
41  virtual void compute_(const Quad<H>& elm, const concepts::Array<F>& coeff,
42  concepts::Array<F>& val, const uint i[2]) const;
43  virtual void compute_(const Quad<H>& elm, const uint j[3],
44  concepts::Array<F>& val, const uint i[2]) const;
45  virtual void compute_(const Quad<H>& elm, const concepts::Array<F>& coeff,
46  concepts::Array<F>& val,
47  const Real2d& p, const Real t = 0.0) const;
48  };
49 
50  // ******************************************************************* Rot **
51 
58  template<typename F = Real, typename G = Real>
59  class Rot : public hp2D::ElementFunction<1, F, Quad<G> > {
60  public:
61  virtual Rot<F,G>* clone() const { return new Rot(); }
62  protected:
63  virtual std::ostream& info(std::ostream& os) const;
64  private:
65  virtual void compute_(const Quad<>& elm, const concepts::Array<F>& coeff,
66  F& val, const uint i[2]) const;
67  virtual void compute_(const Quad<>& elm, const uint j[3],
68  F& val, const uint i[2]) const;
69  virtual void compute_(const Quad<>& elm, const concepts::Array<F>& coeff,
70  F& val,
71  const Real2d& p, const Real t = 0.0) const;
72  };
73 
74 } // namespace hp2Dedge
75 
76 
77 #endif // hpRealunction2dedge_hh
virtual void compute_(const Quad<> &elm, const uint j[3], F &val, const uint i[2]) const
A 2D FEM edge element: a quad.
Definition: bf_advection.hh:40
Point< Real, 2 > Real2d
Base class for element functions for hp elements in 2D.
Definition: functionBase.hh:38
An array of objects.
Definition: bilinearForm.hh:23
virtual std::ostream & info(std::ostream &os) const
virtual void compute_(const Quad<> &elm, const concepts::Array< F > &coeff, F &val, const uint i[2]) const
std::unique_ptr< const concepts::ElementFormula< G, H > > f_
Formula.
Definition: function.hh:40
The approximated function in a FE space.
Definition: function.hh:28
virtual void compute_(const Quad< H > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint i[2]) const
virtual Rot< F, G > * clone() const
Definition: function.hh:61
virtual void compute_(const Quad< H > &elm, const uint j[3], concepts::Array< F > &val, const uint i[2]) const
virtual void compute_(const Quad< H > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real2d &p, const Real t=0.0) const
virtual void compute_(const Quad<> &elm, const concepts::Array< F > &coeff, F &val, const Real2d &p, const Real t=0.0) const
virtual std::ostream & info(std::ostream &os) const
virtual Value< F, G, H > * clone() const
Definition: function.hh:32
Value(const concepts::ElementFormula< G, H > &frm)
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
hp 2D edge elements for electromagnetics.
Definition: bf_advection.hh:37
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich