Go to the documentation of this file. 1 #pragma once // Ensure that file is included only once in a single compilation.
14 template <
typename shape_t>
24 static constexpr
unsigned int n_fun() {
return shape_t::n_fun(); }
28 static constexpr
unsigned int dim() {
return shape_t::dim(); }
32 static constexpr
unsigned int degree() {
return shape_t::degree(); }
36 template <
typename return_t,
typename po
int_t>
37 static constexpr return_t
fct_val(
const unsigned int index,
const point_t& point)
39 return shape_t::template fct_val<return_t>(
index, point);
44 template <
typename return_t,
typename po
int_t>
47 const unsigned int der_dim)
49 return shape_t::template der_val<return_t>(
index, point, der_dim);
55 template <
typename return_t,
typename po
int_t>
56 static constexpr return_t
grad_val(
const unsigned int index,
const point_t& point)
58 static_assert(return_t::size() == point_t::size(),
"Gradient and point have same dimension.");
59 static_assert(point_t::size() ==
dim(),
"Gradient and dimension need to be equal.");
62 for (
unsigned int der_dim = 0; der_dim <
dim(); ++der_dim)
63 value[der_dim] = der_val<return_t::value_type>(
index, point, der_dim);
69 template <
typename return_t,
typename po
int_t>
70 static constexpr return_t
div_val(
const unsigned int index,
const point_t& point)
72 static_assert(point_t::size() ==
dim(),
"Gradient and dimension need to be equal.");
75 for (
unsigned int der_dim = 0; der_dim <
dim(); ++der_dim)
76 value += der_val<return_t>(
index, point, der_dim);
83 template <
typename return_t,
typename coeffs_t,
typename po
int_t>
84 static constexpr return_t
lin_comb_fct_val(
const coeffs_t& coeffs,
const point_t& point)
86 static_assert(point_t::size() ==
dim(),
"Point needs to have correct dimension.");
87 static_assert(coeffs_t::size() ==
n_fun(),
"Coeffs size must coincide with poly space!");
91 value += coeffs[
index] * fct_val<return_t>(
index, point);
97 template <
typename return_t,
typename coeffs_t,
typename po
int_t>
100 const unsigned int der_dim)
102 static_assert(point_t::size() ==
dim(),
"Point needs to have correct dimension.");
103 static_assert(coeffs_t::size() ==
n_fun(),
"Coeffs size must coincide with poly space!");
107 value += coeffs[
index] * der_val<return_t>(
index, point, der_dim);
index
Definition: check_push_test.py:10
static constexpr unsigned int n_fun()
Number of shape functions that span the local polynomial space.
Definition: shape_function.hxx:24
static constexpr unsigned int dim()
Dimension of abscissas of the polynomials.
Definition: shape_function.hxx:28
static constexpr return_t lin_comb_fct_val(const coeffs_t &coeffs, const point_t &point)
Evaluate value linear combination of shape functions.
Definition: shape_function.hxx:84
static constexpr return_t lin_comb_der_val(const coeffs_t &coeffs, const point_t &point, const unsigned int der_dim)
Evaluate value of partial derivative of linear combination of shape functions.
Definition: shape_function.hxx:98
static constexpr unsigned int degree()
Maximum degree of all polynomials.
Definition: shape_function.hxx:32
Contains the functionalities to evaluate and integrate tensor product type polynomials.
Definition: compile_time_tricks.hxx:7
Struct that handles different types of evaluation of shape functions.
Definition: shape_function.hxx:15
static constexpr return_t der_val(const unsigned int index, const point_t &point, const unsigned int der_dim)
Evaluate value of partial derivative of shape function.
Definition: shape_function.hxx:45
static constexpr return_t fct_val(const unsigned int index, const point_t &point)
Evaluate value of shape function.
Definition: shape_function.hxx:37
shape_t shape_fun_t
Make type of shape functions accessable to everyone.
Definition: shape_function.hxx:20
static constexpr return_t div_val(const unsigned int index, const point_t &point)
Evaluate value of divergence of shape function.
Definition: shape_function.hxx:70
static constexpr return_t grad_val(const unsigned int index, const point_t &point)
Evaluate value of gradient of shape function.
Definition: shape_function.hxx:56