20#include <deal.II/base/mpi.templates.h>
22#include <deal.II/distributed/cell_data_transfer.templates.h>
40#include <unordered_set>
44template <
int dim,
int spacedim>
48template <
int dim,
int spacedim>
55 template <
int dim,
int spacedim>
58 PolicyBase<dim, spacedim> &policy)
60 std::string policy_name;
61 if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::
62 Policy::Sequential<dim, spacedim> *
>(&policy) ||
63 dynamic_cast<const typename ::internal::DoFHandlerImplementation::
64 Policy::Sequential<dim, spacedim> *
>(&policy))
65 policy_name =
"Policy::Sequential<";
66 else if (
dynamic_cast<
67 const typename ::internal::DoFHandlerImplementation::
68 Policy::ParallelDistributed<dim, spacedim> *
>(&policy) ||
70 const typename ::internal::DoFHandlerImplementation::
71 Policy::ParallelDistributed<dim, spacedim> *
>(&policy))
72 policy_name =
"Policy::ParallelDistributed<";
73 else if (
dynamic_cast<
74 const typename ::internal::DoFHandlerImplementation::
75 Policy::ParallelShared<dim, spacedim> *
>(&policy) ||
77 const typename ::internal::DoFHandlerImplementation::
78 Policy::ParallelShared<dim, spacedim> *
>(&policy))
79 policy_name =
"Policy::ParallelShared<";
88 namespace DoFHandlerImplementation
100 template <
int spacedim>
110 template <
int spacedim>
229 template <
int spacedim>
242 const unsigned int max_adjacent_cells =
246 if (max_adjacent_cells <= 8)
265 template <
int dim,
int spacedim>
289 template <
int dim,
int spacedim>
292 const unsigned int n_inner_dofs_per_cell)
294 for (
unsigned int i = 0; i < dof_handler.
tria->
n_levels(); ++i)
300 for (
const auto &cell :
302 if (cell->is_active() && !cell->is_artificial())
304 n_inner_dofs_per_cell;
318 for (
const auto &cell :
320 if (cell->is_active() && !cell->is_artificial())
338 template <
int dim,
int spacedim,
typename T>
341 const unsigned int structdim,
342 const unsigned int n_raw_entities,
343 const T & cell_process)
348 dof_handler.
object_dof_ptr[0][structdim].assign(n_raw_entities + 1, -1);
351 if (cell->is_active() && !cell->is_artificial())
354 [&](
const unsigned int n_dofs_per_entity,
355 const unsigned int index) {
356 auto &n_dofs_per_entity_target =
361 Assert((n_dofs_per_entity_target ==
365 n_dofs_per_entity_target == n_dofs_per_entity),
368 n_dofs_per_entity_target = n_dofs_per_entity;
373 for (
unsigned int i = 1; i < n_raw_entities + 1; ++i)
397 template <
int dim,
int spacedim>
403 const auto &fe = dof_handler.
get_fe();
407 dim == 1 ? fe.n_dofs_per_line() :
408 (dim == 2 ? fe.n_dofs_per_quad(0) :
409 fe.n_dofs_per_hex()));
415 [&](
const auto &cell,
const auto &process) {
416 for (const auto vertex_index :
417 cell->vertex_indices())
418 process(fe.n_dofs_per_vertex(),
419 cell->vertex_index(vertex_index));
423 if (dim == 2 || dim == 3)
427 [&](
const auto &cell,
const auto &process) {
428 for (const auto line_index :
429 cell->line_indices())
430 process(fe.n_dofs_per_line(),
431 cell->line(line_index)->index());
439 [&](
const auto &cell,
const auto &process) {
440 for (const auto face_index :
441 cell->face_indices())
442 process(fe.n_dofs_per_quad(face_index),
443 cell->face(face_index)->index());
447 template <
int spacedim>
455 const ::Triangulation<1, spacedim> &
tria =
457 const unsigned int dofs_per_line =
461 for (
unsigned int i = 0; i < n_levels; ++i)
465 dof_handler.
mg_levels.back()->dof_object.dofs =
475 std::vector<unsigned int> max_level(n_vertices, 0);
476 std::vector<unsigned int> min_level(n_vertices, n_levels);
478 for (typename ::Triangulation<1, spacedim>::cell_iterator cell =
483 const unsigned int level = cell->level();
485 for (
const auto vertex : cell->vertex_indices())
487 const unsigned int vertex_index = cell->vertex_index(vertex);
489 if (min_level[vertex_index] >
level)
490 min_level[vertex_index] =
level;
492 if (max_level[vertex_index] <
level)
493 max_level[vertex_index] =
level;
497 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
501 Assert(max_level[vertex] >= min_level[vertex],
517 template <
int spacedim>
525 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe();
526 const ::Triangulation<2, spacedim> &
tria =
530 for (
unsigned int i = 0; i < n_levels; ++i)
535 dof_handler.
mg_levels.back()->dof_object.dofs =
536 std::vector<types::global_dof_index>(
538 fe.n_dofs_per_quad(0 ),
543 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>>();
546 fe.n_dofs_per_line(),
553 std::vector<unsigned int> max_level(n_vertices, 0);
554 std::vector<unsigned int> min_level(n_vertices, n_levels);
556 for (typename ::Triangulation<2, spacedim>::cell_iterator cell =
561 const unsigned int level = cell->level();
563 for (
const auto vertex : cell->vertex_indices())
565 const unsigned int vertex_index = cell->vertex_index(vertex);
567 if (min_level[vertex_index] >
level)
568 min_level[vertex_index] =
level;
570 if (max_level[vertex_index] <
level)
571 max_level[vertex_index] =
level;
575 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
579 Assert(max_level[vertex] >= min_level[vertex],
583 fe.n_dofs_per_vertex());
594 template <
int spacedim>
602 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe();
603 const ::Triangulation<3, spacedim> &
tria =
607 for (
unsigned int i = 0; i < n_levels; ++i)
612 dof_handler.
mg_levels.back()->dof_object.dofs =
619 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>>();
622 fe.n_dofs_per_line(),
628 dof_handler.
mg_faces->quads.dofs = std::vector<types::global_dof_index>(
636 std::vector<unsigned int> max_level(n_vertices, 0);
637 std::vector<unsigned int> min_level(n_vertices, n_levels);
639 for (typename ::Triangulation<3, spacedim>::cell_iterator cell =
644 const unsigned int level = cell->level();
646 for (
const auto vertex : cell->vertex_indices())
648 const unsigned int vertex_index = cell->vertex_index(vertex);
650 if (min_level[vertex_index] >
level)
651 min_level[vertex_index] =
level;
653 if (max_level[vertex_index] <
level)
654 max_level[vertex_index] =
level;
658 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
662 Assert(max_level[vertex] >= min_level[vertex],
666 fe.n_dofs_per_vertex());
683 namespace DoFHandlerImplementation
696 template <
int dim,
int spacedim>
703 if (cell->is_locally_owned())
705 !cell->future_fe_index_set(),
707 "There shouldn't be any cells flagged for p-adaptation when partitioning."));
716 template <
int dim,
int spacedim>
732 std::vector<bool> locally_used_vertices(
735 if (!cell->is_artificial())
736 for (
const auto v : cell->vertex_indices())
737 locally_used_vertices[cell->vertex_index(v)] =
true;
739 std::vector<std::vector<bool>> vertex_fe_association(
744 if (!cell->is_artificial())
745 for (
const auto v : cell->vertex_indices())
746 vertex_fe_association[cell->active_fe_index()]
747 [cell->vertex_index(v)] =
true;
756 if (locally_used_vertices[v] ==
true)
761 if (vertex_fe_association[fe][v] ==
true)
768 const unsigned int d = 0;
769 const unsigned int l = 0;
779 unsigned int vertex_slots_needed = 0;
780 unsigned int fe_slots_needed = 0;
788 for (
unsigned int fe = 0;
791 if (vertex_fe_association[fe][v] ==
true)
794 vertex_slots_needed +=
812 if (vertex_fe_association[fe][v] ==
true)
818 for (
unsigned int i = 0;
819 i < dof_handler.
get_fe(fe).n_dofs_per_vertex();
849 template <
int dim,
int spacedim>
866 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
871 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
881 if (cell->is_active() && !cell->is_artificial())
886 cell->get_fe().template n_dofs_per_object<dim>();
890 cache_size += cell->get_fe().n_dofs_per_cell();
894 std::vector<types::global_dof_index>(
897 std::vector<types::global_dof_index>(
908 template <
int dim,
int spacedim>
931 std::vector<bool> saved_face_user_flags;
938 .save_user_flags_line(saved_face_user_flags);
941 .clear_user_flags_line();
950 .save_user_flags_quad(saved_face_user_flags);
953 .clear_user_flags_quad();
962 const unsigned int d = dim - 1;
963 const unsigned int l = 0;
975 unsigned int n_face_slots = 0;
978 if (!cell->is_artificial())
979 for (
const auto face : cell->face_indices())
980 if (cell->face(face)->user_flag_set() ==
false)
982 unsigned int fe_slots_needed = 0;
984 if (cell->at_boundary(face) ||
985 cell->face(face)->has_children() ||
986 cell->neighbor_is_coarser(face) ||
987 (!cell->at_boundary(face) &&
988 cell->neighbor(face)->is_artificial()) ||
989 (!cell->at_boundary(face) &&
990 !cell->neighbor(face)->is_artificial() &&
991 (cell->active_fe_index() ==
992 cell->neighbor(face)->active_fe_index())))
996 dof_handler.
get_fe(cell->active_fe_index())
997 .template n_dofs_per_object<dim - 1>(face);
1001 fe_slots_needed = 2;
1003 dof_handler.
get_fe(cell->active_fe_index())
1004 .
template n_dofs_per_object<dim - 1>(face) +
1006 .
get_fe(cell->neighbor(face)->active_fe_index())
1007 .
template n_dofs_per_object<dim - 1>(
1008 cell->neighbor_face_no(face));
1012 cell->face(face)->set_user_flag();
1042 .clear_user_flags_line();
1051 .clear_user_flags_quad();
1061 if (!cell->is_artificial())
1062 for (
const auto face : cell->face_indices())
1063 if (!cell->face(face)->user_flag_set())
1066 if (cell->at_boundary(face) ||
1067 cell->face(face)->has_children() ||
1068 cell->neighbor_is_coarser(face) ||
1069 (!cell->at_boundary(face) &&
1070 cell->neighbor(face)->is_artificial()) ||
1071 (!cell->at_boundary(face) &&
1072 !cell->neighbor(face)->is_artificial() &&
1073 (cell->active_fe_index() ==
1074 cell->neighbor(face)->active_fe_index())))
1076 const unsigned int fe = cell->active_fe_index();
1077 const unsigned int n_dofs =
1079 .template n_dofs_per_object<dim - 1>(face);
1080 const unsigned int offset =
1087 for (
unsigned int i = 0; i < n_dofs; ++i)
1093 unsigned int fe_1 = cell->active_fe_index();
1094 unsigned int face_no_1 = face;
1096 cell->neighbor(face)->active_fe_index();
1097 unsigned int face_no_2 = cell->neighbor_face_no(face);
1101 std::swap(fe_1, fe_2);
1102 std::swap(face_no_1, face_no_2);
1105 const unsigned int n_dofs_1 =
1107 .template n_dofs_per_object<dim - 1>(face_no_1);
1109 const unsigned int n_dofs_2 =
1111 .template n_dofs_per_object<dim - 1>(face_no_2);
1113 const unsigned int offset =
1118 cell->active_fe_index());
1132 for (
unsigned int i = 0; i < n_dofs_1 + n_dofs_2; ++i)
1138 cell->face(face)->set_user_flag();
1141 for (
unsigned int i = 1;
1154 .load_user_flags_line(saved_face_user_flags);
1163 .load_user_flags_quad(saved_face_user_flags);
1182 template <
int spacedim>
1187 (typename ::DoFHandler<1, spacedim>::ExcNoFESelected()));
1189 ExcMessage(
"The current Triangulation must not be empty."));
1207 template <
int spacedim>
1212 (typename ::DoFHandler<1, spacedim>::ExcNoFESelected()));
1214 ExcMessage(
"The current Triangulation must not be empty."));
1234 template <
int spacedim>
1239 (typename ::DoFHandler<1, spacedim>::ExcNoFESelected()));
1241 ExcMessage(
"The current Triangulation must not be empty."));
1270 std::vector<std::vector<bool>> line_fe_association(
1275 if (!cell->is_artificial())
1276 for (
const auto l : cell->line_indices())
1277 line_fe_association[cell->active_fe_index()]
1278 [cell->line_index(l)] =
true;
1290 if (line_fe_association[fe][line] ==
true)
1292 line_is_used[line] =
true;
1298 const unsigned int d = 1;
1299 const unsigned int l = 0;
1309 unsigned int line_slots_needed = 0;
1310 unsigned int fe_slots_needed = 0;
1317 if (line_is_used[line] ==
true)
1319 for (
unsigned int fe = 0;
1322 if (line_fe_association[fe][line] ==
true)
1325 line_slots_needed +=
1344 if (line_is_used[line] ==
true)
1346 for (
unsigned int fe = 0;
1349 if (line_fe_association[fe][line] ==
true)
1355 for (
unsigned int i = 0;
1356 i < dof_handler.
get_fe(fe).n_dofs_per_line();
1370 fe_slots_needed + 1);
1392 template <
int dim,
int spacedim>
1400 using active_fe_index_type =
1401 typename ::DoFHandler<dim, spacedim>::active_fe_index_type;
1403 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1405 const ::parallel::shared::Triangulation<dim, spacedim>
1418 std::vector<active_fe_index_type> active_fe_indices(
1419 tr->n_active_cells(), 0u);
1421 if (cell->is_locally_owned())
1422 active_fe_indices[cell->active_cell_index()] =
1423 cell->active_fe_index();
1426 tr->get_communicator(),
1436 if (!cell->is_locally_owned())
1439 active_fe_indices[cell->active_cell_index()];
1441 else if (const ::parallel::
1442 DistributedTriangulationBase<dim, spacedim> *tr =
1445 DistributedTriangulationBase<dim, spacedim> *
>(
1455 [](
const typename ::DoFHandler<dim, spacedim>::
1456 active_cell_iterator &cell) -> active_fe_index_type {
1457 return cell->active_fe_index();
1462 const typename ::DoFHandler<dim, spacedim>::
1463 active_cell_iterator & cell,
1464 const active_fe_index_type active_fe_index) ->
void {
1475 active_fe_index_type,
1483 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1504 template <
int dim,
int spacedim>
1512 using active_fe_index_type =
1513 typename ::DoFHandler<dim, spacedim>::active_fe_index_type;
1515 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1517 const ::parallel::shared::Triangulation<dim, spacedim>
1520 std::vector<active_fe_index_type> future_fe_indices(
1521 tr->n_active_cells(), 0u);
1524 future_fe_indices[cell->active_cell_index()] =
1529 tr->get_communicator(),
1533 if (!cell->is_locally_owned())
1536 future_fe_indices[cell->active_cell_index()];
1538 else if (const ::parallel::
1539 DistributedTriangulationBase<dim, spacedim> *tr =
1542 DistributedTriangulationBase<dim, spacedim> *
>(
1547 const typename ::DoFHandler<dim, spacedim>::
1548 active_cell_iterator &cell) -> active_fe_index_type {
1555 const typename ::DoFHandler<dim, spacedim>::
1556 active_cell_iterator & cell,
1557 const active_fe_index_type future_fe_index) ->
void {
1564 active_fe_index_type,
1571 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1599 template <
int dim,
int spacedim>
1607 if (cell->is_locally_owned())
1609 if (cell->refine_flag_set())
1614 fe_transfer->refined_cells_fe_index.insert(
1615 {cell, cell->future_fe_index()});
1617 else if (cell->coarsen_flag_set())
1624 const auto &parent = cell->parent();
1628 if (fe_transfer->coarsened_cells_fe_index.find(parent) ==
1629 fe_transfer->coarsened_cells_fe_index.end())
1636 for (
const auto &child : parent->child_iterators())
1637 Assert(child->is_active() &&
1638 child->coarsen_flag_set(),
1639 typename ::Triangulation<
1640 dim>::ExcInconsistentCoarseningFlags());
1643 const unsigned int fe_index = ::internal::hp::
1644 DoFHandlerImplementation::Implementation::
1645 dominated_future_fe_on_children<dim, spacedim>(
1648 fe_transfer->coarsened_cells_fe_index.insert(
1649 {parent, fe_index});
1657 if (cell->future_fe_index_set() ==
true)
1658 fe_transfer->persisting_cells_fe_index.insert(
1659 {cell, cell->future_fe_index()});
1670 template <
int dim,
int spacedim>
1678 for (
const auto &persist : fe_transfer->persisting_cells_fe_index)
1680 const auto &cell = persist.first;
1682 if (cell->is_locally_owned())
1685 cell->set_active_fe_index(persist.second);
1691 for (
const auto &refine : fe_transfer->refined_cells_fe_index)
1693 const auto &parent = refine.first;
1695 for (
const auto &child : parent->child_iterators())
1696 if (child->is_locally_owned())
1699 child->set_active_fe_index(refine.second);
1705 for (
const auto &coarsen : fe_transfer->coarsened_cells_fe_index)
1707 const auto &cell = coarsen.first;
1709 if (cell->is_locally_owned())
1712 cell->set_active_fe_index(coarsen.second);
1728 template <
int dim,
int spacedim>
1732 const std::vector<unsigned int> & children_fe_indices,
1733 const ::hp::FECollection<dim, spacedim> &fe_collection)
1738 const std::set<unsigned int> children_fe_indices_set(
1739 children_fe_indices.begin(), children_fe_indices.end());
1741 const unsigned int dominated_fe_index =
1742 fe_collection.find_dominated_fe_extended(children_fe_indices_set,
1748 return dominated_fe_index;
1759 template <
int dim,
int spacedim>
1765 !parent->is_active(),
1767 "You ask for information on children of this cell which is only "
1768 "available for active cells. This cell has no children."));
1770 const auto &dof_handler = parent->get_dof_handler();
1772 dof_handler.has_hp_capabilities(),
1775 std::set<unsigned int> future_fe_indices_children;
1776 for (
const auto &child : parent->child_iterators())
1781 "You ask for information on children of this cell which is only "
1782 "available for active cells. One of its children is not active."));
1790 const unsigned int future_fe_index_child =
1791 ::internal::DoFCellAccessorImplementation::
1792 Implementation::future_fe_index<dim, spacedim, false>(*child);
1794 future_fe_indices_children.insert(future_fe_index_child);
1798 const unsigned int future_fe_index =
1799 dof_handler.fe_collection.find_dominated_fe_extended(
1800 future_fe_indices_children,
1806 return future_fe_index;
1815 template <
int dim,
int spacedim>
1819 Implementation::communicate_future_fe_indices<dim, spacedim>(
1828 template <
int dim,
int spacedim>
1833 return Implementation::dominated_future_fe_on_children<dim, spacedim>(
1842template <
int dim,
int spacedim>
1844 : hp_capability_enabled(true)
1845 ,
tria(nullptr, typeid(*this).name())
1851template <
int dim,
int spacedim>
1860template <
int dim,
int spacedim>
1864 for (
auto &connection : this->tria_listeners)
1865 connection.disconnect();
1866 this->tria_listeners.clear();
1868 for (
auto &connection : this->tria_listeners_for_transfer)
1869 connection.disconnect();
1870 this->tria_listeners_for_transfer.clear();
1881 this->policy.reset();
1886template <
int dim,
int spacedim>
1896template <
int dim,
int spacedim>
1902 this->distribute_dofs(fe);
1907template <
int dim,
int spacedim>
1915 for (
auto &connection : this->tria_listeners)
1916 connection.disconnect();
1917 this->tria_listeners.clear();
1919 for (
auto &connection : this->tria_listeners_for_transfer)
1920 connection.disconnect();
1921 this->tria_listeners_for_transfer.clear();
1925 this->policy.reset();
1935 this->setup_policy();
1938 hp_capability_enabled =
true;
1939 this->connect_to_triangulation_signals();
1940 this->create_active_fe_table();
1947template <
int dim,
int spacedim>
1952 this->get_triangulation().begin(
level);
1953 if (cell == this->get_triangulation().
end(
level))
1955 return cell_iterator(*cell,
this);
1960template <
int dim,
int spacedim>
1968 while (i->has_children())
1976template <
int dim,
int spacedim>
1980 return cell_iterator(&this->get_triangulation(), -1, -1,
this);
1985template <
int dim,
int spacedim>
1990 this->get_triangulation().end(
level);
1993 return cell_iterator(*cell,
this);
1998template <
int dim,
int spacedim>
2003 this->get_triangulation().end_active(
level);
2005 return active_cell_iterator(
end());
2006 return active_cell_iterator(*cell,
this);
2011template <
int dim,
int spacedim>
2015 Assert(this->has_level_dofs(),
2017 "levels if mg dofs got distributed."));
2019 this->get_triangulation().begin(
level);
2020 if (cell == this->get_triangulation().
end(
level))
2021 return end_mg(
level);
2022 return level_cell_iterator(*cell,
this);
2027template <
int dim,
int spacedim>
2031 Assert(this->has_level_dofs(),
2033 "levels if mg dofs got distributed."));
2035 this->get_triangulation().end(
level);
2038 return level_cell_iterator(*cell,
this);
2043template <
int dim,
int spacedim>
2047 return level_cell_iterator(&this->get_triangulation(), -1, -1,
this);
2052template <
int dim,
int spacedim>
2062template <
int dim,
int spacedim>
2073template <
int dim,
int spacedim>
2078 begin_mg(), end_mg());
2083template <
int dim,
int spacedim>
2086 const unsigned int level)
const
2094template <
int dim,
int spacedim>
2097 const unsigned int level)
const
2106template <
int dim,
int spacedim>
2109 const unsigned int level)
const
2121template <
int dim,
int spacedim>
2125 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2126 ExcNotImplementedWithHP());
2128 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2130 std::unordered_set<types::global_dof_index> boundary_dofs;
2131 std::vector<types::global_dof_index> dofs_on_face;
2132 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2134 const IndexSet &owned_dofs = locally_owned_dofs();
2141 for (
const auto &cell : this->active_cell_iterators())
2142 if (cell->is_locally_owned() && cell->at_boundary())
2144 for (
const auto iface : cell->face_indices())
2146 const auto face = cell->face(iface);
2147 if (face->at_boundary())
2149 const unsigned int dofs_per_face =
2150 cell->get_fe().n_dofs_per_face(iface);
2151 dofs_on_face.resize(dofs_per_face);
2153 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2154 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2156 const unsigned int global_idof_index = dofs_on_face[i];
2157 if (owned_dofs.
is_element(global_idof_index))
2159 boundary_dofs.insert(global_idof_index);
2165 return boundary_dofs.size();
2170template <
int dim,
int spacedim>
2173 const std::set<types::boundary_id> &boundary_ids)
const
2175 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2176 ExcNotImplementedWithHP());
2178 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2181 ExcInvalidBoundaryIndicator());
2185 std::unordered_set<types::global_dof_index> boundary_dofs;
2186 std::vector<types::global_dof_index> dofs_on_face;
2187 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2189 const IndexSet &owned_dofs = locally_owned_dofs();
2191 for (
const auto &cell : this->active_cell_iterators())
2192 if (cell->is_locally_owned() && cell->at_boundary())
2194 for (
const auto iface : cell->face_indices())
2196 const auto face = cell->face(iface);
2197 const unsigned int boundary_id = face->boundary_id();
2198 if (face->at_boundary() &&
2199 (boundary_ids.find(boundary_id) != boundary_ids.end()))
2201 const unsigned int dofs_per_face =
2202 cell->get_fe().n_dofs_per_face(iface);
2203 dofs_on_face.resize(dofs_per_face);
2205 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2206 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2208 const unsigned int global_idof_index = dofs_on_face[i];
2209 if (owned_dofs.
is_element(global_idof_index))
2211 boundary_dofs.insert(global_idof_index);
2217 return boundary_dofs.size();
2222template <
int dim,
int spacedim>
2240 if (hp_capability_enabled)
2253 if (this->mg_faces !=
nullptr)
2256 for (
unsigned int i = 0; i < this->mg_vertex_dofs.size(); ++i)
2257 mem +=
sizeof(MGVertexDoFs) +
2258 (1 + this->mg_vertex_dofs[i].get_finest_level() -
2259 this->mg_vertex_dofs[i].get_coarsest_level()) *
2268template <
int dim,
int spacedim>
2277template <
int dim,
int spacedim>
2282 this->tria !=
nullptr,
2284 "You need to set the Triangulation in the DoFHandler using reinit() or "
2285 "in the constructor before you can distribute DoFs."));
2287 ExcMessage(
"The Triangulation you are using is empty!"));
2291 if (this->fe_collection != ff)
2295 const bool contains_multiple_fes = (this->fe_collection.size() > 1);
2298 if (hp_capability_enabled && !contains_multiple_fes)
2300 hp_capability_enabled =
false;
2304 for (
auto &connection : this->tria_listeners_for_transfer)
2305 connection.disconnect();
2306 this->tria_listeners_for_transfer.clear();
2309 this->hp_cell_active_fe_indices.clear();
2310 this->hp_cell_active_fe_indices.shrink_to_fit();
2311 this->hp_cell_future_fe_indices.clear();
2312 this->hp_cell_future_fe_indices.shrink_to_fit();
2318 hp_capability_enabled || !contains_multiple_fes,
2320 "You cannot re-enable hp-capabilities after you registered a single "
2321 "finite element. Please create a new DoFHandler object instead."));
2324 if (hp_capability_enabled)
2333 for (
const auto &cell : this->active_cell_iterators())
2334 if (!cell->is_artificial())
2335 Assert(cell->active_fe_index() < this->fe_collection.size(),
2336 ExcInvalidFEIndex(cell->active_fe_index(),
2337 this->fe_collection.size()));
2343template <
int dim,
int spacedim>
2353template <
int dim,
int spacedim>
2359 this->tria !=
nullptr,
2361 "You need to set the Triangulation in the DoFHandler using reinit() or "
2362 "in the constructor before you can distribute DoFs."));
2364 ExcMessage(
"The Triangulation you are using is empty!"));
2371 if (this->fe_collection != ff)
2375 const bool contains_multiple_fes = (this->fe_collection.size() > 1);
2378 if (hp_capability_enabled && !contains_multiple_fes)
2380 hp_capability_enabled =
false;
2384 for (
auto &connection : this->tria_listeners_for_transfer)
2385 connection.disconnect();
2386 this->tria_listeners_for_transfer.clear();
2389 this->hp_cell_active_fe_indices.clear();
2390 this->hp_cell_active_fe_indices.shrink_to_fit();
2391 this->hp_cell_future_fe_indices.clear();
2392 this->hp_cell_future_fe_indices.shrink_to_fit();
2398 hp_capability_enabled || !contains_multiple_fes,
2400 "You cannot re-enable hp-capabilities after you registered a single "
2401 "finite element. Please call reinit() or create a new DoFHandler "
2402 "object instead."));
2408 if (hp_capability_enabled)
2418 for (
const auto &cell : this->active_cell_iterators())
2420 if (!cell->is_artificial())
2421 Assert(cell->active_fe_index() < this->fe_collection.size(),
2422 ExcInvalidFEIndex(cell->active_fe_index(),
2423 this->fe_collection.size()));
2424 if (cell->is_locally_owned())
2425 Assert(cell->future_fe_index() < this->fe_collection.size(),
2426 ExcInvalidFEIndex(cell->future_fe_index(),
2427 this->fe_collection.size()));
2442 subdomain_modifier(this->get_triangulation());
2451 if (hp_capability_enabled)
2459 this->number_cache = this->policy->distribute_dofs();
2476 if (!hp_capability_enabled &&
2478 *
>(&*this->tria) ==
nullptr)
2479 this->block_info_object.initialize(*
this,
false,
true);
2484template <
int dim,
int spacedim>
2488 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2491 this->object_dof_indices.size() > 0,
2493 "Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
2500 "The mesh smoothing requirement 'limit_level_difference_at_vertices' has to be set for using multigrid!"));
2502 this->clear_mg_space();
2505 this->mg_number_cache = this->policy->distribute_mg_dofs();
2510 &*this->tria) ==
nullptr)
2511 this->block_info_object.initialize(*
this,
true,
false);
2516template <
int dim,
int spacedim>
2520 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2522 this->block_info_object.initialize_local(*
this);
2527template <
int dim,
int spacedim>
2532 if (
dynamic_cast<const ::parallel::shared::Triangulation<dim, spacedim>
2533 *
>(&this->get_triangulation()) !=
nullptr)
2534 this->policy = std::make_unique<internal::DoFHandlerImplementation::Policy::
2535 ParallelShared<dim, spacedim>>(*this);
2536 else if (
dynamic_cast<
2537 const ::parallel::DistributedTriangulationBase<dim, spacedim>
2538 *
>(&this->get_triangulation()) ==
nullptr)
2539 this->policy = std::make_unique<
2544 std::make_unique<internal::DoFHandlerImplementation::Policy::
2545 ParallelDistributed<dim, spacedim>>(*this);
2550template <
int dim,
int spacedim>
2555 this->clear_space();
2556 this->clear_mg_space();
2561template <
int dim,
int spacedim>
2565 cell_dof_cache_indices.clear();
2567 cell_dof_cache_ptr.clear();
2569 object_dof_indices.clear();
2571 object_dof_ptr.clear();
2573 this->number_cache.clear();
2575 this->hp_cell_active_fe_indices.clear();
2576 this->hp_cell_future_fe_indices.clear();
2581template <
int dim,
int spacedim>
2585 this->mg_levels.clear();
2586 this->mg_faces.reset();
2588 std::vector<MGVertexDoFs> tmp;
2590 std::swap(this->mg_vertex_dofs, tmp);
2592 this->mg_number_cache.clear();
2597template <
int dim,
int spacedim>
2600 const std::vector<types::global_dof_index> &new_numbers)
2602 if (hp_capability_enabled)
2604 Assert(this->hp_cell_future_fe_indices.size() > 0,
2606 "You need to distribute DoFs before you can renumber them."));
2615 if (this->n_locally_owned_dofs() == this->n_dofs())
2617 std::vector<types::global_dof_index> tmp(new_numbers);
2618 std::sort(tmp.begin(), tmp.end());
2619 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2621 for (; p != tmp.end(); ++p, ++i)
2622 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2625 for (
const auto new_number : new_numbers)
2626 Assert(new_number < this->n_dofs(),
2628 "New DoF index is not less than the total number of dofs."));
2645 this->number_cache = this->policy->renumber_dofs(new_numbers);
2660 Assert(this->object_dof_indices.size() > 0,
2662 "You need to distribute DoFs before you can renumber them."));
2666 &*this->tria) !=
nullptr)
2668 Assert(new_numbers.size() == this->n_dofs() ||
2669 new_numbers.size() == this->n_locally_owned_dofs(),
2670 ExcMessage(
"Incorrect size of the input array."));
2672 else if (
dynamic_cast<
2674 &*this->tria) !=
nullptr)
2687 if (this->n_locally_owned_dofs() == this->n_dofs())
2689 std::vector<types::global_dof_index> tmp(new_numbers);
2690 std::sort(tmp.begin(), tmp.end());
2691 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2693 for (; p != tmp.end(); ++p, ++i)
2694 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2697 for (
const auto new_number : new_numbers)
2698 Assert(new_number < this->n_dofs(),
2700 "New DoF index is not less than the total number of dofs."));
2703 this->number_cache = this->policy->renumber_dofs(new_numbers);
2709template <
int dim,
int spacedim>
2712 const unsigned int level,
2713 const std::vector<types::global_dof_index> &new_numbers)
2715 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2718 this->mg_levels.size() > 0 && this->object_dof_indices.size() > 0,
2720 "You need to distribute active and level DoFs before you can renumber level DoFs."));
2723 this->locally_owned_mg_dofs(
level).n_elements());
2730 if (this->n_locally_owned_dofs() == this->n_dofs())
2732 std::vector<types::global_dof_index> tmp(new_numbers);
2733 std::sort(tmp.begin(), tmp.end());
2734 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2736 for (; p != tmp.end(); ++p, ++i)
2737 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2740 for (
const auto new_number : new_numbers)
2743 "New DoF index is not less than the total number of dofs."));
2746 this->mg_number_cache[
level] =
2747 this->policy->renumber_mg_dofs(
level, new_numbers);
2752template <
int dim,
int spacedim>
2756 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2761 return this->fe_collection.max_dofs_per_vertex();
2763 return (3 * this->fe_collection.max_dofs_per_vertex() +
2764 2 * this->fe_collection.max_dofs_per_line());
2775 return (19 * this->fe_collection.max_dofs_per_vertex() +
2776 28 * this->fe_collection.max_dofs_per_line() +
2777 8 * this->fe_collection.max_dofs_per_quad());
2786template <
int dim,
int spacedim>
2790 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2797template <
int dim,
int spacedim>
2800 const std::vector<unsigned int> &active_fe_indices)
2802 Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(),
2804 this->get_triangulation().n_active_cells()));
2806 this->create_active_fe_table();
2811 for (
const auto &cell : this->active_cell_iterators())
2812 if (cell->is_locally_owned())
2813 cell->set_active_fe_index(active_fe_indices[cell->active_cell_index()]);
2818template <
int dim,
int spacedim>
2821 std::vector<unsigned int> &active_fe_indices)
const
2823 active_fe_indices.resize(this->get_triangulation().
n_active_cells());
2828 for (
const auto &cell : this->active_cell_iterators())
2829 if (!cell->is_artificial())
2830 active_fe_indices[cell->active_cell_index()] = cell->active_fe_index();
2835template <
int dim,
int spacedim>
2840 Assert(hp_capability_enabled, ExcOnlyAvailableWithHP());
2843 this->tria_listeners.push_back(this->tria->
signals.
create.connect(
2844 [
this]() { this->reinit(*(this->tria)); }));
2845 this->tria_listeners.push_back(
2846 this->tria->
signals.
clear.connect([
this]() { this->clear(); }));
2851 const ::parallel::fullydistributed::Triangulation<dim, spacedim>
2852 *
>(&this->get_triangulation()))
2856 else if (
dynamic_cast<
2857 const ::parallel::distributed::Triangulation<dim, spacedim>
2858 *
>(&this->get_triangulation()))
2861 this->tria_listeners_for_transfer.push_back(
2863 internal::hp::DoFHandlerImplementation::Implementation::
2864 ensure_absence_of_future_fe_indices<dim, spacedim>(*this);
2866 this->tria_listeners_for_transfer.push_back(
2868 [
this]() { this->pre_distributed_transfer_action(); }));
2869 this->tria_listeners_for_transfer.push_back(
2871 [
this] { this->post_distributed_transfer_action(); }));
2874 this->tria_listeners_for_transfer.push_back(
2876 [
this]() { this->pre_distributed_transfer_action(); }));
2877 this->tria_listeners_for_transfer.push_back(
2879 [
this]() { this->post_distributed_transfer_action(); }));
2882 this->tria_listeners_for_transfer.push_back(
2884 [
this]() { this->active_fe_index_transfer.reset(); }));
2885 this->tria_listeners_for_transfer.push_back(
2887 [
this]() { this->update_active_fe_table(); }));
2889 else if (
dynamic_cast<
2890 const ::parallel::shared::Triangulation<dim, spacedim> *
>(
2891 &this->get_triangulation()) !=
nullptr)
2894 this->tria_listeners_for_transfer.push_back(
2896 internal::hp::DoFHandlerImplementation::Implementation::
2897 ensure_absence_of_future_fe_indices(*this);
2901 this->tria_listeners_for_transfer.push_back(
2903 internal::hp::DoFHandlerImplementation::Implementation::
2904 communicate_future_fe_indices(*this);
2906 this->tria_listeners_for_transfer.push_back(
2908 [
this] { this->pre_transfer_action(); }));
2909 this->tria_listeners_for_transfer.push_back(
2911 [
this] { this->post_transfer_action(); }));
2916 this->tria_listeners_for_transfer.push_back(
2918 [
this] { this->pre_transfer_action(); }));
2919 this->tria_listeners_for_transfer.push_back(
2921 [
this] { this->post_transfer_action(); }));
2927template <
int dim,
int spacedim>
2931 AssertThrow(hp_capability_enabled ==
true, ExcOnlyAvailableWithHP());
2938 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2939 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2943 for (
unsigned int level = 0;
level < this->hp_cell_future_fe_indices.size();
2946 if (this->hp_cell_active_fe_indices[
level].size() == 0 &&
2947 this->hp_cell_future_fe_indices[
level].size() == 0)
2949 this->hp_cell_active_fe_indices[
level].resize(
2951 this->hp_cell_future_fe_indices[
level].resize(
2959 Assert(this->hp_cell_active_fe_indices[
level].size() ==
2961 this->hp_cell_future_fe_indices[
level].size() ==
2962 this->tria->n_raw_cells(
level),
2978template <
int dim,
int spacedim>
2994 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2995 this->hp_cell_active_fe_indices.shrink_to_fit();
2997 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2998 this->hp_cell_future_fe_indices.shrink_to_fit();
3000 for (
unsigned int i = 0; i < this->hp_cell_future_fe_indices.size(); ++i)
3003 this->hp_cell_active_fe_indices[i].resize(this->tria->
n_raw_cells(i), 0);
3010 this->hp_cell_future_fe_indices[i].assign(this->tria->
n_raw_cells(i),
3011 invalid_active_fe_index);
3016template <
int dim,
int spacedim>
3022 this->active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3030template <
int dim,
int spacedim>
3034#ifndef DEAL_II_WITH_P4EST
3037 "You are attempting to use a functionality that is only available "
3038 "if deal.II was configured to use p4est, but cmake did not find a "
3039 "valid p4est library."));
3044 &this->get_triangulation()) !=
nullptr),
3049 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3058 active_fe_index_transfer->active_fe_indices.resize(
3061 for (
const auto &cell : active_cell_iterators())
3062 if (cell->is_locally_owned())
3063 active_fe_index_transfer->active_fe_indices[cell->active_cell_index()] =
3064 cell->future_fe_index();
3067 const auto *distributed_tria =
3069 &this->get_triangulation());
3071 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3072 parallel::distributed::
3073 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
3077 &::AdaptationStrategies::Refinement::
3078 preserve<dim, spacedim, unsigned int>,
3081 const std::vector<unsigned int> &children_fe_indices)
3083 return ::internal::hp::DoFHandlerImplementation::Implementation::
3084 determine_fe_from_children<dim, spacedim>(parent,
3085 children_fe_indices,
3089 active_fe_index_transfer->cell_data_transfer
3090 ->prepare_for_coarsening_and_refinement(
3091 active_fe_index_transfer->active_fe_indices);
3097template <
int dim,
int spacedim>
3101 update_active_fe_table();
3115 this->active_fe_index_transfer.reset();
3120template <
int dim,
int spacedim>
3124#ifndef DEAL_II_WITH_P4EST
3127 update_active_fe_table();
3132 this->active_fe_index_transfer->active_fe_indices.resize(
3134 this->active_fe_index_transfer->cell_data_transfer->unpack(
3135 this->active_fe_index_transfer->active_fe_indices);
3138 this->set_active_fe_indices(
3139 this->active_fe_index_transfer->active_fe_indices);
3146 this->active_fe_index_transfer.reset();
3152template <
int dim,
int spacedim>
3156#ifndef DEAL_II_WITH_P4EST
3159 "You are attempting to use a functionality that is only available "
3160 "if deal.II was configured to use p4est, but cmake did not find a "
3161 "valid p4est library."));
3166 &this->get_triangulation()) !=
nullptr),
3171 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3174 const auto *distributed_tria =
3176 &this->get_triangulation());
3178 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3179 parallel::distributed::
3180 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
3184 &::AdaptationStrategies::Refinement::
3185 preserve<dim, spacedim, unsigned int>,
3188 const std::vector<unsigned int> &children_fe_indices)
3190 return ::internal::hp::DoFHandlerImplementation::Implementation::
3191 determine_fe_from_children<dim, spacedim>(parent,
3192 children_fe_indices,
3203 active_fe_index_transfer->cell_data_transfer->prepare_for_serialization(
3204 active_fe_index_transfer->active_fe_indices);
3210template <
int dim,
int spacedim>
3214#ifndef DEAL_II_WITH_P4EST
3217 "You are attempting to use a functionality that is only available "
3218 "if deal.II was configured to use p4est, but cmake did not find a "
3219 "valid p4est library."));
3224 &this->get_triangulation()) !=
nullptr),
3229 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3232 const auto *distributed_tria =
3234 &this->get_triangulation());
3236 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3237 parallel::distributed::
3238 CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>(
3242 &::AdaptationStrategies::Refinement::
3243 preserve<dim, spacedim, unsigned int>,
3246 const std::vector<unsigned int> &children_fe_indices)
3248 return ::internal::hp::DoFHandlerImplementation::Implementation::
3249 determine_fe_from_children<dim, spacedim>(parent,
3250 children_fe_indices,
3255 active_fe_index_transfer->active_fe_indices.resize(
3257 active_fe_index_transfer->cell_data_transfer->deserialize(
3258 active_fe_index_transfer->active_fe_indices);
3261 set_active_fe_indices(active_fe_index_transfer->active_fe_indices);
3268 active_fe_index_transfer.reset();
3274template <
int dim,
int spacedim>
3276 : coarsest_level(
numbers::invalid_unsigned_int)
3282template <
int dim,
int spacedim>
3285 const unsigned int cl,
3286 const unsigned int fl,
3287 const unsigned int dofs_per_vertex)
3289 coarsest_level = cl;
3292 if (coarsest_level <= finest_level)
3294 const unsigned int n_levels = finest_level - coarsest_level + 1;
3295 const unsigned int n_indices = n_levels * dofs_per_vertex;
3297 indices = std::make_unique<types::global_dof_index[]>(n_indices);
3298 std::fill(indices.get(),
3299 indices.get() + n_indices,
3308template <
int dim,
int spacedim>
3312 return coarsest_level;
3317template <
int dim,
int spacedim>
3321 return finest_level;
3325#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
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
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
void set_fe(const FiniteElement< dim, spacedim > &fe)
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
typename LevelSelector::cell_iterator level_cell_iterator
void prepare_for_serialization_of_active_fe_indices()
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 initialize(const Triangulation< dim, spacedim > &tria, const FiniteElement< dim, spacedim > &fe)
unsigned short int active_fe_index_type
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
IteratorState::IteratorStates state() 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
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() const
IteratorRange< level_cell_iterator > mg_cell_iterators() const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators() const
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< cell_iterator > cell_iterators() const
IteratorRange< level_cell_iterator > mg_cell_iterators_on_level(const unsigned int level) const
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
#define AssertIndexRange(index, range)
static ::ExceptionBase & ExcNoDominatedFiniteElementOnChildren()
static ::ExceptionBase & ExcInternalError()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
typename ActiveSelector::cell_iterator cell_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
void exchange_cell_data_to_ghosts(const MeshType &mesh, const std::function< std_cxx17::optional< DataType >(const typename MeshType::active_cell_iterator &)> &pack, const std::function< void(const typename MeshType::active_cell_iterator &, const DataType &)> &unpack, const std::function< bool(const typename MeshType::active_cell_iterator &)> &cell_filter=always_return< typename MeshType::active_cell_iterator, bool >{true})
Task< RT > new_task(const std::function< RT()> &function)
@ valid
Iterator points to a valid object.
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
VectorType::value_type * end(VectorType &V)
VectorType::value_type * begin(VectorType &V)
T sum(const T &t, const MPI_Comm &mpi_communicator)
std::string int_to_string(const unsigned int value, const unsigned int digits=numbers::invalid_unsigned_int)
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
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
boost::signals2::signal< void()> post_distributed_load
boost::signals2::signal< void()> post_distributed_refinement
boost::signals2::signal< void()> pre_refinement
boost::signals2::signal< void()> create
boost::signals2::signal< void()> clear
boost::signals2::signal< void()> post_refinement
boost::signals2::signal< void()> pre_partition
boost::signals2::signal< void()> pre_distributed_repartition
boost::signals2::signal< void()> post_p4est_refinement
boost::signals2::signal< void()> post_distributed_repartition
boost::signals2::signal< void()> post_distributed_save
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