29 std::vector<std::vector<Polynomials::Polynomial<double>>>
30 get_abf_polynomials(
const unsigned int k)
32 std::vector<std::vector<Polynomials::Polynomial<double>>> pols(dim);
36 for (
unsigned int d = 1;
d < dim; ++
d)
39 for (
unsigned int d = 1;
d < dim; ++
d)
69 Assert(values.size() == this->n() || values.empty(),
71 Assert(grads.size() == this->n() || grads.empty(),
73 Assert(grad_grads.size() == this->n() || grad_grads.empty(),
75 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
77 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
86 std::scoped_lock lock(
mutex);
88 p_values.resize((values.empty()) ? 0 : n_sub);
89 p_grads.resize((grads.empty()) ? 0 : n_sub);
94 for (
unsigned int d = 0; d < dim; ++d)
108 for (
unsigned int c = 0; c < dim; ++c)
109 p[c] = unit_point[(c + d) % dim];
118 for (
unsigned int i = 0; i <
p_values.size(); ++i)
119 values[i + d * n_sub][d] =
p_values[i];
121 for (
unsigned int i = 0; i <
p_grads.size(); ++i)
122 for (
unsigned int d1 = 0; d1 < dim; ++d1)
123 grads[i + d * n_sub][d][(d1 + d) % dim] =
p_grads[i][d1];
126 for (
unsigned int d1 = 0; d1 < dim; ++d1)
127 for (
unsigned int d2 = 0; d2 < dim; ++d2)
128 grad_grads[i + d * n_sub][d][(d1 + d) % dim][(d2 + d) % dim] =
132 for (
unsigned int d1 = 0; d1 < dim; ++d1)
133 for (
unsigned int d2 = 0; d2 < dim; ++d2)
134 for (
unsigned int d3 = 0; d3 < dim; ++d3)
135 third_derivatives[i + d * n_sub][d][(d1 + d) % dim]
136 [(d2 + d) % dim][(d3 + d) % dim] =
140 for (
unsigned int d1 = 0; d1 < dim; ++d1)
141 for (
unsigned int d2 = 0; d2 < dim; ++d2)
142 for (
unsigned int d3 = 0; d3 < dim; ++d3)
143 for (
unsigned int d4 = 0; d4 < dim; ++d4)
144 fourth_derivatives[i + d * n_sub][d][(d1 + d) % dim]
145 [(d2 + d) % dim][(d3 + d) % dim]
165 return 2 * (k + 3) * (k + 1);
170 return 3 * (k + 3) * (k + 1) * (k + 1);
181std::unique_ptr<TensorPolynomialsBase<dim>>
184 return std::make_unique<PolynomialsABF<dim>>(*this);
std::vector< Tensor< 4, dim > > p_fourth_derivatives
std::vector< Tensor< 2, dim > > p_grad_grads
std::vector< Tensor< 1, dim > > p_grads
std::vector< Tensor< 3, dim > > p_third_derivatives
const AnisotropicPolynomials< dim > polynomial_space
PolynomialsABF(const unsigned int k)
static unsigned int n_polynomials(const unsigned int degree)
std::vector< double > p_values
void evaluate(const Point< dim > &unit_point, std::vector< Tensor< 1, dim > > &values, std::vector< Tensor< 2, dim > > &grads, std::vector< Tensor< 3, dim > > &grad_grads, std::vector< Tensor< 4, dim > > &third_derivatives, std::vector< Tensor< 5, dim > > &fourth_derivatives) const override
virtual std::unique_ptr< TensorPolynomialsBase< dim > > clone() const override
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
static std::vector< Polynomial< double > > generate_complete_basis(const unsigned int degree)
TensorPolynomialsBase(const unsigned int deg, const unsigned int n_polynomials)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)