20 #include <deal.II/base/mpi.templates.h>
23 #include <deal.II/distributed/cell_data_transfer.templates.h>
41 #include <unordered_set>
45 template <
int dim,
int spacedim>
49 template <
int dim,
int spacedim>
56 template <
int dim,
int spacedim>
59 PolicyBase<dim, spacedim> &policy)
61 std::string policy_name;
62 if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::
63 Policy::Sequential<dim, spacedim> *
>(&policy) ||
64 dynamic_cast<const typename ::internal::DoFHandlerImplementation::
65 Policy::Sequential<dim, spacedim> *
>(&policy))
66 policy_name =
"Policy::Sequential<";
67 else if (
dynamic_cast<
68 const typename ::internal::DoFHandlerImplementation::
69 Policy::ParallelDistributed<dim, spacedim> *
>(&policy) ||
71 const typename ::internal::DoFHandlerImplementation::
72 Policy::ParallelDistributed<dim, spacedim> *
>(&policy))
73 policy_name =
"Policy::ParallelDistributed<";
74 else if (
dynamic_cast<
75 const typename ::internal::DoFHandlerImplementation::
76 Policy::ParallelShared<dim, spacedim> *
>(&policy) ||
78 const typename ::internal::DoFHandlerImplementation::
79 Policy::ParallelShared<dim, spacedim> *
>(&policy))
80 policy_name =
"Policy::ParallelShared<";
89 namespace DoFHandlerImplementation
101 template <
int spacedim>
111 template <
int spacedim>
230 template <
int spacedim>
243 const unsigned int max_adjacent_cells =
247 if (max_adjacent_cells <= 8)
266 template <
int dim,
int spacedim>
290 template <
int dim,
int spacedim>
293 const unsigned int n_inner_dofs_per_cell)
295 for (
unsigned int i = 0; i < dof_handler.
tria->
n_levels(); ++i)
301 for (
const auto &cell :
303 if (cell->is_active() && !cell->is_artificial())
305 n_inner_dofs_per_cell;
319 for (
const auto &cell :
321 if (cell->is_active() && !cell->is_artificial())
339 template <
int dim,
int spacedim,
typename T>
342 const unsigned int structdim,
343 const unsigned int n_raw_entities,
344 const T & cell_process)
349 dof_handler.
object_dof_ptr[0][structdim].assign(n_raw_entities + 1, -1);
352 if (cell->is_active() && !cell->is_artificial())
355 [&](
const unsigned int n_dofs_per_entity,
356 const unsigned int index) {
357 auto &n_dofs_per_entity_target =
362 Assert((n_dofs_per_entity_target ==
366 n_dofs_per_entity_target == n_dofs_per_entity),
369 n_dofs_per_entity_target = n_dofs_per_entity;
374 for (
unsigned int i = 1; i < n_raw_entities + 1; ++i)
398 template <
int dim,
int spacedim>
404 const auto &fe = dof_handler.
get_fe();
408 dim == 1 ? fe.n_dofs_per_line() :
409 (dim == 2 ? fe.n_dofs_per_quad(0) :
410 fe.n_dofs_per_hex()));
416 [&](
const auto &cell,
const auto &process) {
417 for (const auto vertex_index :
418 cell->vertex_indices())
419 process(fe.n_dofs_per_vertex(),
420 cell->vertex_index(vertex_index));
424 if (dim == 2 || dim == 3)
428 [&](
const auto &cell,
const auto &process) {
429 for (const auto line_index :
430 cell->line_indices())
431 process(fe.n_dofs_per_line(),
432 cell->line(line_index)->index());
440 [&](
const auto &cell,
const auto &process) {
441 for (const auto face_index :
442 cell->face_indices())
443 process(fe.n_dofs_per_quad(face_index),
444 cell->face(face_index)->index());
448 template <
int spacedim>
456 const ::Triangulation<1, spacedim> &
tria =
458 const unsigned int dofs_per_line =
462 for (
unsigned int i = 0; i < n_levels; ++i)
466 dof_handler.
mg_levels.back()->dof_object.dofs =
476 std::vector<unsigned int> max_level(n_vertices, 0);
477 std::vector<unsigned int> min_level(n_vertices, n_levels);
479 for (typename ::Triangulation<1, spacedim>::cell_iterator cell =
484 const unsigned int level = cell->level();
486 for (
const auto vertex : cell->vertex_indices())
488 const unsigned int vertex_index = cell->vertex_index(vertex);
490 if (min_level[vertex_index] >
level)
491 min_level[vertex_index] =
level;
493 if (max_level[vertex_index] <
level)
494 max_level[vertex_index] =
level;
498 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
502 Assert(max_level[vertex] >= min_level[vertex],
518 template <
int spacedim>
526 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe();
527 const ::Triangulation<2, spacedim> &
tria =
531 for (
unsigned int i = 0; i < n_levels; ++i)
536 dof_handler.
mg_levels.back()->dof_object.dofs =
537 std::vector<types::global_dof_index>(
539 fe.n_dofs_per_quad(0 ),
544 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>>();
547 fe.n_dofs_per_line(),
554 std::vector<unsigned int> max_level(n_vertices, 0);
555 std::vector<unsigned int> min_level(n_vertices, n_levels);
557 for (typename ::Triangulation<2, spacedim>::cell_iterator cell =
562 const unsigned int level = cell->level();
564 for (
const auto vertex : cell->vertex_indices())
566 const unsigned int vertex_index = cell->vertex_index(vertex);
568 if (min_level[vertex_index] >
level)
569 min_level[vertex_index] =
level;
571 if (max_level[vertex_index] <
level)
572 max_level[vertex_index] =
level;
576 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
580 Assert(max_level[vertex] >= min_level[vertex],
584 fe.n_dofs_per_vertex());
595 template <
int spacedim>
603 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe();
604 const ::Triangulation<3, spacedim> &
tria =
608 for (
unsigned int i = 0; i < n_levels; ++i)
613 dof_handler.
mg_levels.back()->dof_object.dofs =
620 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>>();
623 fe.n_dofs_per_line(),
629 dof_handler.
mg_faces->quads.dofs = std::vector<types::global_dof_index>(
637 std::vector<unsigned int> max_level(n_vertices, 0);
638 std::vector<unsigned int> min_level(n_vertices, n_levels);
640 for (typename ::Triangulation<3, spacedim>::cell_iterator cell =
645 const unsigned int level = cell->level();
647 for (
const auto vertex : cell->vertex_indices())
649 const unsigned int vertex_index = cell->vertex_index(vertex);
651 if (min_level[vertex_index] >
level)
652 min_level[vertex_index] =
level;
654 if (max_level[vertex_index] <
level)
655 max_level[vertex_index] =
level;
659 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
663 Assert(max_level[vertex] >= min_level[vertex],
667 fe.n_dofs_per_vertex());
684 namespace DoFHandlerImplementation
697 template <
int dim,
int spacedim>
704 if (cell->is_locally_owned())
706 !cell->future_fe_index_set(),
708 "There shouldn't be any cells flagged for p-adaptation when partitioning."));
717 template <
int dim,
int spacedim>
733 std::vector<bool> locally_used_vertices(
736 if (!cell->is_artificial())
737 for (
const auto v : cell->vertex_indices())
738 locally_used_vertices[cell->vertex_index(v)] =
true;
740 std::vector<std::vector<bool>> vertex_fe_association(
745 if (!cell->is_artificial())
746 for (
const auto v : cell->vertex_indices())
747 vertex_fe_association[cell->active_fe_index()]
748 [cell->vertex_index(v)] =
true;
757 if (locally_used_vertices[v] ==
true)
762 if (vertex_fe_association[fe][v] ==
true)
769 const unsigned int d = 0;
770 const unsigned int l = 0;
780 unsigned int vertex_slots_needed = 0;
781 unsigned int fe_slots_needed = 0;
789 for (
unsigned int fe = 0;
792 if (vertex_fe_association[fe][v] ==
true)
795 vertex_slots_needed +=
813 if (vertex_fe_association[fe][v] ==
true)
819 for (
unsigned int i = 0;
820 i < dof_handler.
get_fe(fe).n_dofs_per_vertex();
850 template <
int dim,
int spacedim>
867 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
872 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
882 if (cell->is_active() && !cell->is_artificial())
887 cell->get_fe().template n_dofs_per_object<dim>();
891 cache_size += cell->get_fe().n_dofs_per_cell();
895 std::vector<types::global_dof_index>(
898 std::vector<types::global_dof_index>(
909 template <
int dim,
int spacedim>
930 std::vector<bool> face_touched(dim == 2 ?
934 const unsigned int d = dim - 1;
935 const unsigned int l = 0;
947 unsigned int n_face_slots = 0;
950 if (!cell->is_artificial())
951 for (
const auto face : cell->face_indices())
952 if (!face_touched[cell->face(face)->index()])
954 unsigned int fe_slots_needed = 0;
956 if (cell->at_boundary(face) ||
957 cell->face(face)->has_children() ||
958 cell->neighbor_is_coarser(face) ||
959 (!cell->at_boundary(face) &&
960 cell->neighbor(face)->is_artificial()) ||
961 (!cell->at_boundary(face) &&
962 !cell->neighbor(face)->is_artificial() &&
963 (cell->active_fe_index() ==
964 cell->neighbor(face)->active_fe_index())))
968 dof_handler.
get_fe(cell->active_fe_index())
969 .template n_dofs_per_object<dim - 1>(face);
975 dof_handler.
get_fe(cell->active_fe_index())
976 .
template n_dofs_per_object<dim - 1>(face) +
978 .
get_fe(cell->neighbor(face)->active_fe_index())
979 .
template n_dofs_per_object<dim - 1>(
980 cell->neighbor_face_no(face));
984 face_touched[cell->face(face)->index()] =
true;
1008 face_touched = std::vector<bool>(face_touched.size());
1011 if (!cell->is_artificial())
1012 for (
const auto face : cell->face_indices())
1013 if (!face_touched[cell->face(face)->index()])
1016 if (cell->at_boundary(face) ||
1017 cell->face(face)->has_children() ||
1018 cell->neighbor_is_coarser(face) ||
1019 (!cell->at_boundary(face) &&
1020 cell->neighbor(face)->is_artificial()) ||
1021 (!cell->at_boundary(face) &&
1022 !cell->neighbor(face)->is_artificial() &&
1023 (cell->active_fe_index() ==
1024 cell->neighbor(face)->active_fe_index())))
1026 const unsigned int fe = cell->active_fe_index();
1027 const unsigned int n_dofs =
1029 .template n_dofs_per_object<dim - 1>(face);
1030 const unsigned int offset =
1037 for (
unsigned int i = 0; i < n_dofs; ++i)
1043 unsigned int fe_1 = cell->active_fe_index();
1044 unsigned int face_no_1 = face;
1046 cell->neighbor(face)->active_fe_index();
1047 unsigned int face_no_2 = cell->neighbor_face_no(face);
1055 const unsigned int n_dofs_1 =
1057 .template n_dofs_per_object<dim - 1>(face_no_1);
1059 const unsigned int n_dofs_2 =
1061 .template n_dofs_per_object<dim - 1>(face_no_2);
1063 const unsigned int offset =
1068 cell->active_fe_index());
1082 for (
unsigned int i = 0; i < n_dofs_1 + n_dofs_2; ++i)
1088 face_touched[cell->face(face)->index()] =
true;
1091 for (
unsigned int i = 1;
1107 template <
int spacedim>
1114 ExcMessage(
"The current Triangulation must not be empty."));
1132 template <
int spacedim>
1139 ExcMessage(
"The current Triangulation must not be empty."));
1159 template <
int spacedim>
1166 ExcMessage(
"The current Triangulation must not be empty."));
1195 std::vector<std::vector<bool>> line_fe_association(
1200 if (!cell->is_artificial())
1201 for (
const auto l : cell->line_indices())
1202 line_fe_association[cell->active_fe_index()]
1203 [cell->line_index(
l)] =
true;
1215 if (line_fe_association[fe][line] ==
true)
1217 line_is_used[line] =
true;
1223 const unsigned int d = 1;
1224 const unsigned int l = 0;
1234 unsigned int line_slots_needed = 0;
1235 unsigned int fe_slots_needed = 0;
1242 if (line_is_used[line] ==
true)
1244 for (
unsigned int fe = 0;
1247 if (line_fe_association[fe][line] ==
true)
1250 line_slots_needed +=
1269 if (line_is_used[line] ==
true)
1271 for (
unsigned int fe = 0;
1274 if (line_fe_association[fe][line] ==
true)
1280 for (
unsigned int i = 0;
1281 i < dof_handler.
get_fe(fe).n_dofs_per_line();
1295 fe_slots_needed + 1);
1317 template <
int dim,
int spacedim>
1325 using active_fe_index_type =
1326 typename ::DoFHandler<dim, spacedim>::active_fe_index_type;
1328 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1330 const ::parallel::shared::Triangulation<dim, spacedim>
1343 std::vector<active_fe_index_type> active_fe_indices(
1344 tr->n_active_cells(), 0u);
1346 if (cell->is_locally_owned())
1347 active_fe_indices[cell->active_cell_index()] =
1348 cell->active_fe_index();
1351 tr->get_communicator(),
1361 if (!cell->is_locally_owned())
1364 active_fe_indices[cell->active_cell_index()];
1366 else if (const ::parallel::
1367 DistributedTriangulationBase<dim, spacedim> *tr =
1370 DistributedTriangulationBase<dim, spacedim> *
>(
1380 [](
const typename ::DoFHandler<dim, spacedim>::
1381 active_cell_iterator &cell) -> active_fe_index_type {
1382 return cell->active_fe_index();
1387 const typename ::DoFHandler<dim, spacedim>::
1388 active_cell_iterator & cell,
1389 const active_fe_index_type active_fe_index) ->
void {
1400 active_fe_index_type,
1408 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1429 template <
int dim,
int spacedim>
1437 using active_fe_index_type =
1438 typename ::DoFHandler<dim, spacedim>::active_fe_index_type;
1440 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1442 const ::parallel::shared::Triangulation<dim, spacedim>
1445 std::vector<active_fe_index_type> future_fe_indices(
1446 tr->n_active_cells(), 0u);
1449 future_fe_indices[cell->active_cell_index()] =
1454 tr->get_communicator(),
1458 if (!cell->is_locally_owned())
1461 future_fe_indices[cell->active_cell_index()];
1463 else if (const ::parallel::
1464 DistributedTriangulationBase<dim, spacedim> *tr =
1467 DistributedTriangulationBase<dim, spacedim> *
>(
1472 const typename ::DoFHandler<dim, spacedim>::
1473 active_cell_iterator &cell) -> active_fe_index_type {
1480 const typename ::DoFHandler<dim, spacedim>::
1481 active_cell_iterator & cell,
1482 const active_fe_index_type future_fe_index) ->
void {
1489 active_fe_index_type,
1496 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1524 template <
int dim,
int spacedim>
1532 if (cell->is_locally_owned())
1534 if (cell->refine_flag_set())
1539 fe_transfer->refined_cells_fe_index.insert(
1540 {cell, cell->future_fe_index()});
1542 else if (cell->coarsen_flag_set())
1549 const auto &parent = cell->parent();
1553 if (fe_transfer->coarsened_cells_fe_index.find(parent) ==
1554 fe_transfer->coarsened_cells_fe_index.end())
1561 for (
const auto &child : parent->child_iterators())
1562 Assert(child->is_active() &&
1563 child->coarsen_flag_set(),
1564 typename ::Triangulation<
1565 dim>::ExcInconsistentCoarseningFlags());
1568 const unsigned int fe_index = ::internal::hp::
1569 DoFHandlerImplementation::Implementation::
1570 dominated_future_fe_on_children<dim, spacedim>(
1573 fe_transfer->coarsened_cells_fe_index.insert(
1574 {parent, fe_index});
1582 if (cell->future_fe_index_set() ==
true)
1583 fe_transfer->persisting_cells_fe_index.insert(
1584 {cell, cell->future_fe_index()});
1595 template <
int dim,
int spacedim>
1603 for (
const auto &persist : fe_transfer->persisting_cells_fe_index)
1605 const auto &cell = persist.first;
1607 if (cell->is_locally_owned())
1610 cell->set_active_fe_index(persist.second);
1616 for (
const auto &
refine : fe_transfer->refined_cells_fe_index)
1618 const auto &parent =
refine.first;
1620 for (
const auto &child : parent->child_iterators())
1621 if (child->is_locally_owned())
1624 child->set_active_fe_index(
refine.second);
1630 for (
const auto &
coarsen : fe_transfer->coarsened_cells_fe_index)
1632 const auto &cell =
coarsen.first;
1634 if (cell->is_locally_owned())
1637 cell->set_active_fe_index(
coarsen.second);
1653 template <
int dim,
int spacedim>
1657 const std::vector<unsigned int> & children_fe_indices,
1658 const ::hp::FECollection<dim, spacedim> &fe_collection)
1663 const std::set<unsigned int> children_fe_indices_set(
1664 children_fe_indices.begin(), children_fe_indices.end());
1666 const unsigned int dominated_fe_index =
1667 fe_collection.find_dominated_fe_extended(children_fe_indices_set,
1673 return dominated_fe_index;
1684 template <
int dim,
int spacedim>
1690 !parent->is_active(),
1692 "You ask for information on children of this cell which is only "
1693 "available for active cells. This cell has no children."));
1695 const auto &dof_handler = parent->get_dof_handler();
1697 dof_handler.has_hp_capabilities(),
1700 std::set<unsigned int> future_fe_indices_children;
1701 for (
const auto &child : parent->child_iterators())
1706 "You ask for information on children of this cell which is only "
1707 "available for active cells. One of its children is not active."));
1715 const unsigned int future_fe_index_child =
1716 ::internal::DoFCellAccessorImplementation::
1717 Implementation::future_fe_index<dim, spacedim, false>(*child);
1719 future_fe_indices_children.insert(future_fe_index_child);
1723 const unsigned int future_fe_index =
1724 dof_handler.fe_collection.find_dominated_fe_extended(
1725 future_fe_indices_children,
1731 return future_fe_index;
1740 template <
int dim,
int spacedim>
1744 Implementation::communicate_future_fe_indices<dim, spacedim>(
1753 template <
int dim,
int spacedim>
1758 return Implementation::dominated_future_fe_on_children<dim, spacedim>(
1767 template <
int dim,
int spacedim>
1769 : hp_capability_enabled(true)
1770 ,
tria(nullptr, typeid(*this).name())
1776 template <
int dim,
int spacedim>
1785 template <
int dim,
int spacedim>
1789 for (
auto &connection : this->tria_listeners)
1790 connection.disconnect();
1791 this->tria_listeners.clear();
1793 for (
auto &connection : this->tria_listeners_for_transfer)
1794 connection.disconnect();
1795 this->tria_listeners_for_transfer.clear();
1806 this->policy.reset();
1811 template <
int dim,
int spacedim>
1819 for (
auto &connection : this->tria_listeners)
1820 connection.disconnect();
1821 this->tria_listeners.clear();
1823 for (
auto &connection : this->tria_listeners_for_transfer)
1824 connection.disconnect();
1825 this->tria_listeners_for_transfer.clear();
1829 this->policy.reset();
1839 this->setup_policy();
1842 hp_capability_enabled =
true;
1843 this->connect_to_triangulation_signals();
1844 this->create_active_fe_table();
1851 template <
int dim,
int spacedim>
1857 if (cell == this->get_triangulation().
end(
level))
1859 return cell_iterator(*cell,
this);
1864 template <
int dim,
int spacedim>
1872 while (i->has_children())
1880 template <
int dim,
int spacedim>
1884 return cell_iterator(&this->get_triangulation(), -1, -1,
this);
1889 template <
int dim,
int spacedim>
1894 this->get_triangulation().
end(
level);
1897 return cell_iterator(*cell,
this);
1902 template <
int dim,
int spacedim>
1909 return active_cell_iterator(
end());
1910 return active_cell_iterator(*cell,
this);
1915 template <
int dim,
int spacedim>
1919 Assert(this->has_level_dofs(),
1921 "levels if mg dofs got distributed."));
1924 if (cell == this->get_triangulation().
end(
level))
1925 return end_mg(
level);
1926 return level_cell_iterator(*cell,
this);
1931 template <
int dim,
int spacedim>
1935 Assert(this->has_level_dofs(),
1937 "levels if mg dofs got distributed."));
1939 this->get_triangulation().
end(
level);
1942 return level_cell_iterator(*cell,
this);
1947 template <
int dim,
int spacedim>
1951 return level_cell_iterator(&this->get_triangulation(), -1, -1,
this);
1956 template <
int dim,
int spacedim>
1966 template <
int dim,
int spacedim>
1977 template <
int dim,
int spacedim>
1982 begin_mg(), end_mg());
1987 template <
int dim,
int spacedim>
1990 const unsigned int level)
const
1998 template <
int dim,
int spacedim>
2001 const unsigned int level)
const
2010 template <
int dim,
int spacedim>
2013 const unsigned int level)
const
2025 template <
int dim,
int spacedim>
2029 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2030 ExcNotImplementedWithHP());
2034 std::unordered_set<types::global_dof_index> boundary_dofs;
2035 std::vector<types::global_dof_index> dofs_on_face;
2036 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2038 const IndexSet &owned_dofs = locally_owned_dofs();
2045 for (
const auto &cell : this->active_cell_iterators())
2046 if (cell->is_locally_owned() && cell->at_boundary())
2048 for (
const auto iface : cell->face_indices())
2050 const auto face = cell->face(iface);
2051 if (face->at_boundary())
2053 const unsigned int dofs_per_face =
2054 cell->get_fe().n_dofs_per_face(iface);
2055 dofs_on_face.resize(dofs_per_face);
2057 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2058 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2060 const unsigned int global_idof_index = dofs_on_face[i];
2061 if (owned_dofs.
is_element(global_idof_index))
2063 boundary_dofs.insert(global_idof_index);
2069 return boundary_dofs.size();
2074 template <
int dim,
int spacedim>
2077 const std::set<types::boundary_id> &boundary_ids)
const
2079 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2080 ExcNotImplementedWithHP());
2089 std::unordered_set<types::global_dof_index> boundary_dofs;
2090 std::vector<types::global_dof_index> dofs_on_face;
2091 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2093 const IndexSet &owned_dofs = locally_owned_dofs();
2095 for (
const auto &cell : this->active_cell_iterators())
2096 if (cell->is_locally_owned() && cell->at_boundary())
2098 for (
const auto iface : cell->face_indices())
2100 const auto face = cell->face(iface);
2101 const unsigned int boundary_id = face->boundary_id();
2102 if (face->at_boundary() &&
2103 (boundary_ids.find(
boundary_id) != boundary_ids.end()))
2105 const unsigned int dofs_per_face =
2106 cell->get_fe().n_dofs_per_face(iface);
2107 dofs_on_face.resize(dofs_per_face);
2109 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2110 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2112 const unsigned int global_idof_index = dofs_on_face[i];
2113 if (owned_dofs.
is_element(global_idof_index))
2115 boundary_dofs.insert(global_idof_index);
2121 return boundary_dofs.size();
2126 template <
int dim,
int spacedim>
2144 if (hp_capability_enabled)
2157 if (this->mg_faces !=
nullptr)
2160 for (
unsigned int i = 0; i < this->mg_vertex_dofs.size(); ++i)
2161 mem +=
sizeof(MGVertexDoFs) +
2162 (1 + this->mg_vertex_dofs[i].get_finest_level() -
2163 this->mg_vertex_dofs[i].get_coarsest_level()) *
2172 template <
int dim,
int spacedim>
2182 template <
int dim,
int spacedim>
2188 this->tria !=
nullptr,
2190 "You need to set the Triangulation in the DoFHandler using reinit() or "
2191 "in the constructor before you can distribute DoFs."));
2193 ExcMessage(
"The Triangulation you are using is empty!"));
2200 if (this->fe_collection != ff)
2204 const bool contains_multiple_fes = (this->fe_collection.size() > 1);
2207 if (hp_capability_enabled && !contains_multiple_fes)
2209 hp_capability_enabled =
false;
2213 for (
auto &connection : this->tria_listeners_for_transfer)
2214 connection.disconnect();
2215 this->tria_listeners_for_transfer.clear();
2218 this->hp_cell_active_fe_indices.clear();
2219 this->hp_cell_active_fe_indices.shrink_to_fit();
2220 this->hp_cell_future_fe_indices.clear();
2221 this->hp_cell_future_fe_indices.shrink_to_fit();
2227 hp_capability_enabled || !contains_multiple_fes,
2229 "You cannot re-enable hp-capabilities after you registered a single "
2230 "finite element. Please call reinit() or create a new DoFHandler "
2231 "object instead."));
2237 if (hp_capability_enabled)
2247 for (
const auto &cell : this->active_cell_iterators())
2249 if (!cell->is_artificial())
2250 Assert(cell->active_fe_index() < this->fe_collection.size(),
2251 ExcInvalidFEIndex(cell->active_fe_index(),
2252 this->fe_collection.size()));
2253 if (cell->is_locally_owned())
2254 Assert(cell->future_fe_index() < this->fe_collection.size(),
2255 ExcInvalidFEIndex(cell->future_fe_index(),
2256 this->fe_collection.size()));
2271 subdomain_modifier(this->get_triangulation());
2280 if (hp_capability_enabled)
2288 this->number_cache = this->policy->distribute_dofs();
2305 if (!hp_capability_enabled &&
2307 *
>(&*this->tria) ==
nullptr)
2308 this->block_info_object.initialize(*
this,
false,
true);
2313 template <
int dim,
int spacedim>
2317 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2320 this->object_dof_indices.size() > 0,
2322 "Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
2329 "The mesh smoothing requirement 'limit_level_difference_at_vertices' has to be set for using multigrid!"));
2331 this->clear_mg_space();
2334 this->mg_number_cache = this->policy->distribute_mg_dofs();
2339 &*this->tria) ==
nullptr)
2340 this->block_info_object.initialize(*
this,
true,
false);
2345 template <
int dim,
int spacedim>
2349 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2351 this->block_info_object.initialize_local(*
this);
2356 template <
int dim,
int spacedim>
2361 if (
dynamic_cast<const ::parallel::shared::Triangulation<dim, spacedim>
2362 *
>(&this->get_triangulation()) !=
nullptr)
2363 this->policy = std::make_unique<internal::DoFHandlerImplementation::Policy::
2364 ParallelShared<dim, spacedim>>(*this);
2365 else if (
dynamic_cast<
2366 const ::parallel::DistributedTriangulationBase<dim, spacedim>
2367 *
>(&this->get_triangulation()) ==
nullptr)
2368 this->policy = std::make_unique<
2373 std::make_unique<internal::DoFHandlerImplementation::Policy::
2374 ParallelDistributed<dim, spacedim>>(*this);
2379 template <
int dim,
int spacedim>
2384 this->clear_space();
2385 this->clear_mg_space();
2390 template <
int dim,
int spacedim>
2394 cell_dof_cache_indices.clear();
2396 cell_dof_cache_ptr.clear();
2398 object_dof_indices.clear();
2400 object_dof_ptr.clear();
2402 this->number_cache.clear();
2404 this->hp_cell_active_fe_indices.clear();
2405 this->hp_cell_future_fe_indices.clear();
2410 template <
int dim,
int spacedim>
2414 this->mg_levels.clear();
2415 this->mg_faces.reset();
2417 std::vector<MGVertexDoFs> tmp;
2421 this->mg_number_cache.clear();
2426 template <
int dim,
int spacedim>
2429 const std::vector<types::global_dof_index> &new_numbers)
2431 if (hp_capability_enabled)
2433 Assert(this->hp_cell_future_fe_indices.size() > 0,
2435 "You need to distribute DoFs before you can renumber them."));
2444 if (this->n_locally_owned_dofs() == this->n_dofs())
2446 std::vector<types::global_dof_index> tmp(new_numbers);
2447 std::sort(tmp.begin(), tmp.end());
2448 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2450 for (; p != tmp.end(); ++p, ++i)
2451 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2454 for (
const auto new_number : new_numbers)
2455 Assert(new_number < this->n_dofs(),
2457 "New DoF index is not less than the total number of dofs."));
2474 this->number_cache = this->policy->renumber_dofs(new_numbers);
2489 Assert(this->object_dof_indices.size() > 0,
2491 "You need to distribute DoFs before you can renumber them."));
2495 &*this->tria) !=
nullptr)
2497 Assert(new_numbers.size() == this->n_dofs() ||
2498 new_numbers.size() == this->n_locally_owned_dofs(),
2499 ExcMessage(
"Incorrect size of the input array."));
2501 else if (
dynamic_cast<
2503 &*this->tria) !=
nullptr)
2516 if (this->n_locally_owned_dofs() == this->n_dofs())
2518 std::vector<types::global_dof_index> tmp(new_numbers);
2519 std::sort(tmp.begin(), tmp.end());
2520 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2522 for (; p != tmp.end(); ++p, ++i)
2523 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2526 for (
const auto new_number : new_numbers)
2527 Assert(new_number < this->n_dofs(),
2529 "New DoF index is not less than the total number of dofs."));
2532 this->number_cache = this->policy->renumber_dofs(new_numbers);
2538 template <
int dim,
int spacedim>
2541 const unsigned int level,
2542 const std::vector<types::global_dof_index> &new_numbers)
2544 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2547 this->mg_levels.size() > 0 && this->object_dof_indices.size() > 0,
2549 "You need to distribute active and level DoFs before you can renumber level DoFs."));
2552 this->locally_owned_mg_dofs(
level).n_elements());
2559 if (this->n_locally_owned_dofs() == this->n_dofs())
2561 std::vector<types::global_dof_index> tmp(new_numbers);
2562 std::sort(tmp.begin(), tmp.end());
2563 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2565 for (; p != tmp.end(); ++p, ++i)
2566 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2569 for (
const auto new_number : new_numbers)
2572 "New DoF index is not less than the total number of dofs."));
2575 this->mg_number_cache[
level] =
2576 this->policy->renumber_mg_dofs(
level, new_numbers);
2581 template <
int dim,
int spacedim>
2590 return this->fe_collection.max_dofs_per_vertex();
2592 return (3 * this->fe_collection.max_dofs_per_vertex() +
2593 2 * this->fe_collection.max_dofs_per_line());
2604 return (19 * this->fe_collection.max_dofs_per_vertex() +
2605 28 * this->fe_collection.max_dofs_per_line() +
2606 8 * this->fe_collection.max_dofs_per_quad());
2615 template <
int dim,
int spacedim>
2626 template <
int dim,
int spacedim>
2629 const std::vector<unsigned int> &active_fe_indices)
2631 Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(),
2633 this->get_triangulation().n_active_cells()));
2635 this->create_active_fe_table();
2640 for (
const auto &cell : this->active_cell_iterators())
2641 if (cell->is_locally_owned())
2642 cell->set_active_fe_index(active_fe_indices[cell->active_cell_index()]);
2647 template <
int dim,
int spacedim>
2650 std::vector<unsigned int> &active_fe_indices)
const
2652 active_fe_indices.resize(this->get_triangulation().
n_active_cells());
2657 for (
const auto &cell : this->active_cell_iterators())
2658 if (!cell->is_artificial())
2659 active_fe_indices[cell->active_cell_index()] = cell->active_fe_index();
2664 template <
int dim,
int spacedim>
2669 Assert(hp_capability_enabled, ExcOnlyAvailableWithHP());
2672 this->tria_listeners.push_back(this->tria->
signals.create.connect(
2673 [
this]() { this->reinit(*(this->tria)); }));
2674 this->tria_listeners.push_back(
2675 this->tria->
signals.clear.connect([
this]() { this->clear(); }));
2680 const ::parallel::fullydistributed::Triangulation<dim, spacedim>
2681 *
>(&this->get_triangulation()))
2685 else if (
dynamic_cast<
2686 const ::parallel::distributed::Triangulation<dim, spacedim>
2687 *
>(&this->get_triangulation()))
2690 this->tria_listeners_for_transfer.push_back(
2691 this->tria->
signals.pre_distributed_repartition.connect([
this]() {
2692 internal::hp::DoFHandlerImplementation::Implementation::
2693 ensure_absence_of_future_fe_indices<dim, spacedim>(*this);
2695 this->tria_listeners_for_transfer.push_back(
2696 this->tria->
signals.pre_distributed_repartition.connect(
2697 [
this]() { this->pre_distributed_transfer_action(); }));
2698 this->tria_listeners_for_transfer.push_back(
2699 this->tria->
signals.post_distributed_repartition.connect(
2700 [
this] { this->post_distributed_transfer_action(); }));
2703 this->tria_listeners_for_transfer.push_back(
2704 this->tria->
signals.post_p4est_refinement.connect(
2705 [
this]() { this->pre_distributed_transfer_action(); }));
2706 this->tria_listeners_for_transfer.push_back(
2707 this->tria->
signals.post_distributed_refinement.connect(
2708 [
this]() { this->post_distributed_transfer_action(); }));
2711 this->tria_listeners_for_transfer.push_back(
2712 this->tria->
signals.post_distributed_save.connect(
2713 [
this]() { this->active_fe_index_transfer.reset(); }));
2714 this->tria_listeners_for_transfer.push_back(
2715 this->tria->
signals.post_distributed_load.connect(
2716 [
this]() { this->update_active_fe_table(); }));
2718 else if (
dynamic_cast<
2719 const ::parallel::shared::Triangulation<dim, spacedim> *
>(
2720 &this->get_triangulation()) !=
nullptr)
2723 this->tria_listeners_for_transfer.push_back(
2724 this->tria->
signals.pre_partition.connect([
this]() {
2725 internal::hp::DoFHandlerImplementation::Implementation::
2726 ensure_absence_of_future_fe_indices(*this);
2730 this->tria_listeners_for_transfer.push_back(
2731 this->tria->
signals.pre_refinement.connect([
this]() {
2732 internal::hp::DoFHandlerImplementation::Implementation::
2733 communicate_future_fe_indices(*this);
2735 this->tria_listeners_for_transfer.push_back(
2736 this->tria->
signals.pre_refinement.connect(
2737 [
this] { this->pre_transfer_action(); }));
2738 this->tria_listeners_for_transfer.push_back(
2739 this->tria->
signals.post_refinement.connect(
2740 [
this] { this->post_transfer_action(); }));
2745 this->tria_listeners_for_transfer.push_back(
2746 this->tria->
signals.pre_refinement.connect(
2747 [
this] { this->pre_transfer_action(); }));
2748 this->tria_listeners_for_transfer.push_back(
2749 this->tria->
signals.post_refinement.connect(
2750 [
this] { this->post_transfer_action(); }));
2756 template <
int dim,
int spacedim>
2760 AssertThrow(hp_capability_enabled ==
true, ExcOnlyAvailableWithHP());
2767 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2768 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2772 for (
unsigned int level = 0;
level < this->hp_cell_future_fe_indices.size();
2775 if (this->hp_cell_active_fe_indices[
level].size() == 0 &&
2776 this->hp_cell_future_fe_indices[
level].size() == 0)
2778 this->hp_cell_active_fe_indices[
level].resize(
2780 this->hp_cell_future_fe_indices[
level].resize(
2788 Assert(this->hp_cell_active_fe_indices[
level].size() ==
2790 this->hp_cell_future_fe_indices[
level].size() ==
2791 this->tria->n_raw_cells(
level),
2807 template <
int dim,
int spacedim>
2823 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2824 this->hp_cell_active_fe_indices.shrink_to_fit();
2826 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2827 this->hp_cell_future_fe_indices.shrink_to_fit();
2829 for (
unsigned int i = 0; i < this->hp_cell_future_fe_indices.size(); ++i)
2832 this->hp_cell_active_fe_indices[i].resize(this->tria->
n_raw_cells(i), 0);
2839 this->hp_cell_future_fe_indices[i].assign(this->tria->
n_raw_cells(i),
2840 invalid_active_fe_index);
2845 template <
int dim,
int spacedim>
2851 this->active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2859 template <
int dim,
int spacedim>
2863 #ifndef DEAL_II_WITH_P4EST
2866 "You are attempting to use a functionality that is only available "
2867 "if deal.II was configured to use p4est, but cmake did not find a "
2868 "valid p4est library."));
2873 &this->get_triangulation()) !=
nullptr),
2878 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2887 active_fe_index_transfer->active_fe_indices.resize(
2890 for (
const auto &cell : active_cell_iterators())
2891 if (cell->is_locally_owned())
2892 active_fe_index_transfer->active_fe_indices[cell->active_cell_index()] =
2893 cell->future_fe_index();
2896 const auto *distributed_tria =
2898 &this->get_triangulation());
2900 active_fe_index_transfer->cell_data_transfer = std::make_unique<
2901 parallel::distributed::
2902 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
2906 &::AdaptationStrategies::Refinement::
2907 preserve<dim, spacedim, unsigned int>,
2910 const std::vector<unsigned int> &children_fe_indices)
2912 return ::internal::hp::DoFHandlerImplementation::Implementation::
2913 determine_fe_from_children<dim, spacedim>(parent,
2914 children_fe_indices,
2918 active_fe_index_transfer->cell_data_transfer
2919 ->prepare_for_coarsening_and_refinement(
2920 active_fe_index_transfer->active_fe_indices);
2926 template <
int dim,
int spacedim>
2930 update_active_fe_table();
2944 this->active_fe_index_transfer.reset();
2949 template <
int dim,
int spacedim>
2953 #ifndef DEAL_II_WITH_P4EST
2956 update_active_fe_table();
2961 this->active_fe_index_transfer->active_fe_indices.resize(
2963 this->active_fe_index_transfer->cell_data_transfer->unpack(
2964 this->active_fe_index_transfer->active_fe_indices);
2967 this->set_active_fe_indices(
2968 this->active_fe_index_transfer->active_fe_indices);
2975 this->active_fe_index_transfer.reset();
2981 template <
int dim,
int spacedim>
2985 #ifndef DEAL_II_WITH_P4EST
2988 "You are attempting to use a functionality that is only available "
2989 "if deal.II was configured to use p4est, but cmake did not find a "
2990 "valid p4est library."));
2995 &this->get_triangulation()) !=
nullptr),
3000 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3003 const auto *distributed_tria =
3005 &this->get_triangulation());
3007 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3008 parallel::distributed::
3009 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
3013 &::AdaptationStrategies::Refinement::
3014 preserve<dim, spacedim, unsigned int>,
3017 const std::vector<unsigned int> &children_fe_indices)
3019 return ::internal::hp::DoFHandlerImplementation::Implementation::
3020 determine_fe_from_children<dim, spacedim>(parent,
3021 children_fe_indices,
3032 active_fe_index_transfer->cell_data_transfer->prepare_for_serialization(
3033 active_fe_index_transfer->active_fe_indices);
3039 template <
int dim,
int spacedim>
3043 #ifndef DEAL_II_WITH_P4EST
3046 "You are attempting to use a functionality that is only available "
3047 "if deal.II was configured to use p4est, but cmake did not find a "
3048 "valid p4est library."));
3053 &this->get_triangulation()) !=
nullptr),
3058 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3061 const auto *distributed_tria =
3063 &this->get_triangulation());
3065 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3066 parallel::distributed::
3067 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
3071 &::AdaptationStrategies::Refinement::
3072 preserve<dim, spacedim, unsigned int>,
3075 const std::vector<unsigned int> &children_fe_indices)
3077 return ::internal::hp::DoFHandlerImplementation::Implementation::
3078 determine_fe_from_children<dim, spacedim>(parent,
3079 children_fe_indices,
3084 active_fe_index_transfer->active_fe_indices.resize(
3086 active_fe_index_transfer->cell_data_transfer->deserialize(
3087 active_fe_index_transfer->active_fe_indices);
3090 set_active_fe_indices(active_fe_index_transfer->active_fe_indices);
3097 active_fe_index_transfer.reset();
3103 template <
int dim,
int spacedim>
3111 template <
int dim,
int spacedim>
3114 const unsigned int cl,
3115 const unsigned int fl,
3116 const unsigned int dofs_per_vertex)
3118 coarsest_level = cl;
3121 if (coarsest_level <= finest_level)
3123 const unsigned int n_levels = finest_level - coarsest_level + 1;
3124 const unsigned int n_indices = n_levels * dofs_per_vertex;
3126 indices = std::make_unique<types::global_dof_index[]>(n_indices);
3127 std::fill(indices.get(),
3128 indices.get() + n_indices,
3137 template <
int dim,
int spacedim>
3141 return coarsest_level;
3146 template <
int dim,
int spacedim>
3150 return finest_level;
3154 #include "dof_handler.inst"
void init(const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex)
unsigned int get_finest_level() const
unsigned int get_coarsest_level() const
cell_iterator end() const
void pre_distributed_transfer_action()
void post_transfer_action()
virtual std::size_t memory_consumption() const
std::vector< std::vector< active_fe_index_type > > hp_cell_active_fe_indices
unsigned int max_couplings_between_dofs() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
std::unique_ptr< ActiveFEIndexTransfer > active_fe_index_transfer
hp::FECollection< dim, spacedim > fe_collection
void create_active_fe_table()
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
void set_active_fe_indices(const std::vector< unsigned int > &active_fe_indices)
level_cell_iterator end_mg() const
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
level_cell_iterator begin_mg(const unsigned int level=0) const
void distribute_dofs(const FiniteElement< dim, spacedim > &fe)
types::global_dof_index n_boundary_dofs() const
void connect_to_triangulation_signals()
std::vector< std::vector< types::global_dof_index > > cell_dof_cache_indices
std::vector< MGVertexDoFs > mg_vertex_dofs
std::vector< std::vector< active_fe_index_type > > hp_cell_future_fe_indices
void post_distributed_transfer_action()
std::vector< std::array< std::vector< types::global_dof_index >, dim+1 > > object_dof_indices
const Triangulation< dim, spacedim > & get_triangulation() const
void pre_transfer_action()
std::array< std::vector< active_fe_index_type >, dim+1 > hp_object_fe_indices
void reinit(const Triangulation< dim, spacedim > &tria)
std::vector< std::array< std::vector< offset_type >, dim+1 > > object_dof_ptr
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > mg_faces
active_cell_iterator begin_active(const unsigned int level=0) const
void distribute_mg_dofs()
active_cell_iterator end_active(const unsigned int level) const
bool hp_capability_enabled
void initialize_local_block_info()
types::global_dof_index n_dofs() const
void update_active_fe_table()
std::vector< std::vector< offset_type > > cell_dof_cache_ptr
void prepare_for_serialization_of_active_fe_indices()
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
cell_iterator begin(const unsigned int level=0) const
std::array< std::vector< offset_type >, dim+1 > hp_object_fe_ptr
void get_active_fe_indices(std::vector< unsigned int > &active_fe_indices) const
unsigned int max_couplings_between_boundary_dofs() const
void deserialize_active_fe_indices()
virtual ~DoFHandler() override
unsigned int n_dofs_per_vertex() const
unsigned int n_dofs_per_cell() const
unsigned int n_dofs_per_line() const
bool is_element(const size_type index) const
virtual const MeshSmoothing & get_mesh_smoothing() const
cell_iterator begin(const unsigned int level=0) const
unsigned int n_raw_lines() const
unsigned int n_raw_faces() const
unsigned int n_levels() const
cell_iterator end() const
unsigned int n_raw_cells(const unsigned int level) const
unsigned int max_adjacent_cells() const
bool vertex_used(const unsigned int index) const
active_cell_iterator end_active(const unsigned int level) const
unsigned int n_raw_quads() const
unsigned int n_cells() const
unsigned int n_vertices() const
unsigned int n_raw_hexs(const unsigned int level) const
unsigned int size() const
unsigned int max_dofs_per_line() const
unsigned int max_dofs_per_hex() const
unsigned int max_dofs_per_vertex() const
unsigned int max_dofs_per_quad() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< level_cell_iterator > mg_cell_iterators() const
IteratorRange< cell_iterator > cell_iterators() const
IteratorRange< cell_iterator > cell_iterators() const
IteratorRange< level_cell_iterator > mg_cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
static ::ExceptionBase & ExcNoFESelected()
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcNoDominatedFiniteElementOnChildren()
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
#define AssertThrow(cond, exc)
Task< RT > new_task(const std::function< RT()> &function)
void refine(Triangulation< dim, spacedim > &tria, const Vector< Number > &criteria, const double threshold, const unsigned int max_to_mark=numbers::invalid_unsigned_int)
void coarsen(Triangulation< dim, spacedim > &tria, const Vector< Number > &criteria, const double threshold)
@ valid
Iterator points to a valid object.
std::enable_if_t< std::is_fundamental< T >::value, std::size_t > memory_consumption(const T &t)
void swap(MemorySpaceData< Number, MemorySpace > &, MemorySpaceData< Number, MemorySpace > &)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
Tensor< 2, dim, Number > l(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
VectorType::value_type * begin(VectorType &V)
VectorType::value_type * end(VectorType &V)
T sum(const T &t, const MPI_Comm &mpi_communicator)
size_t pack(const T &object, std::vector< char > &dest_buffer, const bool allow_compression=true)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
T unpack(const std::vector< char > &buffer, const bool allow_compression=true)
unsigned int n_active_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
unsigned int dominated_future_fe_on_children(const typename DoFHandler< dim, spacedim >::cell_iterator &parent)
void communicate_future_fe_indices(DoFHandler< dim, spacedim > &dof_handler)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
std::string policy_to_string(const ::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > &policy)
const types::boundary_id internal_face_boundary_id
static const unsigned int invalid_unsigned_int
const types::global_dof_index invalid_dof_index
unsigned int global_dof_index
static void reserve_space_mg(DoFHandler< 3, spacedim > &dof_handler)
static void reserve_space(DoFHandler< dim, spacedim > &dof_handler)
static void reserve_subentities(DoFHandler< dim, spacedim > &dof_handler, const unsigned int structdim, const unsigned int n_raw_entities, const T &cell_process)
static unsigned int max_couplings_between_dofs(const DoFHandler< 2, spacedim > &dof_handler)
static void reset_to_empty_objects(DoFHandler< dim, spacedim > &dof_handler)
static unsigned int max_couplings_between_dofs(const DoFHandler< 3, spacedim > &dof_handler)
static void reserve_space_mg(DoFHandler< 1, spacedim > &dof_handler)
static unsigned int max_couplings_between_dofs(const DoFHandler< 1, spacedim > &dof_handler)
static void reserve_space_mg(DoFHandler< 2, spacedim > &dof_handler)
static void reserve_cells(DoFHandler< dim, spacedim > &dof_handler, const unsigned int n_inner_dofs_per_cell)
static void collect_fe_indices_on_cells_to_be_refined(DoFHandler< dim, spacedim > &dof_handler)
static unsigned int determine_fe_from_children(const typename Triangulation< dim, spacedim >::cell_iterator &, const std::vector< unsigned int > &children_fe_indices, const ::hp::FECollection< dim, spacedim > &fe_collection)
static void reserve_space_cells(DoFHandler< dim, spacedim > &dof_handler)
static unsigned int dominated_future_fe_on_children(const typename DoFHandler< dim, spacedim >::cell_iterator &parent)
static void distribute_fe_indices_on_refined_cells(DoFHandler< dim, spacedim > &dof_handler)
static void ensure_absence_of_future_fe_indices(DoFHandler< dim, spacedim > &dof_handler)
static void reserve_space(::DoFHandler< 1, spacedim > &dof_handler)
static void reserve_space_faces(DoFHandler< dim, spacedim > &dof_handler)
static void communicate_future_fe_indices(DoFHandler< dim, spacedim > &dof_handler)
static void communicate_active_fe_indices(DoFHandler< dim, spacedim > &dof_handler)
static void reserve_space_vertices(DoFHandler< dim, spacedim > &dof_handler)
static void reserve_space(::DoFHandler< 2, spacedim > &dof_handler)
static void reserve_space(::DoFHandler< 3, spacedim > &dof_handler)
const ::Triangulation< dim, spacedim > & tria