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>
51 template <
int dim,
int spacedim>
54 PolicyBase<dim, spacedim> &policy)
56 std::string policy_name;
57 if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::
58 Policy::Sequential<dim, spacedim> *
>(&policy) ||
59 dynamic_cast<const typename ::internal::DoFHandlerImplementation::
60 Policy::Sequential<dim, spacedim> *
>(&policy))
61 policy_name =
"Policy::Sequential<";
62 else if (
dynamic_cast<
63 const typename ::internal::DoFHandlerImplementation::
64 Policy::ParallelDistributed<dim, spacedim> *
>(&policy) ||
66 const typename ::internal::DoFHandlerImplementation::
67 Policy::ParallelDistributed<dim, spacedim> *
>(&policy))
68 policy_name =
"Policy::ParallelDistributed<";
69 else if (
dynamic_cast<
70 const typename ::internal::DoFHandlerImplementation::
71 Policy::ParallelShared<dim, spacedim> *
>(&policy) ||
73 const typename ::internal::DoFHandlerImplementation::
74 Policy::ParallelShared<dim, spacedim> *
>(&policy))
75 policy_name =
"Policy::ParallelShared<";
84 namespace DoFHandlerImplementation
96 template <
int spacedim>
106 template <
int spacedim>
225 template <
int spacedim>
238 const unsigned int max_adjacent_cells =
242 if (max_adjacent_cells <= 8)
261 template <
int dim,
int spacedim>
277 template <
int dim,
int spacedim>
280 const unsigned int n_inner_dofs_per_cell)
282 for (
unsigned int i = 0; i < dof_handler.
tria->
n_levels(); ++i)
287 for (
const auto &cell :
289 if (cell->is_active() && !cell->is_artificial())
291 n_inner_dofs_per_cell;
307 template <
int dim,
int spacedim,
typename T>
310 const unsigned int structdim,
311 const unsigned int n_raw_entities,
312 const T & cell_process)
317 dof_handler.
object_dof_ptr[0][structdim].assign(n_raw_entities + 1, -1);
320 if (cell->is_active() && !cell->is_artificial())
323 [&](
const unsigned int n_dofs_per_entity,
324 const unsigned int index) {
325 auto &n_dofs_per_entity_target =
330 Assert((n_dofs_per_entity_target ==
334 n_dofs_per_entity_target == n_dofs_per_entity),
337 n_dofs_per_entity_target = n_dofs_per_entity;
342 for (
unsigned int i = 1; i < n_raw_entities + 1; ++i)
366 template <
int dim,
int spacedim>
372 const auto &fe = dof_handler.
get_fe();
376 dim == 1 ? fe.n_dofs_per_line() :
377 (dim == 2 ? fe.n_dofs_per_quad(0) :
378 fe.n_dofs_per_hex()));
384 [&](
const auto &cell,
const auto &process) {
385 for (const auto vertex_index :
386 cell->vertex_indices())
387 process(fe.n_dofs_per_vertex(),
388 cell->vertex_index(vertex_index));
392 if (dim == 2 || dim == 3)
396 [&](
const auto &cell,
const auto &process) {
397 for (const auto line_index :
398 cell->line_indices())
399 process(fe.n_dofs_per_line(),
400 cell->line(line_index)->index());
408 [&](
const auto &cell,
const auto &process) {
409 for (const auto face_index :
410 cell->face_indices())
411 process(fe.n_dofs_per_quad(face_index),
412 cell->face(face_index)->index());
416 template <
int spacedim>
424 const ::Triangulation<1, spacedim> &
tria =
426 const unsigned int dofs_per_line =
430 for (
unsigned int i = 0; i < n_levels; ++i)
434 dof_handler.
mg_levels.back()->dof_object.dofs =
444 std::vector<unsigned int> max_level(n_vertices, 0);
445 std::vector<unsigned int> min_level(n_vertices, n_levels);
447 for (typename ::Triangulation<1, spacedim>::cell_iterator cell =
452 const unsigned int level = cell->level();
454 for (
const auto vertex : cell->vertex_indices())
456 const unsigned int vertex_index = cell->vertex_index(vertex);
458 if (min_level[vertex_index] >
level)
459 min_level[vertex_index] =
level;
461 if (max_level[vertex_index] <
level)
462 max_level[vertex_index] =
level;
466 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
470 Assert(max_level[vertex] >= min_level[vertex],
486 template <
int spacedim>
494 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe();
495 const ::Triangulation<2, spacedim> &
tria =
499 for (
unsigned int i = 0; i < n_levels; ++i)
504 dof_handler.
mg_levels.back()->dof_object.dofs =
505 std::vector<types::global_dof_index>(
507 fe.n_dofs_per_quad(0 ),
512 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>>();
515 fe.n_dofs_per_line(),
522 std::vector<unsigned int> max_level(n_vertices, 0);
523 std::vector<unsigned int> min_level(n_vertices, n_levels);
525 for (typename ::Triangulation<2, spacedim>::cell_iterator cell =
530 const unsigned int level = cell->level();
532 for (
const auto vertex : cell->vertex_indices())
534 const unsigned int vertex_index = cell->vertex_index(vertex);
536 if (min_level[vertex_index] >
level)
537 min_level[vertex_index] =
level;
539 if (max_level[vertex_index] <
level)
540 max_level[vertex_index] =
level;
544 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
548 Assert(max_level[vertex] >= min_level[vertex],
552 fe.n_dofs_per_vertex());
563 template <
int spacedim>
571 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe();
572 const ::Triangulation<3, spacedim> &
tria =
576 for (
unsigned int i = 0; i < n_levels; ++i)
581 dof_handler.
mg_levels.back()->dof_object.dofs =
588 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>>();
591 fe.n_dofs_per_line(),
597 dof_handler.
mg_faces->quads.dofs = std::vector<types::global_dof_index>(
605 std::vector<unsigned int> max_level(n_vertices, 0);
606 std::vector<unsigned int> min_level(n_vertices, n_levels);
608 for (typename ::Triangulation<3, spacedim>::cell_iterator cell =
613 const unsigned int level = cell->level();
615 for (
const auto vertex : cell->vertex_indices())
617 const unsigned int vertex_index = cell->vertex_index(vertex);
619 if (min_level[vertex_index] >
level)
620 min_level[vertex_index] =
level;
622 if (max_level[vertex_index] <
level)
623 max_level[vertex_index] =
level;
627 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
631 Assert(max_level[vertex] >= min_level[vertex],
635 fe.n_dofs_per_vertex());
652 namespace DoFHandlerImplementation
665 template <
int dim,
int spacedim>
672 if (cell->is_locally_owned())
674 !cell->future_fe_index_set(),
676 "There shouldn't be any cells flagged for p-adaptation when partitioning."));
685 template <
int dim,
int spacedim>
701 std::vector<bool> locally_used_vertices(
704 if (!cell->is_artificial())
705 for (
const auto v : cell->vertex_indices())
706 locally_used_vertices[cell->vertex_index(v)] =
true;
708 std::vector<std::vector<bool>> vertex_fe_association(
713 if (!cell->is_artificial())
714 for (
const auto v : cell->vertex_indices())
715 vertex_fe_association[cell->active_fe_index()]
716 [cell->vertex_index(v)] =
true;
725 if (locally_used_vertices[v] ==
true)
730 if (vertex_fe_association[fe][v] ==
true)
737 const unsigned int d = 0;
738 const unsigned int l = 0;
748 unsigned int vertex_slots_needed = 0;
749 unsigned int fe_slots_needed = 0;
757 for (
unsigned int fe = 0;
760 if (vertex_fe_association[fe][v] ==
true)
763 vertex_slots_needed +=
781 if (vertex_fe_association[fe][v] ==
true)
787 for (
unsigned int i = 0;
788 i < dof_handler.
get_fe(fe).n_dofs_per_vertex();
818 template <
int dim,
int spacedim>
835 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
843 if (cell->is_active() && !cell->is_artificial())
848 cell->get_fe().template n_dofs_per_object<dim>();
852 std::vector<types::global_dof_index>(
863 template <
int dim,
int spacedim>
884 std::vector<bool> face_touched(dim == 2 ?
888 const unsigned int d = dim - 1;
889 const unsigned int l = 0;
901 unsigned int n_face_slots = 0;
904 if (!cell->is_artificial())
905 for (
const auto face : cell->face_indices())
906 if (!face_touched[cell->face(face)->index()])
908 unsigned int fe_slots_needed = 0;
910 if (cell->at_boundary(face) ||
911 cell->face(face)->has_children() ||
912 cell->neighbor_is_coarser(face) ||
913 (!cell->at_boundary(face) &&
914 cell->neighbor(face)->is_artificial()) ||
915 (!cell->at_boundary(face) &&
916 !cell->neighbor(face)->is_artificial() &&
917 (cell->active_fe_index() ==
918 cell->neighbor(face)->active_fe_index())))
922 dof_handler.
get_fe(cell->active_fe_index())
923 .template n_dofs_per_object<dim - 1>(face);
929 dof_handler.
get_fe(cell->active_fe_index())
930 .
template n_dofs_per_object<dim - 1>(face) +
932 .
get_fe(cell->neighbor(face)->active_fe_index())
933 .
template n_dofs_per_object<dim - 1>(
934 cell->neighbor_face_no(face));
938 face_touched[cell->face(face)->index()] =
true;
962 face_touched = std::vector<bool>(face_touched.size());
965 if (!cell->is_artificial())
966 for (
const auto face : cell->face_indices())
967 if (!face_touched[cell->face(face)->index()])
970 if (cell->at_boundary(face) ||
971 cell->face(face)->has_children() ||
972 cell->neighbor_is_coarser(face) ||
973 (!cell->at_boundary(face) &&
974 cell->neighbor(face)->is_artificial()) ||
975 (!cell->at_boundary(face) &&
976 !cell->neighbor(face)->is_artificial() &&
977 (cell->active_fe_index() ==
978 cell->neighbor(face)->active_fe_index())))
981 const unsigned int n_dofs =
983 .template n_dofs_per_object<dim - 1>(face);
984 const unsigned int offset =
991 for (
unsigned int i = 0; i < n_dofs; ++i)
998 unsigned int face_no_1 = face;
1000 cell->neighbor(face)->active_fe_index();
1001 unsigned int face_no_2 = cell->neighbor_face_no(face);
1009 const unsigned int n_dofs_1 =
1011 .template n_dofs_per_object<dim - 1>(face_no_1);
1013 const unsigned int n_dofs_2 =
1015 .template n_dofs_per_object<dim - 1>(face_no_2);
1017 const unsigned int offset =
1022 cell->active_fe_index());
1036 for (
unsigned int i = 0; i < n_dofs_1 + n_dofs_2; ++i)
1042 face_touched[cell->face(face)->index()] =
true;
1045 for (
unsigned int i = 1;
1061 template <
int spacedim>
1068 ExcMessage(
"The current Triangulation must not be empty."));
1086 template <
int spacedim>
1093 ExcMessage(
"The current Triangulation must not be empty."));
1113 template <
int spacedim>
1120 ExcMessage(
"The current Triangulation must not be empty."));
1149 std::vector<std::vector<bool>> line_fe_association(
1154 if (!cell->is_artificial())
1155 for (
const auto l : cell->line_indices())
1156 line_fe_association[cell->active_fe_index()]
1157 [cell->line_index(
l)] =
true;
1169 if (line_fe_association[fe][line] ==
true)
1171 line_is_used[line] =
true;
1177 const unsigned int d = 1;
1178 const unsigned int l = 0;
1188 unsigned int line_slots_needed = 0;
1189 unsigned int fe_slots_needed = 0;
1196 if (line_is_used[line] ==
true)
1198 for (
unsigned int fe = 0;
1201 if (line_fe_association[fe][line] ==
true)
1204 line_slots_needed +=
1223 if (line_is_used[line] ==
true)
1225 for (
unsigned int fe = 0;
1228 if (line_fe_association[fe][line] ==
true)
1234 for (
unsigned int i = 0;
1235 i < dof_handler.
get_fe(fe).n_dofs_per_line();
1249 fe_slots_needed + 1);
1271 template <
int dim,
int spacedim>
1279 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1281 const ::parallel::shared::Triangulation<dim, spacedim>
1294 std::vector<types::fe_index> active_fe_indices(
1295 tr->n_active_cells(), 0u);
1297 if (cell->is_locally_owned())
1298 active_fe_indices[cell->active_cell_index()] =
1299 cell->active_fe_index();
1302 tr->get_communicator(),
1312 if (!cell->is_locally_owned())
1315 active_fe_indices[cell->active_cell_index()];
1317 else if (const ::parallel::
1318 DistributedTriangulationBase<dim, spacedim> *tr =
1321 DistributedTriangulationBase<dim, spacedim> *
>(
1330 auto pack = [](
const typename ::DoFHandler<dim, spacedim>::
1332 return cell->active_fe_index();
1335 auto unpack = [&dof_handler](
1336 const typename ::DoFHandler<dim, spacedim>::
1337 active_cell_iterator &cell,
1357 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1378 template <
int dim,
int spacedim>
1386 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1388 const ::parallel::shared::Triangulation<dim, spacedim>
1391 std::vector<types::fe_index> future_fe_indices(
1392 tr->n_active_cells(), 0u);
1395 future_fe_indices[cell->active_cell_index()] =
1400 tr->get_communicator(),
1404 if (!cell->is_locally_owned())
1407 future_fe_indices[cell->active_cell_index()];
1409 else if (const ::parallel::
1410 DistributedTriangulationBase<dim, spacedim> *tr =
1413 DistributedTriangulationBase<dim, spacedim> *
>(
1416 auto pack = [&dof_handler](
1417 const typename ::DoFHandler<dim, spacedim>::
1423 auto unpack = [&dof_handler](
1424 const typename ::DoFHandler<dim, spacedim>::
1425 active_cell_iterator &cell,
1440 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1468 template <
int dim,
int spacedim>
1476 if (cell->is_locally_owned())
1478 if (cell->refine_flag_set())
1483 fe_transfer->refined_cells_fe_index.insert(
1484 {cell, cell->future_fe_index()});
1486 else if (cell->coarsen_flag_set())
1493 const auto &parent = cell->parent();
1497 if (fe_transfer->coarsened_cells_fe_index.find(parent) ==
1498 fe_transfer->coarsened_cells_fe_index.end())
1505 for (
const auto &child : parent->child_iterators())
1506 Assert(child->is_active() &&
1507 child->coarsen_flag_set(),
1508 typename ::Triangulation<
1509 dim>::ExcInconsistentCoarseningFlags());
1513 DoFHandlerImplementation::Implementation::
1514 dominated_future_fe_on_children<dim, spacedim>(
1517 fe_transfer->coarsened_cells_fe_index.insert(
1526 if (cell->future_fe_index_set() ==
true)
1527 fe_transfer->persisting_cells_fe_index.insert(
1528 {cell, cell->future_fe_index()});
1539 template <
int dim,
int spacedim>
1547 for (
const auto &persist : fe_transfer->persisting_cells_fe_index)
1549 const auto &cell = persist.first;
1551 if (cell->is_locally_owned())
1554 cell->set_active_fe_index(persist.second);
1560 for (
const auto &
refine : fe_transfer->refined_cells_fe_index)
1562 const auto &parent =
refine.first;
1564 for (
const auto &child : parent->child_iterators())
1565 if (child->is_locally_owned())
1568 child->set_active_fe_index(
refine.second);
1574 for (
const auto &
coarsen : fe_transfer->coarsened_cells_fe_index)
1576 const auto &cell =
coarsen.first;
1578 if (cell->is_locally_owned())
1581 cell->set_active_fe_index(
coarsen.second);
1597 template <
int dim,
int spacedim>
1601 const std::vector<types::fe_index> & children_fe_indices,
1602 const ::hp::FECollection<dim, spacedim> &fe_collection)
1608 const std::set<unsigned int> children_fe_indices_set(
1609 children_fe_indices.begin(), children_fe_indices.end());
1612 fe_collection.find_dominated_fe_extended(children_fe_indices_set,
1618 return dominated_fe_index;
1629 template <
int dim,
int spacedim>
1635 !parent->is_active(),
1637 "You ask for information on children of this cell which is only "
1638 "available for active cells. This cell has no children."));
1640 const auto &dof_handler = parent->get_dof_handler();
1642 dof_handler.has_hp_capabilities(),
1646 std::set<unsigned int> future_fe_indices_children;
1647 for (
const auto &child : parent->child_iterators())
1652 "You ask for information on children of this cell which is only "
1653 "available for active cells. One of its children is not active."));
1662 ::internal::DoFCellAccessorImplementation::
1663 Implementation::future_fe_index<dim, spacedim, false>(*child);
1665 future_fe_indices_children.insert(future_fe_index_child);
1670 dof_handler.fe_collection.find_dominated_fe_extended(
1671 future_fe_indices_children,
1677 return future_fe_index;
1686 template <
int dim,
int spacedim>
1690 Implementation::communicate_future_fe_indices<dim, spacedim>(
1699 template <
int dim,
int spacedim>
1704 return Implementation::dominated_future_fe_on_children<dim, spacedim>(
1713 template <
int dim,
int spacedim>
1715 : hp_capability_enabled(true)
1716 ,
tria(nullptr, typeid(*this).name())
1722 template <
int dim,
int spacedim>
1731 template <
int dim,
int spacedim>
1735 for (
auto &connection : this->tria_listeners)
1736 connection.disconnect();
1737 this->tria_listeners.clear();
1739 for (
auto &connection : this->tria_listeners_for_transfer)
1740 connection.disconnect();
1741 this->tria_listeners_for_transfer.clear();
1752 this->policy.reset();
1757 template <
int dim,
int spacedim>
1765 for (
auto &connection : this->tria_listeners)
1766 connection.disconnect();
1767 this->tria_listeners.clear();
1769 for (
auto &connection : this->tria_listeners_for_transfer)
1770 connection.disconnect();
1771 this->tria_listeners_for_transfer.clear();
1775 this->policy.reset();
1785 this->setup_policy();
1788 hp_capability_enabled =
true;
1789 this->connect_to_triangulation_signals();
1790 this->create_active_fe_table();
1797 template <
int dim,
int spacedim>
1803 if (cell == this->get_triangulation().
end(
level))
1805 return cell_iterator(*cell,
this);
1810 template <
int dim,
int spacedim>
1818 while (i->has_children())
1826 template <
int dim,
int spacedim>
1830 return cell_iterator(&this->get_triangulation(), -1, -1,
this);
1835 template <
int dim,
int spacedim>
1840 this->get_triangulation().
end(
level);
1843 return cell_iterator(*cell,
this);
1848 template <
int dim,
int spacedim>
1855 return active_cell_iterator(
end());
1856 return active_cell_iterator(*cell,
this);
1861 template <
int dim,
int spacedim>
1865 Assert(this->has_level_dofs(),
1867 "levels if mg dofs got distributed."));
1870 if (cell == this->get_triangulation().
end(
level))
1871 return end_mg(
level);
1872 return level_cell_iterator(*cell,
this);
1877 template <
int dim,
int spacedim>
1881 Assert(this->has_level_dofs(),
1883 "levels if mg dofs got distributed."));
1885 this->get_triangulation().
end(
level);
1888 return level_cell_iterator(*cell,
this);
1893 template <
int dim,
int spacedim>
1897 return level_cell_iterator(&this->get_triangulation(), -1, -1,
this);
1902 template <
int dim,
int spacedim>
1912 template <
int dim,
int spacedim>
1923 template <
int dim,
int spacedim>
1928 begin_mg(), end_mg());
1933 template <
int dim,
int spacedim>
1936 const unsigned int level)
const
1944 template <
int dim,
int spacedim>
1947 const unsigned int level)
const
1956 template <
int dim,
int spacedim>
1959 const unsigned int level)
const
1971 template <
int dim,
int spacedim>
1975 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
1976 ExcNotImplementedWithHP());
1980 std::unordered_set<types::global_dof_index> boundary_dofs;
1981 std::vector<types::global_dof_index> dofs_on_face;
1982 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
1984 const IndexSet &owned_dofs = locally_owned_dofs();
1991 for (
const auto &cell : this->active_cell_iterators())
1992 if (cell->is_locally_owned() && cell->at_boundary())
1994 for (
const auto iface : cell->face_indices())
1996 const auto face = cell->face(iface);
1997 if (face->at_boundary())
1999 const unsigned int dofs_per_face =
2000 cell->get_fe().n_dofs_per_face(iface);
2001 dofs_on_face.resize(dofs_per_face);
2003 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2004 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2006 const unsigned int global_idof_index = dofs_on_face[i];
2007 if (owned_dofs.
is_element(global_idof_index))
2009 boundary_dofs.insert(global_idof_index);
2015 return boundary_dofs.size();
2020 template <
int dim,
int spacedim>
2023 const std::set<types::boundary_id> &boundary_ids)
const
2025 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2026 ExcNotImplementedWithHP());
2035 std::unordered_set<types::global_dof_index> boundary_dofs;
2036 std::vector<types::global_dof_index> dofs_on_face;
2037 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2039 const IndexSet &owned_dofs = locally_owned_dofs();
2041 for (
const auto &cell : this->active_cell_iterators())
2042 if (cell->is_locally_owned() && cell->at_boundary())
2044 for (
const auto iface : cell->face_indices())
2046 const auto face = cell->face(iface);
2047 const unsigned int boundary_id = face->boundary_id();
2048 if (face->at_boundary() &&
2049 (boundary_ids.find(
boundary_id) != boundary_ids.end()))
2051 const unsigned int dofs_per_face =
2052 cell->get_fe().n_dofs_per_face(iface);
2053 dofs_on_face.resize(dofs_per_face);
2055 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2056 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2058 const unsigned int global_idof_index = dofs_on_face[i];
2059 if (owned_dofs.
is_element(global_idof_index))
2061 boundary_dofs.insert(global_idof_index);
2067 return boundary_dofs.size();
2072 template <
int dim,
int spacedim>
2088 if (hp_capability_enabled)
2101 if (this->mg_faces !=
nullptr)
2104 for (
unsigned int i = 0; i < this->mg_vertex_dofs.size(); ++i)
2105 mem +=
sizeof(MGVertexDoFs) +
2106 (1 + this->mg_vertex_dofs[i].get_finest_level() -
2107 this->mg_vertex_dofs[i].get_coarsest_level()) *
2116 template <
int dim,
int spacedim>
2126 template <
int dim,
int spacedim>
2132 this->tria !=
nullptr,
2134 "You need to set the Triangulation in the DoFHandler using reinit() or "
2135 "in the constructor before you can distribute DoFs."));
2137 ExcMessage(
"The Triangulation you are using is empty!"));
2144 if (this->fe_collection != ff)
2148 const bool contains_multiple_fes = (this->fe_collection.size() > 1);
2151 if (hp_capability_enabled && !contains_multiple_fes)
2153 hp_capability_enabled =
false;
2157 for (
auto &connection : this->tria_listeners_for_transfer)
2158 connection.disconnect();
2159 this->tria_listeners_for_transfer.clear();
2162 this->hp_cell_active_fe_indices.clear();
2163 this->hp_cell_active_fe_indices.shrink_to_fit();
2164 this->hp_cell_future_fe_indices.clear();
2165 this->hp_cell_future_fe_indices.shrink_to_fit();
2171 hp_capability_enabled || !contains_multiple_fes,
2173 "You cannot re-enable hp-capabilities after you registered a single "
2174 "finite element. Please call reinit() or create a new DoFHandler "
2175 "object instead."));
2181 if (hp_capability_enabled)
2191 for (
const auto &cell : this->active_cell_iterators())
2193 if (!cell->is_artificial())
2194 Assert(cell->active_fe_index() < this->fe_collection.size(),
2195 ExcInvalidFEIndex(cell->active_fe_index(),
2196 this->fe_collection.size()));
2197 if (cell->is_locally_owned())
2198 Assert(cell->future_fe_index() < this->fe_collection.size(),
2199 ExcInvalidFEIndex(cell->future_fe_index(),
2200 this->fe_collection.size()));
2215 subdomain_modifier(this->get_triangulation());
2224 if (hp_capability_enabled)
2232 this->number_cache = this->policy->distribute_dofs();
2249 if (!hp_capability_enabled &&
2251 *
>(&*this->tria) ==
nullptr)
2252 this->block_info_object.initialize(*
this,
false,
true);
2257 template <
int dim,
int spacedim>
2261 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2264 this->object_dof_indices.size() > 0,
2266 "Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
2273 "The mesh smoothing requirement 'limit_level_difference_at_vertices' has to be set for using multigrid!"));
2275 this->clear_mg_space();
2278 this->mg_number_cache = this->policy->distribute_mg_dofs();
2283 &*this->tria) ==
nullptr)
2284 this->block_info_object.initialize(*
this,
true,
false);
2289 template <
int dim,
int spacedim>
2293 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2295 this->block_info_object.initialize_local(*
this);
2300 template <
int dim,
int spacedim>
2305 if (
dynamic_cast<const ::parallel::shared::Triangulation<dim, spacedim>
2306 *
>(&this->get_triangulation()) !=
nullptr)
2307 this->policy = std::make_unique<internal::DoFHandlerImplementation::Policy::
2308 ParallelShared<dim, spacedim>>(*this);
2309 else if (
dynamic_cast<
2310 const ::parallel::DistributedTriangulationBase<dim, spacedim>
2311 *
>(&this->get_triangulation()) ==
nullptr)
2312 this->policy = std::make_unique<
2317 std::make_unique<internal::DoFHandlerImplementation::Policy::
2318 ParallelDistributed<dim, spacedim>>(*this);
2323 template <
int dim,
int spacedim>
2328 this->clear_space();
2329 this->clear_mg_space();
2334 template <
int dim,
int spacedim>
2338 object_dof_indices.clear();
2340 object_dof_ptr.clear();
2342 this->number_cache.clear();
2344 this->hp_cell_active_fe_indices.clear();
2345 this->hp_cell_future_fe_indices.clear();
2350 template <
int dim,
int spacedim>
2354 this->mg_levels.clear();
2355 this->mg_faces.reset();
2357 std::vector<MGVertexDoFs> tmp;
2361 this->mg_number_cache.clear();
2366 template <
int dim,
int spacedim>
2369 const std::vector<types::global_dof_index> &new_numbers)
2371 if (hp_capability_enabled)
2373 Assert(this->hp_cell_future_fe_indices.size() > 0,
2375 "You need to distribute DoFs before you can renumber them."));
2384 if (this->n_locally_owned_dofs() == this->n_dofs())
2386 std::vector<types::global_dof_index> tmp(new_numbers);
2387 std::sort(tmp.begin(), tmp.end());
2388 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2390 for (; p != tmp.end(); ++p, ++i)
2391 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2394 for (
const auto new_number : new_numbers)
2395 Assert(new_number < this->n_dofs(),
2397 "New DoF index is not less than the total number of dofs."));
2414 this->number_cache = this->policy->renumber_dofs(new_numbers);
2429 Assert(this->object_dof_indices.size() > 0,
2431 "You need to distribute DoFs before you can renumber them."));
2435 &*this->tria) !=
nullptr)
2437 Assert(new_numbers.size() == this->n_dofs() ||
2438 new_numbers.size() == this->n_locally_owned_dofs(),
2439 ExcMessage(
"Incorrect size of the input array."));
2441 else if (
dynamic_cast<
2443 &*this->tria) !=
nullptr)
2456 if (this->n_locally_owned_dofs() == this->n_dofs())
2458 std::vector<types::global_dof_index> tmp(new_numbers);
2459 std::sort(tmp.begin(), tmp.end());
2460 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2462 for (; p != tmp.end(); ++p, ++i)
2463 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2466 for (
const auto new_number : new_numbers)
2467 Assert(new_number < this->n_dofs(),
2469 "New DoF index is not less than the total number of dofs."));
2472 this->number_cache = this->policy->renumber_dofs(new_numbers);
2478 template <
int dim,
int spacedim>
2481 const unsigned int level,
2482 const std::vector<types::global_dof_index> &new_numbers)
2484 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2487 this->mg_levels.size() > 0 && this->object_dof_indices.size() > 0,
2489 "You need to distribute active and level DoFs before you can renumber level DoFs."));
2492 this->locally_owned_mg_dofs(
level).n_elements());
2499 if (this->n_locally_owned_dofs() == this->n_dofs())
2501 std::vector<types::global_dof_index> tmp(new_numbers);
2502 std::sort(tmp.begin(), tmp.end());
2503 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2505 for (; p != tmp.end(); ++p, ++i)
2506 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2509 for (
const auto new_number : new_numbers)
2512 "New DoF index is not less than the total number of dofs."));
2515 this->mg_number_cache[
level] =
2516 this->policy->renumber_mg_dofs(
level, new_numbers);
2521 template <
int dim,
int spacedim>
2530 return this->fe_collection.max_dofs_per_vertex();
2532 return (3 * this->fe_collection.max_dofs_per_vertex() +
2533 2 * this->fe_collection.max_dofs_per_line());
2544 return (19 * this->fe_collection.max_dofs_per_vertex() +
2545 28 * this->fe_collection.max_dofs_per_line() +
2546 8 * this->fe_collection.max_dofs_per_quad());
2555 template <
int dim,
int spacedim>
2566 template <
int dim,
int spacedim>
2569 const std::vector<types::fe_index> &active_fe_indices)
2571 Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(),
2573 this->get_triangulation().n_active_cells()));
2575 this->create_active_fe_table();
2580 for (
const auto &cell : this->active_cell_iterators())
2581 if (cell->is_locally_owned())
2582 cell->set_active_fe_index(active_fe_indices[cell->active_cell_index()]);
2587 template <
int dim,
int spacedim>
2590 const std::vector<unsigned int> &active_fe_indices)
2592 set_active_fe_indices(std::vector<types::fe_index>(active_fe_indices.begin(),
2593 active_fe_indices.end()));
2598 template <
int dim,
int spacedim>
2599 std::vector<types::fe_index>
2602 std::vector<types::fe_index> active_fe_indices(
2608 for (
const auto &cell : this->active_cell_iterators())
2609 if (!cell->is_artificial())
2610 active_fe_indices[cell->active_cell_index()] = cell->active_fe_index();
2612 return active_fe_indices;
2617 template <
int dim,
int spacedim>
2620 std::vector<unsigned int> &active_fe_indices)
const
2624 active_fe_indices.assign(indices.begin(), indices.end());
2629 template <
int dim,
int spacedim>
2632 const std::vector<types::fe_index> &future_fe_indices)
2634 Assert(future_fe_indices.size() == this->get_triangulation().n_active_cells(),
2636 this->get_triangulation().n_active_cells()));
2638 this->create_active_fe_table();
2643 for (
const auto &cell : this->active_cell_iterators())
2644 if (cell->is_locally_owned() &&
2645 future_fe_indices[cell->active_cell_index()] !=
2647 cell->set_future_fe_index(future_fe_indices[cell->active_cell_index()]);
2652 template <
int dim,
int spacedim>
2653 std::vector<types::fe_index>
2656 std::vector<types::fe_index> future_fe_indices(
2662 for (
const auto &cell : this->active_cell_iterators())
2663 if (cell->is_locally_owned() && cell->future_fe_index_set())
2664 future_fe_indices[cell->active_cell_index()] = cell->future_fe_index();
2666 return future_fe_indices;
2671 template <
int dim,
int spacedim>
2676 Assert(hp_capability_enabled, ExcOnlyAvailableWithHP());
2679 this->tria_listeners.push_back(this->tria->
signals.create.connect(
2680 [
this]() { this->reinit(*(this->tria)); }));
2681 this->tria_listeners.push_back(
2682 this->tria->
signals.clear.connect([
this]() { this->clear(); }));
2687 const ::parallel::fullydistributed::Triangulation<dim, spacedim>
2688 *
>(&this->get_triangulation()))
2692 else if (
dynamic_cast<
2693 const ::parallel::distributed::Triangulation<dim, spacedim>
2694 *
>(&this->get_triangulation()))
2697 this->tria_listeners_for_transfer.push_back(
2698 this->tria->
signals.pre_distributed_repartition.connect([
this]() {
2699 internal::hp::DoFHandlerImplementation::Implementation::
2700 ensure_absence_of_future_fe_indices<dim, spacedim>(*this);
2702 this->tria_listeners_for_transfer.push_back(
2703 this->tria->
signals.pre_distributed_repartition.connect(
2704 [
this]() { this->pre_distributed_transfer_action(); }));
2705 this->tria_listeners_for_transfer.push_back(
2706 this->tria->
signals.post_distributed_repartition.connect(
2707 [
this] { this->post_distributed_transfer_action(); }));
2710 this->tria_listeners_for_transfer.push_back(
2711 this->tria->
signals.post_p4est_refinement.connect(
2712 [
this]() { this->pre_distributed_transfer_action(); }));
2713 this->tria_listeners_for_transfer.push_back(
2714 this->tria->
signals.post_distributed_refinement.connect(
2715 [
this]() { this->post_distributed_transfer_action(); }));
2718 this->tria_listeners_for_transfer.push_back(
2719 this->tria->
signals.post_distributed_save.connect(
2720 [
this]() { this->active_fe_index_transfer.reset(); }));
2721 this->tria_listeners_for_transfer.push_back(
2722 this->tria->
signals.post_distributed_load.connect(
2723 [
this]() { this->update_active_fe_table(); }));
2725 else if (
dynamic_cast<
2726 const ::parallel::shared::Triangulation<dim, spacedim> *
>(
2727 &this->get_triangulation()) !=
nullptr)
2730 this->tria_listeners_for_transfer.push_back(
2731 this->tria->
signals.pre_partition.connect([
this]() {
2732 internal::hp::DoFHandlerImplementation::Implementation::
2733 ensure_absence_of_future_fe_indices(*this);
2737 this->tria_listeners_for_transfer.push_back(
2738 this->tria->
signals.pre_refinement.connect([
this]() {
2739 internal::hp::DoFHandlerImplementation::Implementation::
2740 communicate_future_fe_indices(*this);
2742 this->tria_listeners_for_transfer.push_back(
2743 this->tria->
signals.pre_refinement.connect(
2744 [
this] { this->pre_transfer_action(); }));
2745 this->tria_listeners_for_transfer.push_back(
2746 this->tria->
signals.post_refinement.connect(
2747 [
this] { this->post_transfer_action(); }));
2752 this->tria_listeners_for_transfer.push_back(
2753 this->tria->
signals.pre_refinement.connect(
2754 [
this] { this->pre_transfer_action(); }));
2755 this->tria_listeners_for_transfer.push_back(
2756 this->tria->
signals.post_refinement.connect(
2757 [
this] { this->post_transfer_action(); }));
2763 template <
int dim,
int spacedim>
2767 AssertThrow(hp_capability_enabled ==
true, ExcOnlyAvailableWithHP());
2774 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2775 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2779 for (
unsigned int level = 0;
level < this->hp_cell_future_fe_indices.size();
2782 if (this->hp_cell_active_fe_indices[
level].size() == 0 &&
2783 this->hp_cell_future_fe_indices[
level].size() == 0)
2785 this->hp_cell_active_fe_indices[
level].resize(
2787 this->hp_cell_future_fe_indices[
level].resize(
2795 Assert(this->hp_cell_active_fe_indices[
level].size() ==
2797 this->hp_cell_future_fe_indices[
level].size() ==
2798 this->tria->n_raw_cells(
level),
2814 template <
int dim,
int spacedim>
2830 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2831 this->hp_cell_active_fe_indices.shrink_to_fit();
2833 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2834 this->hp_cell_future_fe_indices.shrink_to_fit();
2836 for (
unsigned int i = 0; i < this->hp_cell_future_fe_indices.size(); ++i)
2839 this->hp_cell_active_fe_indices[i].resize(this->tria->
n_raw_cells(i), 0);
2846 this->hp_cell_future_fe_indices[i].assign(this->tria->
n_raw_cells(i),
2852 template <
int dim,
int spacedim>
2858 this->active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2866 template <
int dim,
int spacedim>
2870 #ifndef DEAL_II_WITH_P4EST
2873 "You are attempting to use a functionality that is only available "
2874 "if deal.II was configured to use p4est, but cmake did not find a "
2875 "valid p4est library."));
2880 &this->get_triangulation()) !=
nullptr),
2885 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2894 active_fe_index_transfer->active_fe_indices.resize(
2897 for (
const auto &cell : active_cell_iterators())
2898 if (cell->is_locally_owned())
2899 active_fe_index_transfer->active_fe_indices[cell->active_cell_index()] =
2900 cell->future_fe_index();
2903 const auto *distributed_tria =
2905 &this->get_triangulation());
2907 active_fe_index_transfer->cell_data_transfer = std::make_unique<
2908 parallel::distributed::
2909 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
2913 &::AdaptationStrategies::Refinement::
2914 preserve<dim, spacedim, types::fe_index>,
2917 const std::vector<types::fe_index> &children_fe_indices)
2919 return ::internal::hp::DoFHandlerImplementation::Implementation::
2920 determine_fe_from_children<dim, spacedim>(parent,
2921 children_fe_indices,
2925 active_fe_index_transfer->cell_data_transfer
2926 ->prepare_for_coarsening_and_refinement(
2927 active_fe_index_transfer->active_fe_indices);
2933 template <
int dim,
int spacedim>
2937 update_active_fe_table();
2951 this->active_fe_index_transfer.reset();
2956 template <
int dim,
int spacedim>
2960 #ifndef DEAL_II_WITH_P4EST
2963 update_active_fe_table();
2968 this->active_fe_index_transfer->active_fe_indices.resize(
2970 this->active_fe_index_transfer->cell_data_transfer->unpack(
2971 this->active_fe_index_transfer->active_fe_indices);
2974 this->set_active_fe_indices(
2975 this->active_fe_index_transfer->active_fe_indices);
2982 this->active_fe_index_transfer.reset();
2988 template <
int dim,
int spacedim>
2992 #ifndef DEAL_II_WITH_P4EST
2995 "You are attempting to use a functionality that is only available "
2996 "if deal.II was configured to use p4est, but cmake did not find a "
2997 "valid p4est library."));
3002 &this->get_triangulation()) !=
nullptr),
3007 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3010 const auto *distributed_tria =
3012 &this->get_triangulation());
3014 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3015 parallel::distributed::
3016 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
3020 &::AdaptationStrategies::Refinement::
3021 preserve<dim, spacedim, types::fe_index>,
3024 const std::vector<types::fe_index> &children_fe_indices)
3026 return ::internal::hp::DoFHandlerImplementation::Implementation::
3027 determine_fe_from_children<dim, spacedim>(parent,
3028 children_fe_indices,
3039 active_fe_index_transfer->cell_data_transfer->prepare_for_serialization(
3040 active_fe_index_transfer->active_fe_indices);
3046 template <
int dim,
int spacedim>
3050 #ifndef DEAL_II_WITH_P4EST
3053 "You are attempting to use a functionality that is only available "
3054 "if deal.II was configured to use p4est, but cmake did not find a "
3055 "valid p4est library."));
3060 &this->get_triangulation()) !=
nullptr),
3065 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3068 const auto *distributed_tria =
3070 &this->get_triangulation());
3072 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3073 parallel::distributed::
3074 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
3078 &::AdaptationStrategies::Refinement::
3079 preserve<dim, spacedim, types::fe_index>,
3082 const std::vector<types::fe_index> &children_fe_indices)
3084 return ::internal::hp::DoFHandlerImplementation::Implementation::
3085 determine_fe_from_children<dim, spacedim>(parent,
3086 children_fe_indices,
3091 active_fe_index_transfer->active_fe_indices.resize(
3093 active_fe_index_transfer->cell_data_transfer->deserialize(
3094 active_fe_index_transfer->active_fe_indices);
3097 set_active_fe_indices(active_fe_index_transfer->active_fe_indices);
3104 active_fe_index_transfer.reset();
3110 template <
int dim,
int spacedim>
3118 template <
int dim,
int spacedim>
3121 const unsigned int cl,
3122 const unsigned int fl,
3123 const unsigned int dofs_per_vertex)
3125 coarsest_level = cl;
3128 if (coarsest_level <= finest_level)
3130 const unsigned int n_levels = finest_level - coarsest_level + 1;
3131 const unsigned int n_indices = n_levels * dofs_per_vertex;
3133 indices = std::make_unique<types::global_dof_index[]>(n_indices);
3134 std::fill(indices.get(),
3135 indices.get() + n_indices,
3144 template <
int dim,
int spacedim>
3148 return coarsest_level;
3153 template <
int dim,
int spacedim>
3157 return finest_level;
3161 #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
unsigned int max_couplings_between_dofs() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
std::vector< types::fe_index > get_active_fe_indices() const
std::unique_ptr< ActiveFEIndexTransfer > active_fe_index_transfer
hp::FECollection< dim, spacedim > fe_collection
void create_active_fe_table()
std::vector< std::vector< types::fe_index > > hp_cell_future_fe_indices
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
level_cell_iterator end_mg() const
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
std::vector< types::fe_index > get_future_fe_indices() const
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::fe_index > > hp_cell_active_fe_indices
std::vector< MGVertexDoFs > mg_vertex_dofs
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()
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()
void prepare_for_serialization_of_active_fe_indices()
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
cell_iterator begin(const unsigned int level=0) const
std::array< std::vector< offset_type >, dim+1 > hp_object_fe_ptr
std::array< std::vector< types::fe_index >, dim+1 > hp_object_fe_indices
void set_active_fe_indices(const std::vector< types::fe_index > &active_fe_indices)
unsigned int max_couplings_between_boundary_dofs() const
void deserialize_active_fe_indices()
void set_future_fe_indices(const std::vector< types::fe_index > &future_fe_indices)
virtual ~DoFHandler() override
unsigned int n_dofs_per_vertex() 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< T, MemorySpace > &u, MemorySpaceData< T, MemorySpace > &v)
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
const types::fe_index invalid_fe_index
static const unsigned int invalid_unsigned_int
const types::global_dof_index invalid_dof_index
unsigned int global_dof_index
unsigned short int fe_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 void reserve_space_cells(DoFHandler< dim, spacedim > &dof_handler)
static types::fe_index 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 types::fe_index determine_fe_from_children(const typename Triangulation< dim, spacedim >::cell_iterator &, const std::vector< types::fe_index > &children_fe_indices, const ::hp::FECollection< dim, spacedim > &fe_collection)
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