Class documentation of Concepts

Loading...
Searching...
No Matches
function.hh
Go to the documentation of this file.
1
7#ifndef VECTORIAL_FUNCTION_HH
8#define VECTORIAL_FUNCTION_HH
9
10#include <memory>
11#include "space/function.hh"
13
14namespace vectorial {
15
16 using concepts::Real;
17 using concepts::Real2d;
18 using concepts::Real3d;
19
20
21 // ******************************************************* ElementFunction **
22
30 template<class F, class G = typename concepts::Realtype<F>::type>
32 public Vectorial<const concepts::ElementFunction<F,G> > {
33 public:
34 ElementFunction(const uint vdim, uint arrayWidth = 0)
36
37 virtual ~ElementFunction();
39 virtual uint n() const;
41 virtual void operator() (const concepts::Element<G>& elm,
42 const concepts::Array<F>& coeff,
43 concepts::Array<F>& val, const uint *i) const;
47 virtual void operator() (const concepts::Element<G>& elm, const uint* j,
48 concepts::Array<F>& val, const uint* i) const;
50
53 virtual void operator() (const concepts::Element<G>& elm,
54 const concepts::Array<F>& coeff,
55 concepts::Array<F>& val, const Real p,
56 const Real t = 0.0) const;
57 virtual void operator() (const concepts::Element<G>& elm,
58 const concepts::Array<F>& coeff,
60 const Real t = 0.0) const;
61 virtual void operator() (const concepts::Element<G>& elm,
62 const concepts::Array<F>& coeff,
64 const Real t = 0.0) const;
66
67 virtual ElementFunction<F,G>* clone() const;
68
75 virtual void put(const concepts::ElementFunction<F,G>& vdata,
76 const uint a = 0, const uint b = 0);
77 protected:
78 virtual std::ostream& info(std::ostream& os) const;
79 };
80
81
82 // ********************************************** ElementFunctionComponent **
83
90 template<class F, class G = Real>
92 {
93 public:
95 const uint component);
96
97 virtual ~ElementFunctionComponent() {}
98
99 virtual ElementFunctionComponent<F,G>* clone() const
100 {
101 return new ElementFunctionComponent(fun_->clone(), n_);
102 }
103
104 virtual uint n() const {
105 return n_;
106 }
107
108 virtual void operator()(const concepts::Element<G>& elm,
109 const concepts::Array<F>& coeff,
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,
119 const Real p, const Real t = 0.0) const;
120
121 virtual void operator()(const concepts::Element<G>& elm,
122 const concepts::Array<F>& coeff,
124 const Real2d& p, const Real t = 0.0) const;
125
126 virtual void operator()(const concepts::Element<G>& elm,
127 const concepts::Array<F>& coeff,
129 const Real3d& p, const Real t = 0.0) const;
130
131 protected:
132 virtual std::ostream& info(std::ostream &os) const
133 {
134 return os << fun_;
135 }
136 private:
138 uint n_;
140 std::unique_ptr<ElementFunction<F,G> > fun_;
141
144 : n_(n), fun_(fun)
145 {}
146 };
147
148 // ************************************************** ElementFunctionAllComponents **
149
155 template<class F, class G = Real>
157 {
158 public:
160
162
163 virtual ElementFunctionAllComponents<F,G>* clone() const
164 {
165 return new ElementFunctionAllComponents(fun_->clone(), n_);
166 }
167
168 virtual uint n() const {
169 return n_;
170 }
171
172 virtual void operator()(const concepts::Element<G>& elm,
173 const concepts::Array<F>& coeff,
175 const uint *i) const;
176
177 virtual void operator()(const concepts::Element<G>& elm, const uint* j,
178 concepts::Array<F>& val, const uint* i) const;
179
180 virtual void operator()(const concepts::Element<G>& elm,
181 const concepts::Array<F>& coeff,
183 const Real p, const Real t = 0.0) const;
184
185 virtual void operator()(const concepts::Element<G>& elm,
186 const concepts::Array<F>& coeff,
188 const Real2d& p, const Real t = 0.0) const;
189
190 virtual void operator()(const concepts::Element<G>& elm,
191 const concepts::Array<F>& coeff,
193 const Real3d& p, const Real t = 0.0) const;
194
195 protected:
196 virtual std::ostream& info(std::ostream &os) const
197 {
198 return os << fun_;
199 }
200 private:
202 uint n_;
204 std::unique_ptr<ElementFunction<F,G> > fun_;
205
208 : n_(n), fun_(fun)
209 {}
210 };
211
212 // ****************************************************** SymmetrizeTensor **
213
222 template<uint dim, class F, class G = Real>
224 {
225 public:
231
232 virtual ~SymmetrizeTensor(){}
233
234 virtual SymmetrizeTensor<dim,F,G>* clone() const
235 {
236 return new SymmetrizeTensor( *fun_ );
237 }
238
239 virtual uint n() const {
240 return dim*dim;
241 }
242
243 virtual void operator()(const concepts::Element<G>& elm,
244 const concepts::Array<F>& coeff,
246 const uint *i) const;
247
248 virtual void operator()(const concepts::Element<G>& elm, const uint* j,
249 concepts::Array<F>& val, const uint* i) const;
250
251 virtual void operator()(const concepts::Element<G>& elm,
252 const concepts::Array<F>& coeff,
254 const Real p, const Real t = 0.0) const;
255
256 virtual void operator()(const concepts::Element<G>& elm,
257 const concepts::Array<F>& coeff,
259 const Real2d& p, const Real t = 0.0) const;
260
261 virtual void operator()(const concepts::Element<G>& elm,
262 const concepts::Array<F>& coeff,
264 const Real3d& p, const Real t = 0.0) const;
265
266 protected:
267 virtual std::ostream& info(std::ostream &os) const
268 {
269 return os << concepts::typeOf(*this)<<"(" << *fun_ << ")";
270 }
271
272 private:
273 std::unique_ptr<const concepts::ElementFunction<F,G> > fun_;
274
275 };
276
277
278} // namespace vectorial
279
280
281#endif // VECTORIAL_FUNCTION_HH
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< 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
virtual uint n() const
Number of components.
Definition function.hh:168
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition function.hh:196
virtual void operator()(const concepts::Element< G > &elm, const uint *j, concepts::Array< F > &val, const uint *i) const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition function.hh:132
virtual uint n() const
Number of components.
Definition function.hh:104
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
virtual void put(const concepts::ElementFunction< F, G > &vdata, const uint a=0, const uint b=0)
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< F > &val, const uint *i) const
Evaluates the function on precalculated quadrature points.
virtual uint n() const
Number of components.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
SymmetrizeTensor(const concepts::ElementFunction< F, G > &fun)
virtual uint n() const
Number of components.
Definition function.hh:239
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
Definition function.hh:267
virtual void operator()(const concepts::Element< G > &elm, const concepts::Array< F > &coeff, concepts::Array< 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
uint vdim() const
Returns number of components.
Definition vectorial.hh:77
std::string typeOf(const T &t)
Definition output.hh:43
double Real
Definition typedefs.hh:39