Rheolef  7.1
an efficient C++ finite element environment
field_expr_variational_terminal.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_FIELD_EXPR_VARIATIONAL_TERMINAL_H
2 #define _RHEOLEF_FIELD_EXPR_VARIATIONAL_TERMINAL_H
3 //
24 // terminals variational expressions are used for field assembly
25 // e.g. for right-hand-side of linear systems
26 //
27 // author: Pierre.Saramito@imag.fr
28 //
29 // date: 21 september 2015
30 //
31 // Notes: use template expressions and SFINAE techniques
32 //
33 // SUMMARY:
34 // 1. concept
35 // 2. grad, grad_s, D, etc
36 // 3. div, div_s
37 // 4. curl
38 // 5. jump, average, inner, outer
39 //
40 #include "rheolef/field_expr.h"
41 #include "rheolef/test.h"
42 #include "rheolef/test_component.h"
43 
44 namespace rheolef {
45 
46 // -------------------------------------------------------------------
47 // 1. concept
48 // -------------------------------------------------------------------
49 namespace details {
50 
51 // Define a trait type for detecting field expression valid arguments
52 template<class T> struct is_field_expr_v2_variational_arg : std::false_type {};
53 template<class T, class M, class VfTag> struct is_field_expr_v2_variational_arg<test_basic<T,M,VfTag> > : std::true_type {};
54 template<class T, class M, class VfTag> struct is_field_expr_v2_variational_arg<test_component<T,M,VfTag> > : std::true_type {};
55 
56 } // namespace details
57 // ---------------------------------------------------------------------------
58 // 2. grad, grad_s, D, etc
59 // ---------------------------------------------------------------------------
60 namespace details {
61 
62 template<class Expr>
64 public:
65 // typedefs:
66 
68  typedef typename Expr::memory_type memory_type;
75  typedef typename Expr::vf_tag_type vf_tag_type;
81 
82 // alocators:
83 
85  : _expr(expr),
86  _gopt(gopt)
87  {
88  check_macro (gopt.broken || get_vf_space().get_basis().is_continuous(),
89  "grad(.): unexpected " << get_vf_space().get_basis().name()
90  << " discontinuous approximation (HINT: consider grad_h(.))");
91  }
93  : _expr(x._expr),
94  _gopt(x._gopt)
95  {}
96 
97 // accessors:
98 
99  const space_type& get_vf_space() const { return _expr.get_vf_space(); }
102  space_constant::valued_type v = _expr.valued_tag();
103  switch (v) {
107  default:
108  fatal_macro ("unexpected " << space_constant::valued_name(v) << "-valued argument for grad() operator");
110  }
111  }
112  size_type n_derivative() const { return _expr.n_derivative() + 1; }
113 
114 // mutable modifiers:
115 
116  void initialize (
117  const piola_on_pointset<float_type>& pops,
118  const integrate_option& iopt) const
119  {
120  _expr.initialize (pops, iopt);
121  }
122  void initialize (
124  const piola_on_pointset<float_type>& pops,
125  const integrate_option& iopt) const
126  {
127  _expr.initialize (gh, pops, iopt);
128  }
129  template<class Result>
130  void
132  const geo_basic<float_type,memory_type>& omega_K,
133  const geo_element& K,
134  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value) const
135  {
136  _expr.template evaluate<Result,details::differentiate_option::gradient> (omega_K, K, _gopt, value);
137  }
138  template<class Result>
139  void
141  const geo_basic<float_type,memory_type>& omega_K,
142  const geo_element& K,
143  const side_information_type& sid,
144  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value,
145  bool do_local_component_assembly) const
146  {
147  _expr.template evaluate_on_side<Result,details::differentiate_option::gradient> (omega_K, K, sid, _gopt, value, do_local_component_assembly);
148  }
149  template<class Value>
151  const geo_basic<float_type,memory_type>& omega_K,
152  const geo_element& S,
153  const geo_element& K0,
154  const geo_element& K1,
155  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value0,
156  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value1,
157  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
158  {
159  _expr.local_dg_merge_on_side (omega_K, S, K0, K1, value0, value1, value);
160  }
161  template<class Result>
162  void valued_check() const {
163  _expr.template grad_valued_check<Result>();
164  }
165 protected:
166 // data:
167  Expr _expr;
169 };
170 template<class Expr> struct is_field_expr_v2_variational_arg <field_expr_v2_variational_grad<Expr> > : std::true_type {};
171 
172 } // namespace details
173 
174 // grad(v)
175 template<class Expr>
176 inline
177 typename
178 std::enable_if<
181 >::type
182 grad (const Expr& expr)
183 {
185 }
186 // grad_s(v)
187 template<class Expr>
188 inline
189 typename
190 std::enable_if<
191  details::is_field_expr_v2_variational_arg<Expr>::value
192  ,details::field_expr_v2_variational_grad<Expr>
193 >::type
194 grad_s (const Expr& expr)
195 {
197  opt.surfacic = true;
199 }
200 // grad_h(v)
201 template<class Expr>
202 inline
203 typename
204 std::enable_if<
205  details::is_field_expr_v2_variational_arg<Expr>::value
206  ,details::field_expr_v2_variational_grad<Expr>
207 >::type
208 grad_h (const Expr& expr)
209 {
211  opt.broken = true;
213 }
214 // D(v)
215 template<class Expr>
216 inline
217 typename
218 std::enable_if<
219  details::is_field_expr_v2_variational_arg<Expr>::value
220  ,details::field_expr_v2_variational_grad<Expr>
221 >::type
222 D (const Expr& expr)
223 {
225  opt.symmetrized = true;
227 }
228 // Ds(v)
229 template<class Expr>
230 inline
231 typename
232 std::enable_if<
233  details::is_field_expr_v2_variational_arg<Expr>::value
234  ,details::field_expr_v2_variational_grad<Expr>
235 >::type
236 Ds (const Expr& expr)
237 {
239  opt.symmetrized = true;
240  opt.surfacic = true;
242 }
243 // Dh(v)
244 template<class Expr>
245 inline
246 typename
247 std::enable_if<
248  details::is_field_expr_v2_variational_arg<Expr>::value
249  ,details::field_expr_v2_variational_grad<Expr>
250 >::type
251 Dh (const Expr& expr)
252 {
254  opt.symmetrized = true;
255  opt.broken = true;
257 }
258 // ---------------------------------------------------------------------------
259 // 3. div, div_s
260 // ---------------------------------------------------------------------------
261 namespace details {
262 
263 template<class Expr>
265 public:
266 // typedefs:
267 
269  typedef typename Expr::memory_type memory_type;
276  typedef typename Expr::vf_tag_type vf_tag_type;
282 
283 // alocators:
284 
286  : _expr(expr),
287  _gopt(gopt)
288  {
289  check_macro (gopt.broken || get_vf_space().get_basis().is_continuous(),
290  "div(.): unexpected " << get_vf_space().get_basis().name()
291  << " discontinuous approximation (HINT: consider div_h(.))");
292  }
293 
294 // accessors:
295 
296  const space_type& get_vf_space() const { return _expr.get_vf_space(); }
299  space_constant::valued_type v = _expr.valued_tag();
300  switch (v) {
304  default:
305  fatal_macro ("unexpected " << space_constant::valued_name(v) << "-valued argument for div() operator");
307  }
308  }
309  size_type n_derivative() const { return _expr.n_derivative() + 1; }
310 
311 // mutable modifiers:
312 
313  void initialize (const piola_on_pointset<float_type>& pops, const integrate_option& iopt) const {
314  _expr.initialize (pops, iopt);
315  }
317  _expr.initialize (gh, pops, iopt);
318  }
319  template<class Result>
320  void evaluate (
321  const geo_basic<float_type,memory_type>& omega_K,
322  const geo_element& K,
323  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value) const
324  {
325  _expr.template evaluate<Result,details::differentiate_option::divergence> (omega_K, K, _gopt, value);
326  }
327  template<class Result>
329  const geo_basic<float_type,memory_type>& omega_K,
330  const geo_element& K,
331  const side_information_type& sid,
332  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value,
333  bool do_local_component_assembly) const
334  {
335  _expr.template evaluate_on_side<Result,details::differentiate_option::divergence> (omega_K, K, sid, _gopt, value, do_local_component_assembly);
336  }
337  template<class Result>
338  void valued_check() const {
339  _expr.template div_valued_check<Result>();
340  }
341  template<class Value>
343  const geo_basic<float_type,memory_type>& omega_K,
344  const geo_element& S,
345  const geo_element& K0,
346  const geo_element& K1,
347  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value0,
348  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value1,
349  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
350  {
351  _expr.local_dg_merge_on_side (omega_K, S, K0, K1, value0, value1, value);
352  }
353 protected:
354 // data:
355  Expr _expr;
357 };
358 template<class Expr> struct is_field_expr_v2_variational_arg <field_expr_v2_variational_div<Expr> > : std::true_type {};
359 
360 } // namespace details
361 
362 // div(v)
363 template<class Expr>
364 inline
365 typename
366 std::enable_if<
369 >::type
370 div (const Expr& expr)
371 {
373 }
374 // div_s(v)
375 template<class Expr>
376 inline
377 typename
378 std::enable_if<
379  details::is_field_expr_v2_variational_arg<Expr>::value
380  ,details::field_expr_v2_variational_div<Expr>
381 >::type
382 div_s (const Expr& expr)
383 {
385  opt.surfacic = true;
387 }
388 // div_h(v)
389 template<class Expr>
390 inline
391 typename
392 std::enable_if<
393  details::is_field_expr_v2_variational_arg<Expr>::value
394  ,details::field_expr_v2_variational_div<Expr>
395 >::type
396 div_h (const Expr& expr)
397 {
399  opt.broken = true;
401 }
402 // ---------------------------------------------------------------------------
403 // 4. curl
404 // ---------------------------------------------------------------------------
405 namespace details {
406 
407 template<class Expr>
409 public:
410 // typedefs:
411 
413  typedef typename Expr::memory_type memory_type;
416  // value_type = vctor when d=2 and Expr is scalar or when d=3
417  // = scalar when d=2 and Expr is vector
418  // thus is undeterminated at compile-time
422  typedef typename Expr::vf_tag_type vf_tag_type;
428 
429 // alocators:
430 
432  : _expr(expr),
433  _gopt(gopt)
434  {
435  check_macro (gopt.broken || get_vf_space().get_basis().is_continuous(),
436  "curl(.): unexpected " << get_vf_space().get_basis().name()
437  << " discontinuous approximation (HINT: consider curl_h(.))");
438  }
439 
440 // accessors:
441 
442  const space_type& get_vf_space() const { return _expr.get_vf_space(); }
445  space_constant::valued_type arg_v = _expr.valued_tag();
446  switch (arg_v) {
448  case space_constant::vector: {
449  size_type d = get_vf_space().get_geo().dimension();
451  }
452  default:
453  fatal_macro ("unexpected " << space_constant::valued_name(arg_v) << "-valued argument for curl() operator");
455  }
456  }
457  size_type n_derivative() const { return _expr.n_derivative() + 1; }
458 
459 // mutable modifiers:
460 
461  void initialize (const piola_on_pointset<float_type>& pops, const integrate_option& iopt) const {
462  _expr.initialize (pops, iopt);
463  }
465  _expr.initialize (gh, pops, iopt);
466  }
467  template<class Result>
468  void evaluate (
469  const geo_basic<float_type,memory_type>& omega_K,
470  const geo_element& K,
471  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value) const
472  {
473  _expr.template evaluate<Result,details::differentiate_option::curl> (omega_K, K, _gopt, value);
474  }
475  template<class Value>
477  const geo_basic<float_type,memory_type>& omega_K,
478  const geo_element& S,
479  const geo_element& K0,
480  const geo_element& K1,
481  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value0,
482  const Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value1,
483  Eigen::Matrix<Value,Eigen::Dynamic,Eigen::Dynamic>& value) const
484  {
485  _expr.local_dg_merge_on_side (omega_K, S, K0, K1, value0, value1, value);
486  }
487  void _valued_check_internal(const scalar_type&) const {
488  _expr.template valued_check<point_basic<scalar_type> >();
489  size_type d = get_vf_space().get_geo().dimension();
490  check_macro (d==2, "unexpected "<<d<<"D physical dimension for the scalar-valued curl() operator");
491  }
493  size_type d = get_vf_space().get_geo().dimension();
494  check_macro (d==2 || d==3, "unexpected "<<d<<"D physical dimension for the vector-valued curl() operator");
495  if (d == 2) {
496  _expr.template valued_check<scalar_type>();
497  } else {
498  _expr.template valued_check<point_basic<scalar_type> >();
499  }
500  }
502  fatal_macro ("unexpected tensor-valued result for the curl() operator");
503  }
504  template<class Result>
505  void valued_check() const {
506  _valued_check_internal(Result());
507  }
508 protected:
509 // data:
510  Expr _expr;
512 };
513 template<class Expr> struct is_field_expr_v2_variational_arg <field_expr_v2_variational_curl<Expr> > : std::true_type {};
514 
515 } // namespace details
516 
517 // curl(v)
518 template<class Expr>
519 inline
520 typename
521 std::enable_if<
524 >::type
525 curl (const Expr& expr)
526 {
528 }
529 // bcurl(v) = Batchelor curl
530 template<class Expr>
531 inline
532 typename
533 std::enable_if<
534  details::is_field_expr_v2_variational_arg<Expr>::value
535  ,details::field_expr_v2_variational_curl<Expr>
536 >::type
537 bcurl (const Expr& expr)
538 {
540  opt.batchelor_curl = true;
542 }
543 // ---------------------------------------------------------------------------
544 // 5. jump, average, inner, outer
545 // ---------------------------------------------------------------------------
546 // discontinuous Galerkin operators
547 // in expressions templates for variationnal formulations
548 //
549 /*
550 
551 SPECIFICATION: a first example
552 
553  Let v be a function defined over Omega
554  and discontinuous across internal sides (e.g. Pkd).
555  Let f be a function defined on Oemga.
556 
557  We want to assembly
558  l(v) = int_{internal sides} f(x) [v](x) ds
559  where [v] is the jump of v across internal sides.
560 
561  => l(v) = sum_{K is internal sides} int_K f(x) [v](x) ds
562 
563  Let K be an internal side of the mesh of Omega.
564 
565  int_K f(x) [v](x) ds
566  = int_{hat_K} f(F(hat_x))
567  [v](F(hat_x))
568  det(DF(hat_x)) d hat_s
569 
570  where F is the piola transformation from the reference element hat_K to K:
571  F : hat_K ---> K
572  hat_x |--> x = F(hat_x)
573 
574  The fonction v is not defined on a basis over internal sides K but over
575  elements L of the mesh of Omega.
576  Let L0 and L1 the two elements such that K is the common side of L0 and L1
577  and K is oriented from L0 to L1:
578  [v] = v0 - v1 on K, where v0=v/L0 and v1=v/L1.
579 
580  Let G0 the piola transformation from the reference element tilde_L to L0:
581  G0 : tilde_L ---> L0
582  tilde_x |--> x = G0(tilde_x)
583 
584  Conversely, let G1 the piola transformation from the reference element tilde_L to L1.
585 
586  int_K f(x) [v](x) ds
587  = int_{hat_K} f(F(hat_x))
588  (v0-v1)(F(hat_x))
589  det(DF(hat_x)) d hat_s
590 
591  The the basis fonction v0 and v1 are defined by using tilde_v, on the reference element tilde_L:
592  v0(x) = tilde_v (G0^{-1}(x))
593  v1(x) = tilde_v (G1^{-1}(x))
594  and with x=F(hat_x):
595  v0(F(hat_x)) = tilde_v (G0^{-1}(F(hat_x)))
596  v1(F(hat_x)) = tilde_v (G1^{-1}(F(hat_x)))
597 
598  Thus:
599  int_K f(x) [v](x) ds
600  = int_{hat_K} f(F(hat_x))
601  ( tilde_v (G0^{-1}(F(hat_x)))
602  - tilde_v (G1^{-1}(F(hat_x))) )
603  det(DF(hat_x)) ds
604 
605  Observe that H0=G0^{-1}oF is linear:
606  H0 : hat_K ---> tilde0_K subset tilde_L
607  hat_x ---> tilde0_x = H0(hat_x)
608  Conversely:
609  H1 : hat_K ---> tilde1_K subset tilde_L
610  hat_x ---> tilde1_x = H1(hat_x)
611  Thus, K linearly transforms by H0 into a side tilde0_K of the reference element tilde_L
612  and, by H1, into another side tilde1_K of tilde_L.
613 
614  int_K f(x) [v](x) ds
615  = int_{hat_K} f(F(hat_x))
616  ( tilde_v (H0(hat_x))
617  - tilde_v (H1(hat_x)) )
618  det(DF(hat_x)) ds
619 
620  Let (hat_xq, hat_wq)_{q=0...} a quadrature formulae over hat_K.
621  The integral becomes:
622 
623  int_K f(x) [v](x) ds
624  = sum_q f(F(hat_xq))
625  ( tilde_v (H0(hat_xq))
626  - tilde_v (H1(hat_xq)) )
627  det(DF(hat_xq)) hat_wq
628 
629  Then, the basis functions tilde_v can be computed one time for all
630  over all the sides tilde(i)_K of the reference element tilde_L, i=0..nsides(tilde_L)
631  at the quadratures nodes tilde(i)_xq = Hi(hat_xq):
632  tilde_v (Hi(hat_xq)), i=0..nsides(tilde_L), q=0..nq(hat_K)
633 
634 SPECIFICATION: a second example
635 
636  We want to assembly
637  l(v) = int_{internal sides} f(x) [grad(v).n](x) ds
638  where [grad(v).n] is the jump of the normal derivative of v across internal sides.
639 
640  Let K be an internal side of the mesh of Omega.
641 
642  int_K f(x) [grad(v).n](x) ds
643  = int_{hat_K} f(F(hat_x))
644  [grad(v).n](F(hat_x))
645  det(DF(hat_x)) d hat_s
646 
647  = int_{hat_K} f(F(hat_x))
648  (grad(v0).n)(F(hat_x))
649  det(DF(hat_x)) d hat_s
650  - int_{hat_K} f(F(hat_x))
651  (grad(v1).n)(F(hat_x))
652  det(DF(hat_x)) d hat_s
653 
654  where v0=v/L0 and v1=v/L1 and Li are the two elements containing the side K.
655  Let us fix one of the Li and omits the i subscript.
656  The computation reduces to evaluate:
657 
658  int_K f(x) grad(v).n(x) ds
659  = sum_q f(F(hat_xq))
660  (grad(v).n)(F(hat_xq))
661  det(DF(hat_xq)) hat_wq
662 
663  From the gradient transformation:
664 
665  grad(v)(F(hat_xq)) = DG^{-T}(H(hat_xq)) * tilde_grad(tilde_v)(H(hat_xq))
666 
667  where H = G^{-1}oF is linear from hat_K to tilde_K subset tilde_L.
668 
669  int_K f(x) grad(v).n(x) ds
670  = sum_q f(F(hat_xq))
671  DG^{-T}(H(hat_xq))*tilde_grad(tilde_v)(H(hat_xq))
672  .n(F(hat_xq))
673  det(DF(hat_xq)) hat_wq
674 
675  We can evaluate one time for all the gradients of basis functions tilde_v
676  on the quadrature nodes of each sides tilde_K of tilde_L :
677  tilde_grad(tilde_v)(H(hat_xq))
678  The piola basis functions and their derivatives are also evaluated one time for all on these nodes :
679  DG^{-T}(H(hat_xq))
680 
681  The normal vector
682  n(xq), xq=F(hat_xq), q=...
683  should be evaluated on K, not on L that has no normal vector.
684 
685 IMPLEMENTATION: bassis evaluation => test.cc
686 
687  The basis_on_pointset class extends to the case of an integration over a side of
688 
689  test_rep<T,M>::initialize (const geo_basic<float_type,M>& dom, const quadrature<T>& quad, const integrate_option& iopt) const {
690  _basis_on_quad.set (quad, get_vf_space().get_basis());
691  _piola_on_quad.set (quad, get_vf_space().get_geo().get_piola_basis());
692  => inchange'
693  }
694  test_rep<T,M>::element_initialize (const geo_element& L, size_type loc_isid=-1) const {
695  if (loc_isid != -1) {
696  basis_on_quad.restrict_on_side (tilde_L, loc_isid);
697  piola_on_quad.restrict_on_side (tilde_L, loc_isid);
698  }
699  }
700  test_rep<T,M>::basis_evaluate (...) {
701  // Then, a subsequent call to
702  basis_on_quad.evaluate (tilde_L, q);
703  // will restrict to the loc_isid part.
704  }
705 
706 IMPLEMENTATION: normal vector => field_vf_expr.h & field_nl_expr_terminal.h
707  on propage des vf_expr aux nl_expr le fait qu'on travaille sur une face :
708  class nl_helper {
709  void element_initialize (const This& obj, const geo_element& L, size_type loc_isid=-1) const {
710  obj._nl_expr.evaluate (L, isid, obj._vector_nl_value_quad);
711  }
712  };
713  pour la classe normal :
714  field_expr_terminal_normal::evaluate (L, loc_isid, value) {
715  if (loc_isid != -1) K=side(L,loc_isid); else K=L;
716  puis inchange.
717  }
718  pour la classe terminal_field: si on evalue un field uh qui est discontinu :
719  on sait sur quelle face il se restreint :
720  field_expr_terminal_field::evaluate (L, loc_isid, value) {
721  if (loc_isid != -1) {
722  _basis_on_quad.restrict_on_side (tilde_L, loc_isid);
723  }
724  for (q..) {
725  general_field_evaluate (_uh, _basis_on_quad, tilde_L, _dis_idof, q, value[q]);
726  }
727  }
728 IMPLEMENTATION: bassis evaluation => basis_on_pointset.cc
729  c'est la que se fait le coeur du travail :
730  basis_on_pointset::restrict_on_side (tilde_L, loc_isid)
731  => initialise
732 
733  a l'initialisation, on evalue une fois pour tte
734  sur toutes les faces en transformant la quadrature via
735  tilde(i)_xq = Hi(hat_xq)
736  tilde(i)_wq = ci*hat_wq
737  avec
738  ci = meas(tilde(i)_K)/meas(hat_K)
739 
740  puis :
741  basis_on_pointset::evaluate (tilde_L, q)
742  on se baladera dans la tranche [loc_isid*nq, (loc_isid+1)*nq[
743  du coup, on positionne un pointeur de debut q_start = loc_isid*nq
744  et une taille q_size = nq
745  si les faces sont differentes (tri,qua) dans un prisme, il faudra
746  un tableau de pointeurs pour gerer cela :
747  q_start [loc_nsid+1]
748  q_size [loc_isid] = q_start[loc_isid+1] - q_start[loc_isid]
749 
750  basis_on_pointset::begin() { return _val[_curr_K_variant][_curr_q].begin() + q_start[_curr_K_variant][loc_isid]; }
751  basis_on_pointset::begin() { return _val[_curr_K_variant][_curr_q].begin() + q_start[_curr_K_variant][loc_isid+1]; }
752 
753  et le tour est joue' !
754 
755 PLAN DE DEVELOPPEMENT:
756  1) DG transport
757  basis_on_pointset.cc
758  test.cc
759  essais :
760  lh = integrate(jump(v)*f);
761  convect_dg2.cc
762  2) DG diffusion : avec normale et gradient
763  field_vf_expr.h
764  class nl_helper
765  field_nl_expr_terminal.h
766  field_expr_terminal_normal::evaluate (L, loc_isid, value)
767  field_expr_terminal_field ::evaluate (L, loc_isid, value)
768 
769 */
770 
771 namespace details {
772 // ---------------------------------------------------------------------------
773 // 5.1 class dg
774 // ---------------------------------------------------------------------------
775 template<class Expr>
777 public:
778 // typedefs:
779 
780  typedef typename Expr::size_type size_type;
781  typedef typename Expr::memory_type memory_type;
782  typedef typename Expr::value_type value_type;
783  typedef typename Expr::scalar_type scalar_type;
784  typedef typename Expr::float_type float_type;
785  typedef typename Expr::space_type space_type;
786  typedef typename Expr::vf_tag_type vf_tag_type;
792 
793 // alocators:
794 
795  field_expr_v2_variational_dg (const Expr& expr, const float_type& c0, const float_type& c1)
796  : _expr0(expr),
797  _expr1(expr),
798  _c0(c0),
799  _c1(c1),
800  _tilde0_L0(),
801  _tilde1_L1(),
802  _bgd_omega()
803  {
804  }
805 
806 // accessors:
807 
808  const space_type& get_vf_space() const { return _expr0.get_vf_space(); }
809  static const space_constant::valued_type valued_hint = Expr::valued_hint;
810  space_constant::valued_type valued_tag() const { return _expr0.valued_tag(); }
811  size_type n_derivative() const { return _expr0.n_derivative(); }
812 
813 // mutable modifiers:
814 
815  void initialize (const piola_on_pointset<float_type>& pops, const integrate_option& iopt) const {
816  _expr0.initialize (pops, iopt);
817  _expr1.initialize (pops, iopt);
818  _bgd_omega = get_vf_space().get_constitution().get_background_geo();
819  }
821  _expr0.initialize (gh, pops, iopt);
822  _expr1.initialize (gh, pops, iopt);
823  fatal_macro ("unsupported discontinuous Galerkin on a band"); // how to define background mesh _bgd_omega ?
824  }
825  template<class Result>
826  void evaluate (
827  const geo_basic<float_type,memory_type>& omega_K,
828  const geo_element& K,
829  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value) const;
830 
831  template<class Result>
832  void valued_check() const {
833  check_macro (get_vf_space().get_constitution().is_discontinuous(),
834  "unexpected continuous test-function in space " << get_vf_space().name()
835  << " for jump or average operator (HINT: omit jump or average)");
836  _expr0.template valued_check<Result>();
837  }
838 
839 protected:
840 // data:
841  mutable Expr _expr0;
842  mutable Expr _expr1;
848 };
849 template<class Expr> struct is_field_expr_v2_variational_arg <field_expr_v2_variational_dg<Expr> > : std::true_type {};
850 // ---------------------------------------------------------------------------
851 // 5.2. evaluate
852 // ---------------------------------------------------------------------------
853 template<class Expr>
854 template<class Result>
855 void
857  const geo_basic<float_type,memory_type>& omega_K,
858  const geo_element& K,
859  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic>& value) const
860 {
861 trace_macro ("evaluate_dg: "<<K.name()<<K.dis_ie()<<"...")
862  check_macro (_bgd_omega == omega_K.get_background_geo().get_background_geo(),
863  "discontinuous Galerkin: incompatible integration domain "<<omega_K.name() << " and test function in "
864  << get_vf_space().name());
865  size_type L_map_d = K.dimension() + 1;
866  size_type L_dis_ie0 = K.master(0);
867  size_type L_dis_ie1 = K.master(1);
868  check_macro (L_dis_ie0 != std::numeric_limits<size_type>::max(),
869  "unexpected isolated mesh side "<<K.name()<<K.dis_ie()<<" dim="<<K.dimension());
870  const geo_element& L0 = _bgd_omega.dis_get_geo_element (L_map_d, L_dis_ie0);
872  L0.get_side_informations (K, sid0);
873  if (L_dis_ie1 == std::numeric_limits<size_type>::max()) {
874  // K is a boundary side
875  bool do_local_component_assembly = true;
876  _expr0.evaluate_on_side (omega_K, L0, sid0, value, do_local_component_assembly);
877  // outer(v) i.e. when c0==0 => fix it since outer(v)=0 on the boundary
878  // otherwise: average(v)=jump(v)=inner(v)=v on the boundary : no changes
879  if (_c0 == 0) { value.fill (Result()); }
880  } else {
881  // K is an internal side
882  const geo_element& L1 = _bgd_omega.dis_get_geo_element (L_map_d, L_dis_ie1);
884  L1.get_side_informations (K, sid1);
885  Eigen::Matrix<Result,Eigen::Dynamic,Eigen::Dynamic> value0, value1;
886  bool do_local_component_assembly = false;
887  _expr0.evaluate_on_side (omega_K, L0, sid0, value0, do_local_component_assembly);
888  _expr1.evaluate_on_side (omega_K, L1, sid1, value1, do_local_component_assembly);
889  for (size_type loc_inod = 0, loc_nnod = value0.rows(); loc_inod < loc_nnod; ++loc_inod) {
890  for (size_type loc_idof = 0, loc_ndof = value0.cols(); loc_idof < loc_ndof; ++loc_idof) {
891  value0 (loc_inod,loc_idof) = _c0*value0 (loc_inod,loc_idof); // TODO: DVT_EIGEN_BLAS2
892  }}
893  for (size_type loc_inod = 0, loc_nnod = value1.rows(); loc_inod < loc_nnod; ++loc_inod) {
894  for (size_type loc_idof = 0, loc_ndof = value1.cols(); loc_idof < loc_ndof; ++loc_idof) {
895  value1 (loc_inod,loc_idof) = _c1*value1 (loc_inod,loc_idof); // TODO: DVT_EIGEN_BLAS2
896  }}
897  // merge loc_dofs at the component level
898  // assume that space is not hierarchical, otherwise see dg_merge
899  _expr0.local_dg_merge_on_side (omega_K, K, L0, L1, value0, value1, value);
900  }
901 trace_macro ("evaluate_dg: "<<K.name()<<K.dis_ie()<<" done")
902 }
903 
904 } // namespace details
905 // ---------------------------------------------------------------------------
906 // 5.4. user-level interface
907 // ---------------------------------------------------------------------------
908 #define _RHEOLEF_make_field_expr_v2_variational_dg(op,c0,c1) \
909 template<class Expr> \
910 inline \
911 typename \
912 std::enable_if< \
913  details::is_field_expr_v2_variational_arg<Expr>::value \
914  ,details::field_expr_v2_variational_dg<Expr> \
915 >::type \
916 op (const Expr& expr) \
917 { \
918  return details::field_expr_v2_variational_dg <Expr> (expr, c0, c1); \
919 }
920 
925 #undef _RHEOLEF_make_field_expr_v2_variational_dg
926 
927 } // namespace rheolef
928 #endif // _RHEOLEF_FIELD_EXPR_VARIATIONAL_TERMINAL_H
rheolef::details::field_expr_v2_variational_curl::valued_hint
static const space_constant::valued_type valued_hint
Definition: field_expr_variational_terminal.h:443
rheolef::details::field_expr_v2_variational_div::valued_check
void valued_check() const
Definition: field_expr_variational_terminal.h:338
rheolef::details::field_expr_v2_variational_div::memory_type
Expr::memory_type memory_type
Definition: field_expr_variational_terminal.h:269
rheolef::details::field_expr_v2_variational_div::self_type
field_expr_v2_variational_div< Expr > self_type
Definition: field_expr_variational_terminal.h:279
rheolef::details::field_expr_v2_variational_dg::valued_hint
static const space_constant::valued_type valued_hint
Definition: field_expr_variational_terminal.h:809
rheolef::geo_basic< float_type, memory_type >
rheolef::div
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::divergence >>::type div(const Expr &expr)
div(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:1031
rheolef::space_constant::last_valued
@ last_valued
Definition: space_constant.h:143
rheolef::details::field_expr_v2_variational_dg::_tilde0_L0
reference_element _tilde0_L0
Definition: field_expr_variational_terminal.h:845
rheolef::bcurl
std::enable_if< details::is_field_expr_v2_variational_arg< Expr >::value,details::field_expr_v2_variational_curl< Expr >>::type bcurl(const Expr &expr)
Definition: field_expr_variational_terminal.h:537
rheolef::details::field_expr_v2_variational_div::size_type
geo_element::size_type size_type
Definition: field_expr_variational_terminal.h:268
rheolef::details::field_expr_v2_variational_curl::_valued_check_internal
void _valued_check_internal(const tensor_basic< scalar_type > &) const
Definition: field_expr_variational_terminal.h:501
rheolef::details::field_expr_v2_variational_dg::valued_tag
space_constant::valued_type valued_tag() const
Definition: field_expr_variational_terminal.h:810
rheolef::details::field_expr_v2_variational_grad::get_vf_space
const space_type & get_vf_space() const
Definition: field_expr_variational_terminal.h:99
rheolef::details::field_expr_v2_variational_grad::_gopt
differentiate_option _gopt
Definition: field_expr_variational_terminal.h:168
rheolef::Ds
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type Ds(const Expr &expr)
Ds(uh): see the expression page for the full documentation.
Definition: field_expr_terminal.h:989
rheolef::details::field_expr_v2_variational_div::value_type
space_constant::rank_down< typename Expr::value_type >::type value_type
Definition: field_expr_variational_terminal.h:271
gh
field gh(Float epsilon, Float t, const field &uh, const test &v)
Definition: burgers_diffusion_operators.icc:37
rheolef::details::field_expr_v2_variational_grad::scalar_type
scalar_traits< typename Expr::value_type >::type scalar_type
Definition: field_expr_variational_terminal.h:70
mkgeo_ball.expr
expr
Definition: mkgeo_ball.sh:361
rheolef::point_basic
Definition: point.h:87
rheolef::details::field_expr_v2_variational_dg::value_type
Expr::value_type value_type
Definition: field_expr_variational_terminal.h:782
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
rheolef::geo_element::master
size_type master(bool i) const
Definition: geo_element.h:165
rheolef::details::field_expr_v2_variational_div::n_derivative
size_type n_derivative() const
Definition: field_expr_variational_terminal.h:309
rheolef::details::field_expr_v2_variational_dg::self_type
field_expr_v2_variational_dg< Expr > self_type
Definition: field_expr_variational_terminal.h:789
rheolef::details::field_expr_v2_variational_curl::scalar_type
scalar_traits< typename Expr::value_type >::type scalar_type
Definition: field_expr_variational_terminal.h:415
rheolef::details::field_expr_v2_variational_curl::n_derivative
size_type n_derivative() const
Definition: field_expr_variational_terminal.h:457
rheolef::details::field_expr_v2_variational_grad::_expr
Expr _expr
Definition: field_expr_variational_terminal.h:167
rheolef::details::test_component
Definition: test_component.h:405
rheolef::details::field_expr_v2_variational_div::valued_tag
space_constant::valued_type valued_tag() const
Definition: field_expr_variational_terminal.h:298
rheolef::details::field_expr_v2_variational_dg::memory_type
Expr::memory_type memory_type
Definition: field_expr_variational_terminal.h:781
rheolef::details::field_expr_v2_variational_dg::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:856
rheolef::details::field_expr_v2_variational_dg::float_type
Expr::float_type float_type
Definition: field_expr_variational_terminal.h:784
rheolef::details::field_expr_v2_variational_curl::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:468
rheolef::details::field_expr_v2_variational_div::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:316
rheolef::details::field_expr_v2_variational_dg::dual_self_type
field_expr_v2_variational_dg< typename Expr::dual_self_type > dual_self_type
Definition: field_expr_variational_terminal.h:791
rheolef::details::field_expr_v2_variational_curl::_valued_check_internal
void _valued_check_internal(const point_basic< scalar_type > &) const
Definition: field_expr_variational_terminal.h:492
rheolef::details::field_expr_v2_variational_curl::initialize
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:461
rheolef::value
rheolef::std value
rheolef::details::field_expr_v2_variational_div::vf_tag_type
Expr::vf_tag_type vf_tag_type
Definition: field_expr_variational_terminal.h:276
rheolef::geo_element::get_side_informations
orientation_type get_side_informations(const geo_element &S, size_type &loc_isid, size_type &shift) const
Definition: geo_element.cc:185
rheolef::_expr1
Expr1 _expr1
Definition: field_expr_recursive.h:933
rheolef::space_basic
the finite element space
Definition: space.h:352
rheolef::tensor_basic
Definition: tensor.h:90
rheolef::details::field_expr_v2_variational_grad::local_dg_merge_on_side
void local_dg_merge_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &S, const geo_element &K0, const geo_element &K1, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value0, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value1, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:150
rheolef::details::field_expr_v2_variational_grad::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:131
rheolef::details::field_expr_v2_variational_div::_expr
Expr _expr
Definition: field_expr_variational_terminal.h:355
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
rheolef::space_constant::tensor3
@ tensor3
Definition: space_constant.h:140
rheolef::geo_element
see the geo_element page for the full documentation
Definition: geo_element.h:102
rheolef::details::field_expr_v2_variational_grad::valued_tag
space_constant::valued_type valued_tag() const
Definition: field_expr_variational_terminal.h:101
rheolef::details::field_expr_v2_variational_grad::vf_tag_type
Expr::vf_tag_type vf_tag_type
Definition: field_expr_variational_terminal.h:75
rheolef::details::field_expr_v2_variational_div::get_vf_space
const space_type & get_vf_space() const
Definition: field_expr_variational_terminal.h:296
rheolef::details::field_expr_v2_variational_dg::size_type
Expr::size_type size_type
Definition: field_expr_variational_terminal.h:780
rheolef::details::field_expr_v2_variational_dg
Definition: field_expr_variational_terminal.h:776
rheolef::space_constant::valued_type
valued_type
Definition: space_constant.h:135
rheolef::details::field_expr_v2_variational_dg::space_type
Expr::space_type space_type
Definition: field_expr_variational_terminal.h:785
rheolef::grad
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad(const Expr &expr)
grad(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:911
rheolef::undeterminated_basic
helper for generic field value_type: T, point_basic<T> or tensor_basic<T>
Definition: undeterminated.h:32
rheolef::details::field_expr_v2_variational_grad::field_expr_v2_variational_grad
field_expr_v2_variational_grad(const field_expr_v2_variational_grad< Expr > &x)
Definition: field_expr_variational_terminal.h:92
rheolef::details::field_expr_v2_variational_grad::initialize
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:116
rheolef::geo_element::dis_ie
size_type dis_ie() const
Definition: geo_element.h:163
rheolef::div_h
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::divergence >>::type div_h(const Expr &expr)
div_h(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:1069
rheolef::details::field_expr_v2_variational_grad::field_expr_v2_variational_grad
field_expr_v2_variational_grad(const Expr &expr, const differentiate_option &gopt=differentiate_option())
Definition: field_expr_variational_terminal.h:84
rheolef::details::field_expr_v2_variational_div
Definition: field_expr_variational_terminal.h:264
rheolef::details::field_expr_v2_variational_dg::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:820
rheolef::side_information_type
Definition: reference_element_face_transformation.h:37
rheolef::details::field_expr_v2_variational_curl::get_vf_space
const space_type & get_vf_space() const
Definition: field_expr_variational_terminal.h:442
rheolef::reference_element
see the reference_element page for the full documentation
Definition: reference_element.h:66
rheolef::details::field_expr_v2_variational_div::float_type
float_traits< scalar_type >::type float_type
Definition: field_expr_variational_terminal.h:274
rheolef::details::field_expr_v2_variational_curl::_valued_check_internal
void _valued_check_internal(const scalar_type &) const
Definition: field_expr_variational_terminal.h:487
rheolef::integrate_option
see the integrate_option page for the full documentation
Definition: integrate_option.h:125
rheolef::space_constant::tensor
@ tensor
Definition: space_constant.h:138
rheolef::details::field_expr_v2_variational_div::dual_self_type
field_expr_v2_variational_div< typename Expr::dual_self_type > dual_self_type
Definition: field_expr_variational_terminal.h:281
rheolef::space_constant::scalar
@ scalar
Definition: space_constant.h:136
rheolef::details::field_expr_v2_variational_dg::_expr0
Expr _expr0
Definition: field_expr_variational_terminal.h:841
rheolef::details::field_expr_v2_variational_grad::value_type
space_constant::rank_up< typename Expr::value_type >::type value_type
Definition: field_expr_variational_terminal.h:72
rheolef::Dh
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type Dh(const Expr &expr)
Dh(uh): see the expression page for the full documentation.
Definition: field_expr_terminal.h:1010
rheolef::details::field_expr_v2_variational_grad::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value, bool do_local_component_assembly) const
Definition: field_expr_variational_terminal.h:140
rheolef::details::vf_tag_nonlinear
Definition: field_expr_variational_tag.h:49
rheolef::test_basic
Definition: test.h:207
rheolef::geo_element::dimension
size_type dimension() const
Definition: geo_element.h:167
rheolef::details::field_expr_v2_variational_grad::memory_type
Expr::memory_type memory_type
Definition: field_expr_variational_terminal.h:68
rheolef::details::field_expr_v2_variational_grad::float_type
float_traits< scalar_type >::type float_type
Definition: field_expr_variational_terminal.h:73
rheolef::details::field_expr_v2_variational_curl::memory_type
Expr::memory_type memory_type
Definition: field_expr_variational_terminal.h:413
rheolef::geo_element::size_type
reference_element::size_type size_type
Definition: geo_element.h:125
rheolef::details::field_expr_v2_variational_div::vf_dual_tag_type
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
Definition: field_expr_variational_terminal.h:278
rheolef::details::field_expr_v2_variational_curl::valued_check
void valued_check() const
Definition: field_expr_variational_terminal.h:505
rheolef::type
rheolef::std type
rheolef::details::differentiate_option::symmetrized
bool symmetrized
Definition: piola.h:49
rheolef::details::differentiate_option
Definition: piola.h:41
rheolef::details::field_expr_v2_variational_dg::get_vf_space
const space_type & get_vf_space() const
Definition: field_expr_variational_terminal.h:808
rheolef::details::field_expr_v2_variational_div::evaluate_on_side
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, const side_information_type &sid, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value, bool do_local_component_assembly) const
Definition: field_expr_variational_terminal.h:328
rheolef::details::field_expr_v2_variational_dg::_c0
scalar_type _c0
Definition: field_expr_variational_terminal.h:843
rheolef::details::field_expr_v2_variational_grad::valued_hint
static const space_constant::valued_type valued_hint
Definition: field_expr_variational_terminal.h:100
rheolef::details::field_expr_v2_variational_curl::vf_tag_type
Expr::vf_tag_type vf_tag_type
Definition: field_expr_variational_terminal.h:422
rheolef::grad_s
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad_s(const Expr &expr)
grad_s(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:929
rheolef::details::field_expr_v2_variational_curl::value_type
undeterminated_basic< scalar_type > value_type
Definition: field_expr_variational_terminal.h:419
rheolef::space_constant::unsymmetric_tensor
@ unsymmetric_tensor
Definition: space_constant.h:139
rheolef::details::field_expr_v2_variational_div::field_expr_v2_variational_div
field_expr_v2_variational_div(const Expr &expr, const differentiate_option &gopt=differentiate_option())
Definition: field_expr_variational_terminal.h:285
rheolef::details::field_expr_v2_variational_curl::dual_self_type
field_expr_v2_variational_curl< typename Expr::dual_self_type > dual_self_type
Definition: field_expr_variational_terminal.h:427
rheolef::details::field_expr_v2_variational_grad::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:122
fatal_macro
#define fatal_macro(message)
Definition: dis_macros.h:33
rheolef::details::field_expr_v2_variational_dg::n_derivative
size_type n_derivative() const
Definition: field_expr_variational_terminal.h:811
rheolef::piola_on_pointset< float_type >
rheolef::space_constant::valued_name
const std::string & valued_name(valued_type valued_tag)
Definition: space_constant.cc:43
rheolef::details::field_expr_v2_variational_div::scalar_type
scalar_traits< typename Expr::value_type >::type scalar_type
Definition: field_expr_variational_terminal.h:273
rheolef::band_basic
Definition: band.h:95
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::float_traits::type
T type
Definition: Float.h:94
rheolef::details::field_expr_v2_variational_curl::space_type
space_basic< scalar_type, memory_type > space_type
Definition: field_expr_variational_terminal.h:421
rheolef::details::field_expr_v2_variational_curl::local_dg_merge_on_side
void local_dg_merge_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &S, const geo_element &K0, const geo_element &K1, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value0, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value1, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:476
rheolef::curl
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::curl >>::type curl(const Expr &expr)
curl(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:1089
rheolef::details::is_field_expr_v2_variational_arg
Definition: field_expr_variational_terminal.h:52
rheolef::details::field_expr_v2_variational_grad
Definition: field_expr_variational_terminal.h:63
rheolef::details::field_expr_v2_variational_div::initialize
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:313
rheolef::details::field_expr_v2_variational_dg::scalar_type
Expr::scalar_type scalar_type
Definition: field_expr_variational_terminal.h:783
rheolef::D
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type D(const Expr &expr)
D(uh): see the expression page for the full documentation.
Definition: field_expr_terminal.h:969
rheolef::details::field_expr_v2_variational_grad::space_type
space_basic< scalar_type, memory_type > space_type
Definition: field_expr_variational_terminal.h:74
rheolef::details::field_expr_v2_variational_div::_gopt
differentiate_option _gopt
Definition: field_expr_variational_terminal.h:356
rheolef::details::differentiate_option::broken
bool broken
Definition: piola.h:51
rheolef::details::field_expr_v2_variational_grad::self_type
field_expr_v2_variational_grad< Expr > self_type
Definition: field_expr_variational_terminal.h:78
rheolef::details::field_expr_v2_variational_curl::initialize
void initialize(const band_basic< float_type, memory_type > &gh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:464
rheolef::details::field_expr_v2_variational_dg::vf_tag_type
Expr::vf_tag_type vf_tag_type
Definition: field_expr_variational_terminal.h:786
rheolef::scalar_traits::type
T type
Definition: point.h:324
rheolef::details::field_expr_v2_variational_curl::vf_dual_tag_type
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
Definition: field_expr_variational_terminal.h:424
rheolef::details::field_expr_v2_variational_dg::_expr1
Expr _expr1
Definition: field_expr_variational_terminal.h:842
rheolef::div_s
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::divergence >>::type div_s(const Expr &expr)
div_s(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:1049
rheolef::space_constant::vector
@ vector
Definition: space_constant.h:137
rheolef::details::field_expr_v2_variational_div::evaluate
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Result, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:320
rheolef::details::field_expr_v2_variational_curl::valued_tag
space_constant::valued_type valued_tag() const
Definition: field_expr_variational_terminal.h:444
rheolef::details::field_expr_v2_variational_curl::self_type
field_expr_v2_variational_curl< Expr > self_type
Definition: field_expr_variational_terminal.h:425
rheolef::details::field_expr_v2_variational_grad::vf_dual_tag_type
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
Definition: field_expr_variational_terminal.h:77
rheolef::details::field_expr_v2_variational_grad::valued_check
void valued_check() const
Definition: field_expr_variational_terminal.h:162
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::_RHEOLEF_make_field_expr_v2_variational_dg
_RHEOLEF_make_field_expr_v2_variational_dg(jump, 1, -1) _RHEOLEF_make_field_expr_v2_variational_dg(average
rheolef::geo_element::name
char name() const
Definition: geo_element.h:169
rheolef::grad_h
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad_h(const Expr &expr)
grad_h(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:949
rheolef::details::field_expr_v2_variational_grad::dual_self_type
field_expr_v2_variational_grad< typename Expr::dual_self_type > dual_self_type
Definition: field_expr_variational_terminal.h:80
rheolef::details::field_expr_v2_variational_dg::field_expr_v2_variational_dg
field_expr_v2_variational_dg(const Expr &expr, const float_type &c0, const float_type &c1)
Definition: field_expr_variational_terminal.h:795
rheolef::details::field_expr_v2_variational_curl::_gopt
differentiate_option _gopt
Definition: field_expr_variational_terminal.h:511
rheolef::details::field_expr_v2_variational_curl::_expr
Expr _expr
Definition: field_expr_variational_terminal.h:510
rheolef::details::field_expr_v2_variational_curl::field_expr_v2_variational_curl
field_expr_v2_variational_curl(const Expr &expr, const differentiate_option &gopt=differentiate_option())
Definition: field_expr_variational_terminal.h:431
rheolef::space_constant::valued_tag_traits
Definition: space_constant.h:161
rheolef::details::field_expr_v2_variational_curl
Definition: field_expr_variational_terminal.h:408
rheolef::details::differentiate_option::surfacic
bool surfacic
Definition: piola.h:50
rheolef::details::field_expr_v2_variational_dg::valued_check
void valued_check() const
Definition: field_expr_variational_terminal.h:832
rheolef::details::field_expr_v2_variational_grad::n_derivative
size_type n_derivative() const
Definition: field_expr_variational_terminal.h:112
rheolef::details::field_expr_v2_variational_dg::_tilde1_L1
reference_element _tilde1_L1
Definition: field_expr_variational_terminal.h:846
rheolef::details::field_expr_v2_variational_dg::_bgd_omega
geo_basic< float_type, memory_type > _bgd_omega
Definition: field_expr_variational_terminal.h:847
mkgeo_contraction.name
string name
Definition: mkgeo_contraction.sh:133
rheolef::details::field_expr_v2_variational_dg::_c1
scalar_type _c1
Definition: field_expr_variational_terminal.h:844
rheolef::details::field_expr_v2_variational_div::space_type
space_basic< scalar_type, memory_type > space_type
Definition: field_expr_variational_terminal.h:275
M
Expr1::memory_type M
Definition: vec_expr_v2.h:416
rheolef::details::field_expr_v2_variational_grad::size_type
geo_element::size_type size_type
Definition: field_expr_variational_terminal.h:67
rheolef::details::field_expr_v2_variational_div::local_dg_merge_on_side
void local_dg_merge_on_side(const geo_basic< float_type, memory_type > &omega_K, const geo_element &S, const geo_element &K0, const geo_element &K1, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value0, const Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value1, Eigen::Matrix< Value, Eigen::Dynamic, Eigen::Dynamic > &value) const
Definition: field_expr_variational_terminal.h:342
rheolef::details::field_expr_v2_variational_dg::vf_dual_tag_type
details::dual_vf_tag< vf_tag_type >::type vf_dual_tag_type
Definition: field_expr_variational_terminal.h:788
T
Expr1::float_type T
Definition: field_expr.h:261
rheolef::details::field_expr_v2_variational_curl::size_type
geo_element::size_type size_type
Definition: field_expr_variational_terminal.h:412
rheolef::details::field_expr_v2_variational_curl::float_type
float_traits< scalar_type >::type float_type
Definition: field_expr_variational_terminal.h:420
rheolef::details::differentiate_option::batchelor_curl
bool batchelor_curl
Definition: piola.h:52
rheolef::details::field_expr_v2_variational_div::valued_hint
static const space_constant::valued_type valued_hint
Definition: field_expr_variational_terminal.h:297
trace_macro
#define trace_macro(message)
Definition: dis_macros.h:111
rheolef::details::field_expr_v2_variational_dg::initialize
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
Definition: field_expr_variational_terminal.h:815