Go to the documentation of this file. 1 #pragma once // Ensure that file is included only once in a single compilation.
21 template <
typename shape_t,
unsigned int dimT>
35 static constexpr
unsigned int dim() {
return dimT; }
39 static constexpr
unsigned int degree() {
return shape_t::degree(); }
52 template <
typename return_t,
typename po
int_t>
53 static constexpr return_t
fct_val(__attribute__((unused))
const unsigned int index,
54 __attribute__((unused))
const point_t& point)
56 static_assert(point_t::size() ==
dim(),
"Point needs to have correct dimension.");
59 if constexpr (dimT == 0)
63 std::array<
unsigned int, std::max(dimT, 1U)> index_dim =
65 for (
unsigned int dim = 0;
dim < dimT; ++
dim)
66 value *= shape_fun_1d::template fct_val<return_t>(index_dim[
dim], point[
dim]);
83 template <
typename return_t,
typename po
int_t>
86 const unsigned int der_dim)
88 static_assert(point_t::size() ==
dim(),
"Point needs to have correct dimension.");
89 tpp_assert(der_dim < dimT,
"The derivative needs to be with respect to a valid dimension.");
92 std::array<
unsigned int, std::max(dimT, 1U)> index_dim =
94 for (
unsigned int dim = 0;
dim < dimT; ++
dim)
96 value *= shape_fun_1d::template der_val<return_t>(index_dim[
dim], point[
dim]);
98 value *= shape_fun_1d::template fct_val<return_t>(index_dim[
dim], point[
dim]);
index
Definition: check_push_test.py:10
#define tpp_assert(Expr, Msg)
The assertion to be used within tpp — deactivate using -DNDEBUG compile flag.
Definition: tpp_assert.hxx:33
Struct that handles the evaluation of tensorial shape functions.
Definition: tensorial.hxx:22
static constexpr return_t der_val(const unsigned int index, const point_t &point, const unsigned int der_dim)
Evaluate value of one shape function.
Definition: tensorial.hxx:84
This file provides the function tpp_assert.
Contains the functionalities to evaluate and integrate tensor product type polynomials.
Definition: compile_time_tricks.hxx:7
shape_t shape_fun_1d
Make type of one-dimensional shape functions accessable to everyone.
Definition: tensorial.hxx:27
static constexpr unsigned int n_fun()
Number of shape functions that span the local polynomial space.
Definition: tensorial.hxx:31
static constexpr unsigned int dim()
Dimension of abscissas of the polynomials.
Definition: tensorial.hxx:35
static constexpr unsigned int pow(unsigned int base)
Return n to the power dim.
Definition: hypercube.hxx:29
static constexpr return_t fct_val(__attribute__((unused)) const unsigned int index, __attribute__((unused)) const point_t &point)
Evaluate value of one shape function.
Definition: tensorial.hxx:53
static constexpr std::array< unsigned int, std::max(dimT, 1U)> index_decompose(unsigned int index, const unsigned int range)
Decompose global index of tensorial structure with respect to its dimensions.
Definition: hypercube.hxx:44
static constexpr unsigned int degree()
Maximum degree of all polynomials.
Definition: tensorial.hxx:39