Rheolef  7.2
an efficient C++ finite element environment
form_expr_quadrature.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_FORM_EXPR_QUADRATURE_H
2 #define _RHEOLEF_FORM_EXPR_QUADRATURE_H
23 //
24 // variational expressions are integrated by using a quadrature formulae
25 //
26 // author: Pierre.Saramito@imag.fr
27 //
28 // date: 18 march 2018
29 //
30 // SUMMARY:
31 // 1. concept
32 // 2. terminals
33 // 2.1. integration on one element K
34 // 2.2. integration on element boundary partial K
35 // 3. unary function
36 // 3.1. unary node
37 // 3.2. unary calls
38 // 4. binary operators +- between two integrated forms
39 // 4.1. binary node
40 // 4.2. binary calls
41 // 5. binary operators */ between a integrated form and a constant
42 //
43 
44 /*
45  let:
46  a(u,v) = int_domain expr(u,v) dx
47 
48  The integrals are evaluated over each element K of the domain
49  by using a quadrature formulae given by iopt
50 
51  expr(u,v) is a bilinear expression with respect to the
52  trial and test functions u and v
53 
54  The trial function u is replaced by each of the basis function of
55  the corresponding finite element space Xh: (phi_j), j=0..dim(Xh)-1
56 
57  The test function v is replaced by each of the basis function of
58  the corresponding finite element space Yh: (psi_i), i=0..dim(Yh)-1
59 
60  The integrals over the domain omega is the sum of integrals over K.
61 
62  The integrals over K are transformed on the reference element with
63  the piola transformation:
64  F : hat_K ---> K
65  hat_x |--> x = F(hat_x)
66 
67  exemples:
68  1) expr(v) = u*v
69  int_K phi_j(x)*psi_i(x) dx
70  = int_{hat_K} hat_phi_j(hat_x)*hat_psi_i(hat_x) det(DF(hat_x)) d hat_x
71  = sum_q hat_phi_j(hat_xq)*hat_psi_i(hat_xq) det(DF(hat_xq)) hat_wq
72 
73  The value(q,i,j) = (hat_phi_j(hat_xq)*hat_psi_i(hat_xq))
74  refers to basis values on the reference element.
75  There are evaluated on time for all over the reference element hat_K
76  and for the given quadrature formulae by:
77  expr.initialize (omega, quad);
78  This expression is represented by the 'test' class (see test.h)
79 
80  3) expr(v) = dot(grad(u),grad(v)) dx
81  The 'grad' node returns
82  value(q,i) = trans(inv(DF(hat_wq))*grad_phi_i(hat_xq) that is vector-valued
83  The grad_phi values are obtained by a grad_value(q,i) method on the 'test' class.
84  The 'dot' performs on the fly the product
85  value(q,i,j) = dot (value1(q,i), value2(q,j))
86 
87  This approch generalizes for an expression tree.
88 */
89 
90 #include "rheolef/form_expr_variational.h"
91 #include "rheolef/init_expr_quadrature.h"
92 
93 namespace rheolef {
94 
95 // -------------------------------------------------------------------
96 // 1. concept
97 // -------------------------------------------------------------------
98 namespace details {
99 
100 // Define a trait type for detecting form expression valid arguments
101 template<class T> struct is_form_expr_quadrature_arg: std::false_type {};
102 template<class T> struct is_form_expr_quadrature_on_side_arg: std::false_type {};
103 
104 } // namespace details
105 // ---------------------------------------------------------------------------
106 // 2. terminals
107 // ---------------------------------------------------------------------------
108 // 2.1. integration on one element K
109 // ---------------------------------------------------------------------------
110 namespace details {
111 
112 template<class Expr>
114 public:
115 // typedefs:
116 
118  typedef typename Expr::memory_type memory_type;
119  typedef typename Expr::value_type result_hint;
120  typedef typename Expr::value_type value_type;
125  typedef typename Expr::vf_tag_type vf_tag_type;
131  typedef typename Expr::maybe_symmetric::type maybe_symmetric;
132 
134 
135 // alocators:
136 
137  template<class Sfinae = typename std::enable_if<is_form_expr_v2_variational_arg<Expr>::value, Expr>::type>
138  form_expr_quadrature_on_element (const Expr& expr);
139 
140 // modifiers:
141 
142  void initialize (const geo_basic<float_type,memory_type>& omega_K, const integrate_option& iopt);
144 
145 // accessors:
146 
147  const space_type& get_trial_space() const { return _expr.get_trial_space(); }
148  const space_type& get_test_space() const { return _expr.get_test_space(); }
149  size_type n_derivative() const { return _expr.n_derivative(); }
150 
151  template<class Value>
152  void evaluate (
153  const geo_basic<float_type,memory_type>& omega_K,
154  const geo_element& K,
155  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak) const;
156 
157  template<class Value>
158  bool valued_check() const {
159  typedef Value A1;
160  if (! is_undeterminated<A1>::value) return _expr.template valued_check<A1>();
161  return true;
162  }
163 protected:
164 // data:
165  Expr _expr;
167 
168 // working variables:
169  mutable Eigen::Tensor<float_type,3> _value_i;
170 };
171 template<class Expr> struct is_form_expr_quadrature_arg <form_expr_quadrature_on_element<Expr> > : std::true_type {};
172 
173 // ---------------------------------------------------------------------------
174 // inlined
175 // ---------------------------------------------------------------------------
176 template<class Expr>
177 template<class Sfinae>
178 inline
180  : _expr(expr),
181  _pops(),
182  _value_i()
183 {
184 }
185 template<class Expr>
186 void
188  const geo_basic<float_type,memory_type>& omega_K,
189  const integrate_option& iopt)
190 {
191  integrate_option new_iopt = expr_quadrature_init_iopt (omega_K, get_trial_space(), get_test_space(), n_derivative(), iopt);
192  quadrature<float_type> quad = expr_quadrature_init_quad<float_type> (new_iopt);
193  _pops.initialize (omega_K.get_piola_basis(), quad, new_iopt);
194  _expr.initialize (_pops, new_iopt);
195 }
196 template<class Expr>
197 void
200  const integrate_option& iopt)
201 {
202  integrate_option new_iopt = expr_quadrature_init_iopt (gh.band(), get_trial_space(), get_test_space(), n_derivative(), iopt);
203  quadrature<float_type> quad = expr_quadrature_init_quad<float_type> (new_iopt);
204  _pops.initialize (gh.band().get_piola_basis(), quad, new_iopt);
205  _expr.initialize (gh, _pops, new_iopt);
206 }
207 template<class Expr>
208 template<class Value>
209 void
211  const geo_basic<float_type,memory_type>& omega_K,
212  const geo_element& K,
213  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak) const
214 {
215  const Eigen::Matrix<float_type,Eigen::Dynamic,1>& w = _pops.get_weight (omega_K, K);
216  _expr.evaluate (omega_K, K, _value_i);
217 
218  // blas3: a_jk = sum_i phi_jk(xi)*w(xi) TODO: DVT_EIGEN_BLAS2
219  size_t ni = _value_i.dimension(0);
220  size_t nj = _value_i.dimension(1);
221  size_t nk = _value_i.dimension(2);
222  ak.resize (nj, nk);
223  for (size_t j = 0; j < nj; ++j) {
224  for (size_t k = 0; k < nk; ++k) {
225  Value sum = 0;
226  for (size_t i = 0; i < ni; ++i) {
227  sum += w[i] * _value_i(i,j,k);
228  }
229  ak(j,k) = sum;
230  }}
231 }
232 
233 } // namespace details
234 
235 // ---------------------------------------------------------------------------
236 // 2.2. integration on element boundary partial K
237 // ---------------------------------------------------------------------------
238 namespace details {
239 
240 template<class Expr>
242 public:
243 // typedefs:
244 
246  typedef typename Expr::memory_type memory_type;
247  typedef typename Expr::value_type result_hint;
248  typedef typename Expr::value_type value_type;
253  typedef typename Expr::vf_tag_type vf_tag_type;
259  typedef typename Expr::maybe_symmetric::type maybe_symmetric;
260 
262 
263 // alocators:
264 
265  template<class Sfinae = typename std::enable_if<is_form_expr_v2_variational_arg<Expr>::value, Expr>::type>
266  form_expr_quadrature_on_sides (const Expr& expr);
267 
268 // accessors:
269 
270  const space_type& get_trial_space() const { return _expr.get_trial_space(); }
271  const space_type& get_test_space() const { return _expr.get_test_space(); }
272  size_type n_derivative() const { return _expr.n_derivative(); }
273 
274 // mutable modifiers:
275 
276  void initialize (const geo_basic<float_type,memory_type>& omega_K, const integrate_option& iopt);
278 
279  template<class Value>
280  void evaluate (
281  const geo_basic<float_type,memory_type>& omega_K,
282  const geo_element& K,
283  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& ak) const;
284 
285  template<class Value>
286  bool valued_check() const {
287  typedef Value A1;
288  if (! is_undeterminated<A1>::value) return _expr.template valued_check<A1>();
289  return true;
290  }
291 protected:
292 // data:
293  mutable Expr _expr;
295  mutable bool _ignore_sys_coord;
296 // working variables:
297  mutable Eigen::Tensor<float_type,3> _value_i;
298  mutable std::vector<size_type> _dis_inod_S;
300 };
301 template<class Expr> struct is_form_expr_quadrature_arg <form_expr_quadrature_on_sides<Expr> > : std::true_type {};
302 template<class Expr> struct is_form_expr_quadrature_on_side_arg <form_expr_quadrature_on_sides<Expr> > : std::true_type {};
303 
304 // ---------------------------------------------------------------------------
305 // inlined
306 // ---------------------------------------------------------------------------
307 template<class Expr>
308 template<class Sfinae>
309 inline
311  : _expr(expr),
312  _pops(),
313  _ignore_sys_coord(false),
314  _value_i(),
315  _dis_inod_S(),
316  _DF()
317 {
318 }
319 template<class Expr>
320 void
322 {
323  _ignore_sys_coord = iopt.ignore_sys_coord;
324  integrate_option new_iopt = expr_quadrature_init_iopt (omega_K, get_trial_space(), get_test_space(), _expr.n_derivative(), iopt);
325  quadrature<float_type> quad = expr_quadrature_init_quad<float_type> (new_iopt);
326  new_iopt._is_inside_on_local_sides = true; // propagate it recursively in the whole expression
327  _pops.initialize (omega_K.get_piola_basis(), quad, new_iopt);
328  _expr.initialize (_pops, new_iopt);
329 }
330 template<class Expr>
331 void
333 {
334  _ignore_sys_coord = iopt.ignore_sys_coord;
335  integrate_option new_iopt = expr_quadrature_init_iopt (gh.band(), get_trial_space(), get_test_space(), n_derivative(), iopt);
336  quadrature<float_type> quad = expr_quadrature_init_quad<float_type> (new_iopt);
337  new_iopt._is_inside_on_local_sides = true; // propagate it recursively in the whole expression
338  _pops.initialize (gh.band().get_piola_basis(), quad, new_iopt);
339  _expr.initialize (gh, _pops, new_iopt);
340  fatal_macro("on_local_sides: banded-level set not yet supported, sorry");
341 }
342 template<class Expr>
343 template<class Value>
344 void
346  const geo_basic<float_type,memory_type>& omega_K,
347  const geo_element& K,
348  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
349 {
350  size_type sid_dim = K.dimension()-1;
351  size_type nyi = get_test_space().get_constitution().assembly_loc_ndof (omega_K, K);
352  size_type nxj = get_trial_space().get_constitution().assembly_loc_ndof (omega_K, K);
353  for (size_type isid = 0, nsid = K.n_subgeo(sid_dim); isid < nsid; ++isid) {
354  size_type dis_isid = (K.dimension() == 1) ? K[isid] : (K.dimension() == 2) ? K.edge(isid) : K.face(isid);
355  const geo_element& S = omega_K.dis_get_geo_element (sid_dim, dis_isid);
357  K.get_side_informations (S, sid);
358  _expr.evaluate_on_side (omega_K, K, sid, _value_i);
359  const Eigen::Matrix<float_type,Eigen::Dynamic,1>& w = _pops.get_weight (omega_K, S);
360  // blas3: a_jk += sum_i phi_jk(xi)*w(xi) TODO: DVT_EIGEN_BLAS2
361  size_t ni = _value_i.dimension(0);
362  size_t nj = _value_i.dimension(1);
363  size_t nk = _value_i.dimension(2);
364  if (isid == 0) {
365  value = Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>::Zero(nj, nk);
366  }
367  for (size_t j = 0; j < nj; ++j) {
368  for (size_t k = 0; k < nk; ++k) {
369  Value sum = 0;
370  for (size_t i = 0; i < ni; ++i) {
371  sum += w[i] * _value_i(i,j,k);
372  }
373  value(j,k) += sum;
374  }}
375  }
376 }
377 
378 } // namespace details
379 
380 template<class Expr>
381 inline
382 typename
383 std::enable_if<
386 >::type
387 on_local_sides (const Expr& expr)
388 {
390 }
391 
392 // ---------------------------------------------------------------------------
393 // 3. unary function
394 // example: -(u*v), 2*(u*v), (u*v)/2
395 // ---------------------------------------------------------------------------
396 // 3.1. unary node
397 // ---------------------------------------------------------------------------
398 namespace details {
399 
400 template<class UnaryFunction, class Expr>
402 public:
403 // typedefs:
404 
406  typedef typename Expr::memory_type memory_type;
408  typename Expr::value_type>::type result_hint;
410  typename Expr::value_type
416  typedef typename Expr::vf_tag_type vf_tag_type;
422  typedef typename Expr::maybe_symmetric::type maybe_symmetric;
423 
425 
426 // alocators:
427 
428  template<class Sfinae = typename std::enable_if<is_form_expr_quadrature_arg<Expr>::value, Expr>::type>
429  form_expr_quadrature_unary (const UnaryFunction& f, const Expr& expr)
430  : _f(f), _expr(expr) {}
431 
432 // accessors:
433 
434  const space_type& get_trial_space() const { return _expr.get_trial_space(); }
435  const space_type& get_test_space() const { return _expr.get_test_space(); }
436  size_type n_derivative() const { return _expr.n_derivative(); }
437 
438 // mutable modifiers:
439 
440  void initialize (const geo_basic<float_type,memory_type>& omega_K, const integrate_option& iopt) {
441  return _expr.initialize (omega_K, iopt); }
443  return _expr.initialize (gh, iopt); }
444 
445  template<class Value>
446  void evaluate (
447  const geo_basic<float_type,memory_type>& omega_K,
448  const geo_element& K,
449  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
450  {
451  typedef Value A1; // Value is float_type in general: elementary matrix
452  _expr.evaluate (omega_K, K, value);
453  for (size_type i = 0, ni = value.rows(); i < ni; ++i) {
454  for (size_type j = 0, nj = value.cols(); j < nj; ++j) {
455  value(i,j) = _f (value(i,j));
456  }}
457  }
458  template<class Value>
459  bool valued_check() const {
460  typedef Value A1;
461  if (! is_undeterminated<A1>::value) return _expr.template valued_check<A1>();
462  return true;
463  }
464 protected:
465 // data:
466  UnaryFunction _f;
467  Expr _expr;
468 };
469 template<class F, class Expr> struct is_form_expr_quadrature_arg <form_expr_quadrature_unary<F,Expr> > : std::true_type {};
470 
471 } // namespace details
472 // ---------------------------------------------------------------------------
473 // 3.2. unary calls
474 // ---------------------------------------------------------------------------
475 
476 #define _RHEOLEF_make_form_expr_quadrature_unary(FUNCTION,FUNCTOR) \
477 template<class Expr> \
478 inline \
479 typename \
480 std::enable_if< \
481  details::is_form_expr_quadrature_arg<Expr>::value \
482  ,details::form_expr_quadrature_unary< \
483  FUNCTOR \
484  ,Expr \
485  > \
486 >::type \
487 FUNCTION (const Expr& expr) \
488 { \
489  return details::form_expr_quadrature_unary <FUNCTOR,Expr> (FUNCTOR(), expr); \
490 }
491 
494 #undef _RHEOLEF_make_form_expr_quadrature_unary
495 
496 // ---------------------------------------------------------------------------
497 // 4. binary operators +- between two integrated forms
498 // ---------------------------------------------------------------------------
499 // 4.1. binary node
500 // ---------------------------------------------------------------------------
501 // example: operator+ between two forms as in
502 // (u*v) + on_local_sides(u*v)
503 
504 namespace details {
505 
506 template<class BinaryFunction, class Expr1, class Expr2>
508 public:
509 // typedefs:
510 
515  typename Expr1::value_type
516  ,typename Expr2::value_type>::type result_hint;
518  typename Expr1::value_type
519  ,typename Expr2::value_type
523  typedef space_basic<float_type,memory_type> space_type; // TODO: deduce from Exprs
525  typedef typename details::bf_vf_tag<BinaryFunction,
526  typename Expr1::vf_tag_type,
527  typename Expr2::vf_tag_type>::type vf_tag_type;
531  typedef form_expr_quadrature_binary<BinaryFunction,typename Expr1::dual_self_type,
532  typename Expr2::dual_self_type>
534  typedef typename and_type<typename Expr1::maybe_symmetric::type,
535  typename Expr2::maybe_symmetric::type>::type
537 
539 
540 // alocators:
541 #ifdef TODO
542  template<class Sfinae
543  = typename std::enable_if<
545  ,Expr1
546  >::type
547  >
548 #endif // TODO
550  const Expr1& expr1,
551  const Expr2& expr2)
552  : _f(f), _expr1(expr1), _expr2(expr2) {}
553 
554 // accessors:
555 
556  const space_type& get_trial_space() const { return _expr1.get_trial_space(); }
557  const space_type& get_test_space() const { return _expr1.get_test_space(); }
558  size_type n_derivative() const { return std::min(_expr1.n_derivative(), _expr2.n_derivative()); }
559 
560 // mutable modifiers:
561  void initialize (const geo_basic<float_type,memory_type>& omega_K, const integrate_option& iopt) {
563  _expr1.initialize (omega_K, new_iopt);
564  _expr2.initialize (omega_K, new_iopt);
565  }
568  _expr1.initialize (gh, new_iopt);
569  _expr2.initialize (gh, new_iopt);
570  }
571  template<class Value>
572  void evaluate (
573  const geo_basic<float_type,memory_type>& omega_K,
574  const geo_element& K,
575  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
576  {
577  // Value is float_type in general: elementary matrix
578  // for f=operator+ => sum of two elementary matrix of the same type
579  // TODO: otherwise Value and 2 could be obtained from the hint<> helper
580  typedef Value A1;
581  typedef Value A2;
582  Eigen::Matrix<A2,Eigen::Dynamic,Eigen::Dynamic> value2 (value.cols(), value.cols());
583  _expr1.evaluate (omega_K, K, value);
584  _expr2.evaluate (omega_K, K, value2);
585  for (size_type i = 0, ni = value.rows(); i < ni; ++i) {
586  for (size_type j = 0, nj = value.cols(); j < nj; ++j) {
587  value(i,j) = _f (value(i,j), value2(i,j));
588  }}
589  }
590  template<class Value>
591  bool valued_check() const {
592  typedef Value A1;
593  typedef Value A2;
594  bool status = true;
595  if (! is_undeterminated<A1>::value) status &= _expr1.template valued_check<A1>();
596  if (! is_undeterminated<A2>::value) status &= _expr2.template valued_check<A2>();
597  return status;
598  }
599 protected:
600 // data:
603  Expr2 _expr2;
604 };
605 template<class F, class Expr1, class Expr2> struct is_form_expr_quadrature_arg <form_expr_quadrature_binary<F,Expr1,Expr2> > : std::true_type {};
606 
607 } // namespace details
608 
609 // ---------------------------------------------------------------------------
610 // 4.2. binary calls
611 // ---------------------------------------------------------------------------
612 // expr_quad := expr_quad +- expr_quad
613 // expr_quad := expr_var +- expr_quad
614 // expr_quad := expr_quad +- expr_var
615 
616 #define _RHEOLEF_form_expr_quadrature_binary(FUNCTION,FUNCTOR) \
617 template <class Expr1, class Expr2> \
618 inline \
619 typename \
620 std::enable_if< \
621  details::is_form_expr_quadrature_arg <Expr1>::value \
622  && details::is_form_expr_quadrature_arg <Expr2>::value \
623  ,details::form_expr_quadrature_binary< \
624  FUNCTOR \
625  ,Expr1 \
626  ,Expr2 \
627  > \
628 >::type \
629 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
630 { \
631  return details::form_expr_quadrature_binary \
632  <FUNCTOR, Expr1, Expr2> \
633  (FUNCTOR(), expr1, expr2); \
634 } \
635 template <class Expr1, class ExprVar2> \
636 inline \
637 typename \
638 std::enable_if< \
639  details::is_form_expr_quadrature_arg <Expr1>::value \
640  && details::is_form_expr_v2_variational_arg <ExprVar2>::value \
641  ,details::form_expr_quadrature_binary< \
642  FUNCTOR \
643  ,Expr1 \
644  ,details::form_expr_quadrature_on_element<ExprVar2> \
645  > \
646 >::type \
647 FUNCTION (const Expr1& expr1, const ExprVar2& expr_var2) \
648 { \
649  using Expr2 = details::form_expr_quadrature_on_element<ExprVar2>; \
650  return details::form_expr_quadrature_binary \
651  <FUNCTOR, Expr1, Expr2> \
652  (FUNCTOR(), expr1, Expr2(expr_var2)); \
653 } \
654 template <class ExprVar1, class Expr2> \
655 inline \
656 typename \
657 std::enable_if< \
658  details::is_form_expr_v2_variational_arg <ExprVar1>::value \
659  && details::is_form_expr_quadrature_arg <Expr2>::value \
660  ,details::form_expr_quadrature_binary< \
661  FUNCTOR \
662  ,details::form_expr_quadrature_on_element<ExprVar1> \
663  ,Expr2 \
664  > \
665 >::type \
666 FUNCTION (const ExprVar1& expr_var1, const Expr2& expr2) \
667 { \
668  using Expr1 = details::form_expr_quadrature_on_element<ExprVar1>; \
669  return details::form_expr_quadrature_binary \
670  <FUNCTOR, Expr1, Expr2> \
671  (FUNCTOR(), Expr1(expr_var1), expr2); \
672 } \
673 
676 
677 #undef _RHEOLEF_form_expr_quadrature_binary
678 
679 // ---------------------------------------------------------------------------
680 // 5. binary operators */ between a integrated form and a constant
681 // ---------------------------------------------------------------------------
682 // expr_quad := k*expr_quad
683 // expr_quad := expr_quad*k
684 // expr_quad := expr_quad/k
685 
686 namespace details {
687 
688 template<class Expr1, class Expr2, class Sfinae = void>
690 
691 template<class Expr1, class Expr2>
693  Expr1
694  ,Expr2
695  ,typename
696  std::enable_if<
697  is_rheolef_arithmetic <Expr1>::value
698  && is_form_expr_quadrature_arg<Expr2>::value
699  >::type
700 >
701 : std::true_type
702 {};
703 
704 template<class Expr1, class Expr2>
707 
708 } // namespace details
709 
710 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left(FUNCTION,FUNCTOR) \
711 template<class Expr1, class Expr2> \
712 inline \
713 typename \
714 std::enable_if< \
715  details::is_form_expr_quadrature_binary_multiplies_divides_constant_left <Expr1,Expr2>::value \
716  ,details::form_expr_quadrature_unary< \
717  details::binder_first <FUNCTOR, Expr1> \
718  ,Expr2 /* vf */ \
719  > \
720 >::type \
721 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
722 { \
723  return details::form_expr_quadrature_unary \
724  <details::binder_first <FUNCTOR,Expr1>, Expr2> \
725  (details::binder_first <FUNCTOR,Expr1> (FUNCTOR(), expr1), expr2); \
726 }
727 
728 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right(FUNCTION,FUNCTOR) \
729 template<class Expr1, class Expr2> \
730 inline \
731 typename \
732 std::enable_if< \
733  details::is_form_expr_quadrature_binary_multiplies_divides_constant_right <Expr1,Expr2>::value \
734  ,details::form_expr_quadrature_unary< \
735  details::binder_second <FUNCTOR, Expr2> \
736  ,Expr1 /* vf */ \
737  > \
738 >::type \
739 FUNCTION (const Expr1& expr1, const Expr2& expr2) \
740 { \
741  return details::form_expr_quadrature_unary \
742  <details::binder_second <FUNCTOR,Expr2>, Expr1> \
743  (details::binder_second <FUNCTOR,Expr2> (FUNCTOR(), expr2), expr1); \
744 }
745 
746 #define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant(FUNCTION,FUNCTOR) \
747  _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left (FUNCTION,FUNCTOR) \
748  _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right (FUNCTION,FUNCTOR)
749 
750 
753 
754 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right
755 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_left
756 #undef _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant
757 
758 #ifdef TODO
759 #endif // TODO
760 
761 } // namespace rheolef
762 #endif // _RHEOLEF_FORM_EXPR_QUADRATURE_H
field gh(Float epsilon, Float t, const field &uh, const test &v)
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
details::generic_binary_traits< BinaryFunction >::template result_hint< typename Expr1::value_type,typename Expr2::value_type >::type result_hint
void initialize(const band_basic< float_type, memory_type > &gh, const integrate_option &iopt)
geo_basic< float_type, memory_type > geo_type
promote_memory< typename Expr1::memory_type, typename Expr2::memory_type >::type memory_type
form_expr_quadrature_binary(const BinaryFunction &f, const Expr1 &expr1, const Expr2 &expr2)
space_basic< float_type, memory_type > space_type
details::generic_binary_traits< BinaryFunction >::template hint< typename Expr1::value_type,typename Expr2::value_type,result_hint >::result_type value_type
void initialize(const geo_basic< float_type, memory_type > &omega_K, const integrate_option &iopt)
form_expr_quadrature_binary< BinaryFunction, Expr1, Expr2 > self_type
form_expr_quadrature_binary< BinaryFunction, typename Expr1::dual_self_type, typename Expr2::dual_self_type > dual_self_type
details::bf_vf_tag< BinaryFunction, typename Expr1::vf_tag_type, typename Expr2::vf_tag_type >::type vf_tag_type
static const space_constant::valued_type valued_hint
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
scalar_traits< value_type >::type scalar_type
and_type< typename Expr1::maybe_symmetric::type, typename Expr2::maybe_symmetric::type >::type maybe_symmetric
geo_basic< float_type, memory_type > geo_type
space_basic< float_type, memory_type > space_type
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &ak) const
void initialize(const geo_basic< float_type, memory_type > &omega_K, const integrate_option &iopt)
static const space_constant::valued_type valued_hint
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
form_expr_quadrature_on_element< Expr > self_type
form_expr_quadrature_on_element< typename Expr::dual_self_type > dual_self_type
geo_basic< float_type, memory_type > geo_type
space_basic< float_type, memory_type > space_type
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &ak) const
void initialize(const geo_basic< float_type, memory_type > &omega_K, const integrate_option &iopt)
static const space_constant::valued_type valued_hint
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
form_expr_quadrature_on_element< Expr > self_type
form_expr_quadrature_on_element< typename Expr::dual_self_type > dual_self_type
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
void initialize(const band_basic< float_type, memory_type > &gh, const integrate_option &iopt)
geo_basic< float_type, memory_type > geo_type
space_basic< float_type, memory_type > space_type
form_expr_quadrature_unary(const UnaryFunction &f, const Expr &expr)
void initialize(const geo_basic< float_type, memory_type > &omega_K, const integrate_option &iopt)
details::generic_unary_traits< UnaryFunction >::template hint< typename Expr::value_type,result_hint >::result_type value_type
static const space_constant::valued_type valued_hint
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
form_expr_quadrature_unary< UnaryFunction, Expr > self_type
details::generic_unary_traits< UnaryFunction >::template result_hint< typename Expr::value_type >::type result_hint
scalar_traits< value_type >::type scalar_type
form_expr_quadrature_unary< UnaryFunction, typename Expr::dual_self_type > dual_self_type
float_traits< value_type >::type float_type
see the geo_element page for the full documentation
Definition: geo_element.h:102
size_type edge(size_type i) const
Definition: geo_element.h:209
size_type face(size_type i) const
Definition: geo_element.h:210
reference_element::size_type size_type
Definition: geo_element.h:125
size_type dimension() const
Definition: geo_element.h:167
orientation_type get_side_informations(const geo_element &S, size_type &loc_isid, size_type &shift) const
Definition: geo_element.cc:185
size_type n_subgeo(size_type subgeo_dim) const
Definition: geo_element.h:212
see the integrate_option page for the full documentation
rheolef::std type
rheolef::std BinaryFunction
rheolef::std value
rheolef::std Expr1
dot(x,y): see the expression page for the full documentation
#define fatal_macro(message)
Definition: dis_macros.h:33
#define _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right(FUNCTION, FUNCTOR)
integrate_option expr_quadrature_init_iopt(const geo_basic< T, M > &omega_K, const space_basic< T, M > &X, size_t n_derivative, const integrate_option &iopt)
This file is part of Rheolef.
std::enable_if< details::is_field_expr_v2_variational_arg< Expr >::value,details::field_expr_quadrature_on_sides< Expr > >::type on_local_sides(const Expr &expr)
on_local_sides(expr): see the expression page for the full documentation
_RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant(operator*, details::multiplies) _RHEOLEF_make_form_expr_quadrature_binary_operator_multiplies_divides_constant_right(operator/
_RHEOLEF_make_form_expr_quadrature_unary(operator+, details::unary_plus) _RHEOLEF_make_form_expr_quadrature_unary(operator-
_RHEOLEF_form_expr_quadrature_binary(operator+, details::plus) _RHEOLEF_form_expr_quadrature_binary(operator-
Definition: cavity_dg.h:29