89 Assert(values.size() == this->n() || values.empty(),
91 Assert(grads.size() == this->n() || grads.empty(),
93 Assert(grad_grads.size() == this->n() || grad_grads.empty(),
95 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
97 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
100 std::vector<double> Q_values;
101 std::vector<Tensor<1, dim>> Q_grads;
102 std::vector<Tensor<2, dim>> Q_grad_grads;
103 std::vector<Tensor<3, dim>> Q_third_derivatives;
104 std::vector<Tensor<4, dim>> Q_fourth_derivatives;
105 std::vector<double> bubble_values;
106 std::vector<Tensor<1, dim>> bubble_grads;
107 std::vector<Tensor<2, dim>> bubble_grad_grads;
108 std::vector<Tensor<3, dim>> bubble_third_derivatives;
109 std::vector<Tensor<4, dim>> bubble_fourth_derivatives;
111 constexpr int n_bubbles =
113 constexpr int n_q = 1 << dim;
116 Q_values.resize((values.empty()) ? 0 : n_q);
117 Q_grads.resize((grads.empty()) ? 0 : n_q);
118 Q_grad_grads.resize((grad_grads.empty()) ? 0 : n_q);
119 Q_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_q);
120 Q_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 : n_q);
121 bubble_values.resize((values.empty()) ? 0 : n_bubbles);
122 bubble_grads.resize((grads.empty()) ? 0 : n_bubbles);
123 bubble_grad_grads.resize((grad_grads.empty()) ? 0 : n_bubbles);
124 bubble_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_bubbles);
125 bubble_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 :
131 std::vector<Tensor<1, dim>> normals;
136 normals.push_back(normal);
140 std::vector<Tensor<1, dim>> units;
141 for (
unsigned int i = 0; i < dim; ++i)
145 units.push_back(unit);
150 std::vector<int> aniso_indices;
153 aniso_indices.push_back(6);
154 aniso_indices.push_back(7);
155 aniso_indices.push_back(2);
156 aniso_indices.push_back(5);
160 aniso_indices.push_back(24);
161 aniso_indices.push_back(25);
162 aniso_indices.push_back(20);
163 aniso_indices.push_back(23);
164 aniso_indices.push_back(8);
165 aniso_indices.push_back(17);
168 polynomial_space_bubble.evaluate(unit_point,
172 bubble_third_derivatives,
173 bubble_fourth_derivatives);
174 polynomial_space_Q.evaluate(unit_point,
179 Q_fourth_derivatives);
182 for (
unsigned int i = 0; i < dim * GeometryInfo<dim>::vertices_per_cell; ++i)
184 if (values.size() != 0)
186 values[i] = units[i % dim] * Q_values[i / dim];
188 if (grads.size() != 0)
192 if (grad_grads.size() != 0)
194 grad_grads[i] =
outer_product(units[i % dim], Q_grad_grads[i / dim]);
196 if (third_derivatives.size() != 0)
198 third_derivatives[i] =
201 if (fourth_derivatives.size() != 0)
203 fourth_derivatives[i] =
204 outer_product(units[i % dim], Q_fourth_derivatives[i / dim]);
210 i < dim * GeometryInfo<dim>::vertices_per_cell +
218 if (values.size() != 0)
220 values[i] = normals[j] * bubble_values[aniso_indices[j]];
222 if (grads.size() != 0)
224 grads[i] =
outer_product(normals[j], bubble_grads[aniso_indices[j]]);
226 if (grad_grads.size() != 0)
229 outer_product(normals[j], bubble_grad_grads[aniso_indices[j]]);
231 if (third_derivatives.size() != 0)
233 third_derivatives[i] =
235 bubble_third_derivatives[aniso_indices[j]]);
237 if (fourth_derivatives.size() != 0)
239 fourth_derivatives[i] =
241 bubble_fourth_derivatives[aniso_indices[j]]);