26 hermite_poly_coeffs(
const unsigned int regularity,
const unsigned int index)
30 const unsigned int curr_index =
index % (regularity + 1);
31 const unsigned int side = (
index > regularity) ? 1 : 0;
34 const int loop_control_1 =
static_cast<int>(regularity + 1 - curr_index);
35 const int loop_control_2 = (side == 1) ?
36 static_cast<int>(curr_index + 1) :
37 static_cast<int>(regularity + 2);
39 std::vector<double> poly_coeffs(2 * regularity + 2, 0.0);
43 int binomial_1 = (curr_index % 2) ? -1 : 1;
45 for (
int i = 0; i < loop_control_2; ++i)
49 for (
int j = 0; j < loop_control_1; ++j)
53 for (
int k = 0; k < j + 1; ++k)
55 poly_coeffs[regularity + i + k + 1] +=
56 binomial_1 * inv_binomial * binomial_2;
60 inv_binomial *= regularity + j + 1;
61 inv_binomial /= j + 1;
64 binomial_1 *= -
static_cast<int>(curr_index - i);
72 for (
int i = 0; i < loop_control_2; ++i)
76 for (
int j = 0; j < loop_control_1; ++j)
78 poly_coeffs[curr_index + i + j] += binomial * inv_binomial;
79 inv_binomial *= regularity + j + 1;
80 inv_binomial /= j + 1;
83 binomial *= -
static_cast<int>(regularity + 1 - i);
91 for (
auto &it : poly_coeffs)
101 const unsigned int index)
102 :
Polynomial<double>(hermite_poly_coeffs(regularity, index))
103 , degree(2 * regularity + 1)
104 , regularity(regularity)
105 , side_index(index % (regularity + 1))
106 , side((index >= regularity + 1) ? 1 : 0)
113 std::vector<Polynomial<double>>
116 std::vector<Polynomial<double>> polys;
120 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)