Rheolef  7.1
an efficient C++ finite element environment
init_expr_quadrature.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_INIT_EXPR_QUADRATURE_H
2 #define _RHEOLEF_INIT_EXPR_QUADRATURE_H
23 //
24 // set iopt.order when not yet set, from expr polynomial degree
25 //
26 // author: Pierre.Saramito@imag.fr
27 //
28 // date: 18 march 2018
29 //
30 #include "rheolef/form_expr_variational.h"
31 
32 namespace rheolef { namespace details {
33 
34 template<class T, class M>
35 integrate_option
37  const geo_basic<T,M>& omega_K,
38  const space_basic<T,M>& X,
39  size_t n_derivative,
40  const integrate_option& iopt)
41 {
43  integrate_option new_iopt = iopt;
44  if (iopt.get_order() == std::numeric_limits<quadrature_option::size_type>::max()) {
45  size_type k = X.get_constitution().degree_max();
46  size_type quad_order = 2*k + 1;
47  new_iopt.set_order (quad_order);
48  }
49  return new_iopt;
50 }
51 template<class T, class M>
52 integrate_option
54  const geo_basic<T,M>& omega_K,
55  const space_basic<T,M>& X,
56  const space_basic<T,M>& Y,
57  size_t n_derivative,
58  const integrate_option& iopt)
59 {
61  integrate_option new_iopt = iopt;
62  if (new_iopt.get_order() == std::numeric_limits<size_type>::max()) {
63  size_type k1 = X.get_constitution().degree_max();
64  size_type k2 = Y.get_constitution().degree_max();
65  size_type quad_order = k1 + k2 + 1;
66  if (omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::q].dis_size() != 0 ||
67  omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::P].dis_size() != 0 ||
68  omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::H].dis_size() != 0) {
69  // integrate exactly ??
70  quad_order += 2;
71  }
72  if (omega_K.coordinate_system() != space_constant::cartesian) quad_order++; // multiplies by a 'r' weight
73  if (quad_order >= n_derivative) quad_order -= n_derivative;
74  new_iopt.set_order (quad_order);
75  }
76  return new_iopt;
77 }
78 template<class T>
81 {
82  quadrature<T> quad;
83  quad.set_order (iopt.get_order());
84  quad.set_family(iopt.get_family());
85  return quad;
86 }
87 } // namespace details
88 } // namespace rheolef
89 #endif // _RHEOLEF_INIT_EXPR_QUADRATURE_H
field::size_type size_type
Definition: branch.cc:425
see the integrate_option page for the full documentation
family_type get_family() const
void set_family(family_type ft)
void set_order(size_type order)
static const variant_type H
static const variant_type q
static const variant_type P
quadrature< T > expr_quadrature_init_quad(const integrate_option &iopt)
integrate_option expr_quadrature_init_iopt(const geo_basic< T, M > &omega_K, const space_basic< T, M > &X, size_t n_derivative, const integrate_option &iopt)
This file is part of Rheolef.