function.hh

Go to the documentation of this file.
1 
6 #ifndef hpFunction3d_hh
7 #define hpFunction3d_hh
8 
9 #include "../space.hh"
10 #include "neumannTraceElement3d.hh"
11 
12 #include "toolbox/sequence.hh"
13 #include "geometry/connectorSet.hh"
14 
15 
16 namespace hp3D {
17  //forward declaration
18  class Hexahedron;
19  template<class F>
21 
22  using concepts::Real;
23  using concepts::Real2d;
24  using concepts::Real3d;
25 
26 
27  // ***************************************************************** Value **
28 
33  template<class F, class G = concepts::Real>
34  class Value: public concepts::ElementFunction<F, G> {
35  public:
36 
38  virtual ~Value() {}
39 
40  virtual Value<F, G>* clone() const;
41 
43  virtual uint n() const {
44  return 1;
45  }
46 
47  virtual void operator()(const concepts::Element<G>& elm,
48  const concepts::Array<F>& coeff, F& val, const uint *i) const;
49 
50  virtual void operator()(const concepts::Element<G>& elm,
51  const concepts::Array<F>& coeff, concepts::Array<F>& val,
52  const uint *i) const;
53 
54  virtual void operator()(const concepts::Element<G>& elm, const uint* j,
55  concepts::Array<F>& val, const uint* i) const;
56 
57  virtual void operator()(const concepts::Element<G>& elm,
58  const concepts::Array<F>& coeff, concepts::Array<F>& val,
59  const Real p, const Real t = 0.0) const;
60 
61  virtual void operator()(const concepts::Element<G>& elm,
62  const concepts::Array<F>& coeff, concepts::Array<F>& val,
63  const Real2d& p, const Real t = 0.0) const;
64 
65  virtual void operator()(const concepts::Element<G>& elm,
66  const concepts::Array<F>& coeff, F& val,
67  const Real3d& p, const Real t = 0.0) const;
68 
69  virtual void operator()(const concepts::Element<G>& elm,
70  const concepts::Array<F>& coeff, concepts::Array<F>& val,
71  const Real3d& p, const Real t = 0.0) const;
72 
73  private:
74 
75  bool compute_(const Hexahedron* elm, const concepts::Array<F>& coeff,
76  F& val, const uint* i) const;
77 
78  bool compute_(const Hexahedron* elm, const concepts::Array<F>& coeff,
79  F& val, const Real3d& p, const Real t) const;
80 
82  F& val, const Real2d& p, const Real t) const;
83 
84  };
85 
86  // ****************************************************************** Grad **
87 
92  template<class F, class G = Real>
93  class Grad: public concepts::ElementFunction<F, G> {
94 
95  public:
96 
98  virtual ~Grad() {
99  }
100 
101 
102  virtual Grad<F, G>* clone() const;
103 
105  virtual uint n() const {
106  return 3;
107  }
108 
109  virtual void operator()(const concepts::Element<G>& elm,
110  const concepts::Array<F>& coeff, concepts::Array<F>& val,
111  const uint *i) const;
112 
113  virtual void operator()(const concepts::Element<G>& elm, const uint* j,
114  concepts::Array<F>& val, const uint* i) const;
115 
116  virtual void operator()(const concepts::Element<G>& elm,
117  const concepts::Array<F>& coeff, concepts::Array<F>& val, const Real p,
118  const Real t = 0.0) const;
119 
120  virtual void operator()(const concepts::Element<G>& elm,
121  const concepts::Array<F>& coeff, concepts::Array<F>& val,
122  const Real2d& p, const Real t = 0.0) const;
123 
124  virtual void operator()(const concepts::Element<G>& elm,
125  const concepts::Array<F>& coeff, concepts::Array<F>& val,
126  const Real3d& p, const Real t = 0.0) const;
127 
128  };
129 
130  // ****************************************************************** Laplacian **
131 
136  template<class F, class G = Real>
137  class Laplacian: public concepts::ElementFunction<F, G> {
138 
139  public:
140 
142  virtual ~Laplacian() {
143  }
144 
145 
146  virtual Laplacian<F, G>* clone() const override;
147 
149  virtual uint n() const override{
150  return 1;
151  }
152 
154  const concepts::Array<F>& coeff,
155  F& val, const uint *i) const;
156 
158  const concepts::Array<F>& coeff,
159  concepts::Array<F>& val,
160  const uint *i) const override {
161  val.resize(1);
162  (*this)(elm, coeff, val[0], i);
163  }
164 
167  const uint* j,
168  concepts::Array<F>& val,
169  const uint* i) const override;
170 
173  const concepts::Array<F>& coeff,
174  concepts::Array<F>& val,
175  const concepts::Real p,
176  const concepts::Real t = 0.0) const override;
177 
180  const concepts::Array<F>& coeff, concepts::Array<F>& val,
181  const concepts::Real2d& p,
182  const concepts::Real t = 0.0) const override;
183 
184 
189  const concepts::Array<F>& coeff, F& val,
190  const concepts::Real3d& p,
191  const concepts::Real t = 0.0) const;
192 
194  const concepts::Array<F>& coeff, concepts::Array<F>& val,
195  const concepts::Real3d& p,
196  const concepts::Real t = 0.0) const override {
197  val.resize(1);
198  (*this)(elm, coeff, val[0], p, t);
199  }
200 
201 
202  };
203 
204 
205 
206 }/*namespace hp3d */
207 
208 #endif /* hpFunction3d_hh */
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const override
Definition: function.hh:157
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, F &val, const Real3d &p, const Real t=0.0) const
void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const override
Throws an exception.
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual ~Laplacian()
Destructor for the class with virtual memberfunctions.
Definition: function.hh:142
A 3D FEM element: a hexahedron.
Definition: hexahedron.hh:37
An abstract class for a function in a FE space.
virtual void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real3d &p, const Real t=0.0) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, F &val, const uint *i) const
virtual Value< F, G > * clone() const
virtual uint n() const
Number of components.
Definition: function.hh:43
Point< Real, 2 > Real2d
The Laplacian of an approximated function in a FE space.
Definition: function.hh:137
virtual Grad< F, G > * clone() const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real2d &p, const Real t=0.0) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual ~Grad()
Destructor for the class with virtual memberfunctions.
Definition: function.hh:98
Point< Real, 3 > Real3d
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real p, const Real t=0.0) const
bool compute_(const NeumannTraceElement3d< Real > *elm, const concepts::Array< F > &coeff, F &val, const Real2d &p, const Real t) const
bool compute_(const Hexahedron *elm, const concepts::Array< F > &coeff, F &val, const uint *i) const
virtual void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const concepts::Real2d &p, const concepts::Real t=0.0) const override
Throws an exception.
An array of objects.
Definition: bilinearForm.hh:23
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real3d &p, const Real t=0.0) const
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real p, const Real t=0.0) const
bool compute_(const Hexahedron *elm, const concepts::Array< F > &coeff, F &val, const Real3d &p, const Real t) const
virtual ~Value()
Destructor for the class with virtual memberfunctions.
Definition: function.hh:38
The approximated function in a FE space.
Definition: function.hh:34
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, F &val, const uint *i) const
void resize(const uint sz)
Resizes the array.
Definition: array.hh:281
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, F &val, const concepts::Real3d &p, const concepts::Real t=0.0) const
Implements Value::operator() for the subsequent method at a given reference coordinate.
virtual uint n() const
Number of components.
Definition: function.hh:105
Element on an edge representing the normal derivatives of neighbouring elements, especially their mea...
Definition: function.hh:20
virtual uint n() const override
Number of components.
Definition: function.hh:149
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const concepts::Real p, const concepts::Real t=0.0) const override
Throws an exception.
void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const concepts::Real3d &p, const concepts::Real t=0.0) const override
Definition: function.hh:193
The gradient of an approximated function in a FE space.
Definition: function.hh:93
3D hp-FEM for H1-conforming elements.
Definition: meshDX.hh:23
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const Real2d &p, const Real t=0.0) const
double Real
Type normally used for a floating point number.
Definition: typedefs.hh:36
virtual Laplacian< F, G > * clone() const override
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich