78 Assert(values.size() == this->n() || values.empty(),
80 Assert(grads.size() == this->n() || grads.empty(),
82 Assert(grad_grads.size() == this->n() || grad_grads.empty(),
84 Assert(third_derivatives.size() == this->n() || third_derivatives.empty(),
86 Assert(fourth_derivatives.size() == this->n() || fourth_derivatives.empty(),
89 std::vector<double> Q_values;
90 std::vector<Tensor<1, dim>> Q_grads;
91 std::vector<Tensor<2, dim>> Q_grad_grads;
92 std::vector<Tensor<3, dim>> Q_third_derivatives;
93 std::vector<Tensor<4, dim>> Q_fourth_derivatives;
94 std::vector<double> bubble_values;
95 std::vector<Tensor<1, dim>> bubble_grads;
96 std::vector<Tensor<2, dim>> bubble_grad_grads;
97 std::vector<Tensor<3, dim>> bubble_third_derivatives;
98 std::vector<Tensor<4, dim>> bubble_fourth_derivatives;
100 constexpr int n_bubbles =
102 constexpr int n_q = 1 << dim;
105 Q_values.resize((values.empty()) ? 0 : n_q);
106 Q_grads.resize((grads.empty()) ? 0 : n_q);
107 Q_grad_grads.resize((grad_grads.empty()) ? 0 : n_q);
108 Q_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_q);
109 Q_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 : n_q);
110 bubble_values.resize((values.empty()) ? 0 : n_bubbles);
111 bubble_grads.resize((grads.empty()) ? 0 : n_bubbles);
112 bubble_grad_grads.resize((grad_grads.empty()) ? 0 : n_bubbles);
113 bubble_third_derivatives.resize((third_derivatives.empty()) ? 0 : n_bubbles);
114 bubble_fourth_derivatives.resize((fourth_derivatives.empty()) ? 0 :
120 std::vector<Tensor<1, dim>> normals;
125 normals.push_back(normal);
129 std::vector<Tensor<1, dim>> units;
130 for (
unsigned int i = 0; i < dim; ++i)
134 units.push_back(unit);
139 std::vector<int> aniso_indices;
142 aniso_indices.push_back(6);
143 aniso_indices.push_back(7);
144 aniso_indices.push_back(2);
145 aniso_indices.push_back(5);
149 aniso_indices.push_back(24);
150 aniso_indices.push_back(25);
151 aniso_indices.push_back(20);
152 aniso_indices.push_back(23);
153 aniso_indices.push_back(8);
154 aniso_indices.push_back(17);
157 polynomial_space_bubble.evaluate(unit_point,
161 bubble_third_derivatives,
162 bubble_fourth_derivatives);
163 polynomial_space_Q.evaluate(unit_point,
168 Q_fourth_derivatives);
171 for (
unsigned int i = 0; i < dim * GeometryInfo<dim>::vertices_per_cell; ++i)
173 if (values.size() != 0)
175 values[i] = units[i % dim] * Q_values[i / dim];
177 if (grads.size() != 0)
181 if (grad_grads.size() != 0)
183 grad_grads[i] =
outer_product(units[i % dim], Q_grad_grads[i / dim]);
185 if (third_derivatives.size() != 0)
187 third_derivatives[i] =
190 if (fourth_derivatives.size() != 0)
192 fourth_derivatives[i] =
193 outer_product(units[i % dim], Q_fourth_derivatives[i / dim]);
199 i < dim * GeometryInfo<dim>::vertices_per_cell +
207 if (values.size() != 0)
209 values[i] = normals[j] * bubble_values[aniso_indices[j]];
211 if (grads.size() != 0)
213 grads[i] =
outer_product(normals[j], bubble_grads[aniso_indices[j]]);
215 if (grad_grads.size() != 0)
218 outer_product(normals[j], bubble_grad_grads[aniso_indices[j]]);
220 if (third_derivatives.size() != 0)
222 third_derivatives[i] =
224 bubble_third_derivatives[aniso_indices[j]]);
226 if (fourth_derivatives.size() != 0)
228 fourth_derivatives[i] =
230 bubble_fourth_derivatives[aniso_indices[j]]);