79 Assert(values.size() == this->n() || values.size() == 0,
81 Assert(grads.size() == this->n() || grads.size() == 0,
83 Assert(grad_grads.size() == this->n() || grad_grads.size() == 0,
85 Assert(third_derivatives.size() == this->n() || third_derivatives.size() == 0,
87 Assert(fourth_derivatives.size() == this->n() ||
88 fourth_derivatives.size() == 0,
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.size() == 0) ? 0 : n_q);
108 Q_grads.resize((grads.size() == 0) ? 0 : n_q);
109 Q_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_q);
110 Q_third_derivatives.resize((third_derivatives.size() == 0) ? 0 : n_q);
111 Q_fourth_derivatives.resize((fourth_derivatives.size() == 0) ? 0 : n_q);
112 bubble_values.resize((values.size() == 0) ? 0 : n_bubbles);
113 bubble_grads.resize((grads.size() == 0) ? 0 : n_bubbles);
114 bubble_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_bubbles);
115 bubble_third_derivatives.resize((third_derivatives.size() == 0) ? 0 :
117 bubble_fourth_derivatives.resize(
118 (fourth_derivatives.size() == 0) ? 0 : n_bubbles);
123 std::vector<Tensor<1, dim>> normals;
128 normals.push_back(normal);
132 std::vector<Tensor<1, dim>> units;
133 for (
unsigned int i = 0; i < dim; ++i)
137 units.push_back(unit);
142 std::vector<int> aniso_indices;
145 aniso_indices.push_back(6);
146 aniso_indices.push_back(7);
147 aniso_indices.push_back(2);
148 aniso_indices.push_back(5);
152 aniso_indices.push_back(24);
153 aniso_indices.push_back(25);
154 aniso_indices.push_back(20);
155 aniso_indices.push_back(23);
156 aniso_indices.push_back(8);
157 aniso_indices.push_back(17);
160 polynomial_space_bubble.evaluate(unit_point,
164 bubble_third_derivatives,
165 bubble_fourth_derivatives);
166 polynomial_space_Q.evaluate(unit_point,
171 Q_fourth_derivatives);
174 for (
unsigned int i = 0; i < dim * GeometryInfo<dim>::vertices_per_cell; ++i)
176 if (values.size() != 0)
178 values[i] = units[i % dim] * Q_values[i / dim];
180 if (grads.size() != 0)
184 if (grad_grads.size() != 0)
186 grad_grads[i] =
outer_product(units[i % dim], Q_grad_grads[i / dim]);
188 if (third_derivatives.size() != 0)
190 third_derivatives[i] =
193 if (fourth_derivatives.size() != 0)
195 fourth_derivatives[i] =
196 outer_product(units[i % dim], Q_fourth_derivatives[i / dim]);
202 i < dim * GeometryInfo<dim>::vertices_per_cell +
210 if (values.size() != 0)
212 values[i] = normals[j] * bubble_values[aniso_indices[j]];
214 if (grads.size() != 0)
216 grads[i] =
outer_product(normals[j], bubble_grads[aniso_indices[j]]);
218 if (grad_grads.size() != 0)
221 outer_product(normals[j], bubble_grad_grads[aniso_indices[j]]);
223 if (third_derivatives.size() != 0)
225 third_derivatives[i] =
227 bubble_third_derivatives[aniso_indices[j]]);
229 if (fourth_derivatives.size() != 0)
231 fourth_derivatives[i] =
233 bubble_fourth_derivatives[aniso_indices[j]]);