40#ifdef DEAL_II_WITH_MPI
60 check_primary_dof_list(
62 const std::vector<types::global_dof_index> &primary_dof_list)
64 const unsigned int N = primary_dof_list.size();
67 for (
unsigned int i = 0; i <
N; ++i)
68 for (
unsigned int j = 0; j <
N; ++j)
69 tmp(i, j) = face_interpolation_matrix(primary_dof_list[i], j);
80 double diagonal_sum = 0;
81 for (
unsigned int i = 0; i <
N; ++i)
83 const double typical_diagonal_element = diagonal_sum /
N;
87 std::vector<unsigned int> p(
N);
88 for (
unsigned int i = 0; i <
N; ++i)
91 for (
unsigned int j = 0; j <
N; ++j)
97 for (
unsigned int i = j + 1; i <
N; ++i)
108 if (
max < 1.e-12 * typical_diagonal_element)
114 for (
unsigned int k = 0; k <
N; ++k)
121 const double hr = 1. / tmp(j, j);
123 for (
unsigned int k = 0; k <
N; ++k)
127 for (
unsigned int i = 0; i <
N; ++i)
131 tmp(i, k) -= tmp(i, j) * tmp(j, k) * hr;
134 for (
unsigned int i = 0; i <
N; ++i)
170 template <
int dim,
int spacedim>
172 select_primary_dofs_for_face_restriction(
176 std::vector<bool> & primary_dof_mask)
182 const unsigned int face_no = 0;
217 std::vector<types::global_dof_index> primary_dof_list;
218 unsigned int index = 0;
223 unsigned int dofs_added = 0;
232 primary_dof_list.push_back(index + i);
235 if (check_primary_dof_list(face_interpolation_matrix,
236 primary_dof_list) ==
true)
241 primary_dof_list.pop_back();
254 unsigned int dofs_added = 0;
260 primary_dof_list.push_back(index + i);
261 if (check_primary_dof_list(face_interpolation_matrix,
262 primary_dof_list) ==
true)
265 primary_dof_list.pop_back();
277 unsigned int dofs_added = 0;
283 primary_dof_list.push_back(index + i);
284 if (check_primary_dof_list(face_interpolation_matrix,
285 primary_dof_list) ==
true)
288 primary_dof_list.pop_back();
299 std::fill(primary_dof_mask.begin(), primary_dof_mask.end(),
false);
300 for (
const auto dof : primary_dof_list)
301 primary_dof_mask[dof] =
true;
310 template <
int dim,
int spacedim>
312 ensure_existence_of_primary_dof_mask(
316 std::unique_ptr<std::vector<bool>> &primary_dof_mask)
322 const unsigned int face_no = 0;
324 if (primary_dof_mask ==
nullptr)
328 select_primary_dofs_for_face_restriction(fe1,
330 face_interpolation_matrix,
342 template <
int dim,
int spacedim>
344 ensure_existence_of_face_matrix(
353 const unsigned int face_no = 0;
357 matrix = std::make_unique<FullMatrix<double>>(
368 template <
int dim,
int spacedim>
370 ensure_existence_of_subface_matrix(
373 const unsigned int subface,
380 const unsigned int face_no = 0;
384 matrix = std::make_unique<FullMatrix<double>>(
401 ensure_existence_of_split_face_matrix(
403 const std::vector<bool> & primary_dof_mask,
408 Assert(std::count(primary_dof_mask.begin(),
409 primary_dof_mask.end(),
411 static_cast<signed int>(face_interpolation_matrix.
n()),
414 if (split_matrix ==
nullptr)
416 split_matrix = std::make_unique<
419 const unsigned int n_primary_dofs = face_interpolation_matrix.
n();
420 const unsigned int n_dofs = face_interpolation_matrix.
m();
426 split_matrix->first.reinit(n_primary_dofs, n_primary_dofs);
427 split_matrix->second.reinit(n_dofs - n_primary_dofs,
430 unsigned int nth_primary_dof = 0, nth_dependent_dof = 0;
432 for (
unsigned int i = 0; i < n_dofs; ++i)
433 if (primary_dof_mask[i] ==
true)
435 for (
unsigned int j = 0; j < n_primary_dofs; ++j)
436 split_matrix->first(nth_primary_dof, j) =
437 face_interpolation_matrix(i, j);
442 for (
unsigned int j = 0; j < n_primary_dofs; ++j)
443 split_matrix->second(nth_dependent_dof, j) =
444 face_interpolation_matrix(i, j);
453 split_matrix->first.gauss_jordan();
463 template <
int dim,
int spacedim>
485 template <
typename number1,
typename number2>
488 const std::vector<types::global_dof_index> &primary_dofs,
489 const std::vector<types::global_dof_index> &dependent_dofs,
493 Assert(face_constraints.
n() == primary_dofs.size(),
495 Assert(face_constraints.
m() == dependent_dofs.size(),
497 face_constraints.
m()));
499 const unsigned int n_primary_dofs = primary_dofs.size();
500 const unsigned int n_dependent_dofs = dependent_dofs.size();
504 for (
unsigned int row = 0; row != n_dependent_dofs; ++row)
507 for (
unsigned int col = 0; col != n_primary_dofs; ++col)
512 for (
unsigned int row = 0; row != n_dependent_dofs; ++row)
532 bool is_trivial_constraint =
false;
534 for (
unsigned int i = 0; i < n_primary_dofs; ++i)
535 if (face_constraints(row, i) == 1.0)
536 if (dependent_dofs[row] == primary_dofs[i])
538 is_trivial_constraint =
true;
540 for (
unsigned int ii = 0; ii < n_primary_dofs; ++ii)
542 Assert(face_constraints(row, ii) == 0.0,
548 if (is_trivial_constraint ==
true)
554 for (
unsigned int i = 0; i < n_primary_dofs; ++i)
555 abs_sum +=
std::abs(face_constraints(row, i));
563 constraints.
add_line(dependent_dofs[row]);
564 for (
unsigned int i = 0; i < n_primary_dofs; ++i)
565 if ((face_constraints(row, i) != 0) &&
566 (
std::fabs(face_constraints(row, i)) >= 1
e-14 * abs_sum))
567 constraints.
add_entry(dependent_dofs[row],
569 face_constraints(row, i));
577 template <
typename number>
586 template <
typename number>
590 std::integral_constant<int, 1>)
596 template <
typename number>
605 template <
typename number>
609 std::integral_constant<int, 1>)
615 template <
typename number,
int spacedim>
618 const ::DoFHandler<1, spacedim> & ,
625 template <
typename number,
int spacedim>
628 const ::DoFHandler<1, spacedim> & ,
630 std::integral_constant<int, 1>)
635 template <
int dim_,
int spacedim,
typename number>
640 std::integral_constant<int, 2>)
642 const unsigned int dim = 2;
644 std::vector<types::global_dof_index> dofs_on_mother;
645 std::vector<types::global_dof_index> dofs_on_children;
657 endc = dof_handler.
end();
658 for (; cell != endc; ++cell)
662 if (cell->is_artificial())
665 for (
const unsigned int face : cell->face_indices())
666 if (cell->face(face)->has_children())
672 Assert(cell->face(face)->n_active_fe_indices() == 1,
674 Assert(cell->face(face)->fe_index_is_active(
675 cell->active_fe_index()) ==
true,
677 for (
unsigned int c = 0; c < cell->face(face)->n_children();
679 if (!cell->neighbor_child_on_subface(face, c)
681 Assert(cell->face(face)->child(c)->n_active_fe_indices() ==
687 for (
unsigned int c = 0; c < cell->face(face)->n_children();
689 if (!cell->neighbor_child_on_subface(face, c)
691 Assert(cell->face(face)->child(c)->fe_index_is_active(
692 cell->active_fe_index()) ==
true,
697 const unsigned int fe_index = cell->active_fe_index();
699 const unsigned int n_dofs_on_mother =
706 dofs_on_mother.resize(n_dofs_on_mother);
709 dofs_on_children.clear();
710 dofs_on_children.reserve(n_dofs_on_children);
720 this_face = cell->face(face);
724 unsigned int next_index = 0;
725 for (
unsigned int vertex = 0; vertex < 2; ++vertex)
728 dofs_on_mother[next_index++] =
729 this_face->vertex_dof_index(vertex, dof, fe_index);
731 dofs_on_mother[next_index++] =
732 this_face->dof_index(dof, fe_index);
736 dofs_on_children.push_back(
737 this_face->child(0)->vertex_dof_index(1, dof, fe_index));
738 for (
unsigned int child = 0; child < 2; ++child)
741 if (cell->neighbor_child_on_subface(face, child)
746 dofs_on_children.push_back(
747 this_face->child(child)->dof_index(dof, fe_index));
750 Assert(dofs_on_children.size() <= n_dofs_on_children,
754 for (
unsigned int row = 0; row != dofs_on_children.size();
757 constraints.
add_line(dofs_on_children[row]);
758 for (
unsigned int i = 0; i != dofs_on_mother.size(); ++i)
759 constraints.
add_entry(dofs_on_children[row],
772 if (!cell->at_boundary(face) &&
773 !cell->neighbor(face)->is_artificial())
775 Assert(cell->face(face)->n_active_fe_indices() == 1,
777 Assert(cell->face(face)->fe_index_is_active(
778 cell->active_fe_index()) ==
true,
787 template <
int dim_,
int spacedim,
typename number>
792 std::integral_constant<int, 3>)
794 const unsigned int dim = 3;
796 std::vector<types::global_dof_index> dofs_on_mother;
797 std::vector<types::global_dof_index> dofs_on_children;
809 endc = dof_handler.
end();
810 for (; cell != endc; ++cell)
814 if (cell->is_artificial())
817 for (
const unsigned int face : cell->face_indices())
818 if (cell->face(face)->has_children())
826 Assert(cell->face(face)->refinement_case() ==
835 Assert(cell->face(face)->fe_index_is_active(
836 cell->active_fe_index()) ==
true,
838 for (
unsigned int c = 0; c < cell->face(face)->n_children();
840 if (!cell->neighbor_child_on_subface(face, c)
843 cell->face(face)->child(c)->n_active_fe_indices(), 1);
848 for (
unsigned int c = 0; c < cell->face(face)->n_children();
850 if (!cell->neighbor_child_on_subface(face, c)
853 Assert(cell->face(face)->child(c)->fe_index_is_active(
854 cell->active_fe_index()) ==
true,
856 for (
unsigned int e = 0;
e < 4; ++
e)
861 ->n_active_fe_indices() == 1,
866 ->fe_index_is_active(
867 cell->active_fe_index()) ==
true,
871 for (
unsigned int e = 0;
e < 4; ++
e)
873 Assert(cell->face(face)->line(
e)->n_active_fe_indices() ==
876 Assert(cell->face(face)->line(
e)->fe_index_is_active(
877 cell->active_fe_index()) ==
true,
883 const unsigned int fe_index = cell->active_fe_index();
886 const unsigned int n_dofs_on_children =
893 dofs_on_mother.resize(n_dofs_on_mother);
896 dofs_on_children.clear();
897 dofs_on_children.reserve(n_dofs_on_children);
907 this_face = cell->face(face);
911 unsigned int next_index = 0;
912 for (
unsigned int vertex = 0; vertex < 4; ++vertex)
915 dofs_on_mother[next_index++] =
916 this_face->vertex_dof_index(vertex, dof, fe_index);
917 for (
unsigned int line = 0; line < 4; ++line)
919 dofs_on_mother[next_index++] =
920 this_face->line(line)->dof_index(dof, fe_index);
923 dofs_on_mother[next_index++] =
924 this_face->dof_index(dof, fe_index);
933 ((this_face->child(0)->vertex_index(3) ==
934 this_face->child(1)->vertex_index(2)) &&
935 (this_face->child(0)->vertex_index(3) ==
936 this_face->child(2)->vertex_index(1)) &&
937 (this_face->child(0)->vertex_index(3) ==
938 this_face->child(3)->vertex_index(0))),
942 dofs_on_children.push_back(
943 this_face->child(0)->vertex_dof_index(3, dof));
946 for (
unsigned int line = 0; line < 4; ++line)
949 dofs_on_children.push_back(
950 this_face->line(line)->child(0)->vertex_dof_index(
957 dofs_on_children.push_back(
958 this_face->child(0)->line(1)->dof_index(dof, fe_index));
960 dofs_on_children.push_back(
961 this_face->child(2)->line(1)->dof_index(dof, fe_index));
963 dofs_on_children.push_back(
964 this_face->child(0)->line(3)->dof_index(dof, fe_index));
966 dofs_on_children.push_back(
967 this_face->child(1)->line(3)->dof_index(dof, fe_index));
970 for (
unsigned int line = 0; line < 4; ++line)
971 for (
unsigned int child = 0; child < 2; ++child)
975 dofs_on_children.push_back(
976 this_face->line(line)->child(child)->dof_index(
981 for (
unsigned int child = 0; child < 4; ++child)
984 if (cell->neighbor_child_on_subface(face, child)
989 dofs_on_children.push_back(
990 this_face->child(child)->dof_index(dof, fe_index));
994 Assert(dofs_on_children.size() <= n_dofs_on_children,
998 for (
unsigned int row = 0; row != dofs_on_children.size();
1001 constraints.
add_line(dofs_on_children[row]);
1002 for (
unsigned int i = 0; i != dofs_on_mother.size(); ++i)
1003 constraints.
add_entry(dofs_on_children[row],
1016 if (!cell->at_boundary(face) &&
1017 !cell->neighbor(face)->is_artificial())
1019 Assert(cell->face(face)->n_active_fe_indices() == 1,
1021 Assert(cell->face(face)->fe_index_is_active(
1022 cell->active_fe_index()) ==
true,
1031 template <
int dim,
int spacedim,
typename number>
1049 std::vector<types::global_dof_index> primary_dofs;
1050 std::vector<types::global_dof_index> dependent_dofs;
1051 std::vector<types::global_dof_index> scratch_dofs;
1057 n_finite_elements(dof_handler), n_finite_elements(dof_handler));
1059 subface_interpolation_matrices(
1060 n_finite_elements(dof_handler),
1061 n_finite_elements(dof_handler),
1071 split_face_interpolation_matrices(n_finite_elements(dof_handler),
1072 n_finite_elements(dof_handler));
1078 n_finite_elements(dof_handler), n_finite_elements(dof_handler));
1089 if (cell->is_artificial())
1092 for (
const unsigned int face : cell->face_indices())
1093 if (cell->face(face)->has_children())
1098 if (cell->get_fe().n_dofs_per_face(face) == 0)
1101 Assert(cell->face(face)->refinement_case() ==
1112 Assert(cell->face(face)->n_active_fe_indices() == 1,
1114 Assert(cell->face(face)->fe_index_is_active(
1115 cell->active_fe_index()) ==
true,
1117 for (
unsigned int c = 0; c < cell->face(face)->n_children();
1119 if (!cell->neighbor_child_on_subface(face, c)
1121 Assert(cell->face(face)->child(c)->n_active_fe_indices() ==
1137 std::set<unsigned int> fe_ind_face_subface;
1138 fe_ind_face_subface.insert(cell->active_fe_index());
1141 for (
unsigned int c = 0;
1142 c < cell->face(face)->n_active_descendants();
1145 const auto subcell =
1146 cell->neighbor_child_on_subface(face, c);
1147 if (!subcell->is_artificial())
1149 mother_face_dominates =
1150 mother_face_dominates &
1151 (cell->get_fe().compare_for_domination(
1152 subcell->get_fe(), 1));
1153 fe_ind_face_subface.insert(
1154 subcell->active_fe_index());
1158 switch (mother_face_dominates)
1170 primary_dofs.resize(
1171 cell->get_fe().n_dofs_per_face(face));
1173 cell->face(face)->get_dof_indices(
1174 primary_dofs, cell->active_fe_index());
1180 for (
unsigned int c = 0;
1181 c < cell->face(face)->n_children();
1184 if (cell->neighbor_child_on_subface(face, c)
1189 active_face_iterator subface =
1190 cell->face(face)->child(c);
1192 Assert(subface->n_active_fe_indices() == 1,
1195 const unsigned int subface_fe_index =
1196 subface->nth_active_fe_index(0);
1207 if (cell->get_fe().compare_for_domination(
1208 subface->
get_fe(subface_fe_index),
1215 dependent_dofs.resize(
1216 subface->
get_fe(subface_fe_index)
1218 subface->get_dof_indices(dependent_dofs,
1224 (void)dependent_dof;
1252 ensure_existence_of_subface_matrix(
1254 subface->
get_fe(subface_fe_index),
1256 subface_interpolation_matrices
1257 [cell->active_fe_index()][subface_fe_index][c]);
1261 filter_constraints(primary_dofs,
1263 *(subface_interpolation_matrices
1264 [cell->active_fe_index()]
1265 [subface_fe_index][c]),
1285 const ::hp::FECollection<dim, spacedim>
1312 const unsigned int dominating_fe_index =
1314 fe_ind_face_subface, 1);
1319 "Could not find a least face dominating FE."));
1322 dof_handler.
get_fe(dominating_fe_index);
1327 cell->get_fe().n_dofs_per_face(face),
1330 ensure_existence_of_face_matrix(
1333 face_interpolation_matrices[dominating_fe_index]
1334 [cell->active_fe_index()]);
1338 ensure_existence_of_primary_dof_mask(
1341 (*face_interpolation_matrices
1342 [dominating_fe_index][cell->active_fe_index()]),
1343 primary_dof_masks[dominating_fe_index]
1344 [cell->active_fe_index()]);
1346 ensure_existence_of_split_face_matrix(
1347 *face_interpolation_matrices[dominating_fe_index]
1348 [cell->active_fe_index()],
1349 (*primary_dof_masks[dominating_fe_index]
1350 [cell->active_fe_index()]),
1351 split_face_interpolation_matrices
1352 [dominating_fe_index][cell->active_fe_index()]);
1355 &restrict_mother_to_virtual_primary_inv =
1356 (split_face_interpolation_matrices
1357 [dominating_fe_index][cell->active_fe_index()]
1361 &restrict_mother_to_virtual_dependent =
1362 (split_face_interpolation_matrices
1363 [dominating_fe_index][cell->active_fe_index()]
1368 constraint_matrix.reinit(
1369 cell->get_fe().n_dofs_per_face(face) -
1372 restrict_mother_to_virtual_dependent.
mmult(
1374 restrict_mother_to_virtual_primary_inv);
1378 scratch_dofs.resize(
1379 cell->get_fe().n_dofs_per_face(face));
1380 cell->face(face)->get_dof_indices(
1381 scratch_dofs, cell->active_fe_index());
1384 primary_dofs.clear();
1385 dependent_dofs.clear();
1386 for (
unsigned int i = 0;
1387 i < cell->get_fe().n_dofs_per_face(face);
1389 if ((*primary_dof_masks[dominating_fe_index]
1391 ->active_fe_index()])[i] ==
1393 primary_dofs.push_back(scratch_dofs[i]);
1395 dependent_dofs.push_back(scratch_dofs[i]);
1400 cell->get_fe().n_dofs_per_face(face) -
1403 filter_constraints(primary_dofs,
1412 for (
unsigned int sf = 0;
1413 sf < cell->face(face)->n_children();
1418 if (cell->neighbor_child_on_subface(face, sf)
1419 ->is_artificial() ||
1420 (dim == 2 && cell->is_ghost() &&
1421 cell->neighbor_child_on_subface(face, sf)
1427 ->n_active_fe_indices() == 1,
1430 const unsigned int subface_fe_index =
1431 cell->face(face)->child(sf)->nth_active_fe_index(
1434 dof_handler.
get_fe(subface_fe_index);
1441 ensure_existence_of_subface_matrix(
1445 subface_interpolation_matrices
1446 [dominating_fe_index][subface_fe_index][sf]);
1449 &restrict_subface_to_virtual = *(
1450 subface_interpolation_matrices
1451 [dominating_fe_index][subface_fe_index][sf]);
1453 constraint_matrix.reinit(
1457 restrict_subface_to_virtual.
mmult(
1459 restrict_mother_to_virtual_primary_inv);
1461 dependent_dofs.resize(
1463 cell->face(face)->child(sf)->get_dof_indices(
1464 dependent_dofs, subface_fe_index);
1466 filter_constraints(primary_dofs,
1489 Assert(cell->face(face)->fe_index_is_active(
1490 cell->active_fe_index()) ==
true,
1497 if (!cell->at_boundary(face) &&
1498 cell->neighbor(face)->is_artificial())
1504 !cell->face(face)->at_boundary() &&
1505 (cell->neighbor(face)->active_fe_index() !=
1506 cell->active_fe_index()) &&
1507 (!cell->face(face)->has_children() &&
1508 !cell->neighbor_is_coarser(face)))
1511 spacedim>::level_cell_iterator
1512 neighbor = cell->neighbor(face);
1516 cell->get_fe().compare_for_domination(neighbor->get_fe(),
1523 primary_dofs.resize(
1524 cell->get_fe().n_dofs_per_face(face));
1525 cell->face(face)->get_dof_indices(
1526 primary_dofs, cell->active_fe_index());
1531 if (primary_dofs.size() == 0)
1534 dependent_dofs.resize(
1535 neighbor->get_fe().n_dofs_per_face(face));
1536 cell->face(face)->get_dof_indices(
1537 dependent_dofs, neighbor->active_fe_index());
1541 ensure_existence_of_face_matrix(
1544 face_interpolation_matrices
1545 [cell->active_fe_index()]
1546 [neighbor->active_fe_index()]);
1552 *(face_interpolation_matrices
1553 [cell->active_fe_index()]
1554 [neighbor->active_fe_index()]),
1597 if (cell < neighbor)
1611 const unsigned int this_fe_index =
1612 cell->active_fe_index();
1613 const unsigned int neighbor_fe_index =
1614 neighbor->active_fe_index();
1615 std::set<unsigned int> fes;
1616 fes.insert(this_fe_index);
1617 fes.insert(neighbor_fe_index);
1618 const ::hp::FECollection<dim, spacedim>
1621 const unsigned int dominating_fe_index =
1626 dominating_fe_index !=
1629 "Could not find the dominating FE for " +
1630 cell->get_fe().get_name() +
" and " +
1631 neighbor->get_fe().get_name() +
1632 " inside FECollection."));
1635 fe_collection[dominating_fe_index];
1643 cell->get_fe().n_dofs_per_face(face),
1646 ensure_existence_of_face_matrix(
1649 face_interpolation_matrices
1650 [dominating_fe_index][cell->active_fe_index()]);
1654 ensure_existence_of_primary_dof_mask(
1657 (*face_interpolation_matrices
1658 [dominating_fe_index]
1659 [cell->active_fe_index()]),
1660 primary_dof_masks[dominating_fe_index]
1661 [cell->active_fe_index()]);
1663 ensure_existence_of_split_face_matrix(
1664 *face_interpolation_matrices
1665 [dominating_fe_index][cell->active_fe_index()],
1666 (*primary_dof_masks[dominating_fe_index]
1667 [cell->active_fe_index()]),
1668 split_face_interpolation_matrices
1669 [dominating_fe_index][cell->active_fe_index()]);
1672 double> &restrict_mother_to_virtual_primary_inv =
1673 (split_face_interpolation_matrices
1674 [dominating_fe_index][cell->active_fe_index()]
1678 double> &restrict_mother_to_virtual_dependent =
1679 (split_face_interpolation_matrices
1680 [dominating_fe_index][cell->active_fe_index()]
1685 constraint_matrix.reinit(
1686 cell->get_fe().n_dofs_per_face(face) -
1689 restrict_mother_to_virtual_dependent.
mmult(
1691 restrict_mother_to_virtual_primary_inv);
1695 scratch_dofs.resize(
1696 cell->get_fe().n_dofs_per_face(face));
1697 cell->face(face)->get_dof_indices(
1698 scratch_dofs, cell->active_fe_index());
1701 primary_dofs.clear();
1702 dependent_dofs.clear();
1703 for (
unsigned int i = 0;
1704 i < cell->get_fe().n_dofs_per_face(face);
1706 if ((*primary_dof_masks[dominating_fe_index]
1707 [cell->active_fe_index()])
1709 primary_dofs.push_back(scratch_dofs[i]);
1711 dependent_dofs.push_back(scratch_dofs[i]);
1717 dependent_dofs.size(),
1718 cell->get_fe().n_dofs_per_face(face) -
1721 filter_constraints(primary_dofs,
1730 neighbor->get_fe().n_dofs_per_face(face),
1733 ensure_existence_of_face_matrix(
1736 face_interpolation_matrices
1737 [dominating_fe_index]
1738 [neighbor->active_fe_index()]);
1741 &restrict_secondface_to_virtual =
1742 *(face_interpolation_matrices
1743 [dominating_fe_index]
1744 [neighbor->active_fe_index()]);
1746 constraint_matrix.reinit(
1747 neighbor->get_fe().n_dofs_per_face(face),
1750 restrict_secondface_to_virtual.
mmult(
1752 restrict_mother_to_virtual_primary_inv);
1754 dependent_dofs.resize(
1755 neighbor->get_fe().n_dofs_per_face(face));
1756 cell->face(face)->get_dof_indices(
1757 dependent_dofs, neighbor->active_fe_index());
1759 filter_constraints(primary_dofs,
1785 template <
int dim,
int spacedim,
typename number>
1792 "The given DoFHandler does not have any DoFs. Did you forget to "
1793 "call dof_handler.distribute_dofs()?"));
1803 dof_handler, constraints, std::integral_constant<int, dim>());
1835 template <
typename FaceIterator,
typename number>
1837 set_periodicity_constraints(
1838 const FaceIterator & face_1,
1843 const bool face_orientation,
1844 const bool face_flip,
1845 const bool face_rotation,
1846 const number periodicity_factor)
1848 static const int dim = FaceIterator::AccessorType::dimension;
1849 static const int spacedim = FaceIterator::AccessorType::space_dimension;
1859 face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1);
1861 face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1);
1862 const unsigned int face_no = 0;
1867 if (face_2->has_children())
1869 Assert(face_2->n_children() ==
1873 const unsigned int dofs_per_face =
1874 face_1->get_fe(face_1->nth_active_fe_index(0))
1875 .n_dofs_per_face(face_no);
1880 for (
unsigned int c = 0; c < face_2->n_children(); ++c)
1885 const auto &fe = face_1->get_fe(face_1->nth_active_fe_index(0));
1886 fe.get_subface_interpolation_matrix(fe,
1888 subface_interpolation,
1890 subface_interpolation.mmult(child_transformation, transformation);
1892 set_periodicity_constraints(face_1,
1894 child_transformation,
1900 periodicity_factor);
1910 const unsigned int face_1_index = face_1->nth_active_fe_index(0);
1911 const unsigned int face_2_index = face_2->nth_active_fe_index(0);
1912 Assert(face_1->get_fe(face_1_index) == face_2->get_fe(face_2_index),
1914 "Matching periodic cells need to use the same finite element"));
1920 "The number of components in the mask has to be either "
1921 "zero or equal to the number of components in the finite "
1926 std::vector<types::global_dof_index> dofs_1(dofs_per_face);
1927 std::vector<types::global_dof_index> dofs_2(dofs_per_face);
1929 face_1->get_dof_indices(dofs_1, face_1_index);
1930 face_2->get_dof_indices(dofs_2, face_2_index);
1948 for (
unsigned int i = 0; i < dofs_per_face; i++)
1970 std::map<unsigned int, unsigned int> cell_to_rotated_face_index;
1973 for (
unsigned int i = 0; i < dofs_per_face; ++i)
1992 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2013 bool is_identity_constrained =
false;
2015 number constraint_factor = periodicity_factor;
2017 constexpr double eps = 1.e-13;
2018 for (
unsigned int jj = 0; jj < dofs_per_face; ++jj)
2020 const auto entry = transformation(i, jj);
2023 if (is_identity_constrained)
2028 is_identity_constrained =
false;
2031 is_identity_constrained =
true;
2033 constraint_factor = entry * periodicity_factor;
2042 if (!is_identity_constrained)
2050 affine_constraints.
add_line(dofs_2[i]);
2052 for (
unsigned int jj = 0; jj < dofs_per_face; ++jj)
2056 const unsigned int j =
2058 jj, 0, face_orientation, face_flip, face_rotation)];
2063 transformation(i, jj));
2074 const unsigned int j =
2076 target, 0, face_orientation, face_flip, face_rotation)];
2078 auto dof_left = dofs_1[j];
2079 auto dof_right = dofs_2[i];
2085 (dof_left < dof_right &&
2089 constraint_factor = 1. / constraint_factor;
2105 bool constraints_are_cyclic =
true;
2106 number cycle_constraint_factor = constraint_factor;
2108 for (
auto test_dof = dof_right; test_dof != dof_left;)
2112 constraints_are_cyclic =
false;
2116 const auto &constraint_entries =
2118 if (constraint_entries.size() == 1)
2120 test_dof = constraint_entries[0].first;
2121 cycle_constraint_factor *= constraint_entries[0].second;
2125 constraints_are_cyclic =
false;
2140 if (constraints_are_cyclic)
2143 affine_constraints.
add_line(dof_left);
2147 affine_constraints.
add_line(dof_left);
2172 std::abs(constraint_factor) < 1e10,
2174 "The periodicity constraint is too large. The parameter periodicity_factor might be too large or too small."));
2186 template <
int dim,
int spacedim>
2188 compute_transformation(
2191 const std::vector<unsigned int> & first_vector_components)
2196 const unsigned int face_no = 0;
2202 if (
matrix.m() == n_dofs_per_face)
2209 if (first_vector_components.empty() &&
matrix.m() == 0)
2222 quadrature(fe.get_unit_face_support_points(face_no));
2226 using DoFTuple =
std::array<
unsigned int, spacedim>;
2231 for (
unsigned int i = 0; i < n_dofs_per_face; ++i)
2233 std::vector<unsigned int>::const_iterator comp_it =
2234 std::find(first_vector_components.begin(),
2235 first_vector_components.end(),
2237 if (comp_it != first_vector_components.end())
2239 const unsigned int first_vector_component = *comp_it;
2242 DoFTuple vector_dofs;
2244 unsigned int n_found = 1;
2249 "Error: the finite element does not have enough components "
2250 "to define rotated periodic boundaries."));
2252 for (
unsigned int k = 0; k < n_dofs_per_face; ++k)
2253 if ((k != i) && (quadrature.point(k) == quadrature.point(i)) &&
2255 first_vector_component) &&
2257 first_vector_component + spacedim))
2261 first_vector_component] = k;
2269 for (
int i = 0; i < spacedim; ++i)
2271 transformation[vector_dofs[i]][vector_dofs[i]] = 0.;
2272 for (
int j = 0; j < spacedim; ++j)
2273 transformation[vector_dofs[i]][vector_dofs[j]] =
2278 return transformation;
2286 template <
typename FaceIterator,
typename number>
2289 const FaceIterator & face_1,
2293 const bool face_orientation,
2294 const bool face_flip,
2295 const bool face_rotation,
2297 const std::vector<unsigned int> & first_vector_components,
2298 const number periodicity_factor)
2303 face_1->get_fe(face_1->nth_active_fe_index(0)).n_unique_faces(), 1);
2305 face_2->get_fe(face_2->nth_active_fe_index(0)).n_unique_faces(), 1);
2306 const unsigned int face_no = 0;
2308 static const int dim = FaceIterator::AccessorType::dimension;
2309 static const int spacedim = FaceIterator::AccessorType::space_dimension;
2311 Assert((dim != 1) || (face_orientation ==
true && face_flip ==
false &&
2312 face_rotation ==
false),
2314 "(face_orientation, face_flip, face_rotation) "
2315 "is invalid for 1D"));
2317 Assert((dim != 2) || (face_orientation ==
true && face_rotation ==
false),
2319 "(face_orientation, face_flip, face_rotation) "
2320 "is invalid for 2D"));
2323 ExcMessage(
"face_1 and face_2 are equal! Cannot constrain DoFs "
2324 "on the very same face"));
2326 Assert(face_1->at_boundary() && face_2->at_boundary(),
2327 ExcMessage(
"Faces for periodicity constraints must be on the "
2331 ExcMessage(
"The supplied (rotation or interpolation) matrix must "
2332 "be a square matrix"));
2334 Assert(first_vector_components.empty() ||
matrix.m() == spacedim,
2335 ExcMessage(
"first_vector_components is nonempty, so matrix must "
2336 "be a rotation matrix exactly of size spacedim"));
2339 if (!face_1->has_children())
2342 const unsigned int n_dofs_per_face =
2343 face_1->get_fe(face_1->nth_active_fe_index(0))
2344 .n_dofs_per_face(face_no);
2347 (first_vector_components.empty() &&
2348 matrix.m() == n_dofs_per_face) ||
2349 (!first_vector_components.empty() &&
matrix.m() == spacedim),
2351 "The matrix must have either size 0 or spacedim "
2352 "(if first_vector_components is nonempty) "
2353 "or the size must be equal to the # of DoFs on the face "
2354 "(if first_vector_components is empty)."));
2357 if (!face_2->has_children())
2360 const unsigned int n_dofs_per_face =
2361 face_2->get_fe(face_2->nth_active_fe_index(0))
2362 .n_dofs_per_face(face_no);
2365 (first_vector_components.empty() &&
2366 matrix.m() == n_dofs_per_face) ||
2367 (!first_vector_components.empty() &&
matrix.m() == spacedim),
2369 "The matrix must have either size 0 or spacedim "
2370 "(if first_vector_components is nonempty) "
2371 "or the size must be equal to the # of DoFs on the face "
2372 "(if first_vector_components is empty)."));
2379 static const int lookup_table_2d[2][2] = {
2385 static const int lookup_table_3d[2][2][2][4] = {
2409 if (face_1->has_children() && face_2->has_children())
2414 Assert(face_1->n_children() ==
2416 face_2->n_children() ==
2420 for (
unsigned int i = 0; i < GeometryInfo<dim>::max_children_per_face;
2428 j = lookup_table_2d[face_flip][i];
2431 j = lookup_table_3d[face_orientation][face_flip]
2446 first_vector_components,
2447 periodicity_factor);
2457 face_1->has_children() ?
2458 face_2->get_fe(face_2->nth_active_fe_index(0)) :
2459 face_1->get_fe(face_1->nth_active_fe_index(0));
2465 if (n_dofs_per_face == 0)
2469 compute_transformation(fe,
matrix, first_vector_components);
2471 if (!face_2->has_children())
2475 if (first_vector_components.empty() &&
matrix.m() == 0)
2477 set_periodicity_constraints(face_2,
2485 periodicity_factor);
2490 inverse.
invert(transformation);
2492 set_periodicity_constraints(face_2,
2500 periodicity_factor);
2513 set_periodicity_constraints(face_1,
2520 face_rotation ^ face_flip :
2523 periodicity_factor);
2530 template <
int dim,
int spacedim,
typename number>
2537 const std::vector<unsigned int> &first_vector_components,
2538 const number periodicity_factor)
2541 for (
auto &pair : periodic_faces)
2544 const FaceIterator face_1 = pair.cell[0]->face(pair.face_idx[0]);
2545 const FaceIterator face_2 = pair.cell[1]->face(pair.face_idx[1]);
2547 Assert(face_1->at_boundary() && face_2->at_boundary(),
2558 pair.orientation[0],
2559 pair.orientation[1],
2560 pair.orientation[2],
2562 first_vector_components,
2563 periodicity_factor);
2571 template <
int dim,
int spacedim,
typename number>
2576 const unsigned int direction,
2579 const number periodicity_factor)
2584 ExcMessage(
"The boundary indicators b_id1 and b_id2 must be "
2585 "different to denote different boundaries."));
2593 dof_handler, b_id1, b_id2, direction, matched_faces);
2595 make_periodicity_constraints<dim, spacedim>(matched_faces,
2598 std::vector<unsigned int>(),
2599 periodicity_factor);
2604 template <
int dim,
int spacedim,
typename number>
2608 const unsigned int direction,
2611 const number periodicity_factor)
2627 make_periodicity_constraints<dim, spacedim>(matched_faces,
2630 std::vector<unsigned int>(),
2631 periodicity_factor);
2644 template <
int dim,
int spacedim>
2649#ifdef DEAL_II_WITH_MPI
2650 std::vector<::LinearAlgebra::distributed::Vector<double>>
2665 template <
int dim,
int spacedim>
2667 compute_intergrid_weights_3(
2668 const typename ::DoFHandler<dim, spacedim>::active_cell_iterator
2672 const unsigned int coarse_component,
2675 & coarse_to_fine_grid_map,
2732 for (
unsigned int local_dof = 0; local_dof < copy_data.
dofs_per_cell;
2738 const unsigned int local_parameter_dof =
2747 coarse_to_fine_grid_map[cell]->set_dof_values_by_interpolation(
2748 parameter_dofs[local_parameter_dof],
2760 template <
int dim,
int spacedim>
2762 copy_intergrid_weights_3(
2763 const Assembler::CopyData<dim, spacedim> & copy_data,
2764 const unsigned int coarse_component,
2766 const std::vector<types::global_dof_index> &weight_mapping,
2767 const bool is_called_in_parallel,
2768 std::vector<std::map<types::global_dof_index, float>> &weights)
2770 unsigned int pos = 0;
2771 for (
unsigned int local_dof = 0; local_dof < copy_data.dofs_per_cell;
2798 i < copy_data.global_parameter_representation[pos].size();
2804 if (copy_data.global_parameter_representation[pos](i) != 0)
2807 wi = copy_data.parameter_dof_indices[local_dof],
2808 wj = weight_mapping[i];
2810 copy_data.global_parameter_representation[pos](i);
2813 else if (!is_called_in_parallel)
2818 Assert(copy_data.global_parameter_representation[pos](i) ==
2834 template <
int dim,
int spacedim>
2836 compute_intergrid_weights_2(
2837 const ::DoFHandler<dim, spacedim> &coarse_grid,
2838 const unsigned int coarse_component,
2840 & coarse_to_fine_grid_map,
2842 const std::vector<types::global_dof_index> &weight_mapping,
2843 std::vector<std::map<types::global_dof_index, float>> &weights)
2845 Assembler::Scratch scratch;
2846 Assembler::CopyData<dim, spacedim> copy_data;
2848 unsigned int n_interesting_dofs = 0;
2849 for (
unsigned int local_dof = 0;
2850 local_dof < coarse_grid.get_fe().n_dofs_per_cell();
2852 if (coarse_grid.get_fe().system_to_component_index(local_dof).first ==
2854 ++n_interesting_dofs;
2856 copy_data.global_parameter_representation.resize(n_interesting_dofs);
2858 bool is_called_in_parallel =
false;
2859 for (std::size_t i = 0;
2860 i < copy_data.global_parameter_representation.size();
2863#ifdef DEAL_II_WITH_MPI
2864 MPI_Comm communicator = MPI_COMM_SELF;
2867 const typename ::parallel::TriangulationBase<dim,
2869 &tria =
dynamic_cast<const typename ::parallel::
2870 TriangulationBase<dim, spacedim> &
>(
2871 coarse_to_fine_grid_map.get_destination_grid()
2872 .get_triangulation());
2873 communicator = tria.get_communicator();
2874 is_called_in_parallel =
true;
2876 catch (std::bad_cast &)
2884 coarse_to_fine_grid_map.get_destination_grid(),
2885 locally_relevant_dofs);
2887 copy_data.global_parameter_representation[i].reinit(
2888 coarse_to_fine_grid_map.get_destination_grid()
2889 .locally_owned_dofs(),
2890 locally_relevant_dofs,
2894 copy_data.global_parameter_representation[i].reinit(n_fine_dofs);
2901 &coarse_to_fine_grid_map,
2902 ¶meter_dofs](
const typename ::DoFHandler<dim, spacedim>::
2903 active_cell_iterator & cell,
2904 const Assembler::Scratch & scratch_data,
2905 Assembler::CopyData<dim, spacedim> ©_data) {
2906 compute_intergrid_weights_3<dim, spacedim>(cell,
2910 coarse_grid.get_fe(),
2911 coarse_to_fine_grid_map,
2919 is_called_in_parallel,
2920 &weights](
const Assembler::CopyData<dim, spacedim> ©_data) {
2921 copy_intergrid_weights_3<dim, spacedim>(copy_data,
2923 coarse_grid.get_fe(),
2925 is_called_in_parallel,
2936#ifdef DEAL_II_WITH_MPI
2937 for (std::size_t i = 0;
2938 i < copy_data.global_parameter_representation.size();
2940 copy_data.global_parameter_representation[i].update_ghost_values();
2951 template <
int dim,
int spacedim>
2953 compute_intergrid_weights_1(
2954 const ::DoFHandler<dim, spacedim> &coarse_grid,
2955 const unsigned int coarse_component,
2956 const ::DoFHandler<dim, spacedim> &fine_grid,
2957 const unsigned int fine_component,
2959 &coarse_to_fine_grid_map,
2960 std::vector<std::map<types::global_dof_index, float>> &weights,
2961 std::vector<types::global_dof_index> & weight_mapping)
2965 &fine_fe = fine_grid.get_fe();
2969 n_fine_dofs = fine_grid.n_dofs();
2972 const unsigned int fine_dofs_per_cell = fine_fe.n_dofs_per_cell();
2976 const unsigned int coarse_dofs_per_cell_component =
2985 Assert(coarse_grid.get_triangulation().n_cells(0) ==
2986 fine_grid.get_triangulation().n_cells(0),
2990 Assert(&coarse_to_fine_grid_map.get_source_grid() == &coarse_grid,
2992 Assert(&coarse_to_fine_grid_map.get_destination_grid() == &fine_grid,
3004 fine_fe.component_to_base_index(fine_component).first),
3010 for (
const auto &cell : coarse_grid.active_cell_iterators())
3011 Assert(cell->level() <= coarse_to_fine_grid_map[cell]->level(),
3036 std::vector<::Vector<double>> parameter_dofs(
3037 coarse_dofs_per_cell_component,
3042 for (
unsigned int local_coarse_dof = 0;
3043 local_coarse_dof < coarse_dofs_per_cell_component;
3045 for (
unsigned int fine_dof = 0; fine_dof < fine_fe.n_dofs_per_cell();
3047 if (fine_fe.system_to_component_index(fine_dof) ==
3048 std::make_pair(fine_component, local_coarse_dof))
3050 parameter_dofs[local_coarse_dof](fine_dof) = 1.;
3057 unsigned int n_parameters_on_fine_grid = 0;
3061 std::vector<bool> dof_is_interesting(fine_grid.n_dofs(),
false);
3062 std::vector<types::global_dof_index> local_dof_indices(
3063 fine_fe.n_dofs_per_cell());
3065 for (
const auto &cell : fine_grid.active_cell_iterators())
3066 if (cell->is_locally_owned())
3068 cell->get_dof_indices(local_dof_indices);
3069 for (
unsigned int i = 0; i < fine_fe.n_dofs_per_cell(); ++i)
3070 if (fine_fe.system_to_component_index(i).first ==
3072 dof_is_interesting[local_dof_indices[i]] =
true;
3075 n_parameters_on_fine_grid = std::count(dof_is_interesting.begin(),
3076 dof_is_interesting.end(),
3083 weights.resize(n_coarse_dofs);
3085 weight_mapping.clear();
3089 std::vector<types::global_dof_index> local_dof_indices(
3090 fine_fe.n_dofs_per_cell());
3091 unsigned int next_free_index = 0;
3092 for (
const auto &cell : fine_grid.active_cell_iterators())
3093 if (cell->is_locally_owned())
3095 cell->get_dof_indices(local_dof_indices);
3096 for (
unsigned int i = 0; i < fine_fe.n_dofs_per_cell(); ++i)
3099 if ((fine_fe.system_to_component_index(i).first ==
3101 (weight_mapping[local_dof_indices[i]] ==
3104 weight_mapping[local_dof_indices[i]] = next_free_index;
3109 Assert(next_free_index == n_parameters_on_fine_grid,
3121 compute_intergrid_weights_2(coarse_grid,
3123 coarse_to_fine_grid_map,
3143 for (
unsigned int col = 0; col < n_parameters_on_fine_grid; ++col)
3147 if (weights[row].find(col) != weights[row].
end())
3148 sum += weights[row][col];
3156 return n_parameters_on_fine_grid;
3165 template <
int dim,
int spacedim>
3169 const unsigned int coarse_component,
3171 const unsigned int fine_component,
3177 ExcMessage(
"This function is not yet implemented for DoFHandlers "
3178 "using hp-capabilities."));
3199 std::vector<std::map<types::global_dof_index, float>> weights;
3205 std::vector<types::global_dof_index> weight_mapping;
3207 const unsigned int n_parameters_on_fine_grid =
3208 internal::compute_intergrid_weights_1(coarse_grid,
3212 coarse_to_fine_grid_map,
3215 (void)n_parameters_on_fine_grid;
3219 n_fine_dofs = fine_grid.
n_dofs();
3227 mask[coarse_component] =
true;
3229 coarse_dof_is_parameter =
3230 extract_dofs<dim, spacedim>(coarse_grid,
ComponentMask(mask));
3242 std::vector<types::global_dof_index> representants(
3245 parameter_dof < n_coarse_dofs;
3247 if (coarse_dof_is_parameter.
is_element(parameter_dof))
3254 std::map<types::global_dof_index, float>::const_iterator i =
3255 weights[parameter_dof].begin();
3256 for (; i != weights[parameter_dof].end(); ++i)
3266 for (; global_dof < weight_mapping.size(); ++global_dof)
3267 if (weight_mapping[global_dof] ==
3273 representants[parameter_dof] = global_dof;
3289 std::vector<std::pair<types::global_dof_index, double>> constraint_line;
3308 std::map<types::global_dof_index, float>::const_iterator col_entry =
3310 for (; first_used_row < n_coarse_dofs; ++first_used_row)
3312 col_entry = weights[first_used_row].find(col);
3313 if (col_entry != weights[first_used_row].
end())
3317 Assert(col_entry != weights[first_used_row].
end(),
3320 if ((col_entry->second == 1) &&
3321 (representants[first_used_row] == global_dof))
3331 constraint_line.clear();
3333 row < n_coarse_dofs;
3336 const std::map<types::global_dof_index, float>::const_iterator j =
3337 weights[row].find(col);
3338 if ((j != weights[row].
end()) && (j->second != 0))
3339 constraint_line.emplace_back(representants[row], j->second);
3342 constraints.
add_entries(global_dof, constraint_line);
3348 template <
int dim,
int spacedim>
3352 const unsigned int coarse_component,
3354 const unsigned int fine_component,
3356 std::vector<std::map<types::global_dof_index, float>>
3357 &transfer_representation)
3361 ExcMessage(
"This function is not yet implemented for DoFHandlers "
3362 "using hp-capabilities."));
3383 std::vector<std::map<types::global_dof_index, float>> weights;
3389 std::vector<types::global_dof_index> weight_mapping;
3391 internal::compute_intergrid_weights_1(coarse_grid,
3395 coarse_to_fine_grid_map,
3401 std::count_if(weight_mapping.begin(),
3402 weight_mapping.end(),
3404 return dof != numbers::invalid_dof_index;
3408 std::vector<types::global_dof_index> inverse_weight_mapping(
3417 Assert((inverse_weight_mapping[parameter_dof] ==
3421 inverse_weight_mapping[parameter_dof] = i;
3428 transfer_representation.clear();
3429 transfer_representation.resize(n_rows);
3434 std::map<types::global_dof_index, float>::const_iterator j =
3436 for (; j != weights[i].end(); ++j)
3441 transfer_representation[p][i] = j->second;
3448 template <
int dim,
int spacedim,
typename number>
3457 ExcMessage(
"The number of components in the mask has to be either "
3458 "zero or equal to the number of components in the finite "
3467 std::vector<types::global_dof_index> face_dofs;
3470 std::vector<types::global_dof_index> cell_dofs;
3476 for (; cell != endc; ++cell)
3477 if (!cell->is_artificial() && cell->at_boundary())
3483 cell->get_dof_indices(cell_dofs);
3485 for (
const auto face_no : cell->face_indices())
3488 cell->face(face_no);
3492 if (face->at_boundary() &&
3498 face->get_dof_indices(face_dofs, cell->active_fe_index());
3506 const std::vector<types::global_dof_index>::iterator
3507 it_index_on_cell = std::find(cell_dofs.begin(),
3510 Assert(it_index_on_cell != cell_dofs.end(),
3512 const unsigned int index_on_cell =
3513 std::distance(cell_dofs.begin(), it_index_on_cell);
3517 for (
unsigned int c = 0; c < n_components; ++c)
3518 if (nonzero_component_array[c] && component_mask[c])
3525 zero_boundary_constraints.
add_line(face_dof);
3534 template <
int dim,
int spacedim,
typename number>
3543 zero_boundary_constraints,
3554#include "dof_tools_constraints.inst"
void add_entries(const size_type constrained_dof_index, const std::vector< std::pair< size_type, number > > &col_weight_pairs)
void add_line(const size_type line_n)
void add_entry(const size_type constrained_dof_index, const size_type column, const number weight)
void set_inhomogeneity(const size_type constrained_dof_index, const number value)
bool is_constrained(const size_type line_n) const
const std::vector< std::pair< size_type, number > > * get_constraint_entries(const size_type line_n) const
bool represents_n_components(const unsigned int n) const
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
cell_iterator end() const
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
const hp::FECollection< dim, spacedim > & get_fe_collection() const
bool has_active_dofs() const
const Triangulation< dim, spacedim > & get_triangulation() const
active_cell_iterator begin_active(const unsigned int level=0) const
bool has_hp_capabilities() const
types::global_dof_index n_dofs() const
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_line() const
unsigned int n_dofs_per_face(unsigned int face_no=0, unsigned int child=0) const
unsigned int n_components() const
unsigned int n_unique_faces() const
unsigned int n_dofs_per_quad(unsigned int face_no=0) const
const ComponentMask & get_nonzero_components(const unsigned int i) const
virtual const FiniteElement< dim, spacedim > & base_element(const unsigned int index) const
std::pair< unsigned int, unsigned int > component_to_base_index(const unsigned int component) const
virtual unsigned int face_to_cell_index(const unsigned int face_dof_index, const unsigned int face, const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false) const
virtual void get_subface_interpolation_matrix(const FiniteElement< dim, spacedim > &source, const unsigned int subface, FullMatrix< double > &matrix, const unsigned int face_no=0) const
std::pair< unsigned int, unsigned int > system_to_component_index(const unsigned int index) const
const FullMatrix< double > & constraints(const ::internal::SubfaceCase< dim > &subface_case=::internal::SubfaceCase< dim >::case_isotropic) const
virtual void get_face_interpolation_matrix(const FiniteElement< dim, spacedim > &source, FullMatrix< double > &matrix, const unsigned int face_no=0) const
std::pair< unsigned int, unsigned int > face_system_to_component_index(const unsigned int index, const unsigned int face_no=0) const
void mmult(FullMatrix< number2 > &C, const FullMatrix< number2 > &B, const bool adding=false) const
void invert(const FullMatrix< number2 > &M)
bool is_element(const size_type index) const
bool get_anisotropic_refinement_flag() const
unsigned int size() const
unsigned int find_dominating_fe_extended(const std::set< unsigned int > &fes, const unsigned int codim=0) const
bool hp_constraints_are_implemented() const
unsigned int max_dofs_per_face() const
unsigned int n_components() const
unsigned int max_dofs_per_cell() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators() const
static ::ExceptionBase & ExcInvalidIterator()
static ::ExceptionBase & ExcGridNotCoarser()
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcFiniteElementsDontMatch()
static ::ExceptionBase & ExcNoComponentSelected()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcGridsDontMatch()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::line_iterator line_iterator
typename ActiveSelector::face_iterator face_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
void compute_intergrid_transfer_representation(const DoFHandler< dim, spacedim > &coarse_grid, const unsigned int coarse_component, const DoFHandler< dim, spacedim > &fine_grid, const unsigned int fine_component, const InterGridMap< DoFHandler< dim, spacedim > > &coarse_to_fine_grid_map, std::vector< std::map< types::global_dof_index, float > > &transfer_representation)
void make_zero_boundary_constraints(const DoFHandler< dim, spacedim > &dof, const types::boundary_id boundary_id, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
void make_hanging_node_constraints(const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< number > &constraints)
void compute_intergrid_constraints(const DoFHandler< dim, spacedim > &coarse_grid, const unsigned int coarse_component, const DoFHandler< dim, spacedim > &fine_grid, const unsigned int fine_component, const InterGridMap< DoFHandler< dim, spacedim > > &coarse_to_fine_grid_map, AffineConstraints< double > &constraints)
Expression fabs(const Expression &x)
@ either_element_can_dominate
@ other_element_dominates
@ neither_element_dominates
@ matrix
Contents is actually a matrix.
void swap(MemorySpaceData< Number, MemorySpace > &, MemorySpaceData< Number, MemorySpace > &)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
VectorType::value_type * end(VectorType &V)
T sum(const T &t, const MPI_Comm &mpi_communicator)
void run(const std::vector< std::vector< Iterator > > &colored_iterators, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length=2 *MultithreadInfo::n_threads(), const unsigned int chunk_size=8)
const types::boundary_id invalid_boundary_id
static const unsigned int invalid_unsigned_int
const types::global_dof_index invalid_dof_index
::VectorizedArray< Number, width > abs(const ::VectorizedArray< Number, width > &)