80 Assert(values.size() == this->n() || values.empty(),
82 Assert(grads.size() == this->n() || grads.empty(),
84 Assert(grad_grads.size() == this->n() || grad_grads.empty(),
86 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
88 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
91 std::vector<double> Q_values;
92 std::vector<Tensor<1, dim>> Q_grads;
93 std::vector<Tensor<2, dim>> Q_grad_grads;
94 std::vector<Tensor<3, dim>> Q_third_derivatives;
95 std::vector<Tensor<4, dim>> Q_fourth_derivatives;
96 std::vector<double> bubble_values;
97 std::vector<Tensor<1, dim>> bubble_grads;
98 std::vector<Tensor<2, dim>> bubble_grad_grads;
99 std::vector<Tensor<3, dim>> bubble_third_derivatives;
100 std::vector<Tensor<4, dim>> bubble_fourth_derivatives;
102 constexpr int n_bubbles =
104 constexpr int n_q = 1 << dim;
107 Q_values.resize((values.empty()) ? 0 : n_q);
108 Q_grads.resize((grads.empty()) ? 0 : n_q);
109 Q_grad_grads.resize((grad_grads.empty()) ? 0 : n_q);
110 Q_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_q);
111 Q_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 : n_q);
112 bubble_values.resize((values.empty()) ? 0 : n_bubbles);
113 bubble_grads.resize((grads.empty()) ? 0 : n_bubbles);
114 bubble_grad_grads.resize((grad_grads.empty()) ? 0 : n_bubbles);
115 bubble_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_bubbles);
116 bubble_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 :
122 std::vector<Tensor<1, dim>> normals;
127 normals.push_back(normal);
131 std::vector<Tensor<1, dim>> units;
132 for (
unsigned int i = 0; i < dim; ++i)
136 units.push_back(unit);
141 std::vector<int> aniso_indices;
144 aniso_indices.push_back(6);
145 aniso_indices.push_back(7);
146 aniso_indices.push_back(2);
147 aniso_indices.push_back(5);
151 aniso_indices.push_back(24);
152 aniso_indices.push_back(25);
153 aniso_indices.push_back(20);
154 aniso_indices.push_back(23);
155 aniso_indices.push_back(8);
156 aniso_indices.push_back(17);
159 polynomial_space_bubble.evaluate(unit_point,
163 bubble_third_derivatives,
164 bubble_fourth_derivatives);
165 polynomial_space_Q.evaluate(unit_point,
170 Q_fourth_derivatives);
173 for (
unsigned int i = 0; i < dim * GeometryInfo<dim>::vertices_per_cell; ++i)
175 if (values.size() != 0)
177 values[i] = units[i % dim] * Q_values[i / dim];
179 if (grads.size() != 0)
183 if (grad_grads.size() != 0)
185 grad_grads[i] =
outer_product(units[i % dim], Q_grad_grads[i / dim]);
187 if (third_derivatives.size() != 0)
189 third_derivatives[i] =
192 if (fourth_derivatives.size() != 0)
194 fourth_derivatives[i] =
195 outer_product(units[i % dim], Q_fourth_derivatives[i / dim]);
201 i < dim * GeometryInfo<dim>::vertices_per_cell +
209 if (values.size() != 0)
211 values[i] = normals[j] * bubble_values[aniso_indices[j]];
213 if (grads.size() != 0)
215 grads[i] =
outer_product(normals[j], bubble_grads[aniso_indices[j]]);
217 if (grad_grads.size() != 0)
220 outer_product(normals[j], bubble_grad_grads[aniso_indices[j]]);
222 if (third_derivatives.size() != 0)
224 third_derivatives[i] =
226 bubble_third_derivatives[aniso_indices[j]]);
228 if (fourth_derivatives.size() != 0)
230 fourth_derivatives[i] =
232 bubble_fourth_derivatives[aniso_indices[j]]);