17#include <deal.II/base/mpi.templates.h>
20#include <deal.II/distributed/cell_data_transfer.templates.h>
38#include <unordered_set>
43template <
int dim,
int spacedim>
50 template <
int dim,
int spacedim>
53 PolicyBase<dim, spacedim> &policy)
55 std::string policy_name;
56 if (
dynamic_cast<const typename ::internal::DoFHandlerImplementation::
57 Policy::Sequential<dim, spacedim> *
>(&policy))
58 policy_name =
"Policy::Sequential<";
59 else if (
dynamic_cast<
60 const typename ::internal::DoFHandlerImplementation::
61 Policy::ParallelDistributed<dim, spacedim> *
>(&policy))
62 policy_name =
"Policy::ParallelDistributed<";
63 else if (
dynamic_cast<
64 const typename ::internal::DoFHandlerImplementation::
65 Policy::ParallelShared<dim, spacedim> *
>(&policy))
66 policy_name =
"Policy::ParallelShared<";
75 namespace DoFHandlerImplementation
87 template <
int spacedim>
97 template <
int spacedim>
216 template <
int spacedim>
229 const unsigned int max_adjacent_cells =
233 if (max_adjacent_cells <= 8)
252 template <
int dim,
int spacedim>
268 template <
int dim,
int spacedim>
271 const unsigned int n_inner_dofs_per_cell)
273 for (
unsigned int i = 0; i < dof_handler.
tria->
n_levels(); ++i)
278 for (
const auto &cell :
280 if (cell->is_active() && !cell->is_artificial())
282 n_inner_dofs_per_cell;
298 template <
int dim,
int spacedim,
typename T>
301 const unsigned int structdim,
302 const unsigned int n_raw_entities,
303 const T &cell_process)
308 dof_handler.
object_dof_ptr[0][structdim].assign(n_raw_entities + 1, -1);
311 if (cell->is_active() && !cell->is_artificial())
314 [&](
const unsigned int n_dofs_per_entity,
315 const unsigned int index) {
316 auto &n_dofs_per_entity_target =
321 Assert((n_dofs_per_entity_target ==
325 n_dofs_per_entity_target == n_dofs_per_entity),
328 n_dofs_per_entity_target = n_dofs_per_entity;
333 for (
unsigned int i = 1; i < n_raw_entities + 1; ++i)
357 template <
int dim,
int spacedim>
363 const auto &fe = dof_handler.
get_fe();
367 dim == 1 ? fe.n_dofs_per_line() :
368 (dim == 2 ? fe.n_dofs_per_quad(0) :
369 fe.n_dofs_per_hex()));
375 [&](
const auto &cell,
const auto &process) {
376 for (const auto vertex_index :
377 cell->vertex_indices())
378 process(fe.n_dofs_per_vertex(),
379 cell->vertex_index(vertex_index));
383 if (dim == 2 || dim == 3)
387 [&](
const auto &cell,
const auto &process) {
388 for (const auto line_index :
389 cell->line_indices())
390 process(fe.n_dofs_per_line(),
391 cell->line(line_index)->index());
399 [&](
const auto &cell,
const auto &process) {
400 for (const auto face_index :
401 cell->face_indices())
402 process(fe.n_dofs_per_quad(face_index),
403 cell->face(face_index)->index());
407 template <
int spacedim>
415 const ::Triangulation<1, spacedim> &tria =
417 const unsigned int dofs_per_line =
419 const unsigned int n_levels = tria.n_levels();
421 for (
unsigned int i = 0; i < n_levels; ++i)
425 dof_handler.
mg_levels.back()->dof_object.dofs =
426 std::vector<types::global_dof_index>(tria.n_raw_lines(i) *
431 const unsigned int n_vertices = tria.n_vertices();
435 std::vector<unsigned int> max_level(n_vertices, 0);
436 std::vector<unsigned int> min_level(n_vertices, n_levels);
438 for (typename ::Triangulation<1, spacedim>::cell_iterator cell =
443 const unsigned int level = cell->level();
445 for (
const auto vertex : cell->vertex_indices())
447 const unsigned int vertex_index = cell->vertex_index(vertex);
449 if (min_level[vertex_index] > level)
450 min_level[vertex_index] = level;
452 if (max_level[vertex_index] < level)
453 max_level[vertex_index] = level;
457 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
458 if (tria.vertex_used(vertex))
461 Assert(max_level[vertex] >= min_level[vertex],
477 template <
int spacedim>
485 const ::FiniteElement<2, spacedim> &fe = dof_handler.
get_fe();
486 const ::Triangulation<2, spacedim> &tria =
488 const unsigned int n_levels = tria.
n_levels();
490 for (
unsigned int i = 0; i < n_levels; ++i)
495 dof_handler.
mg_levels.back()->dof_object.dofs =
496 std::vector<types::global_dof_index>(
497 tria.n_raw_quads(i) *
498 fe.n_dofs_per_quad(0 ),
503 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<2>>();
505 std::vector<types::global_dof_index>(tria.n_raw_lines() *
506 fe.n_dofs_per_line(),
509 const unsigned int n_vertices = tria.n_vertices();
513 std::vector<unsigned int> max_level(n_vertices, 0);
514 std::vector<unsigned int> min_level(n_vertices, n_levels);
516 for (typename ::Triangulation<2, spacedim>::cell_iterator cell =
521 const unsigned int level = cell->level();
523 for (
const auto vertex : cell->vertex_indices())
525 const unsigned int vertex_index = cell->vertex_index(vertex);
527 if (min_level[vertex_index] > level)
528 min_level[vertex_index] = level;
530 if (max_level[vertex_index] < level)
531 max_level[vertex_index] = level;
535 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
536 if (tria.vertex_used(vertex))
539 Assert(max_level[vertex] >= min_level[vertex],
543 fe.n_dofs_per_vertex());
554 template <
int spacedim>
562 const ::FiniteElement<3, spacedim> &fe = dof_handler.
get_fe();
563 const ::Triangulation<3, spacedim> &tria =
565 const unsigned int n_levels = tria.
n_levels();
567 for (
unsigned int i = 0; i < n_levels; ++i)
572 dof_handler.
mg_levels.back()->dof_object.dofs =
573 std::vector<types::global_dof_index>(tria.n_raw_hexs(i) *
579 std::make_unique<internal::DoFHandlerImplementation::DoFFaces<3>>();
581 std::vector<types::global_dof_index>(tria.n_raw_lines() *
582 fe.n_dofs_per_line(),
588 dof_handler.
mg_faces->quads.dofs = std::vector<types::global_dof_index>(
589 tria.n_raw_quads() * fe.n_dofs_per_quad(0 ),
592 const unsigned int n_vertices = tria.n_vertices();
596 std::vector<unsigned int> max_level(n_vertices, 0);
597 std::vector<unsigned int> min_level(n_vertices, n_levels);
599 for (typename ::Triangulation<3, spacedim>::cell_iterator cell =
604 const unsigned int level = cell->level();
606 for (
const auto vertex : cell->vertex_indices())
608 const unsigned int vertex_index = cell->vertex_index(vertex);
610 if (min_level[vertex_index] > level)
611 min_level[vertex_index] = level;
613 if (max_level[vertex_index] < level)
614 max_level[vertex_index] = level;
618 for (
unsigned int vertex = 0; vertex < n_vertices; ++vertex)
619 if (tria.vertex_used(vertex))
622 Assert(max_level[vertex] >= min_level[vertex],
626 fe.n_dofs_per_vertex());
643 namespace DoFHandlerImplementation
656 template <
int dim,
int spacedim>
663 if (cell->is_locally_owned())
665 !cell->future_fe_index_set(),
667 "There shouldn't be any cells flagged for p-adaptation when partitioning."));
676 template <
int dim,
int spacedim>
692 std::vector<bool> locally_used_vertices(
695 if (!cell->is_artificial())
696 for (
const auto v : cell->vertex_indices())
697 locally_used_vertices[cell->vertex_index(v)] =
true;
699 std::vector<std::vector<bool>> vertex_fe_association(
704 if (!cell->is_artificial())
705 for (
const auto v : cell->vertex_indices())
706 vertex_fe_association[cell->active_fe_index()]
707 [cell->vertex_index(v)] =
true;
717 if (locally_used_vertices[v] ==
true)
722 if (vertex_fe_association[fe][v] ==
true)
729 const unsigned int d = 0;
730 const unsigned int l = 0;
740 unsigned int vertex_slots_needed = 0;
741 unsigned int fe_slots_needed = 0;
749 for (
unsigned int fe = 0;
752 if (vertex_fe_association[fe][v] ==
true)
755 vertex_slots_needed +=
773 if (vertex_fe_association[fe][v] ==
true)
779 for (
unsigned int i = 0;
780 i < dof_handler.
get_fe(fe).n_dofs_per_vertex();
810 template <
int dim,
int spacedim>
823 for (
unsigned int level = 0; level < dof_handler.
tria->
n_levels();
827 std::vector<typename DoFHandler<dim, spacedim>::offset_type>(
835 if (cell->is_active() && !cell->is_artificial())
840 cell->get_fe().template n_dofs_per_object<dim>();
844 std::vector<types::global_dof_index>(
855 template <
int dim,
int spacedim>
876 std::vector<bool> face_touched(dim == 2 ?
880 const unsigned int d = dim - 1;
881 const unsigned int l = 0;
893 unsigned int n_face_slots = 0;
896 if (!cell->is_artificial())
897 for (
const auto face : cell->face_indices())
898 if (!face_touched[cell->face(face)->index()])
900 unsigned int fe_slots_needed = 0;
902 if (cell->at_boundary(face) ||
903 cell->face(face)->has_children() ||
904 cell->neighbor_is_coarser(face) ||
905 (!cell->at_boundary(face) &&
906 cell->neighbor(face)->is_artificial()) ||
907 (!cell->at_boundary(face) &&
908 !cell->neighbor(face)->is_artificial() &&
909 (cell->active_fe_index() ==
910 cell->neighbor(face)->active_fe_index())))
914 dof_handler.
get_fe(cell->active_fe_index())
915 .template n_dofs_per_object<dim - 1>(face);
921 dof_handler.
get_fe(cell->active_fe_index())
922 .template n_dofs_per_object<dim - 1>(face) +
924 .get_fe(cell->neighbor(face)->active_fe_index())
925 .template n_dofs_per_object<dim - 1>(
926 cell->neighbor_face_no(face));
930 face_touched[cell->face(face)->index()] =
true;
954 face_touched = std::vector<bool>(face_touched.size());
957 if (!cell->is_artificial())
958 for (
const auto face : cell->face_indices())
959 if (!face_touched[cell->face(face)->index()])
962 if (cell->at_boundary(face) ||
963 cell->face(face)->has_children() ||
964 cell->neighbor_is_coarser(face) ||
965 (!cell->at_boundary(face) &&
966 cell->neighbor(face)->is_artificial()) ||
967 (!cell->at_boundary(face) &&
968 !cell->neighbor(face)->is_artificial() &&
969 (cell->active_fe_index() ==
970 cell->neighbor(face)->active_fe_index())))
973 const unsigned int n_dofs =
975 .template n_dofs_per_object<dim - 1>(face);
976 const unsigned int offset =
983 for (
unsigned int i = 0; i < n_dofs; ++i)
990 unsigned int face_no_1 = face;
992 cell->neighbor(face)->active_fe_index();
993 unsigned int face_no_2 = cell->neighbor_face_no(face);
997 std::swap(fe_1, fe_2);
998 std::swap(face_no_1, face_no_2);
1001 const unsigned int n_dofs_1 =
1003 .template n_dofs_per_object<dim - 1>(face_no_1);
1005 const unsigned int n_dofs_2 =
1007 .template n_dofs_per_object<dim - 1>(face_no_2);
1009 const unsigned int offset =
1014 cell->active_fe_index());
1028 for (
unsigned int i = 0; i < n_dofs_1 + n_dofs_2; ++i)
1034 face_touched[cell->face(face)->index()] =
true;
1037 for (
unsigned int i = 1;
1053 template <
int spacedim>
1060 ExcMessage(
"The current Triangulation must not be empty."));
1078 template <
int spacedim>
1085 ExcMessage(
"The current Triangulation must not be empty."));
1105 template <
int spacedim>
1112 ExcMessage(
"The current Triangulation must not be empty."));
1141 std::vector<std::vector<bool>> line_fe_association(
1146 if (!cell->is_artificial())
1147 for (
const auto l : cell->line_indices())
1148 line_fe_association[cell->active_fe_index()]
1149 [cell->line_index(l)] =
true;
1161 if (line_fe_association[fe][line] ==
true)
1163 line_is_used[line] =
true;
1169 const unsigned int d = 1;
1170 const unsigned int l = 0;
1180 unsigned int line_slots_needed = 0;
1181 unsigned int fe_slots_needed = 0;
1188 if (line_is_used[line] ==
true)
1190 for (
unsigned int fe = 0;
1193 if (line_fe_association[fe][line] ==
true)
1196 line_slots_needed +=
1215 if (line_is_used[line] ==
true)
1217 for (
unsigned int fe = 0;
1220 if (line_fe_association[fe][line] ==
true)
1226 for (
unsigned int i = 0;
1227 i < dof_handler.
get_fe(fe).n_dofs_per_line();
1241 fe_slots_needed + 1);
1263 template <
int dim,
int spacedim>
1271 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1273 const ::parallel::shared::Triangulation<dim, spacedim>
1286 std::vector<types::fe_index> active_fe_indices(
1287 tr->n_active_cells(), 0u);
1289 if (cell->is_locally_owned())
1290 active_fe_indices[cell->active_cell_index()] =
1291 cell->active_fe_index();
1294 tr->get_mpi_communicator(),
1304 if (!cell->is_locally_owned())
1307 active_fe_indices[cell->active_cell_index()];
1309 else if (const ::parallel::
1310 DistributedTriangulationBase<dim, spacedim> *tr =
1313 DistributedTriangulationBase<dim, spacedim> *
>(
1326 return cell->active_fe_index();
1352 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1373 template <
int dim,
int spacedim>
1381 if (const ::parallel::shared::Triangulation<dim, spacedim> *tr =
1383 const ::parallel::shared::Triangulation<dim, spacedim>
1386 std::vector<types::fe_index> future_fe_indices(
1387 tr->n_active_cells(), 0u);
1390 future_fe_indices[cell->active_cell_index()] =
1395 tr->get_mpi_communicator(),
1399 if (!cell->is_locally_owned())
1402 future_fe_indices[cell->active_cell_index()];
1404 else if (const ::parallel::
1405 DistributedTriangulationBase<dim, spacedim> *tr =
1408 DistributedTriangulationBase<dim, spacedim> *
>(
1437 const ::parallel::TriangulationBase<dim, spacedim> *
>(
1465 template <
int dim,
int spacedim>
1473 if (cell->is_locally_owned())
1475 if (cell->refine_flag_set())
1480 fe_transfer->refined_cells_fe_index.emplace_back(
1481 cell, cell->future_fe_index());
1483 else if (cell->coarsen_flag_set())
1490 const auto &parent = cell->parent();
1494 if (fe_transfer->coarsened_cells_fe_index.find(parent) ==
1495 fe_transfer->coarsened_cells_fe_index.end())
1504 for (
const auto &child : parent->child_iterators())
1505 Assert(child->is_active() &&
1506 child->coarsen_flag_set(),
1516 fe_transfer->coarsened_cells_fe_index.insert(
1517 {parent, fe_index});
1525 if (cell->future_fe_index_set() ==
true)
1526 fe_transfer->persisting_cells_fe_index.emplace_back(
1527 cell, cell->future_fe_index());
1538 template <
int dim,
int spacedim>
1546 for (
const auto &persist : fe_transfer->persisting_cells_fe_index)
1548 const auto &cell = persist.first;
1550 if (cell->is_locally_owned())
1553 cell->set_active_fe_index(persist.second);
1559 for (
const auto &refine : fe_transfer->refined_cells_fe_index)
1561 const auto &parent = refine.first;
1563 for (
const auto &child : parent->child_iterators())
1564 if (child->is_locally_owned())
1567 child->set_active_fe_index(refine.second);
1573 for (
const auto &coarsen : fe_transfer->coarsened_cells_fe_index)
1575 const auto &cell = coarsen.first;
1577 if (cell->is_locally_owned())
1580 cell->set_active_fe_index(coarsen.second);
1596 template <
int dim,
int spacedim>
1600 const std::vector<types::fe_index> &children_fe_indices,
1601 const ::hp::FECollection<dim, spacedim> &fe_collection)
1607 const std::set<unsigned int> children_fe_indices_set(
1608 children_fe_indices.begin(), children_fe_indices.end());
1611 fe_collection.find_dominated_fe_extended(children_fe_indices_set,
1617 return dominated_fe_index;
1628 template <
int dim,
int spacedim>
1634 !parent->is_active(),
1636 "You ask for information on children of this cell which is only "
1637 "available for active cells. This cell has no children."));
1639 const auto &dof_handler = parent->get_dof_handler();
1641 dof_handler.has_hp_capabilities(),
1645 std::set<unsigned int> future_fe_indices_children;
1646 for (
const auto &child : parent->child_iterators())
1651 "You ask for information on children of this cell which is only "
1652 "available for active cells. One of its children is not active."));
1664 future_fe_indices_children.insert(future_fe_index_child);
1669 dof_handler.fe_collection.find_dominated_fe_extended(
1670 future_fe_indices_children,
1676 return future_fe_index;
1685 template <
int dim,
int spacedim>
1698 template <
int dim,
int spacedim>
1712template <
int dim,
int spacedim>
1715 : hp_capability_enabled(true)
1716 , tria(nullptr, typeid(*this).name())
1722template <
int dim,
int spacedim>
1732template <
int dim,
int spacedim>
1737 for (
auto &connection : this->tria_listeners)
1738 connection.disconnect();
1739 this->tria_listeners.clear();
1741 for (
auto &connection : this->tria_listeners_for_transfer)
1742 connection.disconnect();
1743 this->tria_listeners_for_transfer.clear();
1754 this->policy.reset();
1759template <
int dim,
int spacedim>
1767 for (
auto &connection : this->tria_listeners)
1768 connection.disconnect();
1769 this->tria_listeners.clear();
1771 for (
auto &connection : this->tria_listeners_for_transfer)
1772 connection.disconnect();
1773 this->tria_listeners_for_transfer.clear();
1777 this->policy.reset();
1780 this->fe_collection = hp::FECollection<dim, spacedim>();
1787 this->setup_policy();
1790 hp_capability_enabled =
true;
1791 this->connect_to_triangulation_signals();
1792 this->create_active_fe_table();
1798template <
int dim,
int spacedim>
1804 this->get_triangulation().begin(level);
1805 if (cell == this->get_triangulation().
end(level))
1807 return cell_iterator(*cell,
this);
1812template <
int dim,
int spacedim>
1818 cell_iterator i =
begin(level);
1821 while (i->has_children())
1829template <
int dim,
int spacedim>
1834 return cell_iterator(&this->get_triangulation(), -1, -1,
this);
1839template <
int dim,
int spacedim>
1845 this->get_triangulation().end(level);
1848 return cell_iterator(*cell,
this);
1853template <
int dim,
int spacedim>
1859 this->get_triangulation().end_active(level);
1861 return active_cell_iterator(
end());
1862 return active_cell_iterator(*cell,
this);
1867template <
int dim,
int spacedim>
1872 Assert(this->has_level_dofs(),
1874 "levels if mg dofs got distributed."));
1876 this->get_triangulation().begin(level);
1877 if (cell == this->get_triangulation().
end(level))
1878 return end_mg(level);
1879 return level_cell_iterator(*cell,
this);
1884template <
int dim,
int spacedim>
1889 Assert(this->has_level_dofs(),
1891 "levels if mg dofs got distributed."));
1893 this->get_triangulation().end(level);
1896 return level_cell_iterator(*cell,
this);
1901template <
int dim,
int spacedim>
1906 return level_cell_iterator(&this->get_triangulation(), -1, -1,
this);
1911template <
int dim,
int spacedim>
1913IteratorRange<typename DoFHandler<dim, spacedim>::cell_iterator> DoFHandler<
1915 spacedim>::cell_iterators()
const
1917 return IteratorRange<typename DoFHandler<dim, spacedim>::cell_iterator>(
1923template <
int dim,
int spacedim>
1925IteratorRange<typename DoFHandler<dim, spacedim>::
1929 return IteratorRange<
1936template <
int dim,
int spacedim>
1939 typename DoFHandler<dim, spacedim>::
1942 return IteratorRange<typename DoFHandler<dim, spacedim>::level_cell_iterator>(
1943 begin_mg(), end_mg());
1948template <
int dim,
int spacedim>
1950IteratorRange<typename DoFHandler<dim, spacedim>::cell_iterator> DoFHandler<
1952 spacedim>::cell_iterators_on_level(
const unsigned int level)
const
1954 return IteratorRange<typename DoFHandler<dim, spacedim>::cell_iterator>(
1960template <
int dim,
int spacedim>
1962IteratorRange<typename DoFHandler<dim, spacedim>::
1966 return IteratorRange<
1968 begin_active(level), end_active(level));
1973template <
int dim,
int spacedim>
1975IteratorRange<typename DoFHandler<dim, spacedim>::
1979 return IteratorRange<typename DoFHandler<dim, spacedim>::level_cell_iterator>(
1980 begin_mg(level), end_mg(level));
1989template <
int dim,
int spacedim>
1993 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
1994 ExcNotImplementedWithHP());
1996 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
1998 std::unordered_set<types::global_dof_index> boundary_dofs;
1999 std::vector<types::global_dof_index> dofs_on_face;
2000 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2002 const IndexSet &owned_dofs = locally_owned_dofs();
2009 for (
const auto &cell : this->active_cell_iterators())
2014 const auto face = cell->
face(iface);
2015 if (face->at_boundary())
2017 const unsigned int dofs_per_face =
2018 cell->get_fe().n_dofs_per_face(iface);
2019 dofs_on_face.resize(dofs_per_face);
2021 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2022 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2024 const unsigned int global_idof_index = dofs_on_face[i];
2025 if (owned_dofs.
is_element(global_idof_index))
2027 boundary_dofs.insert(global_idof_index);
2033 return boundary_dofs.size();
2038template <
int dim,
int spacedim>
2041 const std::set<types::boundary_id> &boundary_ids)
const
2043 Assert(!(dim == 2 && spacedim == 3) || hp_capability_enabled ==
false,
2044 ExcNotImplementedWithHP());
2046 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2049 ExcInvalidBoundaryIndicator());
2053 std::unordered_set<types::global_dof_index> boundary_dofs;
2054 std::vector<types::global_dof_index> dofs_on_face;
2055 dofs_on_face.reserve(this->get_fe_collection().max_dofs_per_face());
2057 const IndexSet &owned_dofs = locally_owned_dofs();
2059 for (
const auto &cell : this->active_cell_iterators())
2064 const auto face = cell->
face(iface);
2065 const unsigned int boundary_id = face->boundary_id();
2066 if (face->at_boundary() &&
2067 (boundary_ids.find(boundary_id) != boundary_ids.end()))
2069 const unsigned int dofs_per_face =
2070 cell->get_fe().n_dofs_per_face(iface);
2071 dofs_on_face.resize(dofs_per_face);
2073 face->get_dof_indices(dofs_on_face, cell->active_fe_index());
2074 for (
unsigned int i = 0; i < dofs_per_face; ++i)
2076 const unsigned int global_idof_index = dofs_on_face[i];
2077 if (owned_dofs.
is_element(global_idof_index))
2079 boundary_dofs.insert(global_idof_index);
2085 return boundary_dofs.size();
2090template <
int dim,
int spacedim>
2106 if (hp_capability_enabled)
2116 for (
unsigned int level = 0; level < this->mg_levels.size(); ++level)
2119 if (this->mg_faces !=
nullptr)
2122 for (
unsigned int i = 0; i < this->mg_vertex_dofs.size(); ++i)
2123 mem +=
sizeof(MGVertexDoFs) +
2124 (1 + this->mg_vertex_dofs[i].get_finest_level() -
2125 this->mg_vertex_dofs[i].get_coarsest_level()) *
2134template <
int dim,
int spacedim>
2137 const FiniteElement<dim, spacedim> &fe)
2139 this->distribute_dofs(hp::FECollection<dim, spacedim>(fe));
2144template <
int dim,
int spacedim>
2147 const hp::FECollection<dim, spacedim> &ff)
2149 Assert(this->tria !=
nullptr,
2151 "You need to set the Triangulation in the DoFHandler using reinit() "
2152 "or in the constructor before you can distribute DoFs."));
2154 ExcMessage(
"The Triangulation you are using is empty!"));
2158 Assert((ff.
size() <= std::numeric_limits<types::fe_index>::max()) &&
2160 ExcMessage(
"The given hp::FECollection contains more finite elements "
2161 "than the DoFHandler can cover with active FE indices."));
2167 if ((hp_cell_active_fe_indices.size() > 0) &&
2168 (hp_cell_future_fe_indices.size() > 0))
2172 for (
const auto &cell : this->active_cell_iterators() |
2173 IteratorFilters::LocallyOwnedCell())
2176 ExcInvalidFEIndex(cell->active_fe_index(), ff.
size()));
2178 ExcInvalidFEIndex(cell->future_fe_index(), ff.
size()));
2187 if (this->fe_collection != ff)
2189 this->fe_collection = hp::FECollection<dim, spacedim>(ff);
2191 const bool contains_multiple_fes = (this->fe_collection.size() > 1);
2194 if (hp_capability_enabled && !contains_multiple_fes)
2196 hp_capability_enabled =
false;
2200 for (
auto &connection : this->tria_listeners_for_transfer)
2201 connection.disconnect();
2202 this->tria_listeners_for_transfer.clear();
2205 this->hp_cell_active_fe_indices.clear();
2206 this->hp_cell_active_fe_indices.shrink_to_fit();
2207 this->hp_cell_future_fe_indices.clear();
2208 this->hp_cell_future_fe_indices.shrink_to_fit();
2214 hp_capability_enabled || !contains_multiple_fes,
2216 "You cannot re-enable hp-capabilities after you registered a single "
2217 "finite element. Please call reinit() or create a new DoFHandler "
2218 "object instead."));
2224 if (hp_capability_enabled)
2240 const internal::parallel::shared::TemporarilyRestoreSubdomainIds<dim,
2242 subdomain_modifier(this->get_triangulation());
2251 if (hp_capability_enabled)
2259 this->number_cache = this->policy->distribute_dofs();
2276 if (!hp_capability_enabled &&
2277 dynamic_cast<const parallel::DistributedTriangulationBase<dim, spacedim>
2278 *
>(&*this->tria) ==
nullptr)
2279 this->block_info_object.initialize(*
this,
false,
true);
2284template <
int dim,
int spacedim>
2288 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2291 this->object_dof_indices.size() > 0,
2293 "Distribute active DoFs using distribute_dofs() before calling distribute_mg_dofs()."));
2300 "The mesh smoothing requirement 'limit_level_difference_at_vertices' has to be set for using multigrid!"));
2302 this->clear_mg_space();
2305 this->mg_number_cache = this->policy->distribute_mg_dofs();
2309 if (
dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *
>(
2310 &*this->tria) ==
nullptr)
2311 this->block_info_object.initialize(*
this,
true,
false);
2316template <
int dim,
int spacedim>
2320 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2322 this->block_info_object.initialize_local(*
this);
2327template <
int dim,
int spacedim>
2332 if (
dynamic_cast<const ::parallel::shared::Triangulation<dim, spacedim>
2333 *
>(&this->get_triangulation()) !=
nullptr)
2334 this->policy = std::make_unique<internal::DoFHandlerImplementation::Policy::
2335 ParallelShared<dim, spacedim>>(*this);
2336 else if (
dynamic_cast<
2337 const ::parallel::DistributedTriangulationBase<dim, spacedim>
2338 *
>(&this->get_triangulation()) ==
nullptr)
2339 this->policy = std::make_unique<
2340 internal::DoFHandlerImplementation::Policy::Sequential<dim, spacedim>>(
2344 std::make_unique<internal::DoFHandlerImplementation::Policy::
2345 ParallelDistributed<dim, spacedim>>(*this);
2350template <
int dim,
int spacedim>
2355 this->clear_space();
2356 this->clear_mg_space();
2361template <
int dim,
int spacedim>
2365 object_dof_indices.clear();
2367 object_dof_ptr.clear();
2369 this->number_cache.clear();
2371 this->hp_cell_active_fe_indices.clear();
2372 this->hp_cell_future_fe_indices.clear();
2377template <
int dim,
int spacedim>
2381 this->mg_levels.clear();
2382 this->mg_faces.reset();
2384 std::vector<MGVertexDoFs> tmp;
2386 std::swap(this->mg_vertex_dofs, tmp);
2388 this->mg_number_cache.clear();
2393template <
int dim,
int spacedim>
2396 const std::vector<types::global_dof_index> &new_numbers)
2398 if (hp_capability_enabled)
2400 Assert(this->hp_cell_future_fe_indices.size() > 0,
2402 "You need to distribute DoFs before you can renumber them."));
2412 if (this->n_locally_owned_dofs() == this->n_dofs())
2414 std::vector<types::global_dof_index> tmp(new_numbers);
2415 std::sort(tmp.begin(), tmp.end());
2416 std::vector<types::global_dof_index>::const_iterator p =
2419 for (; p != tmp.end(); ++p, ++i)
2420 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2423 for (
const auto new_number : new_numbers)
2425 new_number < this->n_dofs(),
2427 "New DoF index is not less than the total number of dofs."));
2444 this->number_cache = this->policy->renumber_dofs(new_numbers);
2459 Assert(this->object_dof_indices.size() > 0,
2461 "You need to distribute DoFs before you can renumber them."));
2465 if (
dynamic_cast<const parallel::shared::Triangulation<dim, spacedim>
2466 *
>(&*this->tria) !=
nullptr)
2468 Assert(new_numbers.size() == this->n_dofs() ||
2469 new_numbers.size() == this->n_locally_owned_dofs(),
2470 ExcMessage(
"Incorrect size of the input array."));
2472 else if (
dynamic_cast<
2473 const parallel::DistributedTriangulationBase<dim, spacedim>
2474 *
>(&*this->tria) !=
nullptr)
2487 if (this->n_locally_owned_dofs() == this->n_dofs())
2489 std::vector<types::global_dof_index> tmp(new_numbers);
2490 std::sort(tmp.begin(), tmp.end());
2491 std::vector<types::global_dof_index>::const_iterator p =
2494 for (; p != tmp.end(); ++p, ++i)
2495 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2498 for (
const auto new_number : new_numbers)
2500 new_number < this->n_dofs(),
2502 "New DoF index is not less than the total number of dofs."));
2505 this->number_cache = this->policy->renumber_dofs(new_numbers);
2511template <
int dim,
int spacedim>
2514 const unsigned int level,
2515 const std::vector<types::global_dof_index> &new_numbers)
2517 AssertThrow(hp_capability_enabled ==
false, ExcNotImplementedWithHP());
2520 this->mg_levels.size() > 0 && this->object_dof_indices.size() > 0,
2522 "You need to distribute active and level DoFs before you can renumber level DoFs."));
2525 this->locally_owned_mg_dofs(level).n_elements());
2533 if (this->n_locally_owned_dofs() == this->n_dofs())
2535 std::vector<types::global_dof_index> tmp(new_numbers);
2536 std::sort(tmp.begin(), tmp.end());
2537 std::vector<types::global_dof_index>::const_iterator p = tmp.begin();
2539 for (; p != tmp.end(); ++p, ++i)
2540 Assert(*p == i, ExcNewNumbersNotConsecutive(i));
2543 for (
const auto new_number : new_numbers)
2544 Assert(new_number < this->n_dofs(level),
2546 "New DoF index is not less than the total number of dofs."));
2549 this->mg_number_cache[level] =
2550 this->policy->renumber_mg_dofs(level, new_numbers);
2555template <
int dim,
int spacedim>
2560 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2565 return this->fe_collection.max_dofs_per_vertex();
2567 return (3 * this->fe_collection.max_dofs_per_vertex() +
2568 2 * this->fe_collection.max_dofs_per_line());
2579 return (19 * this->fe_collection.max_dofs_per_vertex() +
2580 28 * this->fe_collection.max_dofs_per_line() +
2581 8 * this->fe_collection.max_dofs_per_quad());
2590template <
int dim,
int spacedim>
2594 Assert(this->fe_collection.size() > 0, ExcNoFESelected());
2601template <
int dim,
int spacedim>
2604 const std::vector<types::fe_index> &active_fe_indices)
2606 Assert(active_fe_indices.size() == this->get_triangulation().n_active_cells(),
2608 this->get_triangulation().n_active_cells()));
2610 this->create_active_fe_table();
2615 for (
const auto &cell : this->active_cell_iterators())
2622template <
int dim,
int spacedim>
2625 const std::vector<unsigned int> &active_fe_indices)
2627 set_active_fe_indices(std::vector<types::fe_index>(active_fe_indices.begin(),
2628 active_fe_indices.end()));
2633template <
int dim,
int spacedim>
2638 std::vector<types::fe_index> active_fe_indices(
2644 for (
const auto &cell : this->active_cell_iterators())
2648 return active_fe_indices;
2653template <
int dim,
int spacedim>
2656 const std::vector<types::fe_index> &future_fe_indices)
2658 Assert(future_fe_indices.size() == this->get_triangulation().n_active_cells(),
2660 this->get_triangulation().n_active_cells()));
2662 this->create_active_fe_table();
2667 for (
const auto &cell : this->active_cell_iterators())
2676template <
int dim,
int spacedim>
2681 std::vector<types::fe_index> future_fe_indices(
2687 for (
const auto &cell : this->active_cell_iterators())
2691 return future_fe_indices;
2696template <
int dim,
int spacedim>
2701 Assert(hp_capability_enabled, ExcOnlyAvailableWithHP());
2704 this->tria_listeners.push_back(this->tria->
signals.
create.connect(
2705 [
this]() { this->reinit(*(this->tria)); }));
2706 this->tria_listeners.push_back(
2707 this->tria->
signals.
clear.connect([
this]() { this->clear(); }));
2712 const ::parallel::fullydistributed::Triangulation<dim, spacedim>
2713 *
>(&this->get_triangulation()))
2717 else if (
dynamic_cast<
2718 const ::parallel::distributed::Triangulation<dim, spacedim>
2719 *
>(&this->get_triangulation()))
2722 this->tria_listeners_for_transfer.push_back(
2724 internal::hp::DoFHandlerImplementation::Implementation::
2725 ensure_absence_of_future_fe_indices<dim, spacedim>(*this);
2727 this->tria_listeners_for_transfer.push_back(
2729 [
this]() { this->pre_distributed_transfer_action(); }));
2730 this->tria_listeners_for_transfer.push_back(
2732 [
this]() { this->post_distributed_transfer_action(); }));
2735 this->tria_listeners_for_transfer.push_back(
2737 [
this]() { this->pre_distributed_transfer_action(); }));
2738 this->tria_listeners_for_transfer.push_back(
2740 [
this]() { this->post_distributed_transfer_action(); }));
2743 this->tria_listeners_for_transfer.push_back(
2745 [
this]() { this->active_fe_index_transfer.reset(); }));
2746 this->tria_listeners_for_transfer.push_back(
2748 [
this]() { this->update_active_fe_table(); }));
2750 else if (
dynamic_cast<
2751 const ::parallel::shared::Triangulation<dim, spacedim> *
>(
2752 &this->get_triangulation()) !=
nullptr)
2755 this->tria_listeners_for_transfer.push_back(
2757 internal::hp::DoFHandlerImplementation::Implementation::
2758 ensure_absence_of_future_fe_indices(*this);
2762 this->tria_listeners_for_transfer.push_back(
2764 [
this]() { this->pre_transfer_action(); }));
2765 this->tria_listeners_for_transfer.push_back(
2767 [
this]() { this->post_transfer_action(); }));
2772 this->tria_listeners_for_transfer.push_back(
2774 [
this]() { this->pre_transfer_action(); }));
2775 this->tria_listeners_for_transfer.push_back(
2777 [
this]() { this->post_transfer_action(); }));
2783template <
int dim,
int spacedim>
2787 AssertThrow(hp_capability_enabled ==
true, ExcOnlyAvailableWithHP());
2794 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2795 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2799 for (
unsigned int level = 0; level < this->hp_cell_future_fe_indices.size();
2802 if (this->hp_cell_active_fe_indices[level].empty() &&
2803 this->hp_cell_future_fe_indices[level].empty())
2805 this->hp_cell_active_fe_indices[level].resize(
2807 this->hp_cell_future_fe_indices[level].resize(
2815 Assert(this->hp_cell_active_fe_indices[level].size() ==
2817 this->hp_cell_future_fe_indices[level].size() ==
2818 this->tria->n_raw_cells(level),
2834template <
int dim,
int spacedim>
2850 this->hp_cell_active_fe_indices.resize(this->tria->
n_levels());
2851 this->hp_cell_active_fe_indices.shrink_to_fit();
2853 this->hp_cell_future_fe_indices.resize(this->tria->
n_levels());
2854 this->hp_cell_future_fe_indices.shrink_to_fit();
2856 for (
unsigned int i = 0; i < this->hp_cell_future_fe_indices.size(); ++i)
2859 this->hp_cell_active_fe_indices[i].resize(this->tria->
n_raw_cells(i), 0);
2866 this->hp_cell_future_fe_indices[i].assign(this->tria->
n_raw_cells(i),
2872template <
int dim,
int spacedim>
2878 this->active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2889template <
int dim,
int spacedim>
2893# ifndef DEAL_II_WITH_P4EST
2896 "You are attempting to use a functionality that is only available "
2897 "if deal.II was configured to use p4est, but cmake did not find a "
2898 "valid p4est library."));
2902 (
dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
2903 &this->get_triangulation()) !=
nullptr),
2908 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
2917 active_fe_index_transfer->active_fe_indices.resize(
2927 for (
const auto &cell : active_cell_iterators())
2934 const auto *distributed_tria =
2935 dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
2936 &this->get_triangulation());
2938 active_fe_index_transfer->cell_data_transfer = std::make_unique<
2939 parallel::distributed::
2940 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
2944 &::AdaptationStrategies::Refinement::
2945 preserve<dim, spacedim, types::fe_index>,
2948 const std::vector<types::fe_index> &children_fe_indices)
2950 return ::internal::hp::DoFHandlerImplementation::Implementation::
2951 determine_fe_from_children<dim, spacedim>(parent,
2952 children_fe_indices,
2956 active_fe_index_transfer->cell_data_transfer
2957 ->prepare_for_coarsening_and_refinement(
2958 active_fe_index_transfer->active_fe_indices);
2964template <
int dim,
int spacedim>
2968 update_active_fe_table();
2982 this->active_fe_index_transfer.reset();
2987template <
int dim,
int spacedim>
2991# ifndef DEAL_II_WITH_P4EST
2994 update_active_fe_table();
2999 this->active_fe_index_transfer->active_fe_indices.resize(
3001 this->active_fe_index_transfer->cell_data_transfer->unpack(
3002 this->active_fe_index_transfer->active_fe_indices);
3005 this->set_active_fe_indices(
3006 this->active_fe_index_transfer->active_fe_indices);
3013 this->active_fe_index_transfer.reset();
3019template <
int dim,
int spacedim>
3023# ifndef DEAL_II_WITH_P4EST
3026 "You are attempting to use a functionality that is only available "
3027 "if deal.II was configured to use p4est, but cmake did not find a "
3028 "valid p4est library."));
3032 (
dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
3033 &this->get_triangulation()) !=
nullptr),
3038 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3041 const auto *distributed_tria =
3042 dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
3043 &this->get_triangulation());
3045 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3046 parallel::distributed::
3047 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
3051 &::AdaptationStrategies::Refinement::
3052 preserve<dim, spacedim, types::fe_index>,
3055 const std::vector<types::fe_index> &children_fe_indices)
3057 return ::internal::hp::DoFHandlerImplementation::Implementation::
3058 determine_fe_from_children<dim, spacedim>(parent,
3059 children_fe_indices,
3070 active_fe_index_transfer->cell_data_transfer->prepare_for_serialization(
3071 active_fe_index_transfer->active_fe_indices);
3077template <
int dim,
int spacedim>
3081# ifndef DEAL_II_WITH_P4EST
3084 "You are attempting to use a functionality that is only available "
3085 "if deal.II was configured to use p4est, but cmake did not find a "
3086 "valid p4est library."));
3090 (
dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
3091 &this->get_triangulation()) !=
nullptr),
3096 active_fe_index_transfer = std::make_unique<ActiveFEIndexTransfer>();
3099 const auto *distributed_tria =
3100 dynamic_cast<const parallel::distributed::Triangulation<dim, spacedim> *
>(
3101 &this->get_triangulation());
3103 active_fe_index_transfer->cell_data_transfer = std::make_unique<
3104 parallel::distributed::
3105 CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>(
3109 &::AdaptationStrategies::Refinement::
3110 preserve<dim, spacedim, types::fe_index>,
3113 const std::vector<types::fe_index> &children_fe_indices)
3115 return ::internal::hp::DoFHandlerImplementation::Implementation::
3116 determine_fe_from_children<dim, spacedim>(parent,
3117 children_fe_indices,
3122 active_fe_index_transfer->active_fe_indices.resize(
3124 active_fe_index_transfer->cell_data_transfer->deserialize(
3125 active_fe_index_transfer->active_fe_indices);
3128 set_active_fe_indices(active_fe_index_transfer->active_fe_indices);
3135 active_fe_index_transfer.reset();
3141template <
int dim,
int spacedim>
3150template <
int dim,
int spacedim>
3153 const unsigned int cl,
3154 const unsigned int fl,
3155 const unsigned int dofs_per_vertex)
3157 coarsest_level = cl;
3160 if (coarsest_level <= finest_level)
3162 const unsigned int n_levels = finest_level - coarsest_level + 1;
3163 const unsigned int n_indices = n_levels * dofs_per_vertex;
3165 indices = std::make_unique<types::global_dof_index[]>(n_indices);
3166 std::fill(indices.get(),
3167 indices.get() + n_indices,
3176template <
int dim,
int spacedim>
3180 return coarsest_level;
3185template <
int dim,
int spacedim>
3189 return finest_level;
3193#include "dofs/dof_handler.inst"
bool at_boundary(const unsigned int i) const
TriaIterator< TriaAccessor< dim - 1, dim, spacedim > > face(const unsigned int i) const
bool is_locally_owned() const
unsigned int active_cell_index() const
bool is_artificial() const
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< types::fe_index > get_future_fe_indices() const
unsigned int max_couplings_between_dofs() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
std::unique_ptr< ActiveFEIndexTransfer > active_fe_index_transfer
hp::FECollection< dim, spacedim > fe_collection
void create_active_fe_table()
static const types::fe_index default_fe_index
std::vector< std::vector< types::fe_index > > hp_cell_future_fe_indices
level_cell_iterator end_mg() const
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) 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
std::vector< types::fe_index > get_active_fe_indices() 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()
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
ObserverPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
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
std_cxx20::ranges::iota_view< unsigned int, unsigned int > face_indices() const
IteratorState::IteratorStates state() const
@ limit_level_difference_at_vertices
virtual const MeshSmoothing & get_mesh_smoothing() const
unsigned int n_raw_lines() const
unsigned int n_raw_faces() const
unsigned int n_levels() 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 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
constexpr LibraryBuildMode library_build_mode
#define DEAL_II_NAMESPACE_OPEN
constexpr bool running_in_debug_mode()
#define DEAL_II_CXX20_REQUIRES(condition)
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ASSERT_UNREACHABLE()
#define DEAL_II_NOT_IMPLEMENTED()
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< level_cell_iterator > mg_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 & ExcOnlyAvailableWithHP()
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 & ExcNoFESelected()
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcInconsistentCoarseningFlags()
typename ActiveSelector::cell_iterator cell_iterator
typename ActiveSelector::active_cell_iterator active_cell_iterator
TriaIterator< CellAccessor< dim, spacedim > > cell_iterator
Task< RT > new_task(const std::function< RT()> &function)
@ valid
Iterator points to a valid object.
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
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)
constexpr types::global_dof_index invalid_dof_index
constexpr unsigned int invalid_unsigned_int
constexpr types::boundary_id internal_face_boundary_id
constexpr types::fe_index invalid_fe_index
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)
unsigned short int fe_index
unsigned int global_dof_index
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 types::fe_index future_fe_index(const DoFCellAccessor< dim, spacedim, level_dof_access > &accessor)
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(DoFHandler< 2, 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 reserve_space(DoFHandler< 3, spacedim > &dof_handler)
static void ensure_absence_of_future_fe_indices(DoFHandler< dim, 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< 1, spacedim > &dof_handler)