40 , polynomial_space(create_polynomials(k))
49 , polynomial_space(other.polynomial_space)
56std::vector<std::vector<Polynomials::Polynomial<double>>>
68 std::vector<std::vector<Polynomials::Polynomial<double>>> pols(dim);
78 for (
unsigned int d = 1; d < dim; ++d)
85 for (
unsigned int d = 1; d < dim; ++d)
104 Assert(values.size() == this->n() || values.size() == 0,
106 Assert(grads.size() == this->n() || grads.size() == 0,
108 Assert(grad_grads.size() == this->n() || grad_grads.size() == 0,
110 Assert(third_derivatives.size() == this->n() || third_derivatives.size() == 0,
112 Assert(fourth_derivatives.size() == this->n() ||
113 fourth_derivatives.size() == 0,
120 std::lock_guard<std::mutex> lock(scratch_arrays_mutex);
122 const unsigned int n_sub = polynomial_space.n();
123 scratch_values.resize((values.size() == 0) ? 0 : n_sub);
124 scratch_grads.resize((grads.size() == 0) ? 0 : n_sub);
125 scratch_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub);
126 scratch_third_derivatives.resize((third_derivatives.size() == 0) ? 0 : n_sub);
127 scratch_fourth_derivatives.resize((fourth_derivatives.size() == 0) ? 0 :
130 for (
unsigned int d = 0; d < dim; ++d)
144 for (
unsigned int c = 0; c < dim; ++c)
145 p(c) = unit_point((c + d) % dim);
147 polynomial_space.evaluate(p,
151 scratch_third_derivatives,
152 scratch_fourth_derivatives);
154 for (
unsigned int i = 0; i < scratch_values.size(); ++i)
155 values[i + d * n_sub][d] = scratch_values[i];
157 for (
unsigned int i = 0; i < scratch_grads.size(); ++i)
158 for (
unsigned int d1 = 0; d1 < dim; ++d1)
159 grads[i + d * n_sub][d][(d1 + d) % dim] = scratch_grads[i][d1];
161 for (
unsigned int i = 0; i < scratch_grad_grads.size(); ++i)
162 for (
unsigned int d1 = 0; d1 < dim; ++d1)
163 for (
unsigned int d2 = 0; d2 < dim; ++d2)
164 grad_grads[i + d * n_sub][d][(d1 + d) % dim][(d2 + d) % dim] =
165 scratch_grad_grads[i][d1][d2];
167 for (
unsigned int i = 0; i < scratch_third_derivatives.size(); ++i)
168 for (
unsigned int d1 = 0; d1 < dim; ++d1)
169 for (
unsigned int d2 = 0; d2 < dim; ++d2)
170 for (
unsigned int d3 = 0; d3 < dim; ++d3)
171 third_derivatives[i + d * n_sub][d][(d1 + d) % dim]
172 [(d2 + d) % dim][(d3 + d) % dim] =
173 scratch_third_derivatives[i][d1][d2][d3];
175 for (
unsigned int i = 0; i < scratch_fourth_derivatives.size(); ++i)
176 for (
unsigned int d1 = 0; d1 < dim; ++d1)
177 for (
unsigned int d2 = 0; d2 < dim; ++d2)
178 for (
unsigned int d3 = 0; d3 < dim; ++d3)
179 for (
unsigned int d4 = 0; d4 < dim; ++d4)
180 fourth_derivatives[i + d * n_sub][d][(d1 + d) % dim]
181 [(d2 + d) % dim][(d3 + d) % dim]
183 scratch_fourth_derivatives[i][d1][d2][d3]
196 return 2 * (k + 1) * (k + 2);
198 return 3 * (k + 1) * (k + 1) * (k + 2);
206std::unique_ptr<TensorPolynomialsBase<dim>>
209 return std::make_unique<PolynomialsRaviartThomas<dim>>(*this);
static unsigned int n_polynomials(const unsigned int degree)
PolynomialsRaviartThomas(const unsigned int k)
static std::vector< std::vector< Polynomials::Polynomial< double > > > create_polynomials(const unsigned int k)
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)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)