32 std::vector<std::vector<Polynomials::Polynomial<double>>>
33 get_abf_polynomials(
const unsigned int k)
35 std::vector<std::vector<Polynomials::Polynomial<double>>> pols(dim);
39 for (
unsigned int d = 1;
d < dim; ++
d)
42 for (
unsigned int d = 1;
d < dim; ++
d)
52 , polynomial_space(get_abf_polynomials<dim>(k))
72 Assert(values.size() == this->n() || values.size() == 0,
74 Assert(grads.size() == this->n() || grads.size() == 0,
76 Assert(grad_grads.size() == this->n() || grad_grads.size() == 0,
78 Assert(third_derivatives.size() == this->n() || third_derivatives.size() == 0,
80 Assert(fourth_derivatives.size() == this->n() ||
81 fourth_derivatives.size() == 0,
84 const unsigned int n_sub = polynomial_space.n();
90 std::lock_guard<std::mutex> lock(mutex);
92 p_values.resize((values.size() == 0) ? 0 : n_sub);
93 p_grads.resize((grads.size() == 0) ? 0 : n_sub);
94 p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub);
95 p_third_derivatives.resize((third_derivatives.size() == 0) ? 0 : n_sub);
96 p_fourth_derivatives.resize((fourth_derivatives.size() == 0) ? 0 : n_sub);
98 for (
unsigned int d = 0;
d < dim; ++
d)
112 for (
unsigned int c = 0; c < dim; ++c)
113 p(c) = unit_point((c +
d) % dim);
115 polynomial_space.evaluate(p,
120 p_fourth_derivatives);
122 for (
unsigned int i = 0; i < p_values.size(); ++i)
123 values[i +
d * n_sub][
d] = p_values[i];
125 for (
unsigned int i = 0; i < p_grads.size(); ++i)
126 for (
unsigned int d1 = 0; d1 < dim; ++d1)
127 grads[i +
d * n_sub][
d][(d1 +
d) % dim] = p_grads[i][d1];
129 for (
unsigned int i = 0; i < p_grad_grads.size(); ++i)
130 for (
unsigned int d1 = 0; d1 < dim; ++d1)
131 for (
unsigned int d2 = 0; d2 < dim; ++d2)
132 grad_grads[i +
d * n_sub][
d][(d1 +
d) % dim][(d2 +
d) % dim] =
133 p_grad_grads[i][d1][d2];
135 for (
unsigned int i = 0; i < p_third_derivatives.size(); ++i)
136 for (
unsigned int d1 = 0; d1 < dim; ++d1)
137 for (
unsigned int d2 = 0; d2 < dim; ++d2)
138 for (
unsigned int d3 = 0; d3 < dim; ++d3)
139 third_derivatives[i +
d * n_sub][
d][(d1 +
d) % dim]
140 [(d2 +
d) % dim][(d3 +
d) % dim] =
141 p_third_derivatives[i][d1][d2][d3];
143 for (
unsigned int i = 0; i < p_fourth_derivatives.size(); ++i)
144 for (
unsigned int d1 = 0; d1 < dim; ++d1)
145 for (
unsigned int d2 = 0; d2 < dim; ++d2)
146 for (
unsigned int d3 = 0; d3 < dim; ++d3)
147 for (
unsigned int d4 = 0; d4 < dim; ++d4)
148 fourth_derivatives[i +
d * n_sub][
d][(d1 +
d) % dim]
149 [(d2 +
d) % dim][(d3 +
d) % dim]
151 p_fourth_derivatives[i][d1][d2][d3][d4];
169 return 2 * (k + 3) * (k + 1);
174 return 3 * (k + 3) * (k + 1) * (k + 1);
185 std::unique_ptr<TensorPolynomialsBase<dim>>
188 return std_cxx14::make_unique<PolynomialsABF<dim>>(*this);