59template <
int dim,
int spacedim,
typename VectorType>
65 , n_shape_functions(fe.n_dofs_per_cell())
67 , local_dof_indices(fe.n_dofs_per_cell())
68 , local_dof_values(fe.n_dofs_per_cell())
73template <
int dim,
int spacedim,
typename VectorType>
82 this->update_each = update_flags;
84 const unsigned int n_q_points = quadrature.size();
85 const std::vector<Point<dim>> &points = quadrature.get_points();
91 shape_values.resize(n_shape_functions * n_q_points);
92 for (
unsigned int point = 0; point < n_q_points; ++point)
93 for (
unsigned int i = 0; i < n_shape_functions; ++i)
94 shape(point, i) = fe->shape_value(i, points[point]);
102 shape_derivatives.resize(n_shape_functions * n_q_points);
103 for (
unsigned int point = 0; point < n_q_points; ++point)
104 for (
unsigned int i = 0; i < n_shape_functions; ++i)
105 derivative(point, i) = fe->shape_grad(i, points[point]);
109 covariant.resize(n_q_points);
112 contravariant.resize(n_q_points);
115 volume_elements.resize(n_q_points);
120 shape_second_derivatives.resize(n_shape_functions * n_q_points);
121 for (
unsigned int point = 0; point < n_q_points; ++point)
122 for (
unsigned int i = 0; i < n_shape_functions; ++i)
123 second_derivative(point, i) = fe->shape_grad_grad(i, points[point]);
129 shape_third_derivatives.resize(n_shape_functions * n_q_points);
130 for (
unsigned int point = 0; point < n_q_points; ++point)
131 for (
unsigned int i = 0; i < n_shape_functions; ++i)
132 third_derivative(point, i) =
133 fe->shape_3rd_derivative(i, points[point]);
139 shape_fourth_derivatives.resize(n_shape_functions * n_q_points);
140 for (
unsigned int point = 0; point < n_q_points; ++point)
141 for (
unsigned int i = 0; i < n_shape_functions; ++i)
142 fourth_derivative(point, i) =
143 fe->shape_4th_derivative(i, points[point]);
148 quadrature_weights = quadrature.get_weights();
153template <
int dim,
int spacedim,
typename VectorType>
164template <
int dim,
int spacedim,
typename VectorType>
167 const unsigned int qpoint,
175template <
int dim,
int spacedim,
typename VectorType>
178 const unsigned int qpoint,
182 shape_derivatives.size());
188template <
int dim,
int spacedim,
typename VectorType>
191 const unsigned int qpoint,
195 shape_derivatives.size());
200template <
int dim,
int spacedim,
typename VectorType>
203 const unsigned int qpoint,
207 shape_second_derivatives.size());
208 return shape_second_derivatives[
qpoint * n_shape_functions +
shape_nr];
213template <
int dim,
int spacedim,
typename VectorType>
216 const unsigned int qpoint,
220 shape_second_derivatives.size());
221 return shape_second_derivatives[
qpoint * n_shape_functions +
shape_nr];
225template <
int dim,
int spacedim,
typename VectorType>
228 const unsigned int qpoint,
232 shape_third_derivatives.size());
233 return shape_third_derivatives[
qpoint * n_shape_functions +
shape_nr];
238template <
int dim,
int spacedim,
typename VectorType>
241 const unsigned int qpoint,
245 shape_third_derivatives.size());
246 return shape_third_derivatives[
qpoint * n_shape_functions +
shape_nr];
250template <
int dim,
int spacedim,
typename VectorType>
253 const unsigned int qpoint,
257 shape_fourth_derivatives.size());
258 return shape_fourth_derivatives[
qpoint * n_shape_functions +
shape_nr];
263template <
int dim,
int spacedim,
typename VectorType>
266 const unsigned int qpoint,
270 shape_fourth_derivatives.size());
271 return shape_fourth_derivatives[
qpoint * n_shape_functions +
shape_nr];
276template <
int dim,
int spacedim,
typename VectorType>
284 , euler_dof_handler(&euler_dof_handler)
285 , fe_mask(mask.size() != 0
u ?
288 euler_dof_handler.get_fe().get_nonzero_components(0).
size(),
290 , fe_to_real(fe_mask.
size(),
numbers::invalid_unsigned_int)
291 , fe_values(
this->euler_dof_handler->get_fe(),
292 reference_cell.
template get_nodal_type_quadrature<dim>(),
296 unsigned int size = 0;
297 for (
unsigned int i = 0; i < fe_mask.size(); ++i)
300 fe_to_real[i] =
size++;
307template <
int dim,
int spacedim,
typename VectorType>
310 const std::vector<VectorType> &euler_vector,
312 : reference_cell(euler_dof_handler.get_fe().reference_cell())
313 , uses_level_dofs(
true)
314 , euler_dof_handler(&euler_dof_handler)
315 , fe_mask(mask.
size() != 0
u ?
318 euler_dof_handler.get_fe().get_nonzero_components(0).
size(),
320 , fe_to_real(fe_mask.
size(),
numbers::invalid_unsigned_int)
321 , fe_values(
this->euler_dof_handler->get_fe(),
322 reference_cell.
template get_nodal_type_quadrature<dim>(),
325 unsigned int size = 0;
326 for (
unsigned int i = 0; i <
fe_mask.size(); ++i)
334 ExcMessage(
"The underlying DoFHandler object did not call "
335 "distribute_mg_dofs(). In this case, the construction via "
336 "level vectors does not make sense."));
339 this->euler_vector.clear();
350template <
int dim,
int spacedim,
typename VectorType>
355 : reference_cell(euler_dof_handler.get_fe().reference_cell())
356 , uses_level_dofs(
true)
357 , euler_dof_handler(&euler_dof_handler)
358 , fe_mask(mask.
size() != 0
u ?
361 euler_dof_handler.get_fe().get_nonzero_components(0).
size(),
363 , fe_to_real(fe_mask.
size(),
numbers::invalid_unsigned_int)
364 , fe_values(
this->euler_dof_handler->get_fe(),
365 reference_cell.
template get_nodal_type_quadrature<dim>(),
368 unsigned int size = 0;
369 for (
unsigned int i = 0; i <
fe_mask.size(); ++i)
377 ExcMessage(
"The underlying DoFHandler object did not call "
378 "distribute_mg_dofs(). In this case, the construction via "
379 "level vectors does not make sense."));
382 this->euler_vector.
clear();
383 this->euler_vector.resize(
395template <
int dim,
int spacedim,
typename VectorType>
398 : reference_cell(mapping.reference_cell)
399 , uses_level_dofs(mapping.uses_level_dofs)
400 , euler_vector(mapping.euler_vector)
401 , euler_dof_handler(mapping.euler_dof_handler)
402 , fe_mask(mapping.fe_mask)
403 , fe_to_real(mapping.fe_to_real)
404 , fe_values(mapping.euler_dof_handler->get_fe(),
405 reference_cell.
template get_nodal_type_quadrature<dim>(),
411template <
int dim,
int spacedim,
typename VectorType>
414 const unsigned int qpoint,
423template <
int dim,
int spacedim,
typename VectorType>
432template <
int dim,
int spacedim,
typename VectorType>
438 ExcMessage(
"The dimension of your mapping (" +
440 ") and the reference cell cell_type (" +
442 " ) do not agree."));
449template <
int dim,
int spacedim,
typename VectorType>
450boost::container::small_vector<Point<spacedim>,
452 ReferenceCells::max_n_vertices<dim>()
482 const unsigned int dofs_per_cell =
484 std::vector<types::global_dof_index> dof_indices(dofs_per_cell);
486 dof_cell->get_mg_dof_indices(dof_indices);
488 dof_cell->get_dof_indices(dof_indices);
490 const VectorType &vector =
493 boost::container::small_vector<Point<spacedim>,
495 ReferenceCells::max_n_vertices<dim>()
500 vertices(cell->n_vertices());
501 for (
unsigned int i = 0; i < dofs_per_cell; ++i)
507 typename VectorType::value_type value =
510 for (
const unsigned int v : cell->vertex_indices())
522template <
int dim,
int spacedim,
typename VectorType>
534 for (
unsigned int i = 0; i < 5; ++i)
576template <
int dim,
int spacedim,
typename VectorType>
605 for (
unsigned int i = 0; i < n_faces; ++i)
608 std::fill(
data.unit_tangentials[i].begin(),
609 data.unit_tangentials[i].end(),
613 data.unit_tangentials[n_faces + i].resize(
616 data.unit_tangentials[n_faces + i].begin(),
617 data.unit_tangentials[n_faces + i].end(),
627template <
int dim,
int spacedim,
typename VectorType>
628typename std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
633 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
data_ptr =
642template <
int dim,
int spacedim,
typename VectorType>
643std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
650 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
data_ptr =
663template <
int dim,
int spacedim,
typename VectorType>
664std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
669 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
data_ptr =
685 namespace MappingFEFieldImplementation
695 template <
int dim,
int spacedim,
typename VectorType>
698 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
703 const std::vector<unsigned int> &fe_to_real,
704 std::vector<Point<spacedim>> &quadrature_points)
710 for (
unsigned int point = 0; point < quadrature_points.size();
716 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
718 const unsigned int comp_k =
719 fe.system_to_component_index(
k).first;
722 data.local_dof_values[
k] * shape[
k];
725 quadrature_points[point] =
result;
737 template <
int dim,
int spacedim,
typename VectorType>
740 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
745 const std::vector<unsigned int> &fe_to_real)
752 const unsigned int n_q_points =
data.contravariant.size();
756 for (
unsigned int point = 0; point < n_q_points; ++point)
763 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
765 const unsigned int comp_k =
766 fe.system_to_component_index(
k).first;
773 for (
unsigned int i = 0; i < spacedim; ++i)
783 for (
unsigned int point = 0; point <
data.contravariant.size();
785 data.covariant[point] =
786 (
data.contravariant[point]).covariant_form();
792 data.volume_elements.size());
793 for (
unsigned int point = 0; point <
data.contravariant.size();
795 data.volume_elements[point] =
796 data.contravariant[point].determinant();
806 template <
int dim,
int spacedim,
typename VectorType>
808 maybe_update_jacobian_grads(
809 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
814 const std::vector<unsigned int> &fe_to_real,
815 std::vector<DerivativeForm<2, dim, spacedim>> &jacobian_grads)
820 const unsigned int n_q_points = jacobian_grads.size();
822 for (
unsigned int point = 0; point < n_q_points; ++point)
829 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
831 const unsigned int comp_k =
832 fe.system_to_component_index(
k).first;
834 for (
unsigned int j = 0;
j < dim; ++
j)
835 for (
unsigned int l = 0; l < dim; ++l)
842 for (
unsigned int i = 0; i < spacedim; ++i)
843 for (
unsigned int j = 0;
j < dim; ++
j)
844 for (
unsigned int l = 0; l < dim; ++l)
845 jacobian_grads[point][i][
j][l] =
result[i][
j][l];
856 template <
int dim,
int spacedim,
typename VectorType>
858 maybe_update_jacobian_pushed_forward_grads(
859 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
864 const std::vector<unsigned int> &fe_to_real,
865 std::vector<Tensor<3, spacedim>> &jacobian_pushed_forward_grads)
870 const unsigned int n_q_points =
871 jacobian_pushed_forward_grads.size();
873 double tmp[spacedim][spacedim][spacedim];
874 for (
unsigned int point = 0; point < n_q_points; ++point)
881 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
883 const unsigned int comp_k =
884 fe.system_to_component_index(
k).first;
886 for (
unsigned int j = 0;
j < dim; ++
j)
887 for (
unsigned int l = 0; l < dim; ++l)
893 for (
unsigned int i = 0; i < spacedim; ++i)
894 for (
unsigned int j = 0;
j < spacedim; ++
j)
895 for (
unsigned int l = 0; l < dim; ++l)
899 for (
unsigned int jr = 1;
jr < dim; ++
jr)
907 for (
unsigned int i = 0; i < spacedim; ++i)
908 for (
unsigned int j = 0;
j < spacedim; ++
j)
909 for (
unsigned int l = 0; l < spacedim; ++l)
911 jacobian_pushed_forward_grads[point][i][
j][l] =
912 tmp[i][
j][0] *
data.covariant[point][l][0];
913 for (
unsigned int lr = 1;
lr < dim; ++
lr)
915 jacobian_pushed_forward_grads[point][i][
j][l] +=
916 tmp[i][
j][
lr] *
data.covariant[point][l][
lr];
929 template <
int dim,
int spacedim,
typename VectorType>
931 maybe_update_jacobian_2nd_derivatives(
932 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
937 const std::vector<unsigned int> &fe_to_real,
938 std::vector<DerivativeForm<3, dim, spacedim>> &jacobian_2nd_derivatives)
943 const unsigned int n_q_points = jacobian_2nd_derivatives.size();
945 for (
unsigned int point = 0; point < n_q_points; ++point)
952 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
954 const unsigned int comp_k =
955 fe.system_to_component_index(
k).first;
957 for (
unsigned int j = 0;
j < dim; ++
j)
958 for (
unsigned int l = 0; l < dim; ++l)
959 for (
unsigned int m = 0; m < dim; ++m)
966 for (
unsigned int i = 0; i < spacedim; ++i)
967 for (
unsigned int j = 0;
j < dim; ++
j)
968 for (
unsigned int l = 0; l < dim; ++l)
969 for (
unsigned int m = 0; m < dim; ++m)
970 jacobian_2nd_derivatives[point][i][
j][l][m] =
983 template <
int dim,
int spacedim,
typename VectorType>
985 maybe_update_jacobian_pushed_forward_2nd_derivatives(
986 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
991 const std::vector<unsigned int> &fe_to_real,
992 std::vector<Tensor<4, spacedim>>
993 &jacobian_pushed_forward_2nd_derivatives)
998 const unsigned int n_q_points =
999 jacobian_pushed_forward_2nd_derivatives.size();
1001 double tmp[spacedim][spacedim][spacedim][spacedim];
1002 for (
unsigned int point = 0; point < n_q_points; ++point)
1009 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
1011 const unsigned int comp_k =
1012 fe.system_to_component_index(
k).first;
1014 for (
unsigned int j = 0;
j < dim; ++
j)
1015 for (
unsigned int l = 0; l < dim; ++l)
1016 for (
unsigned int m = 0; m < dim; ++m)
1022 for (
unsigned int i = 0; i < spacedim; ++i)
1023 for (
unsigned int j = 0;
j < spacedim; ++
j)
1024 for (
unsigned int l = 0; l < dim; ++l)
1025 for (
unsigned int m = 0; m < dim; ++m)
1027 jacobian_pushed_forward_2nd_derivatives
1028 [point][i][
j][l][m] =
1030 for (
unsigned int jr = 1;
jr < dim; ++
jr)
1031 jacobian_pushed_forward_2nd_derivatives[point][i][
j]
1038 for (
unsigned int i = 0; i < spacedim; ++i)
1039 for (
unsigned int j = 0;
j < spacedim; ++
j)
1040 for (
unsigned int l = 0; l < spacedim; ++l)
1041 for (
unsigned int m = 0; m < dim; ++m)
1044 jacobian_pushed_forward_2nd_derivatives[point][i][
j]
1046 data.covariant[point][l][0];
1047 for (
unsigned int lr = 1;
lr < dim; ++
lr)
1049 jacobian_pushed_forward_2nd_derivatives[point][i]
1052 data.covariant[point][l][
lr];
1056 for (
unsigned int i = 0; i < spacedim; ++i)
1057 for (
unsigned int j = 0;
j < spacedim; ++
j)
1058 for (
unsigned int l = 0; l < spacedim; ++l)
1059 for (
unsigned int m = 0; m < spacedim; ++m)
1061 jacobian_pushed_forward_2nd_derivatives
1062 [point][i][
j][l][m] =
1063 tmp[i][
j][l][0] *
data.covariant[point][m][0];
1064 for (
unsigned int mr = 1;
mr < dim; ++
mr)
1065 jacobian_pushed_forward_2nd_derivatives[point][i][
j]
1067 tmp[i][
j][l][
mr] *
data.covariant[point][m][
mr];
1079 template <
int dim,
int spacedim,
typename VectorType>
1081 maybe_update_jacobian_3rd_derivatives(
1082 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
1087 const std::vector<unsigned int> &fe_to_real,
1088 std::vector<DerivativeForm<4, dim, spacedim>> &jacobian_3rd_derivatives)
1093 const unsigned int n_q_points = jacobian_3rd_derivatives.size();
1095 for (
unsigned int point = 0; point < n_q_points; ++point)
1102 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
1104 const unsigned int comp_k =
1105 fe.system_to_component_index(
k).first;
1107 for (
unsigned int j = 0;
j < dim; ++
j)
1108 for (
unsigned int l = 0; l < dim; ++l)
1109 for (
unsigned int m = 0; m < dim; ++m)
1110 for (
unsigned int n = 0; n < dim; ++n)
1113 data.local_dof_values[
k]);
1119 for (
unsigned int i = 0; i < spacedim; ++i)
1120 for (
unsigned int j = 0;
j < dim; ++
j)
1121 for (
unsigned int l = 0; l < dim; ++l)
1122 for (
unsigned int m = 0; m < dim; ++m)
1123 for (
unsigned int n = 0; n < dim; ++n)
1124 jacobian_3rd_derivatives[point][i][
j][l][m][n] =
1137 template <
int dim,
int spacedim,
typename VectorType>
1139 maybe_update_jacobian_pushed_forward_3rd_derivatives(
1140 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
1145 const std::vector<unsigned int> &fe_to_real,
1146 std::vector<Tensor<5, spacedim>>
1147 &jacobian_pushed_forward_3rd_derivatives)
1152 const unsigned int n_q_points =
1153 jacobian_pushed_forward_3rd_derivatives.size();
1155 double tmp[spacedim][spacedim][spacedim][spacedim][spacedim];
1156 for (
unsigned int point = 0; point < n_q_points; ++point)
1163 for (
unsigned int k = 0;
k <
data.n_shape_functions; ++
k)
1165 const unsigned int comp_k =
1166 fe.system_to_component_index(
k).first;
1168 for (
unsigned int j = 0;
j < dim; ++
j)
1169 for (
unsigned int l = 0; l < dim; ++l)
1170 for (
unsigned int m = 0; m < dim; ++m)
1171 for (
unsigned int n = 0; n < dim; ++n)
1174 data.local_dof_values[
k]);
1178 for (
unsigned int i = 0; i < spacedim; ++i)
1179 for (
unsigned int j = 0;
j < spacedim; ++
j)
1180 for (
unsigned int l = 0; l < dim; ++l)
1181 for (
unsigned int m = 0; m < dim; ++m)
1182 for (
unsigned int n = 0; n < dim; ++n)
1184 tmp[i][
j][l][m][n] =
result[i][0][l][m][n] *
1185 data.covariant[point][
j][0];
1186 for (
unsigned int jr = 1;
jr < dim; ++
jr)
1187 tmp[i][
j][l][m][n] +=
1193 for (
unsigned int i = 0; i < spacedim; ++i)
1194 for (
unsigned int j = 0;
j < spacedim; ++
j)
1195 for (
unsigned int l = 0; l < spacedim; ++l)
1196 for (
unsigned int m = 0; m < dim; ++m)
1197 for (
unsigned int n = 0; n < dim; ++n)
1199 jacobian_pushed_forward_3rd_derivatives
1200 [point][i][
j][l][m][n] =
1201 tmp[i][
j][0][m][n] *
1202 data.covariant[point][l][0];
1203 for (
unsigned int lr = 1;
lr < dim; ++
lr)
1204 jacobian_pushed_forward_3rd_derivatives[point][i]
1207 tmp[i][
j][
lr][m][n] *
1208 data.covariant[point][l][
lr];
1212 for (
unsigned int i = 0; i < spacedim; ++i)
1213 for (
unsigned int j = 0;
j < spacedim; ++
j)
1214 for (
unsigned int l = 0; l < spacedim; ++l)
1215 for (
unsigned int m = 0; m < spacedim; ++m)
1216 for (
unsigned int n = 0; n < dim; ++n)
1218 tmp[i][
j][l][m][n] =
1219 jacobian_pushed_forward_3rd_derivatives[point][i]
1222 data.covariant[point][m][0];
1223 for (
unsigned int mr = 1;
mr < dim; ++
mr)
1224 tmp[i][
j][l][m][n] +=
1225 jacobian_pushed_forward_3rd_derivatives[point]
1228 data.covariant[point][m][
mr];
1232 for (
unsigned int i = 0; i < spacedim; ++i)
1233 for (
unsigned int j = 0;
j < spacedim; ++
j)
1234 for (
unsigned int l = 0; l < spacedim; ++l)
1235 for (
unsigned int m = 0; m < spacedim; ++m)
1236 for (
unsigned int n = 0; n < spacedim; ++n)
1238 jacobian_pushed_forward_3rd_derivatives
1239 [point][i][
j][l][m][n] =
1240 tmp[i][
j][l][m][0] *
1241 data.covariant[point][n][0];
1242 for (
unsigned int nr = 1;
nr < dim; ++
nr)
1243 jacobian_pushed_forward_3rd_derivatives[point][i]
1246 tmp[i][
j][l][m][
nr] *
1247 data.covariant[point][n][
nr];
1263 template <
int dim,
int spacedim,
typename VectorType>
1265 maybe_compute_face_data(
1266 const ::Mapping<dim, spacedim> &mapping,
1267 const typename ::Triangulation<dim, spacedim>::cell_iterator
1281 const unsigned int n_q_points = output_data.boundary_forms.size();
1290 for (
unsigned int d = 0; d != dim - 1; ++d)
1293 data.unit_tangentials.size(),
1296 data.aux[d].size() <=
1297 data.unit_tangentials[
face_no + cell->n_faces() * d].size(),
1302 data.unit_tangentials[
face_no + cell->n_faces() * d]),
1310 if (dim == spacedim)
1312 for (
unsigned int i = 0; i < n_q_points; ++i)
1320 output_data.boundary_forms[i][0] =
1324 output_data.boundary_forms[i] =
1328 output_data.boundary_forms[i] =
1345 for (
unsigned int point = 0; point < n_q_points; ++point)
1350 output_data.boundary_forms[point] =
1351 data.contravariant[point].transpose()[0];
1352 output_data.boundary_forms[point] /=
1354 output_data.boundary_forms[point].norm();
1360 data.contravariant[point].transpose();
1368 output_data.boundary_forms[point] =
1375 for (
unsigned int i = 0; i < output_data.boundary_forms.size();
1380 output_data.JxW_values[i] =
1381 output_data.boundary_forms[i].norm() *
1395 output_data.normal_vectors[i] =
1397 output_data.boundary_forms[i].norm());
1408 template <
int dim,
int spacedim,
typename VectorType>
1410 do_fill_fe_face_values(
1411 const ::Mapping<dim, spacedim> &mapping,
1412 const typename ::Triangulation<dim, spacedim>::cell_iterator
1416 const typename ::QProjector<dim>::DataSetDescriptor
data_set,
1421 const std::vector<unsigned int> &fe_to_real,
1431 output_data.quadrature_points);
1437 const unsigned int n_q_points =
data.contravariant.size();
1440 for (
unsigned int point = 0; point < n_q_points; ++point)
1441 output_data.jacobians[point] =
data.contravariant[point];
1444 for (
unsigned int point = 0; point < n_q_points; ++point)
1445 output_data.inverse_jacobians[point] =
1446 data.covariant[point].transpose();
1449 data_set,
data, fe, fe_mask, fe_to_real, output_data.jacobian_grads);
1457 output_data.jacobian_pushed_forward_grads);
1465 output_data.jacobian_2nd_derivatives);
1467 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim,
1475 output_data.jacobian_pushed_forward_2nd_derivatives);
1483 output_data.jacobian_3rd_derivatives);
1485 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim,
1493 output_data.jacobian_pushed_forward_3rd_derivatives);
1505template <
int dim,
int spacedim,
typename VectorType>
1521 const unsigned int n_q_points = quadrature.size();
1525 internal::MappingFEFieldImplementation::
1526 maybe_compute_q_points<dim, spacedim, VectorType>(
1534 internal::MappingFEFieldImplementation::
1535 maybe_update_Jacobians<dim, spacedim, VectorType>(
1543 const std::vector<double> &weights = quadrature.get_weights();
1558 for (
unsigned int point = 0; point < n_q_points; ++point)
1560 if (dim == spacedim)
1562 const double det =
data.volume_elements[point];
1569 Assert(
det > 1e-12 * Utilities::fixed_power<dim>(
1570 cell->diameter() /
std::sqrt(
double(dim))),
1572 cell->center(),
det, point)));
1581 for (
unsigned int i = 0; i < spacedim; ++i)
1582 for (
unsigned int j = 0;
j < dim; ++
j)
1583 DX_t[
j][i] =
data.contravariant[point][i][
j];
1586 for (
unsigned int i = 0; i < dim; ++i)
1587 for (
unsigned int j = 0;
j < dim; ++
j)
1595 Assert(spacedim - dim == 1,
1596 ExcMessage(
"There is no cell normal in codim 2."));
1614 if (cell->direction_flag() ==
false)
1625 for (
unsigned int point = 0; point < n_q_points; ++point)
1633 for (
unsigned int point = 0; point < n_q_points; ++point)
1635 data.covariant[point].transpose();
1639 internal::MappingFEFieldImplementation::
1640 maybe_update_jacobian_grads<dim, spacedim, VectorType>(
1650 internal::MappingFEFieldImplementation::
1651 maybe_update_jacobian_pushed_forward_grads<dim, spacedim, VectorType>(
1660 internal::MappingFEFieldImplementation::
1661 maybe_update_jacobian_2nd_derivatives<dim, spacedim, VectorType>(
1670 internal::MappingFEFieldImplementation::
1671 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim,
1682 internal::MappingFEFieldImplementation::
1683 maybe_update_jacobian_3rd_derivatives<dim, spacedim, VectorType>(
1693 internal::MappingFEFieldImplementation::
1694 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim,
1709template <
int dim,
int spacedim,
typename VectorType>
1729 internal::MappingFEFieldImplementation::
1730 do_fill_fe_face_values<dim, spacedim, VectorType>(
1737 cell->combined_face_orientation(
1739 quadrature[0].
size()),
1748template <
int dim,
int spacedim,
typename VectorType>
1767 internal::MappingFEFieldImplementation::do_fill_fe_face_values<dim,
1777 cell->combined_face_orientation(
1790template <
int dim,
int spacedim,
typename VectorType>
1804 const unsigned int n_q_points = quadrature.size();
1808 internal::MappingFEFieldImplementation::
1809 maybe_compute_q_points<dim, spacedim, VectorType>(
1817 internal::MappingFEFieldImplementation::
1818 maybe_update_Jacobians<dim, spacedim, VectorType>(
1826 const std::vector<double> &weights = quadrature.get_weights();
1838 for (
unsigned int point = 0; point < n_q_points; ++point)
1840 const double det =
data.volume_elements[point];
1847 Assert(
det > 1e-12 * Utilities::fixed_power<dim>(
1848 cell->diameter() /
std::sqrt(
double(dim))),
1850 cell->center(),
det, point)));
1854 for (
unsigned int d = 0; d < spacedim; d++)
1862 normal /= normal.
norm();
1871 for (
unsigned int point = 0; point < n_q_points; ++point)
1879 for (
unsigned int point = 0; point < n_q_points; ++point)
1881 data.covariant[point].transpose();
1885 internal::MappingFEFieldImplementation::
1886 maybe_update_jacobian_grads<dim, spacedim, VectorType>(
1896 internal::MappingFEFieldImplementation::
1897 maybe_update_jacobian_pushed_forward_grads<dim, spacedim, VectorType>(
1906 internal::MappingFEFieldImplementation::
1907 maybe_update_jacobian_2nd_derivatives<dim, spacedim, VectorType>(
1917 internal::MappingFEFieldImplementation::
1918 maybe_update_jacobian_pushed_forward_2nd_derivatives<dim,
1929 internal::MappingFEFieldImplementation::
1930 maybe_update_jacobian_3rd_derivatives<dim, spacedim, VectorType>(
1940 internal::MappingFEFieldImplementation::
1941 maybe_update_jacobian_pushed_forward_3rd_derivatives<dim,
1955 namespace MappingFEFieldImplementation
1959 template <
int dim,
int spacedim,
int rank,
typename VectorType>
1970 MappingFEField<dim, spacedim, VectorType>::InternalData *
>(
1971 &mapping_data) !=
nullptr),
1976 InternalData &
>(mapping_data);
1978 switch (mapping_kind)
1985 "update_contravariant_transformation"));
1987 for (
unsigned int i = 0; i < output.size(); ++i)
1999 "update_contravariant_transformation"));
2003 "update_volume_elements"));
2005 for (
unsigned int i = 0; i < output.size(); ++i)
2009 output[i] /=
data.volume_elements[i];
2023 "update_contravariant_transformation"));
2025 for (
unsigned int i = 0; i < output.size(); ++i)
2037 template <
int dim,
int spacedim,
int rank,
typename VectorType>
2048 MappingFEField<dim, spacedim, VectorType>::InternalData *
>(
2049 &mapping_data) !=
nullptr),
2054 InternalData &
>(mapping_data);
2056 switch (mapping_kind)
2063 "update_contravariant_transformation"));
2065 for (
unsigned int i = 0; i < output.size(); ++i)
2080template <
int dim,
int spacedim,
typename VectorType>
2090 internal::MappingFEFieldImplementation::
2091 transform_fields<dim, spacedim, 1, VectorType>(input,
2099template <
int dim,
int spacedim,
typename VectorType>
2109 internal::MappingFEFieldImplementation::
2110 transform_differential_forms<dim, spacedim, 1, VectorType>(input,
2118template <
int dim,
int spacedim,
typename VectorType>
2136template <
int dim,
int spacedim,
typename VectorType>
2149 switch (mapping_kind)
2155 "update_covariant_transformation"));
2157 for (
unsigned int q = 0;
q < output.size(); ++
q)
2158 for (
unsigned int i = 0; i < spacedim; ++i)
2159 for (
unsigned int j = 0;
j < spacedim; ++
j)
2160 for (
unsigned int k = 0;
k < spacedim; ++
k)
2162 output[
q][i][
j][
k] =
data.covariant[
q][
j][0] *
2163 data.covariant[
q][
k][0] *
2165 for (
unsigned int J = 0; J < dim; ++J)
2167 const unsigned int K0 = (0 == J) ? 1 : 0;
2168 for (
unsigned int K =
K0; K < dim; ++K)
2169 output[
q][i][
j][
k] +=
data.covariant[
q][
j][J] *
2170 data.covariant[
q][
k][K] *
2184template <
int dim,
int spacedim,
typename VectorType>
2202template <
int dim,
int spacedim,
typename VectorType>
2212 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
mdata(
2223template <
int dim,
int spacedim,
typename VectorType>
2230 for (
unsigned int i = 0; i <
data.n_shape_functions; ++i)
2236 data.local_dof_values[i] *
data.shape(0, i);
2244template <
int dim,
int spacedim,
typename VectorType>
2256 .transform_real_to_unit_cell(cell, p);
2263 for (
unsigned int d = 0; d < dim; ++d)
2272 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
mdata(
2286template <
int dim,
int spacedim,
typename VectorType>
2315 const double eps = 1.e-12 * cell->diameter();
2323 for (
unsigned int k = 0;
k <
mdata.n_shape_functions; ++
k)
2326 const unsigned int comp_k =
2329 for (
unsigned int j = 0;
j < dim; ++
j)
2333 for (
unsigned int j = 0;
j < dim; ++
j)
2336 for (
unsigned int l = 0; l < dim; ++l)
2356 for (
unsigned int i = 0; i < dim; ++i)
2398template <
int dim,
int spacedim,
typename VectorType>
2407template <
int dim,
int spacedim,
typename VectorType>
2415template <
int dim,
int spacedim,
typename VectorType>
2416std::unique_ptr<Mapping<dim, spacedim>>
2419 return std::make_unique<MappingFEField<dim, spacedim, VectorType>>(*this);
2423template <
int dim,
int spacedim,
typename VectorType>
2450 const VectorType &vector =
2453 for (
unsigned int i = 0; i <
data.local_dof_values.size(); ++i)
2454 data.local_dof_values[i] =
2456 data.local_dof_indices[i]);
2460#define SPLIT_INSTANTIATIONS_COUNT 2
2461#ifndef SPLIT_INSTANTIATIONS_INDEX
2462# define SPLIT_INSTANTIATIONS_INDEX 0
2464#include "fe/mapping_fe_field.inst"
ArrayView< std::remove_reference_t< typename std::iterator_traits< Iterator >::reference >, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
const Tensor< 3, dim > & third_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
InternalData(const FiniteElement< dim, spacedim > &fe, const ComponentMask &mask)
const Tensor< 2, dim > & second_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
virtual void reinit(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) override
virtual std::size_t memory_consumption() const override
const Tensor< 4, dim > & fourth_derivative(const unsigned int qpoint, const unsigned int shape_nr) const
unsigned int n_shape_functions
const Tensor< 1, dim > & derivative(const unsigned int qpoint, const unsigned int shape_nr) const
const double & shape(const unsigned int qpoint, const unsigned int shape_nr) const
std::vector< double > shape_values
std::vector< unsigned int > fe_to_real
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
const ComponentMask fe_mask
void update_internal_dofs(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename MappingFEField< dim, spacedim, VectorType >::InternalData &data) const
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const override
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
virtual bool preserves_vertex_locations() const override
Point< dim > do_transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p, const Point< dim > &starting_guess, InternalData &mdata) const
void compute_face_data(const unsigned int n_original_q_points, InternalData &data) const
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_face_data(const UpdateFlags flags, const hp::QCollection< dim - 1 > &quadrature) const override
virtual void fill_fe_immersed_surface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const NonMatching::ImmersedSurfaceQuadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
friend class MappingFEField
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
virtual bool is_compatible_with(const ReferenceCell &reference_cell) const override
std::vector< ObserverPointer< const VectorType, MappingFEField< dim, spacedim, VectorType > > > euler_vector
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
ReferenceCell reference_cell
unsigned int get_degree() const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
Point< spacedim > do_transform_unit_to_real_cell(const InternalData &mdata) const
Threads::Mutex fe_values_mutex
const bool uses_level_dofs
ComponentMask get_component_mask() const
virtual void fill_fe_face_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const hp::QCollection< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
ObserverPointer< const DoFHandler< dim, spacedim >, MappingFEField< dim, spacedim, VectorType > > euler_dof_handler
FEValues< dim, spacedim > fe_values
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
virtual boost::container::small_vector< Point< spacedim >, ReferenceCells::max_n_vertices< dim >() > get_vertices(const typename Triangulation< dim, spacedim >::cell_iterator &cell) const override
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
Abstract base class for mapping classes.
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
Class storing the offset index into a Quadrature rule created by project_to_all_faces() or project_to...
static DataSetDescriptor subface(const ReferenceCell &reference_cell, const unsigned int face_no, const unsigned int subface_no, const bool face_orientation, const bool face_flip, const bool face_rotation, const unsigned int n_quadrature_points, const internal::SubfaceCase< dim > ref_case=internal::SubfaceCase< dim >::case_isotropic)
static DataSetDescriptor cell()
Class which transforms dim - 1-dimensional quadrature rules to dim-dimensional face quadratures.
unsigned int n_faces() const
unsigned int get_dimension() const
numbers::NumberTraits< Number >::real_type norm() const
constexpr numbers::NumberTraits< Number >::real_type norm_square() const
unsigned int size() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcInactiveCell()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::cell_iterator cell_iterator
@ update_jacobian_pushed_forward_2nd_derivatives
@ update_volume_elements
Determinant of the Jacobian.
@ update_contravariant_transformation
Contravariant transformation.
@ update_jacobian_pushed_forward_grads
@ update_jacobian_3rd_derivatives
@ update_values
Shape function values.
@ update_jacobian_grads
Gradient of volume element.
@ update_normal_vectors
Normal vectors.
@ update_JxW_values
Transformed quadrature weights.
@ update_covariant_transformation
Covariant transformation.
@ update_jacobians
Volume element.
@ update_inverse_jacobians
Volume element.
@ update_quadrature_points
Transformed quadrature points.
@ update_jacobian_pushed_forward_3rd_derivatives
@ update_boundary_forms
Outer normal vector, not normalized.
@ update_jacobian_2nd_derivatives
@ mapping_covariant_gradient
const Mapping< dim, spacedim > & get_default_linear_mapping(const Triangulation< dim, spacedim > &triangulation)
std::vector< index_type > data
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)
void transform_differential_forms(const ArrayView< const DerivativeForm< rank, dim, spacedim > > &input, const MappingKind mapping_kind, const typename Mapping< dim, spacedim >::InternalDataBase &mapping_data, const ArrayView< Tensor< rank+1, spacedim > > &output)
constexpr unsigned int invalid_unsigned_int
::VectorizedArray< Number, width > sqrt(const ::VectorizedArray< Number, width > &)
static double subface_ratio(const internal::SubfaceCase< dim > &subface_case, const unsigned int subface_no)
static VectorType::value_type get(const VectorType &V, const types::global_dof_index i)
DEAL_II_HOST constexpr Number determinant(const SymmetricTensor< 2, dim, Number > &)
DEAL_II_HOST constexpr SymmetricTensor< 2, dim, Number > invert(const SymmetricTensor< 2, dim, Number > &)