Rheolef  7.1
an efficient C++ finite element environment
field_expr_terminal.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_FIELD_EXPR_TERMINAL_H
2 #define _RHEOLEF_FIELD_EXPR_TERMINAL_H
23 //
24 // terminals (leaves) for the non-linear expression tree
25 //
26 // 0) utilities
27 // 0.1) concepts
28 // 0.2) terminal wrapper for exprs
29 // 0.2) utility for evaluation on sides
30 // 1) class-function
31 // 1.1) base class for the class-function family
32 // 1.2) general function or class-function
33 // 1.3) normal to a surface
34 // 1.4) h_local
35 // 1.5) penalty
36 // 2) field and such
37 // 2.1) field
38 // 2.2) jump of a field
39 // 3) convected field, as compose(uh,X) where X is a characteristic
40 //
41 #include "rheolef/field.h"
42 #include "rheolef/field_component.h"
43 #include "rheolef/field_expr_utilities.h"
44 #include "rheolef/expression.h"
45 #include "rheolef/form.h"
46 #include "rheolef/basis_on_pointset.h"
47 #include "rheolef/test.h"
48 #include "rheolef/characteristic.h"
49 
50 namespace rheolef {
51 // -------------------------------------------------------------------
52 // 0) utilities
53 // -------------------------------------------------------------------
54 namespace details {
55 
56 // -------------------------------------------------------------------
57 // 0.1) concepts
58 // -------------------------------------------------------------------
59 
60 // Define a trait type for filtering the field_basic class
61 template <class T> struct is_field : std::false_type {};
62 template <class T, class M> struct is_field <field_basic<T,M> > : std::true_type {};
63 
64 // Define a trait type for detecting expression that are convertible to a field
65 template<class T> struct is_field_convertible : std::false_type {};
66 template<class T, class M> struct is_field_convertible <field_basic<T, M> > : std::true_type {};
67 template<class T, class M> struct is_field_convertible <field_indirect <T, M> > : std::true_type {};
68 template<class T, class M> struct is_field_convertible <field_indirect_const <T, M> > : std::true_type {};
69 template<class T, class M> struct is_field_convertible <field_component <T, M> > : std::true_type {};
70 template<class T, class M> struct is_field_convertible <field_component_const<T, M> > : std::true_type {};
71 
72 // Define a trait type for detecting field expression valid arguments
73 // -> constant and field_convertible are valid terminals:
74 template<class Expr, class Sfinae = void> struct is_field_expr_v2_nonlinear_arg : std::false_type {};
75 template<class Expr> struct is_field_expr_v2_nonlinear_arg <Expr, typename std::enable_if<
76  is_field_expr_v2_constant<Expr>::value>::type> : std::true_type {};
77 template<class Expr> struct is_field_expr_v2_nonlinear_arg <Expr, typename std::enable_if<
78  is_field_convertible<Expr>::value>::type> : std::true_type {};
79 
80 // Define a trait type for detecting linear & homogeneous expressions
81 // these expressions should act homogeneously in the same finite element space
82 #ifdef TO_CLEAN
83 // Default defined in field.h
84 template<class T, class Sfinae = void> struct is_field_expr_affine_homogeneous : std::false_type {};
85 #endif // TO_CLEAN
86 template<class Expr> struct is_field_expr_affine_homogeneous <Expr, typename std::enable_if<
87  is_field_expr_v2_constant<Expr>::value>::type> : std::true_type {};
88 template<class Expr> struct is_field_expr_affine_homogeneous <Expr, typename std::enable_if<
89  is_field_convertible<Expr>::value>::type> : std::true_type {};
90 
91 // -------------------------------------------------------------------
92 // 0.2) terminal wrapper for exprs
93 // -------------------------------------------------------------------
94 template <class Expr, class Sfinae = void>
96 {
97  // catch-all case: non-terminals are not wrapped
98  typedef Expr type;
99 };
100 // -------------------------------------------------------------------
101 // 0.3) utility for evaluation on sides
102 // -------------------------------------------------------------------
103 template<class T, class M>
104 const geo_element& global_get_side (const geo_basic<T,M>& omega, const geo_element& L, const side_information_type& sid);
105 
106 } // namespace details
107 // ---------------------------------------------------------------------------
108 // 1. field-function
109 // ---------------------------------------------------------------------------
110 // 1.1. base class for the field-function family
111 // ---------------------------------------------------------------------------
112 namespace details {
113 
114 template<class T>
116 public:
117 // typedefs:
118 
120  typedef rheo_default_memory_model memory_type; // TODO: deduce it
121  typedef T scalar_type;
122  typedef T float_type;
123 
124 // allocators:
125 
128 
129 // accessors:
130 
131  void initialize (
132  const piola_on_pointset<float_type>& pops,
133  const integrate_option& iopt) const;
134 
135  void initialize (
137  const piola_on_pointset<float_type>& pops,
138  const integrate_option& iopt) const;
139 
140  template<class M>
141  const geo_element&
142  get_side (
143  const geo_basic<float_type,M>& omega_K,
144  const geo_element& K,
145  const side_information_type& sid) const;
146 
147 // data:
148 protected:
150 };
151 // ---------------------------------------------------------------------------
152 // 1.2) general function or class-function
153 // ---------------------------------------------------------------------------
154 template<class Function>
157  <typename float_traits<typename details::function_traits<Function>::result_type>::type>
158 {
159 public:
160 // typedefs:
161 
163  typedef rheo_default_memory_model memory_type; // TODO: how to deduce it ?
171 
172 // alocators:
173 
175 
176 // accessors:
177 
179 
182 
183  void initialize (
184  const piola_on_pointset<float_type>& pops,
185  const integrate_option& iopt) const
186  { base::initialize (pops, iopt); }
187 
188  void initialize (
190  const piola_on_pointset<float_type>& pops,
191  const integrate_option& iopt) const
192  { base::initialize (Xh, pops, iopt); }
193 
194  void evaluate (
195  const geo_basic<float_type,memory_type>& omega_K,
196  const geo_element& K,
197  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
198  {
199  const Eigen::Matrix<piola<float_type>,Eigen::Dynamic,1>& piola = base::_pops.get_piola (omega_K, K);
200  reference_element hat_K = K.variant();
201  size_type loc_nnod = piola.size();
202  value.resize (loc_nnod);
203  for (size_type loc_inod = 0; loc_inod < loc_nnod; ++loc_inod) {
204  const point_basic<float_type>& xi = piola[loc_inod].F;
205  value[loc_inod] = _f (xi);
206  }
207  }
209  const geo_basic<float_type,memory_type>& omega_L,
210  const geo_element& L,
211  const side_information_type& sid,
212  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
213  // TODO QUESTION_SIDE: is there some rotation and orientation to apply to the value order ?
214  { evaluate (omega_L, base::get_side(omega_L,L,sid), value); }
215 
216  template<class Value>
217  bool valued_check() const {
218  static const bool status = is_equal<Value,result_type>::value;
219  check_macro (status, "unexpected result_type");
220  return status;
221  }
222 // data:
223 protected:
225 // working area:
226 public:
227  mutable std::array<
228  Eigen::Matrix<scalar_type,Eigen::Dynamic,1>
230  mutable std::array<
231  Eigen::Matrix<point_basic<scalar_type>,Eigen::Dynamic,1>
233  mutable std::array<
234  Eigen::Matrix<tensor_basic<scalar_type>,Eigen::Dynamic,1>
236  mutable std::array<
237  Eigen::Matrix<tensor3_basic<scalar_type>,Eigen::Dynamic,1>
239  mutable std::array<
240  Eigen::Matrix<tensor4_basic<scalar_type>,Eigen::Dynamic,1>
242 };
243 
244 template<class Function>
246  : base(),
247  _f(f),
248  _scalar_val(),
249  _vector_val(),
250  _tensor_val(),
251  _tensor3_val(),
252  _tensor4_val()
253 {
254 }
255 
256 template<class Function>
257 class field_expr_v2_nonlinear_terminal_function : public smart_pointer<field_expr_v2_nonlinear_terminal_function_rep<Function> >
258 {
259 public:
260 // typedefs:
261 
264  typedef typename rep::size_type size_type;
265  typedef typename rep::memory_type memory_type;
266  typedef typename rep::result_type result_type;
268  typedef typename rep::value_type value_type;
269  typedef typename rep::scalar_type scalar_type;
270  typedef typename rep::float_type float_type;
272 
273 // alocators:
274 
276  : base(new_macro(rep(f))) {}
277 
278  template<class TrueFunction,
279  class Sfinae = typename std::enable_if<std::is_function<TrueFunction>::value, TrueFunction>::type>
281  : base(new_macro(rep(std::ptr_fun(f)))) {}
282 
283  template <class Constant,
284  class Sfinae = typename std::enable_if <is_field_expr_v2_constant<Constant>::value, Constant>::type>
285  explicit field_expr_v2_nonlinear_terminal_function (const Constant& c)
286  : base(new_macro(rep(f_constant<point_basic<float_type>,result_type>(c)))) {}
287 
288 // accessors:
289 
290  space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
291 
292  void initialize (
293  const piola_on_pointset<float_type>& pops,
294  const integrate_option& iopt) const
295  { base::data().initialize (pops, iopt); }
296 
297  void initialize (
299  const piola_on_pointset<float_type>& pops,
300  const integrate_option& iopt) const
301  { base::data().initialize (Xh, pops, iopt); }
302 
303  void evaluate (
304  const geo_basic<float_type,memory_type>& omega_K,
305  const geo_element& K,
306  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
307  { return base::data().evaluate (omega_K, K, value); }
308 
310  const geo_basic<float_type,memory_type>& omega_L,
311  const geo_element& L,
312  const side_information_type& sid,
313  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const
314  { return base::data().evaluate_on_side (omega_L, L, sid, value); }
315 
316  template<class Value>
317  bool valued_check() const {
318  return base::data().template valued_check<Value>(); }
319 };
320 // concept::
321 template<class F> struct is_field_expr_v2_nonlinear_arg <field_expr_v2_nonlinear_terminal_function<F> > : std::true_type {};
322 template<class F> struct is_field_expr_v2_nonlinear_arg <F,
323  typename std::enable_if<
324  is_field_function<F>::value
325  >::type
326 > : std::true_type {};
327 
328 // wrapper:
329 template <class Expr>
331  typename std::enable_if<
332  is_field_function<Expr>::value
333  >::type
334 >
335 {
337 };
338 // wrapper for Expr=constant (used by nary compose to wrap constant args)
339 template <class Expr>
341  typename std::enable_if<
342  is_field_expr_v2_constant<Expr>::value
343  >::type
344 >
345 {
346  typedef typename promote<Expr,Float>::type float_type; // promote int to Float, at least
349 };
350 // ---------------------------------------------------------------------------
351 // 1.3) normal to a surface
352 // ---------------------------------------------------------------------------
353 // the special class-function, used in nonlinear field expressions:
354 template<class T>
355 struct normal_pseudo_function : std::unary_function <point_basic<T>, point_basic<T> > {
357  fatal_macro ("special normal() class-function should not be directly evaluated");
358  return point_basic<T>();
359  }
360 };
361 template<class T>
364 public:
365 // typedefs:
366 
369  typedef rheo_default_memory_model memory_type; // TODO: deduce it
373  typedef T scalar_type;
374  typedef T float_type;
376 
377 // alocators:
378 
381 
382 // accessors:
383 
385 
387 
388  void initialize (
389  const piola_on_pointset<float_type>& pops,
390  const integrate_option& iopt) const;
391 
392  void initialize (
394  const piola_on_pointset<float_type>& pops,
395  const integrate_option& iopt) const;
396 
397  void evaluate (
398  const geo_basic<float_type,memory_type>& omega_K,
399  const geo_element& K,
400  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
401 
402  void evaluate_on_side (
403  const geo_basic<float_type,memory_type>& omega_L,
404  const geo_element& L,
405  const side_information_type& sid,
406  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
407 
408  void evaluate_internal(
409  const geo_basic<float_type,memory_type>& omega_K,
410  const geo_element& K,
411  const T& sign,
412  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
413 
414  template<class Value>
415  bool valued_check() const {
417  check_macro (status, "unexpected result_type");
418  return status;
419  }
420 // data:
421  mutable bool _is_on_interface, _is_inside_on_local_sides; // normal sign fix
422 };
423 
424 } // namespace details
425 
426 // the normal() pseudo-function
427 template<class T>
428 inline
431 {
435 }
437 inline
438 details::field_expr_v2_nonlinear_terminal_function <details::normal_pseudo_function<Float> >
440 {
441  return normal_basic<Float>();
442 }
443 // ---------------------------------------------------------------------------
444 // 1.4) h_local
445 // ---------------------------------------------------------------------------
446 namespace details {
447 
448 // the special class-function, used in nonlinear field expressions:
449 template<class T>
450 struct h_local_pseudo_function : std::unary_function <point_basic<T>, T> {
451  T operator() (const point_basic<T>&) const {
452  fatal_macro ("special h_local() class-function should not be directly evaluated");
453  return 0;
454  }
455 };
456 
457 template<class T>
460 public:
461 // typedefs:
462 
465  typedef rheo_default_memory_model memory_type; // TODO: deduce it
467  typedef T result_type;
469  typedef T scalar_type;
470  typedef T float_type;
472 
473 // alocators:
474 
477 
478 // accessors:
479 
481 
483 
484  void initialize (
485  const piola_on_pointset<float_type>& pops,
486  const integrate_option& iopt) const;
487 
488  void initialize (
490  const piola_on_pointset<float_type>& pops,
491  const integrate_option& iopt) const;
492 
493  void evaluate (
494  const geo_basic<float_type,memory_type>& omega_K,
495  const geo_element& K,
496  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
497 
498  void evaluate_on_side (
499  const geo_basic<float_type,memory_type>& omega_L,
500  const geo_element& L,
501  const side_information_type& sid,
502  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
503 
504  template<class Value>
505  bool valued_check() const {
507  check_macro (status, "unexpected result_type");
508  return status;
509  }
510 };
511 
512 } // namespace details
513 
514 // the h_local() pseudo-function
515 template<class T>
516 inline
517 details::field_expr_v2_nonlinear_terminal_function <details::h_local_pseudo_function<T> >
519 {
523 }
525 inline
526 details::field_expr_v2_nonlinear_terminal_function <details::h_local_pseudo_function<Float> >
528 {
529  return h_local_basic<Float>();
530 }
531 // ---------------------------------------------------------------------------
532 // 1.5) penalty
533 // ---------------------------------------------------------------------------
534 // the special class-function, used in nonlinear field expressions:
535 namespace details {
536 
537 template<class T>
538 struct penalty_pseudo_function : std::unary_function <point_basic<T>, T> {
539  T operator() (const point_basic<T>&) const {
540  fatal_macro ("special penalty() class-function should not be directly evaluated");
541  return 0;
542  }
543 };
544 
545 template<class T>
548 public:
549 // typedefs:
550 
553  typedef rheo_default_memory_model memory_type; // TODO: deduce it
555  typedef T result_type;
557  typedef T scalar_type;
558  typedef T float_type;
560 
561 // alocators:
562 
565 
566 // accessors:
567 
569 
571 
572  void initialize (
573  const piola_on_pointset<float_type>& pops,
574  const integrate_option& iopt) const;
575 
576  void initialize (
578  const piola_on_pointset<float_type>& pops,
579  const integrate_option& iopt) const;
580 
581  void evaluate (
582  const geo_basic<float_type,memory_type>& omega_K,
583  const geo_element& K,
584  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
585 
586  void evaluate_on_side (
587  const geo_basic<float_type,memory_type>& omega_L,
588  const geo_element& L,
589  const side_information_type& sid,
590  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
591 
592  template<class Value>
593  bool valued_check() const {
595  check_macro (status, "unexpected result_type");
596  return status;
597  }
598 protected:
599 // internal:
600  T evaluate_measure (
601  const geo_basic<float_type,memory_type>& omega_K,
602  const geo_element& K) const;
603 
604  void evaluate_internal(
605  const geo_basic<float_type,memory_type>& omega_K,
606  const geo_element& K,
607  const geo_element& L,
608  Eigen::Matrix<result_type,Eigen::Dynamic,1>& value) const;
609 };
610 
611 } // namespace details
612 
613 // the penalty() pseudo-function
614 template<class T>
615 inline
616 details::field_expr_v2_nonlinear_terminal_function <details::penalty_pseudo_function<T> >
618 {
622 }
624 inline
625 details::field_expr_v2_nonlinear_terminal_function <details::penalty_pseudo_function<Float> >
627 {
628  return penalty_basic<Float>();
629 }
630 
631 // ---------------------------------------------------------------------------
632 // 2) field and such
633 // ---------------------------------------------------------------------------
634 // 2.1) field
635 // ---------------------------------------------------------------------------
636 namespace details {
637 
638 template<class T, class M, details::differentiate_option::type Diff>
640 public:
641 // typedefs:
642 
644  using memory_type = M;
645  using scalar_type = T;
647  using result_type = typename std::conditional<
649  ,T // TODO: support also div(tensor) -> vector
651  >::type;
653 
654 // allocators:
655 
656  template <class Expr,
657  class Sfinae = typename std::enable_if<details::is_field_convertible<Expr>::value>::type>
658  explicit field_expr_v2_nonlinear_terminal_field_rep (const Expr& expr, const differentiate_option& gopt);
659 
660 // --------------------------------------------
661 // accessors for the affine & homogeneous case:
662 // --------------------------------------------
663 
665  Vh = _uh.get_space();
666  return true;
667  }
668  // minimal forward iterator interface:
670  const_iterator begin_dof() const { return _uh.begin_dof(); }
671 
672 // --------------------------------------------
673 // accessors for the general nonlinear case:
674 // --------------------------------------------
675 
677 
679 
680  void initialize (
681  const piola_on_pointset<T>& pops,
682  const integrate_option& iopt) const;
683 
684  void initialize (
685  const space_basic<T,M>& Xh,
686  const piola_on_pointset<float_type>& pops,
687  const integrate_option& iopt) const;
688 
689  const geo_element& get_side (const geo_element& K, const side_information_type& sid) const;
690 
691  template<class Value>
692  void evaluate (
693  const geo_basic<float_type,memory_type>& omega_K,
694  const geo_element& K,
695  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
696 
697  template<class Value>
698  void evaluate_on_side (
699  const geo_basic<float_type,memory_type>& omega_L,
700  const geo_element& L,
701  const side_information_type& sid,
702  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
703 
704  template<class Value>
705  bool valued_check() const;
706 
707 // data:
711  mutable bool _use_dom2bgd;
712  mutable bool _use_bgd2dom;
713  mutable bool _have_dg_on_sides;
715 // working data:
716  mutable basis_on_pointset<T> _piola_on_geo_basis; // for DF, for Hdiv RT ect
717  mutable std::vector<size_type> _dis_inod_geo; // idem
719 public:
720  mutable std::array<
721  Eigen::Matrix<T,Eigen::Dynamic,1>
723  mutable std::array<
724  Eigen::Matrix<point_basic<T>,Eigen::Dynamic,1>
726  mutable std::array<
727  Eigen::Matrix<tensor_basic<T>,Eigen::Dynamic,1>
729  mutable std::array<
730  Eigen::Matrix<tensor3_basic<T>,Eigen::Dynamic,1>
732  mutable std::array<
733  Eigen::Matrix<tensor4_basic<T>,Eigen::Dynamic,1>
735 };
736 // inlined:
737 template<class T, class M, details::differentiate_option::type Diff>
738 template <class Expr, class Sfinae>
739 inline
741  : _gopt(gopt),
742  _uh(expr),
743  _u_test(_uh.get_space()),
744  _use_dom2bgd(false),
745  _use_bgd2dom(false),
746  _have_dg_on_sides(false),
747  _tilde_L(),
748  _piola_on_geo_basis(),
749  _dis_inod_geo(),
750  _need_vector_piola(false),
751  _scalar_val(),
752  _vector_val(),
753  _tensor_val(),
754  _tensor3_val(),
755  _tensor4_val()
756 {
757  // e.g. Hdiv RTk: use DF for piola vector/tensor transformation
760  ! _uh.get_space().get_constitution().is_hierarchical();
761 }
762 template<class T, class M, details::differentiate_option::type Diff>
763 template<class Value>
764 inline
765 bool
767 {
768  switch (Diff) {
771  bool status = (_uh.valued_tag() == valued_tag) ||
772  (_uh.valued_tag() == space_constant::unsymmetric_tensor &&
775  "unexpected "<< _uh.valued()
776  << "-valued field while a " << space_constant::valued_name(valued_tag)
777  << "-valued one is expected in expression");
778  return status;
779  }
781 #ifdef TODO
782  base::_fops.template grad_valued_check<Value>();
783 #endif // TODO
784  return true;
785  }
787 #ifdef TODO
788  base::_fops.template div_valued_check<Value>();
789 #endif // TODO
790  return true;
791  }
793 #ifdef TODO
794  base::_fops.template curl_valued_check<Value>();
795 #endif // TODO
796  return true;
797  }
798  }
799 }
800 template<class T, class M, details::differentiate_option::type Diff>
801 class field_expr_v2_nonlinear_terminal_field : public smart_pointer<field_expr_v2_nonlinear_terminal_field_rep<T,M,Diff> >
802 {
803 public:
804 // typedefs:
805 
808  using size_type = typename rep::size_type;
809  using memory_type = typename rep::memory_type;
810  using result_type = typename rep::result_type;
811  using float_type = typename rep::float_type;
812  using scalar_type = typename rep::scalar_type;
813  using value_type = typename rep::value_type;
814 
816 
817 // alocators:
818 
819  template <class Expr,
820  class Sfinae = typename std::enable_if<details::is_field_convertible<Expr>::value>::type>
822  : base(new_macro(rep(expr,gopt))) {}
823 
824 // --------------------------------------------
825 // accessors for the affine & homogeneous case:
826 // --------------------------------------------
827 
829  return base::data().have_homogeneous_space (Vh); }
830  // minimal forward iterator interface:
832  const_iterator begin_dof() const { return base::data().begin_dof(); }
833 
834 // --------------------------------------------
835 // accessors for the general nonlinear case:
836 // --------------------------------------------
837 
838  space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
839  const geo_basic<T,M>& get_geo() const { return base::data().get_geo(); }
840  const field_basic<T,M>& expr() const { return base::data()._uh; }
841 
842  void initialize (
843  const piola_on_pointset<float_type>& pops,
844  const integrate_option& iopt) const
845  { base::data().initialize (pops, iopt); }
846 
847  void initialize (
849  const piola_on_pointset<float_type>& pops,
850  const integrate_option& iopt) const
851  { base::data().initialize (Xh, pops, iopt); }
852 
853  template<class Value>
854  void evaluate (
855  const geo_basic<float_type,memory_type>& omega_K,
856  const geo_element& K,
857  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
858  { base::data().evaluate (omega_K, K, value); }
859 
860  template<class Value>
862  const geo_basic<float_type,memory_type>& omega_L,
863  const geo_element& L,
864  const side_information_type& sid,
865  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
866  { base::data().evaluate_on_side (omega_L, L, sid, value); }
867 
868  template<class Value>
869  bool valued_check() const {
870  return base::data().template valued_check<Value>();
871  }
872 };
873 // concepts:
874 template<class T, class M, details::differentiate_option::type Diff>
876 
877 // field terminal is affine-homogeneous whentere is no differentiation
878 // e.g. when diff=grad then P1 transforms to (P0)^d and then non-homogeneous space ?
879 // TODO: field yh_P0_d = grad(xh_P1); => space should be computed on the fly ?
880 
881 template<class T, class M>
883 
884 // wrapper:
885 template <class Expr>
887  typename std::enable_if<
888  is_field_convertible<Expr>::value
889  >::type
890 >
891 {
892  typedef typename Expr::scalar_type T;
893  typedef typename Expr::memory_type M;
895 };
896 
897 } // namespace details
898 
900 template<class Expr>
901 inline
902 typename
903 std::enable_if<
906  typename Expr::scalar_type
907  ,typename Expr::memory_type
909  >
910 >::type
911 grad (const Expr& expr)
912 {
913  typedef typename Expr::scalar_type T;
914  typedef typename Expr::memory_type M;
916 }
918 template<class Expr>
919 inline
920 typename
921 std::enable_if<
922  details::is_field_convertible<Expr>::value
923  ,details::field_expr_v2_nonlinear_terminal_field<
924  typename Expr::scalar_type
925  ,typename Expr::memory_type
927  >
928 >::type
929 grad_s (const Expr& expr)
930 {
931  typedef typename Expr::scalar_type T;
932  typedef typename Expr::memory_type M;
933  static details::differentiate_option gopt;
934  gopt.surfacic = true;
936 }
938 template<class Expr>
939 inline
940 typename
941 std::enable_if<
942  details::is_field_convertible<Expr>::value
943  ,details::field_expr_v2_nonlinear_terminal_field<
944  typename Expr::scalar_type
945  ,typename Expr::memory_type
947  >
948 >::type
949 grad_h (const Expr& expr)
950 {
951  typedef typename Expr::scalar_type T;
952  typedef typename Expr::memory_type M;
953  static details::differentiate_option gopt;
954  gopt.broken = true;
956 }
958 template<class Expr>
959 inline
960 typename
961 std::enable_if<
962  details::is_field_convertible<Expr>::value
963  ,details::field_expr_v2_nonlinear_terminal_field<
964  typename Expr::scalar_type
965  ,typename Expr::memory_type
967  >
968 >::type
969 D (const Expr& expr)
970 {
971  typedef typename Expr::scalar_type T;
972  typedef typename Expr::memory_type M;
973  details::differentiate_option gopt;
974  gopt.symmetrized = true;
976 }
978 template<class Expr>
979 inline
980 typename
981 std::enable_if<
982  details::is_field_convertible<Expr>::value
983  ,details::field_expr_v2_nonlinear_terminal_field<
984  typename Expr::scalar_type
985  ,typename Expr::memory_type
987  >
988 >::type
989 Ds (const Expr& expr)
990 {
991  typedef typename Expr::scalar_type T;
992  typedef typename Expr::memory_type M;
993  details::differentiate_option gopt;
994  gopt.symmetrized = true;
995  gopt.surfacic = true;
997 }
999 template<class Expr>
1000 inline
1001 typename
1002 std::enable_if<
1003  details::is_field_convertible<Expr>::value
1004  ,details::field_expr_v2_nonlinear_terminal_field<
1005  typename Expr::scalar_type
1006  ,typename Expr::memory_type
1008  >
1009 >::type
1010 Dh (const Expr& expr)
1011 {
1012  typedef typename Expr::scalar_type T;
1013  typedef typename Expr::memory_type M;
1014  details::differentiate_option gopt;
1015  gopt.symmetrized = true;
1016  gopt.broken = true;
1018 }
1020 template<class Expr>
1021 inline
1022 typename
1023 std::enable_if<
1024  details::is_field_convertible<Expr>::value
1025  ,details::field_expr_v2_nonlinear_terminal_field<
1026  typename Expr::scalar_type
1027  ,typename Expr::memory_type
1029  >
1030 >::type
1031 div (const Expr& expr)
1032 {
1033  typedef typename Expr::scalar_type T;
1034  typedef typename Expr::memory_type M;
1036 }
1038 template<class Expr>
1039 inline
1040 typename
1041 std::enable_if<
1042  details::is_field_convertible<Expr>::value
1043  ,details::field_expr_v2_nonlinear_terminal_field<
1044  typename Expr::scalar_type
1045  ,typename Expr::memory_type
1047  >
1048 >::type
1049 div_s (const Expr& expr)
1050 {
1051  typedef typename Expr::scalar_type T;
1052  typedef typename Expr::memory_type M;
1053  static details::differentiate_option gopt;
1054  gopt.surfacic = true;
1056 }
1058 template<class Expr>
1059 inline
1060 typename
1061 std::enable_if<
1062  details::is_field_convertible<Expr>::value
1063  ,details::field_expr_v2_nonlinear_terminal_field<
1064  typename Expr::scalar_type
1065  ,typename Expr::memory_type
1067  >
1068 >::type
1069 div_h (const Expr& expr)
1070 {
1071  typedef typename Expr::scalar_type T;
1072  typedef typename Expr::memory_type M;
1073  static details::differentiate_option gopt;
1074  gopt.broken = true;
1076 }
1078 template<class Expr>
1079 inline
1080 typename
1081 std::enable_if<
1082  details::is_field_convertible<Expr>::value
1083  ,details::field_expr_v2_nonlinear_terminal_field<
1084  typename Expr::scalar_type
1085  ,typename Expr::memory_type
1087  >
1088 >::type
1089 curl (const Expr& expr)
1090 {
1091  typedef typename Expr::scalar_type T;
1092  typedef typename Expr::memory_type M;
1094 }
1095 // TODO: bcurl(uh) = Batchelor curl ?
1096 // TODO: curl_s(uh) curl_h(uh)...?
1097 
1098 // ----------------------------------------------------------------------------
1099 // 2.2) jump of a field
1100 // ----------------------------------------------------------------------------
1101 namespace details {
1102 
1103 template<class T, class M>
1105 public:
1106 // typedefs:
1107 
1109  typedef M memory_type;
1112  typedef T scalar_type;
1114 
1115 // alocators:
1116 
1117  template <class Expr,
1118  class Sfinae = typename std::enable_if<details::is_field_convertible<Expr>::value>::type>
1119  explicit field_expr_v2_nonlinear_terminal_field_dg_rep(const Expr& expr, const float_type& c0, const float_type& c1)
1120  : _expr0(expr), _expr1(expr),
1121  _c0(c0), _c1(c1)
1122  {}
1123 
1124 // accessors:
1125 
1127 
1129 
1130  void initialize (
1131  const piola_on_pointset<float_type>& pops,
1132  const integrate_option& iopt) const;
1133 
1134  void initialize (
1136  const piola_on_pointset<float_type>& pops,
1137  const integrate_option& iopt) const;
1138 
1139  template<class Value>
1140  void evaluate (
1141  const geo_basic<float_type,memory_type>& omega_K,
1142  const geo_element& K,
1143  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
1144 
1145  template<class Value>
1146  bool valued_check() const {
1148  bool status = _expr0.valued_tag() == valued_tag;
1150  "unexpected "<< space_constant::valued_name(_expr0.valued_tag())
1151  << "-valued field while a " << space_constant::valued_name(valued_tag)
1152  << "-valued one is expected in expression");
1153  return status;
1154  }
1155 // data:
1156 protected:
1159 };
1160 
1161 template<class T, class M>
1162 class field_expr_v2_nonlinear_terminal_field_dg : public smart_pointer<field_expr_v2_nonlinear_terminal_field_dg_rep<T,M> >
1163 {
1164 public:
1165 // typedefs:
1166 
1169  typedef typename rep::size_type size_type;
1170  typedef typename rep::memory_type memory_type;
1171  typedef typename rep::result_type result_type;
1172  typedef typename rep::float_type float_type;
1173  typedef typename rep::scalar_type scalar_type;
1174  typedef typename rep::value_type value_type;
1176 
1177 // alocators:
1178 
1179  template <class Expr,
1180  class Sfinae = typename std::enable_if<details::is_field_convertible<Expr>::value>::type>
1181  explicit field_expr_v2_nonlinear_terminal_field_dg(const Expr& expr, const float_type& c0, const float_type& c1)
1182  : base(new_macro(rep(expr,c0,c1))) {}
1183 
1184 // accessors:
1185 
1186  space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
1187 
1188  void initialize (
1189  const piola_on_pointset<float_type>& pops,
1190  const integrate_option& iopt) const
1191  { base::data().initialize (pops, iopt); }
1192 
1193  void initialize (
1195  const piola_on_pointset<float_type>& pops,
1196  const integrate_option& iopt) const
1197  { base::data().initialize (Xh, pops, iopt); }
1198 
1199  template<class Value>
1200  void evaluate (
1201  const geo_basic<float_type,memory_type>& omega_K,
1202  const geo_element& K,
1203  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
1204  { base::data().evaluate (omega_K, K, value); }
1205 
1206  template<class Value>
1207  bool valued_check() const
1208  { return base::data().template valued_check<Value>(); }
1209 };
1210 template<class T, class M> struct is_field_expr_v2_nonlinear_arg <field_expr_v2_nonlinear_terminal_field_dg<T,M> > : std::true_type {};
1211 
1212 } // namespace details
1213 
1214 #define _RHEOLEF_make_field_expr_v2_nonlinear_terminal_field_dg(op,c0,c1) \
1215 template<class Expr> \
1216 inline \
1217 typename \
1218 std::enable_if< \
1219  details::is_field_convertible<Expr>::value \
1220  ,details::field_expr_v2_nonlinear_terminal_field_dg< \
1221  typename Expr::scalar_type \
1222  ,typename Expr::memory_type \
1223  > \
1224 >::type \
1225 op (const Expr& expr) \
1226 { \
1227  return details::field_expr_v2_nonlinear_terminal_field_dg \
1228  <typename Expr::scalar_type ,typename Expr::memory_type> \
1229  (expr, c0, c1); \
1230 }
1231 
1236 #undef _RHEOLEF_make_field_expr_v2_nonlinear_terminal_field_dg
1237 
1238 
1239 // ---------------------------------------------------------------------------
1240 // 3) convected field, as compose(uh,X) where X is a characteristic
1241 // ---------------------------------------------------------------------------
1242 namespace details {
1243 
1244 template<class T, class M>
1246 public:
1247 // typedefs:
1248 
1250  typedef M memory_type;
1253  typedef T scalar_type;
1255 
1256 // alocators:
1257 
1260 
1261 // accessors:
1262 
1264 
1266 
1267  void initialize (
1268  const piola_on_pointset<float_type>& pops,
1269  const integrate_option& iopt) const;
1270 
1271  void initialize (
1273  const piola_on_pointset<float_type>& pops,
1274  const integrate_option& iopt) const;
1275 
1276  template<class Value>
1277  void evaluate (
1278  const geo_basic<float_type,memory_type>& omega_K,
1279  const geo_element& K,
1280  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const;
1281 
1282  template<class Value>
1283  bool valued_check() const {
1285  bool status = (_uh.valued_tag() == valued_tag);
1286  check_macro (status,
1287  "unexpected "<<_uh.valued()
1288  << "-valued field while a " << space_constant::valued_name(valued_tag)
1289  << "-valued one is expected in expression");
1290  return status;
1291  }
1292 
1293 // internal:
1294  template<class Result>
1295  void _check () const;
1296 
1297 // data:
1307 };
1308 template<class T, class M>
1310  const field_basic<T,M>& uh,
1311  const characteristic_basic<T,M>& X)
1312  : _uh (uh),
1313  _X (X),
1314  _fops(),
1315  _scalar_val(),
1316  _vector_val(),
1317  _tensor_val(),
1318  _tensor3_val(),
1319  _tensor4_val(),
1320  _start_q(0)
1321 {
1322 }
1323 template<class T, class M>
1325  const field_o_characteristic<T,M>& uoX)
1326  : _uh (uoX.get_field()),
1327  _X (uoX.get_characteristic()),
1328  _fops(),
1329  _scalar_val(),
1330  _vector_val(),
1331  _tensor_val(),
1332  _tensor3_val(),
1333  _tensor4_val(),
1334  _start_q(0)
1335 {
1336 }
1337 
1338 template<class T, class M>
1340  public smart_pointer<field_expr_v2_nonlinear_terminal_field_o_characteristic_rep<T,M> >
1341 {
1342 public:
1343 // typedefs:
1344 
1347  typedef typename rep::size_type size_type;
1348  typedef typename rep::memory_type memory_type;
1349  typedef typename rep::result_type result_type;
1350  typedef typename rep::float_type float_type;
1351  typedef typename rep::scalar_type scalar_type;
1352  typedef typename rep::value_type value_type;
1354 
1355 // alocators:
1356 
1358  : base(new_macro(rep(uoX))) {}
1359 
1361  : base(new_macro(rep(uh,X))) {}
1362 
1363 // accessors:
1364 
1365  space_constant::valued_type valued_tag() const { return base::data().valued_tag(); }
1366 
1367  void initialize (
1368  const piola_on_pointset<float_type>& pops,
1369  const integrate_option& iopt) const
1370  { base::data().initialize (pops, iopt); }
1371 
1372  void initialize (
1374  const piola_on_pointset<float_type>& pops,
1375  const integrate_option& iopt) const
1376  { base::data().initialize (Xh, pops, iopt); }
1377 
1378  template<class Value>
1379  void evaluate (
1380  const geo_basic<float_type,memory_type>& omega_K,
1381  const geo_element& K,
1382  Eigen::Matrix<Value,Eigen::Dynamic,1>& value) const
1383  { base::data().evaluate (omega_K, K, value); }
1384 
1385  template<class Value>
1386  bool valued_check() const {
1387  return base::data().template valued_check<Value>();
1388  }
1389 };
1390 template<class T, class M> struct is_field_expr_v2_nonlinear_arg <field_expr_v2_nonlinear_terminal_field_o_characteristic<T,M> > : std::true_type {};
1391 
1392 } // namespace details
1393 
1394 // compose a field with a characteristic
1395 template<class T, class M>
1396 inline
1399 {
1401 }
1402 
1403 } // namespace rheolef
1404 #endif // _RHEOLEF_FIELD_EXPR_TERMINAL_H
field_expr_v2_nonlinear_terminal_field_dg_rep(const Expr &expr, const float_type &c0, const float_type &c1)
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
field_expr_v2_nonlinear_terminal_field< T, M, details::differentiate_option::none > _expr1
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_field< T, M, details::differentiate_option::none > _expr0
field_expr_v2_nonlinear_terminal_field_dg(const Expr &expr, const float_type &c0, const float_type &c1)
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_field_dg_rep< T, M > rep
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_field_o_characteristic_rep(const field_o_characteristic< T, M > &uoX)
field_expr_v2_nonlinear_terminal_field_o_characteristic(const field_o_characteristic< T, M > &uoX)
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_field_o_characteristic_rep< T, M > rep
field_expr_v2_nonlinear_terminal_field_o_characteristic(const field_basic< T, M > &uh, const characteristic_basic< T, M > &X)
std::array< Eigen::Matrix< point_basic< T >, Eigen::Dynamic, 1 >,reference_element::max_variant > _vector_val
typename std::conditional< Diff==details::differentiate_option::divergence,T,undeterminated_basic< T > >::type result_type
std::array< Eigen::Matrix< tensor_basic< T >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor_val
field_expr_v2_nonlinear_terminal_field_rep(const Expr &expr, const differentiate_option &gopt)
void initialize(const piola_on_pointset< T > &pops, const integrate_option &iopt) const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
std::array< Eigen::Matrix< T, Eigen::Dynamic, 1 >,reference_element::max_variant > _scalar_val
bool have_homogeneous_space(space_basic< scalar_type, memory_type > &Vh) const
std::array< Eigen::Matrix< tensor3_basic< T >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor3_val
typename field_basic< T, M >::const_iterator const_iterator
std::array< Eigen::Matrix< tensor4_basic< T >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor4_val
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_L, const geo_element &L, const side_information_type &sid, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
const geo_element & get_side(const geo_element &K, const side_information_type &sid) const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
static const space_constant::valued_type valued_hint
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
bool have_homogeneous_space(space_basic< scalar_type, memory_type > &Vh) const
field_expr_v2_nonlinear_terminal_field(const Expr &expr, const differentiate_option &gopt=differentiate_option())
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_L, const geo_element &L, const side_information_type &sid, Eigen::Matrix< Value, Eigen::Dynamic, 1 > &value) const
const geo_element & get_side(const geo_basic< float_type, M > &omega_K, const geo_element &K, const side_information_type &sid) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_function_base_rep< float_type > base
std::array< Eigen::Matrix< tensor_basic< scalar_type >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor_val
details::function_traits< Function >::copiable_type function_type
details::function_traits< Function >::template arg< 0 >::type argument_type
details::function_traits< Function >::result_type result_type
std::array< Eigen::Matrix< tensor3_basic< scalar_type >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor3_val
std::array< Eigen::Matrix< tensor4_basic< scalar_type >, Eigen::Dynamic, 1 >,reference_element::max_variant > _tensor4_val
std::array< Eigen::Matrix< scalar_type, Eigen::Dynamic, 1 >,reference_element::max_variant > _scalar_val
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
std::array< Eigen::Matrix< point_basic< scalar_type >, Eigen::Dynamic, 1 >,reference_element::max_variant > _vector_val
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< result_type, Eigen::Dynamic, 1 > &value) const
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_L, const geo_element &L, const side_information_type &sid, Eigen::Matrix< result_type, Eigen::Dynamic, 1 > &value) const
void initialize(const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
void evaluate(const geo_basic< float_type, memory_type > &omega_K, const geo_element &K, Eigen::Matrix< result_type, Eigen::Dynamic, 1 > &value) const
void initialize(const space_basic< float_type, memory_type > &Xh, const piola_on_pointset< float_type > &pops, const integrate_option &iopt) const
field_expr_v2_nonlinear_terminal_function_rep< Function > rep
void evaluate_on_side(const geo_basic< float_type, memory_type > &omega_L, const geo_element &L, const side_information_type &sid, Eigen::Matrix< result_type, Eigen::Dynamic, 1 > &value) const
const space_type & get_space() const
Definition: field.h:300
valued_type valued_tag() const
Definition: field.h:304
const std::string & valued() const
Definition: field.h:305
iterator begin_dof()
Definition: field.h:501
see the geo_element page for the full documentation
Definition: geo_element.h:102
reference_element::size_type size_type
Definition: geo_element.h:125
variant_type variant() const
Definition: geo_element.h:161
see the integrate_option page for the full documentation
const Eigen::Matrix< piola< T >, Eigen::Dynamic, 1 > & get_piola(const geo_basic< T, M > &omega, const geo_element &K) const
see the reference_element page for the full documentation
static const variant_type max_variant
see the smart_pointer page for the full documentation
the finite element space
Definition: space.h:352
rheolef::std type
point_basic< T >
Definition: piola_fem.h:135
rheolef::std value
BinaryFunction _f
rheolef::std Function
#define rheo_default_memory_model
Definition: distributed.h:74
Expr1::float_type T
Definition: field_expr.h:261
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
const geo_element & global_get_side(const geo_basic< T, M > &omega_L, const geo_element &L, const side_information_type &sid)
const std::string & valued_name(valued_type valued_tag)
This file is part of Rheolef.
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.
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
details::field_expr_v2_nonlinear_terminal_function< details::h_local_pseudo_function< Float > > h_local()
h_local: see the expression page for the full documentation
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
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
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.
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
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
details::field_expr_v2_nonlinear_terminal_function< details::h_local_pseudo_function< T > > h_local_basic()
details::field_expr_v2_nonlinear_terminal_function< details::penalty_pseudo_function< T > > penalty_basic()
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< T > > normal_basic()
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.
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
details::field_expr_v2_nonlinear_terminal_function< details::penalty_pseudo_function< Float > > penalty()
penalty(): see the expression page for the full documentation
details::field_expr_v2_nonlinear_node_nary< typename details::function_traits< Function >::functor_type,typename details::field_expr_v2_nonlinear_terminal_wrapper_traits< Exprs >::type... > ::type compose(const Function &f, const Exprs &... exprs)
see the compose page for the full documentation
Definition: compose.h:246
_RHEOLEF_make_field_expr_v2_nonlinear_terminal_field_dg(jump, 1, -1) _RHEOLEF_make_field_expr_v2_nonlinear_terminal_field_dg(average
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
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
space_constant::valued_type valued_tag() const
Definition: cavity_dg.h:29
T operator()(const point_basic< T > &) const
point_basic< T > operator()(const point_basic< T > &) const
T operator()(const point_basic< T > &) const
point_basic< T > F
Definition: piola.h:79
helper for generic field value_type: T, point_basic<T> or tensor_basic<T>
Expr1::memory_type M
Definition: vec_expr_v2.h:416