17 #include <deal.II/base/array_view.h> 18 #include <deal.II/base/derivative_form.h> 19 #include <deal.II/base/memory_consumption.h> 20 #include <deal.II/base/qprojector.h> 21 #include <deal.II/base/quadrature.h> 22 #include <deal.II/base/quadrature_lib.h> 23 #include <deal.II/base/std_cxx14/memory.h> 24 #include <deal.II/base/table.h> 25 #include <deal.II/base/tensor_product_polynomials.h> 27 #include <deal.II/fe/fe_base.h> 28 #include <deal.II/fe/fe_tools.h> 29 #include <deal.II/fe/fe_values.h> 30 #include <deal.II/fe/mapping_q1.h> 31 #include <deal.II/fe/mapping_q_generic.h> 33 #include <deal.II/grid/manifold_lib.h> 34 #include <deal.II/grid/tria.h> 35 #include <deal.II/grid/tria_iterator.h> 37 #include <deal.II/lac/full_matrix.h> 38 #include <deal.II/lac/tensor_product_matrix.h> 40 #include <deal.II/matrix_free/evaluation_kernels.h> 41 #include <deal.II/matrix_free/evaluation_selector.h> 42 #include <deal.II/matrix_free/shape_info.h> 43 #include <deal.II/matrix_free/tensor_product_kernels.h> 52 DEAL_II_NAMESPACE_OPEN
57 namespace MappingQGenericImplementation
62 std::vector<unsigned int>
63 get_dpo_vector(
const unsigned int degree)
65 std::vector<unsigned int> dpo(dim + 1, 1U);
66 for (
unsigned int i = 1; i < dpo.size(); ++i)
67 dpo[i] = dpo[i - 1] * (degree - 1);
82 template <
int spacedim>
84 transform_real_to_unit_cell(
90 return Point<1>((p[0] - vertices[0](0)) /
91 (vertices[1](0) - vertices[0](0)));
96 template <
int spacedim>
98 transform_real_to_unit_cell(
108 const long double x = p(0);
109 const long double y = p(1);
111 const long double x0 = vertices[0](0);
112 const long double x1 = vertices[1](0);
113 const long double x2 = vertices[2](0);
114 const long double x3 = vertices[3](0);
116 const long double y0 = vertices[0](1);
117 const long double y1 = vertices[1](1);
118 const long double y2 = vertices[2](1);
119 const long double y3 = vertices[3](1);
121 const long double a = (x1 - x3) * (y0 - y2) - (x0 - x2) * (y1 - y3);
122 const long double b = -(x0 - x1 - x2 + x3) * y +
123 (x - 2 * x1 + x3) * y0 - (x - 2 * x0 + x2) * y1 -
124 (x - x1) * y2 + (x - x0) * y3;
125 const long double c = (x0 - x1) * y - (x - x1) * y0 + (x - x0) * y1;
127 const long double discriminant =
b *
b - 4 * a * c;
136 const long double sqrt_discriminant = std::sqrt(discriminant);
139 if (b != 0.0 && std::abs(b) == sqrt_discriminant)
146 else if (std::abs(a) < 1e-8 * std::abs(b))
150 eta1 = 2 * c / (-
b - sqrt_discriminant);
151 eta2 = 2 * c / (-
b + sqrt_discriminant);
156 eta1 = (-
b - sqrt_discriminant) / (2 * a);
157 eta2 = (-
b + sqrt_discriminant) / (2 * a);
160 const long double eta =
161 (std::abs(eta1 - 0.5) < std::abs(eta2 - 0.5)) ? eta1 : eta2;
167 const long double subexpr0 = -eta * x2 + x0 * (eta - 1);
168 const long double xi_denominator0 =
169 eta * x3 - x1 * (eta - 1) + subexpr0;
170 const long double max_x =
171 std::max(std::max(std::abs(x0), std::abs(x1)),
172 std::max(std::abs(x2), std::abs(x3)));
174 if (std::abs(xi_denominator0) > 1e-10 * max_x)
176 const double xi = (x + subexpr0) / xi_denominator0;
177 return {xi,
static_cast<double>(eta)};
181 const long double max_y =
182 std::max(std::max(std::abs(y0), std::abs(y1)),
183 std::max(std::abs(y2), std::abs(y3)));
184 const long double subexpr1 = -eta * y2 + y0 * (eta - 1);
185 const long double xi_denominator1 =
186 eta * y3 - y1 * (eta - 1) + subexpr1;
187 if (std::abs(xi_denominator1) > 1
e-10 * max_y)
189 const double xi = (subexpr1 + y) / xi_denominator1;
190 return {xi,
static_cast<double>(eta)};
197 spacedim>::ExcTransformationFailed()));
203 return {std::numeric_limits<double>::quiet_NaN(),
204 std::numeric_limits<double>::quiet_NaN()};
209 template <
int spacedim>
211 transform_real_to_unit_cell(
223 template <
int dim,
int spacedim>
225 compute_shape_function_values_general(
226 const unsigned int n_shape_functions,
228 typename ::MappingQGeneric<dim, spacedim>::InternalData &data)
230 const unsigned int n_points = unit_points.size();
236 data.line_support_points.get_points()));
241 const std::vector<unsigned int> renumber(
243 internal::MappingQGenericImplementation::get_dpo_vector<dim>(
244 data.polynomial_degree),
246 data.polynomial_degree)));
248 std::vector<double> values;
249 std::vector<Tensor<1, dim>> grads;
250 if (data.shape_values.size() != 0)
252 Assert(data.shape_values.size() == n_shape_functions * n_points,
254 values.resize(n_shape_functions);
256 if (data.shape_derivatives.size() != 0)
258 Assert(data.shape_derivatives.size() ==
259 n_shape_functions * n_points,
261 grads.resize(n_shape_functions);
264 std::vector<Tensor<2, dim>> grad2;
265 if (data.shape_second_derivatives.size() != 0)
267 Assert(data.shape_second_derivatives.size() ==
268 n_shape_functions * n_points,
270 grad2.resize(n_shape_functions);
273 std::vector<Tensor<3, dim>> grad3;
274 if (data.shape_third_derivatives.size() != 0)
276 Assert(data.shape_third_derivatives.size() ==
277 n_shape_functions * n_points,
279 grad3.resize(n_shape_functions);
282 std::vector<Tensor<4, dim>> grad4;
283 if (data.shape_fourth_derivatives.size() != 0)
285 Assert(data.shape_fourth_derivatives.size() ==
286 n_shape_functions * n_points,
288 grad4.resize(n_shape_functions);
292 if (data.shape_values.size() != 0 ||
293 data.shape_derivatives.size() != 0 ||
294 data.shape_second_derivatives.size() != 0 ||
295 data.shape_third_derivatives.size() != 0 ||
296 data.shape_fourth_derivatives.size() != 0)
297 for (
unsigned int point = 0;
point < n_points; ++
point)
300 unit_points[point], values, grads, grad2, grad3, grad4);
302 if (data.shape_values.size() != 0)
303 for (
unsigned int i = 0; i < n_shape_functions; ++i)
304 data.shape(point, renumber[i]) = values[i];
306 if (data.shape_derivatives.size() != 0)
307 for (
unsigned int i = 0; i < n_shape_functions; ++i)
308 data.derivative(point, renumber[i]) = grads[i];
310 if (data.shape_second_derivatives.size() != 0)
311 for (
unsigned int i = 0; i < n_shape_functions; ++i)
312 data.second_derivative(point, renumber[i]) = grad2[i];
314 if (data.shape_third_derivatives.size() != 0)
315 for (
unsigned int i = 0; i < n_shape_functions; ++i)
316 data.third_derivative(point, renumber[i]) = grad3[i];
318 if (data.shape_fourth_derivatives.size() != 0)
319 for (
unsigned int i = 0; i < n_shape_functions; ++i)
320 data.fourth_derivative(point, renumber[i]) = grad4[i];
326 compute_shape_function_values_hardcode(
327 const unsigned int n_shape_functions,
328 const std::vector<
Point<1>> & unit_points,
331 (void)n_shape_functions;
332 const unsigned int n_points = unit_points.size();
333 for (
unsigned int k = 0; k < n_points; ++k)
335 double x = unit_points[k](0);
341 data.
shape(k, 0) = 1. - x;
342 data.
shape(k, 1) = x;
347 n_shape_functions * n_points,
355 n_shape_functions * n_points,
363 n_shape_functions * n_points,
373 n_shape_functions * n_points,
385 compute_shape_function_values_hardcode(
386 const unsigned int n_shape_functions,
387 const std::vector<
Point<2>> & unit_points,
390 (void)n_shape_functions;
391 const unsigned int n_points = unit_points.size();
392 for (
unsigned int k = 0; k < n_points; ++k)
394 double x = unit_points[k](0);
395 double y = unit_points[k](1);
401 data.
shape(k, 0) = (1. - x) * (1. - y);
402 data.
shape(k, 1) = x * (1. - y);
403 data.
shape(k, 2) = (1. - x) * y;
404 data.
shape(k, 3) = x * y;
409 n_shape_functions * n_points,
423 n_shape_functions * n_points,
445 n_shape_functions * n_points,
449 for (
unsigned int i = 0; i < 4; ++i)
455 n_shape_functions * n_points,
458 for (
unsigned int i = 0; i < 4; ++i)
467 compute_shape_function_values_hardcode(
468 const unsigned int n_shape_functions,
469 const std::vector<
Point<3>> & unit_points,
472 (void)n_shape_functions;
473 const unsigned int n_points = unit_points.size();
474 for (
unsigned int k = 0; k < n_points; ++k)
476 double x = unit_points[k](0);
477 double y = unit_points[k](1);
478 double z = unit_points[k](2);
484 data.
shape(k, 0) = (1. - x) * (1. - y) * (1. - z);
485 data.
shape(k, 1) = x * (1. - y) * (1. - z);
486 data.
shape(k, 2) = (1. - x) * y * (1. - z);
487 data.
shape(k, 3) = x * y * (1. - z);
488 data.
shape(k, 4) = (1. - x) * (1. - y) * z;
489 data.
shape(k, 5) = x * (1. - y) * z;
490 data.
shape(k, 6) = (1. - x) * y * z;
491 data.
shape(k, 7) = x * y * z;
496 n_shape_functions * n_points,
498 data.
derivative(k, 0)[0] = (y - 1.) * (1. - z);
499 data.
derivative(k, 1)[0] = (1. - y) * (1. - z);
506 data.
derivative(k, 0)[1] = (x - 1.) * (1. - z);
508 data.
derivative(k, 2)[1] = (1. - x) * (1. - z);
514 data.
derivative(k, 0)[2] = (x - 1) * (1. - y);
518 data.
derivative(k, 4)[2] = (1. - x) * (1. - y);
526 n_shape_functions * n_points,
607 n_shape_functions * n_points,
610 for (
unsigned int i = 0; i < 3; ++i)
611 for (
unsigned int j = 0; j < 3; ++j)
612 for (
unsigned int l = 0;
l < 3; ++
l)
613 if ((i == j) || (j ==
l) || (l == i))
615 for (
unsigned int m = 0; m < 8; ++m)
633 n_shape_functions * n_points,
636 for (
unsigned int i = 0; i < 8; ++i)
647 template <
int dim,
int spacedim>
649 const unsigned int polynomial_degree)
650 : polynomial_degree(polynomial_degree)
651 , n_shape_functions(
Utilities::fixed_power<dim>(polynomial_degree + 1))
652 , line_support_points(
QGaussLobatto<1>(polynomial_degree + 1))
653 , tensor_product_quadrature(false)
658 template <
int dim,
int spacedim>
678 template <
int dim,
int spacedim>
683 const unsigned int n_original_q_points)
687 this->update_each = update_flags;
689 const unsigned int n_q_points = q.
size();
694 shape_values.resize(n_shape_functions * n_q_points);
696 if (this->update_each &
704 shape_derivatives.resize(n_shape_functions * n_q_points);
707 covariant.resize(n_original_q_points);
710 contravariant.resize(n_original_q_points);
713 volume_elements.resize(n_original_q_points);
715 if (this->update_each &
717 shape_second_derivatives.resize(n_shape_functions * n_q_points);
721 shape_third_derivatives.resize(n_shape_functions * n_q_points);
725 shape_fourth_derivatives.resize(n_shape_functions * n_q_points);
727 const std::vector<Point<dim>> &ref_q_points = q.
get_points();
729 compute_shape_function_values(ref_q_points);
735 tensor_product_quadrature =
false;
741 if (tensor_product_quadrature)
743 const std::array<Quadrature<1>, dim> quad_array =
745 for (
unsigned int i = 1; i < dim && tensor_product_quadrature; ++i)
747 if (quad_array[i - 1].size() != quad_array[i].size())
749 tensor_product_quadrature =
false;
754 const std::vector<Point<1>> &points_1 =
755 quad_array[i - 1].get_points();
756 const std::vector<Point<1>> &points_2 =
757 quad_array[i].get_points();
758 const std::vector<double> &weights_1 =
759 quad_array[i - 1].get_weights();
760 const std::vector<double> &weights_2 =
761 quad_array[i].get_weights();
762 for (
unsigned int j = 0; j < quad_array[i].size(); ++j)
764 if (std::abs(points_1[j][0] - points_2[j][0]) > 1.e-10 ||
765 std::abs(weights_1[j] - weights_2[j]) > 1.e-10)
767 tensor_product_quadrature =
false;
774 if (tensor_product_quadrature)
780 const unsigned int max_size =
781 std::max(n_q_points, n_shape_values);
782 const unsigned int vec_length =
784 const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
786 scratch.resize((dim - 1) * max_size);
787 values_dofs.resize(n_comp * n_shape_values);
795 template <
int dim,
int spacedim>
800 const unsigned int n_original_q_points)
802 initialize(update_flags, q, n_original_q_points);
804 if (dim > 1 && tensor_product_quadrature)
806 const unsigned int facedim = dim > 1 ? dim - 1 : 1;
811 const unsigned int n_q_points = q.
size();
812 const unsigned int max_size = std::max(n_q_points, n_shape_values);
814 const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
816 scratch.resize((dim - 1) * max_size);
817 values_dofs.resize(n_comp * n_shape_values);
822 if (this->update_each &
830 for (
unsigned int i = 0; i < unit_tangentials.size(); ++i)
831 unit_tangentials[i].resize(n_original_q_points);
837 static const int tangential_orientation[4] = {-1, 1, 1, -1};
838 for (
unsigned int i = 0;
839 i < GeometryInfo<dim>::faces_per_cell;
843 tang[1 - i / 2] = tangential_orientation[i];
844 std::fill(unit_tangentials[i].begin(),
845 unit_tangentials[i].end(),
854 for (
unsigned int i = 0;
855 i < GeometryInfo<dim>::faces_per_cell;
860 const unsigned int nd =
868 tang1[(nd + 1) % dim] =
873 tang2[(nd + 2) % dim] = 1.;
878 std::fill(unit_tangentials[i].begin(),
879 unit_tangentials[i].end(),
904 const std::vector<
Point<1>> &unit_points)
909 internal::MappingQ1::compute_shape_function_values_hardcode(
910 n_shape_functions, unit_points, *
this);
914 internal::MappingQ1::compute_shape_function_values_general<1, 1>(
915 n_shape_functions, unit_points, *
this);
922 const std::vector<
Point<2>> &unit_points)
927 internal::MappingQ1::compute_shape_function_values_hardcode(
928 n_shape_functions, unit_points, *
this);
932 internal::MappingQ1::compute_shape_function_values_general<2, 2>(
933 n_shape_functions, unit_points, *
this);
940 const std::vector<
Point<3>> &unit_points)
945 internal::MappingQ1::compute_shape_function_values_hardcode(
946 n_shape_functions, unit_points, *
this);
950 internal::MappingQ1::compute_shape_function_values_general<3, 3>(
951 n_shape_functions, unit_points, *
this);
955 template <
int dim,
int spacedim>
962 internal::MappingQ1::compute_shape_function_values_general<dim, spacedim>(
963 n_shape_functions, unit_points, *
this);
969 namespace MappingQGenericImplementation
981 compute_support_point_weights_on_quad(
992 const unsigned int n_inner_2d = M * M;
993 const unsigned int n_outer_2d = 4 + 4 * M;
996 loqvs.
reinit(n_inner_2d, n_outer_2d);
998 for (
unsigned int i = 0; i < M; ++i)
999 for (
unsigned int j = 0; j < M; ++j)
1003 const unsigned int index_table = i * M + j;
1004 for (
unsigned int v = 0; v < 4; ++v)
1005 loqvs(index_table, v) =
1007 loqvs(index_table, 4 + i) = 1. - p[0];
1008 loqvs(index_table, 4 + i + M) = p[0];
1009 loqvs(index_table, 4 + j + 2 * M) = 1. - p[1];
1010 loqvs(index_table, 4 + j + 3 * M) = p[1];
1015 for (
unsigned int unit_point = 0; unit_point < n_inner_2d; ++unit_point)
1016 Assert(std::fabs(std::accumulate(loqvs[unit_point].begin(),
1017 loqvs[unit_point].end(),
1045 const unsigned int n_inner = Utilities::fixed_power<3>(M);
1046 const unsigned int n_outer = 8 + 12 * M + 6 * M * M;
1049 lohvs.
reinit(n_inner, n_outer);
1051 for (
unsigned int i = 0; i < M; ++i)
1052 for (
unsigned int j = 0; j < M; ++j)
1053 for (
unsigned int k = 0; k < M; ++k)
1055 const Point<3> p = gl.point((i + 1) * (M + 2) * (M + 2) +
1056 (j + 1) * (M + 2) + (k + 1));
1057 const unsigned int index_table = i * M * M + j * M + k;
1060 for (
unsigned int v = 0; v < 8; ++v)
1061 lohvs(index_table, v) =
1066 constexpr std::array<unsigned int, 4> line_coordinates_y(
1069 for (
unsigned int l = 0;
l < 4; ++
l)
1070 lohvs(index_table, 8 + line_coordinates_y[l] * M + j) =
1075 constexpr std::array<unsigned int, 4> line_coordinates_x(
1078 for (
unsigned int l = 0;
l < 4; ++
l)
1079 lohvs(index_table, 8 + line_coordinates_x[l] * M + k) =
1084 constexpr std::array<unsigned int, 4> line_coordinates_z(
1087 for (
unsigned int l = 0;
l < 4; ++
l)
1088 lohvs(index_table, 8 + line_coordinates_z[l] * M + i) =
1093 lohvs(index_table, 8 + 12 * M + 0 * M * M + i * M + j) =
1095 lohvs(index_table, 8 + 12 * M + 1 * M * M + i * M + j) = p[0];
1096 lohvs(index_table, 8 + 12 * M + 2 * M * M + k * M + i) =
1098 lohvs(index_table, 8 + 12 * M + 3 * M * M + k * M + i) = p[1];
1099 lohvs(index_table, 8 + 12 * M + 4 * M * M + j * M + k) =
1101 lohvs(index_table, 8 + 12 * M + 5 * M * M + j * M + k) = p[2];
1106 for (
unsigned int unit_point = 0; unit_point < n_inner; ++unit_point)
1107 Assert(std::fabs(std::accumulate(lohvs[unit_point].begin(),
1108 lohvs[unit_point].end(),
1122 std::vector<::Table<2, double>>
1123 compute_support_point_weights_perimeter_to_interior(
1125 const unsigned int dim)
1128 std::vector<::Table<2, double>> output(dim);
1137 for (
unsigned int i = 0; i < GeometryInfo<1>::vertices_per_cell; ++i)
1160 return ::Table<2, double>();
1163 std::vector<unsigned int> h2l(quadrature.size());
1170 for (
unsigned int q = 0; q < output.size(0); ++q)
1171 for (
unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell;
1189 template <
int dim,
int spacedim>
1191 compute_mapped_location_of_point(
1192 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1196 data.mapping_support_points.size());
1200 for (
unsigned int i = 0; i < data.mapping_support_points.size(); ++i)
1201 p_real += data.mapping_support_points[i] * data.shape(0, i);
1213 do_transform_real_to_unit_cell_internal(
1214 const typename ::Triangulation<dim, dim>::cell_iterator &cell,
1217 typename ::MappingQGeneric<dim, dim>::InternalData &mdata)
1219 const unsigned int spacedim = dim;
1221 const unsigned int n_shapes = mdata.shape_values.size();
1226 std::vector<Point<spacedim>> &points = mdata.mapping_support_points;
1242 mdata.compute_shape_function_values(std::vector<
Point<dim>>(1, p_unit));
1245 compute_mapped_location_of_point<dim, spacedim>(mdata);
1249 if (f.norm_square() < 1
e-24 * cell->diameter() * cell->diameter())
1285 const double eps = 1.e-11;
1286 const unsigned int newton_iteration_limit = 20;
1288 unsigned int newton_iteration = 0;
1289 double last_f_weighted_norm;
1292 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1293 std::cout <<
"Newton iteration " << newton_iteration << std::endl;
1298 for (
unsigned int k = 0; k < mdata.n_shape_functions; ++k)
1303 for (
unsigned int i = 0; i < spacedim; ++i)
1304 for (
unsigned int j = 0; j < dim; ++j)
1305 df[i][j] += point[i] * grad_transform[j];
1316 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1317 std::cout <<
" delta=" << delta << std::endl;
1321 double step_length = 1;
1329 for (
unsigned int i = 0; i < dim; ++i)
1330 p_unit_trial[i] -= step_length * delta[i];
1334 mdata.compute_shape_function_values(
1339 internal::MappingQGenericImplementation::
1340 compute_mapped_location_of_point<dim, spacedim>(mdata);
1343 #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL 1344 std::cout <<
" step_length=" << step_length << std::endl
1345 <<
" ||f || =" << f.
norm() << std::endl
1346 <<
" ||f*|| =" << f_trial.norm() << std::endl
1348 << (df_inverse * f_trial).
norm() << std::endl;
1358 if (f_trial.norm() < f.norm())
1360 p_real = p_real_trial;
1361 p_unit = p_unit_trial;
1365 else if (step_length > 0.05)
1376 if (newton_iteration > newton_iteration_limit)
1380 last_f_weighted_norm = (df_inverse * f).
norm();
1382 while (last_f_weighted_norm > eps);
1394 do_transform_real_to_unit_cell_internal_codim1(
1395 const typename ::Triangulation<dim, dim + 1>::cell_iterator &cell,
1398 typename ::MappingQGeneric<dim, dim + 1>::InternalData &mdata)
1400 const unsigned int spacedim = dim + 1;
1402 const unsigned int n_shapes = mdata.shape_values.size();
1406 Assert(mdata.shape_second_derivatives.size() == n_shapes,
1409 std::vector<Point<spacedim>> &points = mdata.mapping_support_points;
1422 mdata.compute_shape_function_values(std::vector<
Point<dim>>(1, p_unit));
1424 for (
unsigned int k = 0; k < mdata.n_shape_functions; ++k)
1427 const Tensor<2, dim> & hessian_k = mdata.second_derivative(0, k);
1430 for (
unsigned int j = 0; j < dim; ++j)
1432 DF[j] += grad_phi_k[j] * point_k;
1433 for (
unsigned int l = 0;
l < dim; ++
l)
1434 D2F[j][l] += hessian_k[j][l] * point_k;
1439 p_minus_F -= compute_mapped_location_of_point<dim, spacedim>(mdata);
1442 for (
unsigned int j = 0; j < dim; ++j)
1443 f[j] = DF[j] * p_minus_F;
1445 for (
unsigned int j = 0; j < dim; ++j)
1447 f[j] = DF[j] * p_minus_F;
1448 for (
unsigned int l = 0;
l < dim; ++
l)
1449 df[j][l] = -DF[j] * DF[l] + D2F[j][l] * p_minus_F;
1453 const double eps = 1.e-12 * cell->diameter();
1454 const unsigned int loop_limit = 10;
1456 unsigned int loop = 0;
1465 for (
unsigned int j = 0; j < dim; ++j)
1468 for (
unsigned int l = 0;
l < dim; ++
l)
1472 mdata.compute_shape_function_values(
1475 for (
unsigned int k = 0; k < mdata.n_shape_functions; ++k)
1481 for (
unsigned int j = 0; j < dim; ++j)
1483 DF[j] += grad_phi_k[j] * point_k;
1484 for (
unsigned int l = 0;
l < dim; ++
l)
1485 D2F[j][l] += hessian_k[j][l] * point_k;
1492 p_minus_F -= compute_mapped_location_of_point<dim, spacedim>(mdata);
1494 for (
unsigned int j = 0; j < dim; ++j)
1496 f[j] = DF[j] * p_minus_F;
1497 for (
unsigned int l = 0;
l < dim; ++
l)
1498 df[j][l] = -DF[j] * DF[l] + D2F[j][l] * p_minus_F;
1519 template <
int dim,
int spacedim>
1521 maybe_update_q_points_Jacobians_and_grads_tensor(
1523 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1528 const UpdateFlags update_flags = data.update_each;
1530 const unsigned int n_shape_values = data.n_shape_functions;
1531 const unsigned int n_q_points = data.shape_info.n_q_points;
1532 const unsigned int vec_length =
1534 const unsigned int n_comp = 1 + (spacedim - 1) / vec_length;
1535 const unsigned int n_hessians = (dim * (dim + 1)) / 2;
1538 const bool evaluate_gradients =
1541 const bool evaluate_hessians =
1546 Assert(!evaluate_values || n_q_points == quadrature_points.size(),
1548 Assert(!evaluate_gradients || data.n_shape_functions > 0,
1550 Assert(!evaluate_gradients || n_q_points == data.contravariant.size(),
1552 Assert(!evaluate_hessians || n_q_points == jacobian_grads.size(),
1556 if (evaluate_values || evaluate_gradients || evaluate_hessians)
1558 data.values_dofs.resize(n_comp * n_shape_values);
1559 data.values_quad.resize(n_comp * n_q_points);
1560 data.gradients_quad.resize(n_comp * n_q_points * dim);
1562 if (evaluate_hessians)
1563 data.hessians_quad.resize(n_comp * n_q_points * n_hessians);
1565 const std::vector<unsigned int> &renumber_to_lexicographic =
1566 data.shape_info.lexicographic_numbering;
1567 for (
unsigned int i = 0; i < n_shape_values; ++i)
1568 for (
unsigned int d = 0;
d < spacedim; ++
d)
1570 const unsigned int in_comp =
d % vec_length;
1571 const unsigned int out_comp =
d / vec_length;
1572 data.values_dofs[out_comp * n_shape_values + i][in_comp] =
1574 .mapping_support_points[renumber_to_lexicographic[i]][
d];
1579 evaluate(data.shape_info,
1580 data.values_dofs.begin(),
1581 data.values_quad.begin(),
1582 data.gradients_quad.begin(),
1583 data.hessians_quad.begin(),
1584 data.scratch.begin(),
1591 if (evaluate_values)
1593 for (
unsigned int out_comp = 0; out_comp < n_comp; ++out_comp)
1594 for (
unsigned int i = 0; i < n_q_points; ++i)
1595 for (
unsigned int in_comp = 0;
1596 in_comp < vec_length &&
1597 in_comp < spacedim - out_comp * vec_length;
1599 quadrature_points[i][out_comp * vec_length + in_comp] =
1600 data.values_quad[out_comp * n_q_points + i][in_comp];
1603 if (evaluate_gradients)
1605 std::fill(data.contravariant.begin(),
1606 data.contravariant.end(),
1609 for (
unsigned int out_comp = 0; out_comp < n_comp; ++out_comp)
1610 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1611 for (
unsigned int j = 0; j < dim; ++j)
1612 for (
unsigned int in_comp = 0;
1613 in_comp < vec_length &&
1614 in_comp < spacedim - out_comp * vec_length;
1617 const unsigned int total_number =
point * dim + j;
1618 const unsigned int new_comp = total_number / n_q_points;
1619 const unsigned int new_point = total_number % n_q_points;
1620 data.contravariant[new_point][out_comp * vec_length +
1621 in_comp][new_comp] =
1622 data.gradients_quad[(out_comp * n_q_points +
point) *
1629 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1630 data.covariant[point] =
1631 (data.contravariant[point]).covariant_form();
1635 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1636 data.volume_elements[point] =
1639 if (evaluate_hessians)
1641 constexpr
int desymmetrize_3d[6][2] = {
1642 {0, 0}, {1, 1}, {2, 2}, {0, 1}, {0, 2}, {1, 2}};
1643 constexpr
int desymmetrize_2d[3][2] = {{0, 0}, {1, 1}, {0, 1}};
1646 for (
unsigned int out_comp = 0; out_comp < n_comp; ++out_comp)
1647 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1648 for (
unsigned int j = 0; j < n_hessians; ++j)
1649 for (
unsigned int in_comp = 0;
1650 in_comp < vec_length &&
1651 in_comp < spacedim - out_comp * vec_length;
1654 const unsigned int total_number =
point * n_hessians + j;
1655 const unsigned int new_point = total_number % n_q_points;
1656 const unsigned int new_hessian_comp =
1657 total_number / n_q_points;
1658 const unsigned int new_hessian_comp_i =
1659 dim == 2 ? desymmetrize_2d[new_hessian_comp][0] :
1660 desymmetrize_3d[new_hessian_comp][0];
1661 const unsigned int new_hessian_comp_j =
1662 dim == 2 ? desymmetrize_2d[new_hessian_comp][1] :
1663 desymmetrize_3d[new_hessian_comp][1];
1664 const double value =
1665 data.hessians_quad[(out_comp * n_q_points +
point) *
1668 jacobian_grads[new_point][out_comp * vec_length + in_comp]
1669 [new_hessian_comp_i][new_hessian_comp_j] =
1671 jacobian_grads[new_point][out_comp * vec_length + in_comp]
1672 [new_hessian_comp_j][new_hessian_comp_i] =
1685 template <
int dim,
int spacedim>
1687 maybe_compute_q_points(
1689 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1693 const UpdateFlags update_flags = data.update_each;
1696 for (
unsigned int point = 0;
point < quadrature_points.size();
1699 const double * shape = &data.shape(point + data_set, 0);
1701 (shape[0] * data.mapping_support_points[0]);
1702 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
1703 for (
unsigned int i = 0; i < spacedim; ++i)
1704 result[i] += shape[k] * data.mapping_support_points[k][i];
1705 quadrature_points[point] = result;
1719 template <
int dim,
int spacedim>
1721 maybe_update_Jacobians(
1723 const typename ::QProjector<dim>::DataSetDescriptor data_set,
1724 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1727 const UpdateFlags update_flags = data.update_each;
1735 const unsigned int n_q_points = data.contravariant.size();
1737 std::fill(data.contravariant.begin(),
1738 data.contravariant.end(),
1744 data.mapping_support_points.data();
1746 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1749 &data.derivative(point + data_set, 0);
1751 double result[spacedim][dim];
1755 for (
unsigned int i = 0; i < spacedim; ++i)
1756 for (
unsigned int j = 0; j < dim; ++j)
1757 result[i][j] = data_derv[0][j] * supp_pts[0][i];
1758 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
1759 for (
unsigned int i = 0; i < spacedim; ++i)
1760 for (
unsigned int j = 0; j < dim; ++j)
1761 result[i][j] += data_derv[k][j] * supp_pts[k][i];
1768 for (
unsigned int i = 0; i < spacedim; ++i)
1769 for (
unsigned int j = 0; j < dim; ++j)
1770 data.contravariant[point][i][j] = result[i][j];
1777 const unsigned int n_q_points = data.contravariant.size();
1778 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1780 data.covariant[
point] =
1781 (data.contravariant[
point]).covariant_form();
1788 const unsigned int n_q_points = data.contravariant.size();
1789 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1790 data.volume_elements[point] =
1801 template <
int dim,
int spacedim>
1803 maybe_update_jacobian_grads(
1806 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1810 const UpdateFlags update_flags = data.update_each;
1813 const unsigned int n_q_points = jacobian_grads.size();
1816 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1819 &data.second_derivative(point + data_set, 0);
1820 double result[spacedim][dim][dim];
1821 for (
unsigned int i = 0; i < spacedim; ++i)
1822 for (
unsigned int j = 0; j < dim; ++j)
1823 for (
unsigned int l = 0;
l < dim; ++
l)
1825 (second[0][j][l] * data.mapping_support_points[0][i]);
1826 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
1827 for (
unsigned int i = 0; i < spacedim; ++i)
1828 for (
unsigned int j = 0; j < dim; ++j)
1829 for (
unsigned int l = 0;
l < dim; ++
l)
1832 data.mapping_support_points[k][i]);
1834 for (
unsigned int i = 0; i < spacedim; ++i)
1835 for (
unsigned int j = 0; j < dim; ++j)
1836 for (
unsigned int l = 0;
l < dim; ++
l)
1837 jacobian_grads[point][i][j][l] = result[i][j][l];
1848 template <
int dim,
int spacedim>
1850 maybe_update_jacobian_pushed_forward_grads(
1853 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1857 const UpdateFlags update_flags = data.update_each;
1860 const unsigned int n_q_points =
1861 jacobian_pushed_forward_grads.size();
1865 double tmp[spacedim][spacedim][spacedim];
1866 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1869 &data.second_derivative(point + data_set, 0);
1870 double result[spacedim][dim][dim];
1871 for (
unsigned int i = 0; i < spacedim; ++i)
1872 for (
unsigned int j = 0; j < dim; ++j)
1873 for (
unsigned int l = 0;
l < dim; ++
l)
1874 result[i][j][l] = (second[0][j][l] *
1875 data.mapping_support_points[0][i]);
1876 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
1877 for (
unsigned int i = 0; i < spacedim; ++i)
1878 for (
unsigned int j = 0; j < dim; ++j)
1879 for (
unsigned int l = 0;
l < dim; ++
l)
1882 data.mapping_support_points[k][i]);
1885 for (
unsigned int i = 0; i < spacedim; ++i)
1886 for (
unsigned int j = 0; j < spacedim; ++j)
1887 for (
unsigned int l = 0;
l < dim; ++
l)
1890 result[i][0][
l] * data.covariant[
point][j][0];
1891 for (
unsigned int jr = 1; jr < dim; ++jr)
1893 tmp[i][j][
l] += result[i][jr][
l] *
1894 data.covariant[
point][j][jr];
1899 for (
unsigned int i = 0; i < spacedim; ++i)
1900 for (
unsigned int j = 0; j < spacedim; ++j)
1901 for (
unsigned int l = 0;
l < spacedim; ++
l)
1903 jacobian_pushed_forward_grads[
point][i][j][
l] =
1904 tmp[i][j][0] * data.covariant[
point][
l][0];
1905 for (
unsigned int lr = 1; lr < dim; ++lr)
1907 jacobian_pushed_forward_grads[
point][i][j][
l] +=
1908 tmp[i][j][lr] * data.covariant[
point][
l][lr];
1922 template <
int dim,
int spacedim>
1924 maybe_update_jacobian_2nd_derivatives(
1927 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1931 const UpdateFlags update_flags = data.update_each;
1934 const unsigned int n_q_points = jacobian_2nd_derivatives.size();
1938 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1941 &data.third_derivative(point + data_set, 0);
1942 double result[spacedim][dim][dim][dim];
1943 for (
unsigned int i = 0; i < spacedim; ++i)
1944 for (
unsigned int j = 0; j < dim; ++j)
1945 for (
unsigned int l = 0;
l < dim; ++
l)
1946 for (
unsigned int m = 0; m < dim; ++m)
1947 result[i][j][l][m] =
1948 (third[0][j][l][m] *
1949 data.mapping_support_points[0][i]);
1950 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
1951 for (
unsigned int i = 0; i < spacedim; ++i)
1952 for (
unsigned int j = 0; j < dim; ++j)
1953 for (
unsigned int l = 0;
l < dim; ++
l)
1954 for (
unsigned int m = 0; m < dim; ++m)
1955 result[i][j][l][m] +=
1956 (third[k][j][l][m] *
1957 data.mapping_support_points[k][i]);
1959 for (
unsigned int i = 0; i < spacedim; ++i)
1960 for (
unsigned int j = 0; j < dim; ++j)
1961 for (
unsigned int l = 0;
l < dim; ++
l)
1962 for (
unsigned int m = 0; m < dim; ++m)
1963 jacobian_2nd_derivatives[point][i][j][l][m] =
1977 template <
int dim,
int spacedim>
1979 maybe_update_jacobian_pushed_forward_2nd_derivatives(
1982 const typename ::MappingQGeneric<dim, spacedim>::InternalData
1985 &jacobian_pushed_forward_2nd_derivatives)
1987 const UpdateFlags update_flags = data.update_each;
1990 const unsigned int n_q_points =
1991 jacobian_pushed_forward_2nd_derivatives.size();
1995 double tmp[spacedim][spacedim][spacedim][spacedim];
1996 for (
unsigned int point = 0;
point < n_q_points; ++
point)
1999 &data.third_derivative(point + data_set, 0);
2000 double result[spacedim][dim][dim][dim];
2001 for (
unsigned int i = 0; i < spacedim; ++i)
2002 for (
unsigned int j = 0; j < dim; ++j)
2003 for (
unsigned int l = 0;
l < dim; ++
l)
2004 for (
unsigned int m = 0; m < dim; ++m)
2005 result[i][j][l][m] =
2006 (third[0][j][l][m] *
2007 data.mapping_support_points[0][i]);
2008 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
2009 for (
unsigned int i = 0; i < spacedim; ++i)
2010 for (
unsigned int j = 0; j < dim; ++j)
2011 for (
unsigned int l = 0;
l < dim; ++
l)
2012 for (
unsigned int m = 0; m < dim; ++m)
2013 result[i][j][l][m] +=
2014 (third[k][j][l][m] *
2015 data.mapping_support_points[k][i]);
2018 for (
unsigned int i = 0; i < spacedim; ++i)
2019 for (
unsigned int j = 0; j < spacedim; ++j)
2020 for (
unsigned int l = 0;
l < dim; ++
l)
2021 for (
unsigned int m = 0; m < dim; ++m)
2023 jacobian_pushed_forward_2nd_derivatives
2025 result[i][0][
l][m] *
2026 data.covariant[
point][j][0];
2027 for (
unsigned int jr = 1; jr < dim; ++jr)
2028 jacobian_pushed_forward_2nd_derivatives[point]
2031 result[i][jr][l][m] *
2032 data.covariant[point][j][jr];
2036 for (
unsigned int i = 0; i < spacedim; ++i)
2037 for (
unsigned int j = 0; j < spacedim; ++j)
2038 for (
unsigned int l = 0;
l < spacedim; ++
l)
2039 for (
unsigned int m = 0; m < dim; ++m)
2042 jacobian_pushed_forward_2nd_derivatives[
point]
2045 data.covariant[
point][
l][0];
2046 for (
unsigned int lr = 1; lr < dim; ++lr)
2048 jacobian_pushed_forward_2nd_derivatives
2049 [point][i][j][lr][m] *
2050 data.covariant[point][l][lr];
2054 for (
unsigned int i = 0; i < spacedim; ++i)
2055 for (
unsigned int j = 0; j < spacedim; ++j)
2056 for (
unsigned int l = 0;
l < spacedim; ++
l)
2057 for (
unsigned int m = 0; m < spacedim; ++m)
2059 jacobian_pushed_forward_2nd_derivatives
2061 tmp[i][j][
l][0] * data.covariant[
point][m][0];
2062 for (
unsigned int mr = 1; mr < dim; ++mr)
2063 jacobian_pushed_forward_2nd_derivatives[point]
2067 data.covariant[point][m][mr];
2080 template <
int dim,
int spacedim>
2082 maybe_update_jacobian_3rd_derivatives(
2085 const typename ::MappingQGeneric<dim, spacedim>::InternalData
2089 const UpdateFlags update_flags = data.update_each;
2092 const unsigned int n_q_points = jacobian_3rd_derivatives.size();
2096 for (
unsigned int point = 0;
point < n_q_points; ++
point)
2099 &data.fourth_derivative(point + data_set, 0);
2100 double result[spacedim][dim][dim][dim][dim];
2101 for (
unsigned int i = 0; i < spacedim; ++i)
2102 for (
unsigned int j = 0; j < dim; ++j)
2103 for (
unsigned int l = 0;
l < dim; ++
l)
2104 for (
unsigned int m = 0; m < dim; ++m)
2105 for (
unsigned int n = 0; n < dim; ++n)
2106 result[i][j][l][m][n] =
2107 (fourth[0][j][l][m][n] *
2108 data.mapping_support_points[0][i]);
2109 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
2110 for (
unsigned int i = 0; i < spacedim; ++i)
2111 for (
unsigned int j = 0; j < dim; ++j)
2112 for (
unsigned int l = 0;
l < dim; ++
l)
2113 for (
unsigned int m = 0; m < dim; ++m)
2114 for (
unsigned int n = 0; n < dim; ++n)
2115 result[i][j][l][m][n] +=
2116 (fourth[k][j][l][m][n] *
2117 data.mapping_support_points[k][i]);
2119 for (
unsigned int i = 0; i < spacedim; ++i)
2120 for (
unsigned int j = 0; j < dim; ++j)
2121 for (
unsigned int l = 0;
l < dim; ++
l)
2122 for (
unsigned int m = 0; m < dim; ++m)
2123 for (
unsigned int n = 0; n < dim; ++n)
2124 jacobian_3rd_derivatives[point][i][j][l][m][n] =
2125 result[i][j][l][m][n];
2138 template <
int dim,
int spacedim>
2140 maybe_update_jacobian_pushed_forward_3rd_derivatives(
2143 const typename ::MappingQGeneric<dim, spacedim>::InternalData
2146 &jacobian_pushed_forward_3rd_derivatives)
2148 const UpdateFlags update_flags = data.update_each;
2151 const unsigned int n_q_points =
2152 jacobian_pushed_forward_3rd_derivatives.size();
2156 double tmp[spacedim][spacedim][spacedim][spacedim][spacedim];
2157 for (
unsigned int point = 0;
point < n_q_points; ++
point)
2160 &data.fourth_derivative(point + data_set, 0);
2161 double result[spacedim][dim][dim][dim][dim];
2162 for (
unsigned int i = 0; i < spacedim; ++i)
2163 for (
unsigned int j = 0; j < dim; ++j)
2164 for (
unsigned int l = 0;
l < dim; ++
l)
2165 for (
unsigned int m = 0; m < dim; ++m)
2166 for (
unsigned int n = 0; n < dim; ++n)
2167 result[i][j][l][m][n] =
2168 (fourth[0][j][l][m][n] *
2169 data.mapping_support_points[0][i]);
2170 for (
unsigned int k = 1; k < data.n_shape_functions; ++k)
2171 for (
unsigned int i = 0; i < spacedim; ++i)
2172 for (
unsigned int j = 0; j < dim; ++j)
2173 for (
unsigned int l = 0;
l < dim; ++
l)
2174 for (
unsigned int m = 0; m < dim; ++m)
2175 for (
unsigned int n = 0; n < dim; ++n)
2176 result[i][j][l][m][n] +=
2177 (fourth[k][j][l][m][n] *
2178 data.mapping_support_points[k][i]);
2181 for (
unsigned int i = 0; i < spacedim; ++i)
2182 for (
unsigned int j = 0; j < spacedim; ++j)
2183 for (
unsigned int l = 0;
l < dim; ++
l)
2184 for (
unsigned int m = 0; m < dim; ++m)
2185 for (
unsigned int n = 0; n < dim; ++n)
2187 tmp[i][j][
l][m][n] =
2188 result[i][0][
l][m][n] *
2189 data.covariant[
point][j][0];
2190 for (
unsigned int jr = 1; jr < dim; ++jr)
2191 tmp[i][j][l][m][n] +=
2192 result[i][jr][l][m][n] *
2193 data.covariant[point][j][jr];
2197 for (
unsigned int i = 0; i < spacedim; ++i)
2198 for (
unsigned int j = 0; j < spacedim; ++j)
2199 for (
unsigned int l = 0;
l < spacedim; ++
l)
2200 for (
unsigned int m = 0; m < dim; ++m)
2201 for (
unsigned int n = 0; n < dim; ++n)
2203 jacobian_pushed_forward_3rd_derivatives
2205 tmp[i][j][0][m][n] *
2206 data.covariant[
point][
l][0];
2207 for (
unsigned int lr = 1; lr < dim; ++lr)
2208 jacobian_pushed_forward_3rd_derivatives
2209 [point][i][j][l][m][n] +=
2210 tmp[i][j][lr][m][n] *
2211 data.covariant[point][l][lr];
2215 for (
unsigned int i = 0; i < spacedim; ++i)
2216 for (
unsigned int j = 0; j < spacedim; ++j)
2217 for (
unsigned int l = 0;
l < spacedim; ++
l)
2218 for (
unsigned int m = 0; m < spacedim; ++m)
2219 for (
unsigned int n = 0; n < dim; ++n)
2221 tmp[i][j][
l][m][n] =
2222 jacobian_pushed_forward_3rd_derivatives
2224 data.covariant[
point][m][0];
2225 for (
unsigned int mr = 1; mr < dim; ++mr)
2226 tmp[i][j][l][m][n] +=
2227 jacobian_pushed_forward_3rd_derivatives
2228 [point][i][j][l][mr][n] *
2229 data.covariant[point][m][mr];
2233 for (
unsigned int i = 0; i < spacedim; ++i)
2234 for (
unsigned int j = 0; j < spacedim; ++j)
2235 for (
unsigned int l = 0;
l < spacedim; ++
l)
2236 for (
unsigned int m = 0; m < spacedim; ++m)
2237 for (
unsigned int n = 0; n < spacedim; ++n)
2239 jacobian_pushed_forward_3rd_derivatives
2241 tmp[i][j][
l][m][0] *
2242 data.covariant[
point][n][0];
2243 for (
unsigned int nr = 1; nr < dim; ++nr)
2244 jacobian_pushed_forward_3rd_derivatives
2245 [point][i][j][l][m][n] +=
2246 tmp[i][j][l][m][nr] *
2247 data.covariant[point][n][nr];
2259 template <
int dim,
int spacedim>
2265 internal::MappingQGenericImplementation::
2266 compute_support_point_weights_perimeter_to_interior(
2270 internal::MappingQGenericImplementation::
2274 ExcMessage(
"It only makes sense to create polynomial mappings " 2275 "with a polynomial degree greater or equal to one."));
2280 template <
int dim,
int spacedim>
2283 : polynomial_degree(mapping.polynomial_degree)
2284 , line_support_points(mapping.line_support_points)
2285 , fe_q(dim == 3 ? new
FE_Q<dim>(*mapping.fe_q) : nullptr)
2286 , support_point_weights_perimeter_to_interior(
2287 mapping.support_point_weights_perimeter_to_interior)
2288 , support_point_weights_cell(mapping.support_point_weights_cell)
2293 template <
int dim,
int spacedim>
2294 std::unique_ptr<Mapping<dim, spacedim>>
2297 return std_cxx14::make_unique<MappingQGeneric<dim, spacedim>>(*this);
2302 template <
int dim,
int spacedim>
2306 return polynomial_degree;
2311 template <
int dim,
int spacedim>
2320 line_support_points.get_points()));
2321 Assert(tensor_pols.
n() == Utilities::fixed_power<dim>(polynomial_degree + 1),
2326 const std::vector<unsigned int> renumber(
2328 internal::MappingQGenericImplementation::get_dpo_vector<dim>(
2331 polynomial_degree)));
2333 const std::vector<Point<spacedim>> support_points =
2334 this->compute_mapping_support_points(cell);
2337 for (
unsigned int i = 0; i < tensor_pols.
n(); ++i)
2339 support_points[renumber[i]] * tensor_pols.
compute_value(i, p);
2341 return mapped_point;
2364 template <
int dim,
int spacedim>
2381 const Point<1> & initial_p_unit)
const 2384 const int spacedim = 1;
2392 get_data(update_flags, point_quadrature));
2394 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
2398 return internal::MappingQGenericImplementation::
2399 do_transform_real_to_unit_cell_internal<1>(cell, p, initial_p_unit, *mdata);
2407 const Point<2> & initial_p_unit)
const 2410 const int spacedim = 2;
2418 get_data(update_flags, point_quadrature));
2420 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
2424 return internal::MappingQGenericImplementation::
2425 do_transform_real_to_unit_cell_internal<2>(cell, p, initial_p_unit, *mdata);
2433 const Point<3> & initial_p_unit)
const 2436 const int spacedim = 3;
2444 get_data(update_flags, point_quadrature));
2446 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
2450 return internal::MappingQGenericImplementation::
2451 do_transform_real_to_unit_cell_internal<3>(cell, p, initial_p_unit, *mdata);
2461 const Point<1> & initial_p_unit)
const 2464 const int spacedim = 2;
2472 get_data(update_flags, point_quadrature));
2474 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
2478 return internal::MappingQGenericImplementation::
2479 do_transform_real_to_unit_cell_internal_codim1<1>(cell,
2492 const Point<2> & initial_p_unit)
const 2495 const int spacedim = 3;
2503 get_data(update_flags, point_quadrature));
2505 mdata->mapping_support_points = this->compute_mapping_support_points(cell);
2509 return internal::MappingQGenericImplementation::
2510 do_transform_real_to_unit_cell_internal_codim1<2>(cell,
2529 template <
int dim,
int spacedim>
2537 if ((polynomial_degree == 1) &&
2538 ((dim == 1) || ((dim == 2) && (dim == spacedim))))
2562 vertices = this->get_vertices(cell);
2571 return internal::MappingQ1::transform_real_to_unit_cell(
2580 internal::MappingQ1::transform_real_to_unit_cell(vertices,
2586 const double eps = 1e-15;
2587 if (-eps <= point(1) && point(1) <= 1 + eps &&
2588 -eps <= point(0) && point(0) <= 1 + eps)
2619 if (this->preserves_vertex_locations())
2620 initial_p_unit = cell->real_to_unit_cell_affine_approximation(p);
2630 std::vector<Point<spacedim>> a =
2631 this->compute_mapping_support_points(cell);
2633 std::vector<CellData<dim>> cells(1);
2634 for (
unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
2635 cells[0].vertices[i] = i;
2639 tria.
begin_active()->real_to_unit_cell_affine_approximation(p);
2642 if (dim == 1 && polynomial_degree == 1)
2644 return initial_p_unit;
2657 return this->transform_real_to_unit_cell_internal(cell,
2665 template <
int dim,
int spacedim>
2677 for (
unsigned int i = 0; i < 5; ++i)
2722 template <
int dim,
int spacedim>
2723 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
2727 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
2728 std_cxx14::make_unique<InternalData>(polynomial_degree);
2730 data.
initialize(this->requires_update_flags(update_flags), q, q.
size());
2737 template <
int dim,
int spacedim>
2738 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
2743 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
2744 std_cxx14::make_unique<InternalData>(polynomial_degree);
2755 template <
int dim,
int spacedim>
2756 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
2761 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
2762 std_cxx14::make_unique<InternalData>(polynomial_degree);
2773 template <
int dim,
int spacedim>
2784 Assert(dynamic_cast<const InternalData *>(&internal_data) !=
nullptr,
2788 const unsigned int n_q_points = quadrature.
size();
2812 internal::MappingQGenericImplementation::
2813 maybe_update_q_points_Jacobians_and_grads_tensor<dim, spacedim>(
2814 computed_cell_similarity,
2821 internal::MappingQGenericImplementation::maybe_compute_q_points<dim,
2827 internal::MappingQGenericImplementation::maybe_update_Jacobians<dim,
2829 computed_cell_similarity,
2833 internal::MappingQGenericImplementation::maybe_update_jacobian_grads<
2835 spacedim>(computed_cell_similarity,
2841 internal::MappingQGenericImplementation::
2842 maybe_update_jacobian_pushed_forward_grads<dim, spacedim>(
2843 computed_cell_similarity,
2848 internal::MappingQGenericImplementation::
2849 maybe_update_jacobian_2nd_derivatives<dim, spacedim>(
2850 computed_cell_similarity,
2855 internal::MappingQGenericImplementation::
2856 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
2857 computed_cell_similarity,
2862 internal::MappingQGenericImplementation::
2863 maybe_update_jacobian_3rd_derivatives<dim, spacedim>(
2864 computed_cell_similarity,
2869 internal::MappingQGenericImplementation::
2870 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
2871 computed_cell_similarity,
2876 const UpdateFlags update_flags = data.update_each;
2877 const std::vector<double> &weights = quadrature.
get_weights();
2893 for (
unsigned int point = 0; point < n_q_points; ++point)
2895 if (dim == spacedim)
2897 const double det = data.contravariant[point].determinant();
2905 1e-12 * Utilities::fixed_power<dim>(
2906 cell->diameter() / std::sqrt(
double(dim))),
2908 cell->center(), det, point)));
2910 output_data.
JxW_values[point] = weights[point] * det;
2918 for (
unsigned int i = 0; i < spacedim; ++i)
2919 for (
unsigned int j = 0; j < dim; ++j)
2920 DX_t[j][i] = data.contravariant[point][i][j];
2923 for (
unsigned int i = 0; i < dim; ++i)
2924 for (
unsigned int j = 0; j < dim; ++j)
2925 G[i][j] = DX_t[i] * DX_t[j];
2930 if (computed_cell_similarity ==
2941 Assert(spacedim == dim + 1,
2943 "There is no (unique) cell normal for " +
2945 "-dimensional cells in " +
2947 "-dimensional space. This only works if the " 2948 "space dimension is one greater than the " 2949 "dimensionality of the mesh cells."));
2961 if (cell->direction_flag() ==
false)
2976 for (
unsigned int point = 0; point < n_q_points; ++point)
2977 output_data.
jacobians[point] = data.contravariant[point];
2985 for (
unsigned int point = 0; point < n_q_points; ++point)
2987 data.covariant[point].transpose();
2990 return computed_cell_similarity;
2997 namespace MappingQGenericImplementation
3010 template <
int dim,
int spacedim>
3012 maybe_compute_face_data(
3013 const ::MappingQGeneric<dim, spacedim> &mapping,
3014 const typename ::Triangulation<dim, spacedim>::cell_iterator
3016 const unsigned int face_no,
3017 const unsigned int subface_no,
3018 const unsigned int n_q_points,
3019 const std::vector<double> &weights,
3020 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3025 const UpdateFlags update_flags = data.update_each;
3046 for (
unsigned int d = 0; d != dim - 1; ++d)
3049 data.unit_tangentials.size(),
3052 data.aux[d].size() <=
3054 .unit_tangentials[face_no +
3062 .unit_tangentials[face_no +
3066 make_array_view(data.aux[d]));
3073 if (dim == spacedim)
3075 for (
unsigned int i = 0; i < n_q_points; ++i)
3085 (face_no == 0 ? -1 : +1);
3089 cross_product_2d(data.aux[0][i]);
3093 cross_product_3d(data.aux[0][i], data.aux[1][i]);
3109 for (
unsigned int point = 0;
point < n_q_points; ++
point)
3115 data.contravariant[
point].transpose()[0];
3117 (face_no == 0 ? -1. : +1.) *
3127 cross_product_3d(DX_t[0], DX_t[1]);
3128 cell_normal /= cell_normal.
norm();
3133 cross_product_3d(data.aux[0][point], cell_normal);
3148 const double area_ratio =
3150 cell->subface_case(face_no), subface_no);
3163 for (
unsigned int point = 0;
point < n_q_points; ++
point)
3164 output_data.
jacobians[point] = data.contravariant[point];
3167 for (
unsigned int point = 0;
point < n_q_points; ++
point)
3169 data.covariant[point].transpose();
3180 template <
int dim,
int spacedim>
3182 do_fill_fe_face_values(
3183 const ::MappingQGeneric<dim, spacedim> &mapping,
3184 const typename ::Triangulation<dim, spacedim>::cell_iterator
3186 const unsigned int face_no,
3187 const unsigned int subface_no,
3190 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3195 if (dim > 1 && data.tensor_product_quadrature)
3197 maybe_update_q_points_Jacobians_and_grads_tensor<dim, spacedim>(
3205 maybe_compute_q_points<dim, spacedim>(
3210 maybe_update_jacobian_grads<dim, spacedim>(
3213 maybe_update_jacobian_pushed_forward_grads<dim, spacedim>(
3218 maybe_update_jacobian_2nd_derivatives<dim, spacedim>(
3223 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim, spacedim>(
3228 maybe_update_jacobian_3rd_derivatives<dim, spacedim>(
3233 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim, spacedim>(
3239 maybe_compute_face_data(mapping,
3254 template <
int dim,
int spacedim>
3258 const unsigned int face_no,
3265 Assert((dynamic_cast<const InternalData *>(&internal_data) !=
nullptr),
3274 (&cell->get_triangulation() !=
3282 internal::MappingQGenericImplementation::do_fill_fe_face_values(
3288 cell->face_orientation(face_no),
3289 cell->face_flip(face_no),
3290 cell->face_rotation(face_no),
3299 template <
int dim,
int spacedim>
3303 const unsigned int face_no,
3304 const unsigned int subface_no,
3311 Assert((dynamic_cast<const InternalData *>(&internal_data) !=
nullptr),
3320 (&cell->get_triangulation() !=
3328 internal::MappingQGenericImplementation::do_fill_fe_face_values(
3335 cell->face_orientation(face_no),
3336 cell->face_flip(face_no),
3337 cell->face_rotation(face_no),
3339 cell->subface_case(face_no)),
3349 namespace MappingQGenericImplementation
3353 template <
int dim,
int spacedim,
int rank>
3362 Assert((
dynamic_cast<const typename ::
3363 MappingQGeneric<dim, spacedim>::InternalData *
>(
3364 &mapping_data) !=
nullptr),
3366 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3368 static_cast<const typename ::MappingQGeneric<dim, spacedim>::
3369 InternalData &
>(mapping_data);
3371 switch (mapping_type)
3378 "update_contravariant_transformation"));
3380 for (
unsigned int i = 0; i < output.size(); ++i)
3382 apply_transformation(data.contravariant[i], input[i]);
3392 "update_contravariant_transformation"));
3396 "update_volume_elements"));
3401 for (
unsigned int i = 0; i < output.size(); ++i)
3404 apply_transformation(data.contravariant[i], input[i]);
3405 output[i] /= data.volume_elements[i];
3417 "update_covariant_transformation"));
3419 for (
unsigned int i = 0; i < output.size(); ++i)
3420 output[i] = apply_transformation(data.covariant[i], input[i]);
3431 template <
int dim,
int spacedim,
int rank>
3433 transform_gradients(
3440 Assert((
dynamic_cast<const typename ::
3441 MappingQGeneric<dim, spacedim>::InternalData *
>(
3442 &mapping_data) !=
nullptr),
3444 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3446 static_cast<const typename ::MappingQGeneric<dim, spacedim>::
3447 InternalData &
>(mapping_data);
3449 switch (mapping_type)
3456 "update_covariant_transformation"));
3460 "update_contravariant_transformation"));
3463 for (
unsigned int i = 0; i < output.size(); ++i)
3466 apply_transformation(data.contravariant[i],
3469 apply_transformation(data.covariant[i], A.
transpose());
3480 "update_covariant_transformation"));
3483 for (
unsigned int i = 0; i < output.size(); ++i)
3486 apply_transformation(data.covariant[i],
3489 apply_transformation(data.covariant[i], A.
transpose());
3500 "update_covariant_transformation"));
3504 "update_contravariant_transformation"));
3508 "update_volume_elements"));
3511 for (
unsigned int i = 0; i < output.size(); ++i)
3514 apply_transformation(data.covariant[i], input[i]);
3516 apply_transformation(data.contravariant[i],
3520 output[i] /= data.volume_elements[i];
3533 template <
int dim,
int spacedim>
3542 Assert((
dynamic_cast<const typename ::
3543 MappingQGeneric<dim, spacedim>::InternalData *
>(
3544 &mapping_data) !=
nullptr),
3546 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3548 static_cast<const typename ::MappingQGeneric<dim, spacedim>::
3549 InternalData &
>(mapping_data);
3551 switch (mapping_type)
3558 "update_covariant_transformation"));
3562 "update_contravariant_transformation"));
3564 for (
unsigned int q = 0; q < output.size(); ++q)
3565 for (
unsigned int i = 0; i < spacedim; ++i)
3567 double tmp1[dim][dim];
3568 for (
unsigned int J = 0; J < dim; ++J)
3569 for (
unsigned int K = 0; K < dim; ++K)
3572 data.contravariant[q][i][0] * input[q][0][J][K];
3573 for (
unsigned int I = 1; I < dim; ++I)
3575 data.contravariant[q][i][I] * input[q][I][J][K];
3577 for (
unsigned int j = 0; j < spacedim; ++j)
3580 for (
unsigned int K = 0; K < dim; ++K)
3582 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3583 for (
unsigned int J = 1; J < dim; ++J)
3584 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3586 for (
unsigned int k = 0; k < spacedim; ++k)
3588 output[q][i][j][k] =
3589 data.covariant[q][k][0] * tmp2[0];
3590 for (
unsigned int K = 1; K < dim; ++K)
3591 output[q][i][j][k] +=
3592 data.covariant[q][k][K] * tmp2[K];
3604 "update_covariant_transformation"));
3606 for (
unsigned int q = 0; q < output.size(); ++q)
3607 for (
unsigned int i = 0; i < spacedim; ++i)
3609 double tmp1[dim][dim];
3610 for (
unsigned int J = 0; J < dim; ++J)
3611 for (
unsigned int K = 0; K < dim; ++K)
3614 data.covariant[q][i][0] * input[q][0][J][K];
3615 for (
unsigned int I = 1; I < dim; ++I)
3617 data.covariant[q][i][I] * input[q][I][J][K];
3619 for (
unsigned int j = 0; j < spacedim; ++j)
3622 for (
unsigned int K = 0; K < dim; ++K)
3624 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3625 for (
unsigned int J = 1; J < dim; ++J)
3626 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3628 for (
unsigned int k = 0; k < spacedim; ++k)
3630 output[q][i][j][k] =
3631 data.covariant[q][k][0] * tmp2[0];
3632 for (
unsigned int K = 1; K < dim; ++K)
3633 output[q][i][j][k] +=
3634 data.covariant[q][k][K] * tmp2[K];
3647 "update_covariant_transformation"));
3651 "update_contravariant_transformation"));
3655 "update_volume_elements"));
3657 for (
unsigned int q = 0; q < output.size(); ++q)
3658 for (
unsigned int i = 0; i < spacedim; ++i)
3661 for (
unsigned int I = 0; I < dim; ++I)
3663 data.contravariant[q][i][I] / data.volume_elements[q];
3664 double tmp1[dim][dim];
3665 for (
unsigned int J = 0; J < dim; ++J)
3666 for (
unsigned int K = 0; K < dim; ++K)
3668 tmp1[J][K] = factor[0] * input[q][0][J][K];
3669 for (
unsigned int I = 1; I < dim; ++I)
3670 tmp1[J][K] += factor[I] * input[q][I][J][K];
3672 for (
unsigned int j = 0; j < spacedim; ++j)
3675 for (
unsigned int K = 0; K < dim; ++K)
3677 tmp2[K] = data.covariant[q][j][0] * tmp1[0][K];
3678 for (
unsigned int J = 1; J < dim; ++J)
3679 tmp2[K] += data.covariant[q][j][J] * tmp1[J][K];
3681 for (
unsigned int k = 0; k < spacedim; ++k)
3683 output[q][i][j][k] =
3684 data.covariant[q][k][0] * tmp2[0];
3685 for (
unsigned int K = 1; K < dim; ++K)
3686 output[q][i][j][k] +=
3687 data.covariant[q][k][K] * tmp2[K];
3702 template <
int dim,
int spacedim,
int rank>
3704 transform_differential_forms(
3711 Assert((
dynamic_cast<const typename ::
3712 MappingQGeneric<dim, spacedim>::InternalData *
>(
3713 &mapping_data) !=
nullptr),
3715 const typename ::MappingQGeneric<dim, spacedim>::InternalData
3717 static_cast<const typename ::MappingQGeneric<dim, spacedim>::
3718 InternalData &
>(mapping_data);
3720 switch (mapping_type)
3727 "update_covariant_transformation"));
3729 for (
unsigned int i = 0; i < output.size(); ++i)
3730 output[i] = apply_transformation(data.covariant[i], input[i]);
3744 template <
int dim,
int spacedim>
3752 internal::MappingQGenericImplementation::transform_fields(input,
3760 template <
int dim,
int spacedim>
3768 internal::MappingQGenericImplementation::transform_differential_forms(
3769 input, mapping_type, mapping_data, output);
3774 template <
int dim,
int spacedim>
3782 switch (mapping_type)
3785 internal::MappingQGenericImplementation::transform_fields(input,
3794 internal::MappingQGenericImplementation::transform_gradients(
3795 input, mapping_type, mapping_data, output);
3804 template <
int dim,
int spacedim>
3813 Assert(dynamic_cast<const InternalData *>(&mapping_data) !=
nullptr,
3817 switch (mapping_type)
3823 "update_covariant_transformation"));
3825 for (
unsigned int q = 0; q < output.size(); ++q)
3826 for (
unsigned int i = 0; i < spacedim; ++i)
3827 for (
unsigned int j = 0; j < spacedim; ++j)
3830 for (
unsigned int K = 0; K < dim; ++K)
3832 tmp[K] = data.
covariant[q][j][0] * input[q][i][0][K];
3833 for (
unsigned int J = 1; J < dim; ++J)
3834 tmp[K] += data.
covariant[q][j][J] * input[q][i][J][K];
3836 for (
unsigned int k = 0; k < spacedim; ++k)
3838 output[q][i][j][k] = data.
covariant[q][k][0] * tmp[0];
3839 for (
unsigned int K = 1; K < dim; ++K)
3840 output[q][i][j][k] += data.
covariant[q][k][K] * tmp[K];
3853 template <
int dim,
int spacedim>
3861 switch (mapping_type)
3866 internal::MappingQGenericImplementation::transform_hessians(
3867 input, mapping_type, mapping_data, output);
3876 template <
int dim,
int spacedim>
3883 if (this->polynomial_degree == 2)
3885 for (
unsigned int line_no = 0;
3886 line_no < GeometryInfo<dim>::lines_per_cell;
3893 cell->line(line_no));
3898 cell->get_manifold() :
3907 std::vector<Point<spacedim>> tmp_points;
3908 for (
unsigned int line_no = 0;
3909 line_no < GeometryInfo<dim>::lines_per_cell;
3916 cell->line(line_no));
3921 cell->get_manifold() :
3924 const std::array<Point<spacedim>, 2> vertices{
3929 const std::size_t n_rows =
3930 support_point_weights_perimeter_to_interior[0].size(0);
3931 a.resize(a.size() + n_rows);
3935 support_point_weights_perimeter_to_interior[0],
3952 std::vector<Point<3>> tmp_points;
3955 for (
unsigned int face_no = 0; face_no < faces_per_cell; ++face_no)
3960 const bool face_orientation = cell->face_orientation(face_no),
3961 face_flip = cell->face_flip(face_no),
3962 face_rotation = cell->face_rotation(face_no);
3967 for (
unsigned int i = 0; i < vertices_per_face; ++i)
3968 Assert(face->vertex_index(i) ==
3970 face_no, i, face_orientation, face_flip, face_rotation)),
3975 for (
unsigned int i = 0; i < lines_per_face; ++i)
3978 face_no, i, face_orientation, face_flip, face_rotation)),
3984 boost::container::small_vector<Point<3>, 200> tmp_points(
3987 for (
unsigned int v = 0; v < GeometryInfo<2>::vertices_per_cell; ++v)
3989 if (polynomial_degree > 1)
3990 for (
unsigned int line = 0; line < GeometryInfo<2>::lines_per_cell;
3992 for (
unsigned int i = 0; i < polynomial_degree - 1; ++i)
3993 tmp_points[4 + line * (polynomial_degree - 1) + i] =
3995 (polynomial_degree - 1) *
3999 const std::size_t n_rows =
4000 support_point_weights_perimeter_to_interior[1].size(0);
4001 a.resize(a.size() + n_rows);
4003 face->get_manifold().get_new_points(
4005 support_point_weights_perimeter_to_interior[1],
4019 for (
unsigned int i = 0; i < GeometryInfo<2>::vertices_per_cell; ++i)
4020 vertices[i] = cell->vertex(i);
4024 for (
unsigned int q = 0, q2 = 0; q2 < polynomial_degree - 1; ++q2)
4025 for (
unsigned int q1 = 0; q1 < polynomial_degree - 1; ++q1, ++q)
4028 line_support_points.point(q2 + 1)[0]);
4029 for (
unsigned int i = 0; i < GeometryInfo<2>::vertices_per_cell; ++i)
4033 const std::size_t n_rows = weights.size(0);
4034 a.resize(a.size() + n_rows);
4036 cell->get_manifold().get_new_points(
4042 template <
int dim,
int spacedim>
4053 template <
int dim,
int spacedim>
4054 std::vector<Point<spacedim>>
4059 std::vector<Point<spacedim>> a;
4060 a.reserve(Utilities::fixed_power<dim>(polynomial_degree + 1));
4061 for (
unsigned int i = 0; i < GeometryInfo<dim>::vertices_per_cell; ++i)
4062 a.push_back(cell->vertex(i));
4064 if (this->polynomial_degree > 1)
4071 bool all_manifold_ids_are_equal = (dim == spacedim);
4072 if (all_manifold_ids_are_equal &&
4074 &cell->get_manifold()) ==
nullptr)
4076 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
4077 if (&cell->face(f)->get_manifold() != &cell->get_manifold())
4078 all_manifold_ids_are_equal =
false;
4081 for (
unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
4082 if (&cell->line(l)->get_manifold() != &cell->get_manifold())
4083 all_manifold_ids_are_equal =
false;
4086 if (all_manifold_ids_are_equal)
4088 const std::size_t n_rows = support_point_weights_cell.size(0);
4089 a.resize(a.size() + n_rows);
4093 support_point_weights_cell,
4100 add_line_support_points(cell, a);
4105 add_line_support_points(cell, a);
4108 if (dim != spacedim)
4109 add_quad_support_points(cell, a);
4112 const std::size_t n_rows =
4113 support_point_weights_perimeter_to_interior[1].size(0);
4114 a.resize(a.size() + n_rows);
4116 cell->get_manifold().get_new_points(
4118 support_point_weights_perimeter_to_interior[1],
4125 add_line_support_points(cell, a);
4126 add_quad_support_points(cell, a);
4130 const std::size_t n_rows =
4131 support_point_weights_perimeter_to_interior[2].size(0);
4132 a.resize(a.size() + n_rows);
4134 cell->get_manifold().get_new_points(
4136 support_point_weights_perimeter_to_interior[2],
4153 #include "mapping_q_generic.inst" 4156 DEAL_II_NAMESPACE_CLOSE
Transformed quadrature weights.
std::vector< Tensor< 2, dim > > shape_second_derivatives
static ::ExceptionBase & ExcTransformationFailed()
void loop(ITERATOR begin, typename identity< ITERATOR >::type end, DOFINFO &dinfo, INFOBOX &info, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &cell_worker, const std::function< void(DOFINFO &, typename INFOBOX::CellInfo &)> &boundary_worker, const std::function< void(DOFINFO &, DOFINFO &, typename INFOBOX::CellInfo &, typename INFOBOX::CellInfo &)> &face_worker, ASSEMBLER &assembler, const LoopControl &lctrl=LoopControl())
const types::manifold_id flat_manifold_id
static const unsigned int invalid_unsigned_int
#define AssertDimension(dim1, dim2)
Number determinant(const SymmetricTensor< 2, dim, Number > &)
const unsigned int polynomial_degree
typename IteratorSelector::line_iterator line_iterator
Contravariant transformation.
Table< 2, double > support_point_weights_cell
const std::vector< Point< dim > > & get_points() const
const std::vector< double > & get_weights() const
virtual void add_quad_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim >> &a) const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
const Tensor< 1, dim > & derivative(const unsigned int qpoint, const unsigned int shape_nr) const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
virtual void add_line_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, std::vector< Point< spacedim >> &a) const
const Tensor< 3, dim > & third_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
Outer normal vector, not normalized.
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
Determinant of the Jacobian.
double norm(const FEValuesBase< dim > &fe, const ArrayView< const std::vector< Tensor< 1, dim >>> &Du)
active_cell_iterator begin_active(const unsigned int level=0) const
const std::array< Quadrature< 1 >, dim > & get_tensor_basis() const
Transformed quadrature points.
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
MappingQGeneric(const unsigned int polynomial_degree)
#define AssertThrow(cond, exc)
bool tensor_product_quadrature
numbers::NumberTraits< Number >::real_type norm() const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
static DataSetDescriptor cell()
const std::unique_ptr< FE_Q< dim > > fe_q
InternalData(const unsigned int polynomial_degree)
std::unique_ptr< To > dynamic_unique_cast(std::unique_ptr< From > &&p)
SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)
std::vector< Table< 2, double > > support_point_weights_perimeter_to_interior
static ::ExceptionBase & ExcMessage(std::string arg1)
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
static ::ExceptionBase & ExcImpossibleInDim(int arg1)
void compute_shape_function_values(const std::vector< Point< dim >> &unit_points)
void reinit(const TableIndices< N > &new_size, const bool omit_default_initialization=false)
virtual void create_triangulation(const std::vector< Point< spacedim >> &vertices, const std::vector< CellData< dim >> &cells, const SubCellData &subcelldata)
Tensor< 1, dim, Number > cross_product_2d(const Tensor< 1, dim, Number > &src)
#define Assert(cond, exc)
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
Abstract base class for mapping classes.
std::vector< Point< spacedim > > mapping_support_points
std::vector< Tensor< 3, dim > > shape_third_derivatives
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
virtual void transform(const ArrayView< const Tensor< 1, dim >> &input, const MappingType type, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim >> &output) const override
SymmetricTensor< rank_, dim, Number > transpose(const SymmetricTensor< rank_, dim, Number > &t)
void initialize(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
Gradient of volume element.
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
Point< spacedim > point(const gp_Pnt &p, const double tolerance=1e-10)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
std::vector< Tensor< 1, dim > > shape_derivatives
unsigned int size() const
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
Tensor< 1, dim, Number > cross_product_3d(const Tensor< 1, dim, Number > &src1, const Tensor< 1, dim, Number > &src2)
Point< dim > transform_real_to_unit_cell_internal(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, const Point< dim > &initial_p_unit) const
static Point< dim > project_to_unit_cell(const Point< dim > &p)
unsigned int get_degree() const
virtual void get_new_points(const ArrayView< const Point< spacedim >> &surrounding_points, const Table< 2, double > &weights, ArrayView< Point< spacedim >> new_points) const
const double & shape(const unsigned int qpoint, const unsigned int shape_nr) const
Number determinant(const SymmetricTensor< 2, dim, Number > &t)
Number determinant(const Tensor< 2, dim, Number > &t)
static double d_linear_shape_function(const Point< dim > &xi, const unsigned int i)
unsigned int n_dofs_per_cell() const
const Tensor< 2, dim > & second_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
Triangulation< dim, spacedim >::cell_iterator cell_of_current_support_points
virtual std::size_t memory_consumption() const override
virtual std::vector< Point< spacedim > > compute_mapping_support_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
static ::ExceptionBase & ExcNotImplemented()
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
std::vector< Tensor< 4, dim > > shape_fourth_derivatives
void initialize_face(const UpdateFlags update_flags, const Quadrature< dim > &quadrature, const unsigned int n_original_q_points)
double compute_value(const unsigned int i, const Point< dim > &p) const
std::vector< double > shape_values
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
static double subface_ratio(const internal::SubfaceCase< dim > &subface_case, const unsigned int subface_no)
const Tensor< 4, dim > & fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
bool is_tensor_product() const
const Manifold< dim, spacedim > & get_manifold(const types::manifold_id number) const
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, ::internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
std::vector< Polynomial< double > > generate_complete_Lagrange_basis(const std::vector< Point< 1 >> &points)
Covariant transformation.
std::vector< DerivativeForm< 1, dim, spacedim > > covariant
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
static ::ExceptionBase & ExcInternalError()