40 , polynomial_space(create_polynomials(k))
46 std::vector<std::vector<Polynomials::Polynomial<double>>>
49 std::vector<std::vector<Polynomials::Polynomial<double>>> pols(dim);
52 for (
unsigned int d = 1;
d < dim; ++
d)
55 for (
unsigned int d = 1;
d < dim; ++
d)
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,
97 static std::mutex mutex;
98 std::lock_guard<std::mutex> lock(mutex);
100 static std::vector<double> p_values;
101 static std::vector<Tensor<1, dim>> p_grads;
102 static std::vector<Tensor<2, dim>> p_grad_grads;
103 static std::vector<Tensor<3, dim>> p_third_derivatives;
104 static std::vector<Tensor<4, dim>> p_fourth_derivatives;
106 const unsigned int n_sub = polynomial_space.n();
107 p_values.resize((values.size() == 0) ? 0 : n_sub);
108 p_grads.resize((grads.size() == 0) ? 0 : n_sub);
109 p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub);
110 p_third_derivatives.resize((third_derivatives.size() == 0) ? 0 : n_sub);
111 p_fourth_derivatives.resize((fourth_derivatives.size() == 0) ? 0 : n_sub);
113 for (
unsigned int d = 0;
d < dim; ++
d)
127 for (
unsigned int c = 0; c < dim; ++c)
128 p(c) = unit_point((c +
d) % dim);
130 polynomial_space.evaluate(p,
135 p_fourth_derivatives);
137 for (
unsigned int i = 0; i < p_values.size(); ++i)
138 values[i +
d * n_sub][
d] = p_values[i];
140 for (
unsigned int i = 0; i < p_grads.size(); ++i)
141 for (
unsigned int d1 = 0; d1 < dim; ++d1)
142 grads[i +
d * n_sub][
d][(d1 +
d) % dim] = p_grads[i][d1];
144 for (
unsigned int i = 0; i < p_grad_grads.size(); ++i)
145 for (
unsigned int d1 = 0; d1 < dim; ++d1)
146 for (
unsigned int d2 = 0; d2 < dim; ++d2)
147 grad_grads[i +
d * n_sub][
d][(d1 +
d) % dim][(d2 +
d) % dim] =
148 p_grad_grads[i][d1][d2];
150 for (
unsigned int i = 0; i < p_third_derivatives.size(); ++i)
151 for (
unsigned int d1 = 0; d1 < dim; ++d1)
152 for (
unsigned int d2 = 0; d2 < dim; ++d2)
153 for (
unsigned int d3 = 0; d3 < dim; ++d3)
154 third_derivatives[i +
d * n_sub][
d][(d1 +
d) % dim]
155 [(d2 +
d) % dim][(d3 +
d) % dim] =
156 p_third_derivatives[i][d1][d2][d3];
158 for (
unsigned int i = 0; i < p_fourth_derivatives.size(); ++i)
159 for (
unsigned int d1 = 0; d1 < dim; ++d1)
160 for (
unsigned int d2 = 0; d2 < dim; ++d2)
161 for (
unsigned int d3 = 0; d3 < dim; ++d3)
162 for (
unsigned int d4 = 0; d4 < dim; ++d4)
163 fourth_derivatives[i +
d * n_sub][
d][(d1 +
d) % dim]
164 [(d2 +
d) % dim][(d3 +
d) % dim]
166 p_fourth_derivatives[i][d1][d2][d3][d4];
178 return 2 * (k + 1) * (k + 2);
180 return 3 * (k + 1) * (k + 1) * (k + 2);
188 std::unique_ptr<TensorPolynomialsBase<dim>>
191 return std_cxx14::make_unique<PolynomialsRaviartThomas<dim>>(*this);