25 hermite_poly_coeffs(
const unsigned int regularity,
const unsigned int index)
29 const unsigned int curr_index =
index % (regularity + 1);
30 const unsigned int side = (
index > regularity) ? 1 : 0;
33 const int loop_control_1 =
static_cast<int>(regularity + 1 - curr_index);
34 const int loop_control_2 = (side == 1) ?
35 static_cast<int>(curr_index + 1) :
36 static_cast<int>(regularity + 2);
38 std::vector<double> poly_coeffs(2 * regularity + 2, 0.0);
42 int binomial_1 = (curr_index % 2) ? -1 : 1;
44 for (
int i = 0; i < loop_control_2; ++i)
48 for (
int j = 0; j < loop_control_1; ++j)
52 for (
int k = 0; k < j + 1; ++k)
54 poly_coeffs[regularity + i + k + 1] +=
55 binomial_1 * inv_binomial * binomial_2;
59 inv_binomial *= regularity + j + 1;
60 inv_binomial /= j + 1;
63 binomial_1 *= -
static_cast<int>(curr_index - i);
71 for (
int i = 0; i < loop_control_2; ++i)
75 for (
int j = 0; j < loop_control_1; ++j)
77 poly_coeffs[curr_index + i + j] += binomial * inv_binomial;
78 inv_binomial *= regularity + j + 1;
79 inv_binomial /= j + 1;
82 binomial *= -
static_cast<int>(regularity + 1 - i);
90 for (
auto &it : poly_coeffs)
100 const unsigned int index)
101 :
Polynomial<double>(hermite_poly_coeffs(regularity, index))
102 , degree(2 * regularity + 1)
103 , regularity(regularity)
104 , side_index(index % (regularity + 1))
105 , side((index >= regularity + 1) ? 1 : 0)
112 std::vector<Polynomial<double>>
115 std::vector<Polynomial<double>> polys;
119 for (
unsigned int i = 0; i < sz; ++i)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int regularity)
PolynomialsHermite(const unsigned int regularity, const unsigned int index)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define AssertIndexRange(index, range)
constexpr T pow(const T base, const int iexp)