init_expr_quadrature.h
Go to the documentation of this file.
#ifndef _RHEOLEF_INIT_EXPR_QUADRATURE_H
#define _RHEOLEF_INIT_EXPR_QUADRATURE_H
//
// set iopt.order when not yet set, from expr polynomial degree
//
// author: Pierre.Saramito@imag.fr
//
// date: 18 march 2018
//
#include "rheolef/form_expr_variational.h"
namespace rheolef { namespace details {
template<class T, class M>
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)
{
using size_type = quadrature_option::size_type;
integrate_option new_iopt = iopt;
if (iopt.get_order() == std::numeric_limits<quadrature_option::size_type>::max()) {
size_type k = X.get_constitution().degree_max();
size_type quad_order = 2*k + 1;
new_iopt.set_order (quad_order);
}
return new_iopt;
}
template<class T, class M>
integrate_option
expr_quadrature_init_iopt (
const geo_basic<T,M>& omega_K,
const space_basic<T,M>& X,
const space_basic<T,M>& Y,
size_t n_derivative,
const integrate_option& iopt)
{
using size_type = quadrature_option::size_type;
integrate_option new_iopt = iopt;
if (new_iopt.get_order() == std::numeric_limits<size_type>::max()) {
size_type k1 = X.get_constitution().degree_max();
size_type k2 = Y.get_constitution().degree_max();
size_type quad_order = k1 + k2 + 1;
if (omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::q].dis_size() != 0 ||
omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::P].dis_size() != 0 ||
omega_K.get_background_geo().sizes().ownership_by_variant[reference_element::H].dis_size() != 0) {
// integrate exactly ??
quad_order += 2;
}
if (omega_K.coordinate_system() != space_constant::cartesian) quad_order++; // multiplies by a 'r' weight
if (quad_order >= n_derivative) quad_order -= n_derivative;
new_iopt.set_order (quad_order);
}
return new_iopt;
}
template<class T>
quadrature<T>
expr_quadrature_init_quad (const integrate_option& iopt)
{
quadrature<T> quad;
quad.set_order (iopt.get_order());
quad.set_family(iopt.get_family());
return quad;
}
} // namespace details
} // namespace rheolef
#endif // _RHEOLEF_INIT_EXPR_QUADRATURE_H
size_type
field::size_type size_type
Definition: branch.cc:425
rheolef::geo_basic< T, M >
rheolef::integrate_option
see the integrate_option page for the full documentation
Definition: integrate_option.h:125
rheolef::integrate_option::get_family
family_type get_family() const
Definition: integrate_option.h:248
rheolef::integrate_option::set_order
void set_order(size_t r)
Definition: integrate_option.h:254
rheolef::integrate_option::get_order
size_t get_order() const
Definition: integrate_option.h:242
rheolef::quadrature
Definition: quadrature.h:186
rheolef::quadrature::set_family
void set_family(family_type ft)
Definition: quadrature_rep.cc:292
rheolef::quadrature::set_order
void set_order(size_type order)
Definition: quadrature_rep.cc:284
rheolef::reference_element::H
static const variant_type H
Definition: reference_element.h:81
rheolef::reference_element::q
static const variant_type q
Definition: reference_element.h:78
rheolef::reference_element::P
static const variant_type P
Definition: reference_element.h:80
rheolef::space_basic< T, M >
rheolef::details::expr_quadrature_init_quad
quadrature< T > expr_quadrature_init_quad(const integrate_option &iopt)
Definition: init_expr_quadrature.h:80
rheolef::details::expr_quadrature_init_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)
Definition: init_expr_quadrature.h:36
rheolef::space_constant::cartesian
@ cartesian
Definition: space_constant.h:122
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37