Reference documentation for deal.II version GIT 7b2de2f2f9 2023-09-24 11:00:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
dof_handler.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2023 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_dof_handler_h
17 #define dealii_dof_handler_h
18 
19 
20 
21 #include <deal.II/base/config.h>
22 
24 #include <deal.II/base/function.h>
25 #include <deal.II/base/index_set.h>
28 #include <deal.II/base/types.h>
29 
32 #include <deal.II/dofs/dof_faces.h>
36 
38 
39 #include <boost/serialization/split_member.hpp>
40 
41 #include <map>
42 #include <memory>
43 #include <set>
44 #include <vector>
45 
47 
48 // Forward declarations
49 #ifndef DOXYGEN
50 template <int dim, int spacedim>
51 class FiniteElement;
52 template <int dim, int spacedim>
53 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
54 class Triangulation;
55 
56 namespace internal
57 {
58  namespace DoFHandlerImplementation
59  {
60  struct Implementation;
61 
62  namespace Policy
63  {
64  template <int dim, int spacedim>
65  class PolicyBase;
66  struct Implementation;
67  } // namespace Policy
68  } // namespace DoFHandlerImplementation
69 
70  namespace DoFAccessorImplementation
71  {
72  struct Implementation;
73  }
74 
75  namespace DoFCellAccessorImplementation
76  {
77  struct Implementation;
78  }
79 
80  namespace hp
81  {
82  namespace DoFHandlerImplementation
83  {
84  struct Implementation;
85  }
86  } // namespace hp
87 } // namespace internal
88 
89 namespace parallel
90 {
91  namespace distributed
92  {
93  template <int dim, int spacedim, typename VectorType>
94  class CellDataTransfer;
95  }
96 } // namespace parallel
97 #endif
98 
315 template <int dim, int spacedim = dim>
316 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
317 class DoFHandler : public Subscriptor
318 {
323 
324 public:
337  using cell_accessor = typename ActiveSelector::CellAccessor;
338 
351  using face_accessor = typename ActiveSelector::FaceAccessor;
352 
360  using line_iterator = typename ActiveSelector::line_iterator;
361 
375  using active_line_iterator = typename ActiveSelector::active_line_iterator;
376 
384  using quad_iterator = typename ActiveSelector::quad_iterator;
385 
399  using active_quad_iterator = typename ActiveSelector::active_quad_iterator;
400 
408  using hex_iterator = typename ActiveSelector::hex_iterator;
409 
419  using active_hex_iterator = typename ActiveSelector::active_hex_iterator;
420 
441  using active_cell_iterator = typename ActiveSelector::active_cell_iterator;
442 
469  using cell_iterator = typename ActiveSelector::cell_iterator;
470 
487  using face_iterator = typename ActiveSelector::face_iterator;
488 
500  using active_face_iterator = typename ActiveSelector::active_face_iterator;
501 
502  using level_cell_accessor = typename LevelSelector::CellAccessor;
503  using level_face_accessor = typename LevelSelector::FaceAccessor;
504 
505  using level_cell_iterator = typename LevelSelector::cell_iterator;
506  using level_face_iterator = typename LevelSelector::face_iterator;
507 
508 
512  static constexpr unsigned int dimension = dim;
513 
517  static constexpr unsigned int space_dimension = spacedim;
518 
522  static const types::fe_index default_fe_index = 0;
523 
529  static const unsigned int invalid_fe_index DEAL_II_DEPRECATED =
531 
538 
542  using offset_type = unsigned int;
543 
550  static const types::fe_index invalid_active_fe_index DEAL_II_DEPRECATED =
552 
558 
563 
570  DoFHandler(const DoFHandler &) = delete;
571 
575  virtual ~DoFHandler() override;
576 
583  DoFHandler &
584  operator=(const DoFHandler &) = delete;
585 
600  void
601  set_active_fe_indices(const std::vector<types::fe_index> &active_fe_indices);
602 
609  void
610  set_active_fe_indices(const std::vector<unsigned int> &active_fe_indices);
611 
625  std::vector<types::fe_index>
627 
645  void
646  get_active_fe_indices(std::vector<unsigned int> &active_fe_indices) const;
647 
661  void
662  set_future_fe_indices(const std::vector<types::fe_index> &future_fe_indices);
663 
674  std::vector<types::fe_index>
676 
684  void
686 
716  void
718 
722  void
724 
730  void
732 
736  bool
738 
744  bool
745  has_level_dofs() const;
746 
761  bool
763 
770  void
772 
776  void
777  clear();
778 
831  void
832  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
833 
838  void
839  renumber_dofs(const unsigned int level,
840  const std::vector<types::global_dof_index> &new_numbers);
841 
870  unsigned int
872 
885  unsigned int
887 
888  /*--------------------------------------*/
889 
900  begin(const unsigned int level = 0) const;
901 
919  begin_active(const unsigned int level = 0) const;
920 
926  end() const;
927 
933  end(const unsigned int level) const;
934 
941  end_active(const unsigned int level) const;
942 
948  begin_mg(const unsigned int level = 0) const;
949 
955  end_mg(const unsigned int level) const;
956 
962  end_mg() const;
981  cell_iterators() const;
982 
1025 
1039 
1056  cell_iterators_on_level(const unsigned int level) const;
1057 
1074  active_cell_iterators_on_level(const unsigned int level) const;
1075 
1092  mg_cell_iterators_on_level(const unsigned int level) const;
1093 
1097  /*---------------------------------------*/
1098 
1099 
1124  n_dofs() const;
1125 
1134  n_dofs(const unsigned int level) const;
1135 
1142 
1154  template <typename number>
1157  const std::map<types::boundary_id, const Function<spacedim, number> *>
1158  &boundary_ids) const;
1159 
1165  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
1166 
1182  const BlockInfo &
1183  block_info() const;
1184 
1206 
1212  const IndexSet &
1214 
1219  const IndexSet &
1220  locally_owned_mg_dofs(const unsigned int level) const;
1221 
1227  get_fe(const types::fe_index index = 0) const;
1228 
1235 
1241 
1245  MPI_Comm
1247 
1264  void
1266 
1282  void
1284 
1293  virtual std::size_t
1295 
1301  template <class Archive>
1302  void
1303  save(Archive &ar, const unsigned int version) const;
1304 
1310  template <class Archive>
1311  void
1312  load(Archive &ar, const unsigned int version);
1313 
1314 #ifdef DOXYGEN
1320  template <class Archive>
1321  void
1322  serialize(Archive &archive, const unsigned int version);
1323 #else
1324  // This macro defines the serialize() method that is compatible with
1325  // the templated save() and load() method that have been implemented.
1326  BOOST_SERIALIZATION_SPLIT_MEMBER()
1327 #endif
1328 
1342  DeclException1(ExcInvalidLevel,
1343  int,
1344  << "The given level " << arg1
1345  << " is not in the valid range!");
1350  DeclException1(ExcNewNumbersNotConsecutive,
1352  << "The given list of new dof indices is not consecutive: "
1353  << "the index " << arg1 << " does not exist.");
1357  DeclException2(ExcInvalidFEIndex,
1358  int,
1359  int,
1360  << "The mesh contains a cell with an active FE index of "
1361  << arg1 << ", but the finite element collection only has "
1362  << arg2 << " elements");
1363 
1368  DeclExceptionMsg(ExcOnlyAvailableWithHP,
1369  "The current function doesn't make sense when used with a "
1370  "DoFHandler without hp-capabilities.");
1371 
1376  DeclExceptionMsg(ExcNotImplementedWithHP,
1377  "The current function has not yet been implemented for a "
1378  "DoFHandler with hp-capabilities.");
1379 
1380 private:
1388  {
1389  public:
1394 
1400  void
1401  init(const unsigned int coarsest_level,
1402  const unsigned int finest_level,
1403  const unsigned int dofs_per_vertex);
1404 
1408  unsigned int
1410 
1414  unsigned int
1416 
1422  access_index(const unsigned int level,
1423  const unsigned int dof_number,
1424  const unsigned int dofs_per_vertex);
1425 
1426  private:
1430  unsigned int coarsest_level;
1431 
1435  unsigned int finest_level;
1436 
1446  std::unique_ptr<types::global_dof_index[]> indices;
1447  };
1448 
1456  {
1461  std::map<const cell_iterator, const types::fe_index>
1463 
1468  std::map<const cell_iterator, const types::fe_index> refined_cells_fe_index;
1469 
1474  std::map<const cell_iterator, const types::fe_index>
1476 
1482  std::vector<types::fe_index> active_fe_indices;
1483 
1489  std::unique_ptr<
1490  parallel::distributed::
1491  CellDataTransfer<dim, spacedim, std::vector<types::fe_index>>>
1493  };
1494 
1499 
1505 
1511 
1518 
1523  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1524  PolicyBase<dim, spacedim>>
1526 
1535 
1539  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1541 
1547  mutable std::vector<std::array<std::vector<types::global_dof_index>, dim + 1>>
1549 
1558  mutable std::vector<std::array<std::vector<offset_type>, dim + 1>>
1560 
1566  mutable std::array<std::vector<types::fe_index>, dim + 1>
1568 
1572  mutable std::array<std::vector<offset_type>, dim + 1> hp_object_fe_ptr;
1573 
1578  mutable std::vector<std::vector<types::fe_index>> hp_cell_active_fe_indices;
1579 
1584  mutable std::vector<std::vector<types::fe_index>> hp_cell_future_fe_indices;
1585 
1590  std::vector<MGVertexDoFs> mg_vertex_dofs;
1591 
1595  std::vector<
1596  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1598 
1602  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1604 
1609  std::unique_ptr<ActiveFEIndexTransfer> active_fe_index_transfer;
1610 
1615  std::vector<boost::signals2::connection> tria_listeners;
1616 
1622  std::vector<boost::signals2::connection> tria_listeners_for_transfer;
1623 
1627  void
1629 
1633  void
1635 
1639  void
1641 
1645  void
1647 
1659  void
1661 
1674  void
1676 
1686  void
1688 
1697  void
1699 
1708  void
1710 
1719  void
1721 
1722 
1723  // Make accessor objects friends.
1724  template <int, int, int, bool>
1725  friend class ::DoFAccessor;
1726  template <int, int, bool>
1727  friend class ::DoFCellAccessor;
1728  friend struct ::internal::DoFAccessorImplementation::Implementation;
1729  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1730 
1731  // Likewise for DoFLevel objects since they need to access the vertex dofs
1732  // in the functions that set and retrieve vertex dof indices.
1733  friend struct ::internal::DoFHandlerImplementation::Implementation;
1734  friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
1735  friend struct ::internal::DoFHandlerImplementation::Policy::
1736  Implementation;
1737 
1738  // explicitly check for sensible template arguments, but not on windows
1739  // because MSVC creates bogus warnings during normal compilation
1740 #ifndef DEAL_II_MSVC
1741  static_assert(dim <= spacedim,
1742  "The dimension <dim> of a DoFHandler must be less than or "
1743  "equal to the space dimension <spacedim> in which it lives.");
1744 #endif
1745 };
1746 
1747 namespace internal
1748 {
1749  namespace hp
1750  {
1751  namespace DoFHandlerImplementation
1752  {
1764  template <int dim, int spacedim>
1765  void
1767 
1792  template <int dim, int spacedim = dim>
1793  unsigned int
1795  const typename DoFHandler<dim, spacedim>::cell_iterator &parent);
1796 
1802  "No FiniteElement has been found in your FECollection that is "
1803  "dominated by all children of a cell you are trying to coarsen!");
1804  } // namespace DoFHandlerImplementation
1805  } // namespace hp
1806 } // namespace internal
1807 
1808 #ifndef DOXYGEN
1809 
1810 /* ----------------------- Inline functions ----------------------------------
1811  */
1812 
1813 
1814 template <int dim, int spacedim>
1815 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1817 {
1818  return hp_capability_enabled;
1819 }
1820 
1821 
1822 
1823 template <int dim, int spacedim>
1824 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1826 {
1827  return mg_number_cache.size() > 0;
1828 }
1829 
1830 
1831 
1832 template <int dim, int spacedim>
1833 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1835 {
1836  return number_cache.n_global_dofs > 0;
1837 }
1838 
1839 
1840 
1841 template <int dim, int spacedim>
1842 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1844 {
1845  return number_cache.n_global_dofs;
1846 }
1847 
1848 
1849 
1850 template <int dim, int spacedim>
1851 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1853  DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1854 {
1856  ExcMessage(
1857  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1859  return mg_number_cache[level].n_global_dofs;
1860 }
1861 
1862 
1863 
1864 template <int dim, int spacedim>
1865 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1867 {
1869 }
1870 
1871 
1872 
1873 template <int dim, int spacedim>
1874 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1876 {
1878 }
1879 
1880 
1881 
1882 template <int dim, int spacedim>
1883 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1885  const unsigned int level) const
1886 {
1887  Assert(level < this->get_triangulation().n_global_levels(),
1888  ExcMessage("The given level index exceeds the number of levels "
1889  "present in the triangulation"));
1890  Assert(
1891  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1892  ExcMessage(
1893  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1894  return mg_number_cache[level].locally_owned_dofs;
1895 }
1896 
1897 
1898 
1899 template <int dim, int spacedim>
1900 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1902  const types::fe_index number) const
1903 {
1904  Assert(fe_collection.size() > 0,
1905  ExcMessage("No finite element collection is associated with "
1906  "this DoFHandler"));
1907  return fe_collection[number];
1908 }
1909 
1910 
1911 
1912 template <int dim, int spacedim>
1913 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1916 {
1917  return fe_collection;
1918 }
1919 
1920 
1921 
1922 template <int dim, int spacedim>
1923 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1924 inline const Triangulation<dim, spacedim>
1926 {
1927  Assert(tria != nullptr,
1928  ExcMessage("This DoFHandler object has not been associated "
1929  "with a triangulation."));
1930  return *tria;
1931 }
1932 
1933 
1934 
1935 template <int dim, int spacedim>
1936 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1937 inline MPI_Comm DoFHandler<dim, spacedim>::get_communicator() const
1938 {
1939  Assert(tria != nullptr,
1940  ExcMessage("This DoFHandler object has not been associated "
1941  "with a triangulation."));
1942  return tria->get_communicator();
1943 }
1944 
1945 
1946 
1947 template <int dim, int spacedim>
1948 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1950 {
1952 
1953  return block_info_object;
1954 }
1955 
1956 
1957 
1958 template <int dim, int spacedim>
1959 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
1960 template <typename number>
1962  const std::map<types::boundary_id, const Function<spacedim, number> *>
1963  &boundary_ids) const
1964 {
1965  Assert(!(dim == 2 && spacedim == 3) || this->hp_capability_enabled == false,
1967 
1968  // extract the set of boundary ids and forget about the function object
1969  // pointers
1970  std::set<types::boundary_id> boundary_ids_only;
1971  for (typename std::map<types::boundary_id,
1972  const Function<spacedim, number> *>::const_iterator p =
1973  boundary_ids.begin();
1974  p != boundary_ids.end();
1975  ++p)
1976  boundary_ids_only.insert(p->first);
1977 
1978  // then just hand everything over to the other function that does the work
1979  return n_boundary_dofs(boundary_ids_only);
1980 }
1981 
1982 
1983 
1984 namespace internal
1985 {
1993  template <int dim, int spacedim>
1994  std::string
1995  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
1996  PolicyBase<dim, spacedim> &policy);
1997 } // namespace internal
1998 
1999 
2000 
2001 template <int dim, int spacedim>
2002 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
2003 template <class Archive>
2004 void DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
2005 {
2006  if (this->hp_capability_enabled)
2007  {
2008  ar &this->object_dof_indices;
2009  ar &this->object_dof_ptr;
2010 
2011  ar &this->hp_cell_active_fe_indices;
2012  ar &this->hp_cell_future_fe_indices;
2013 
2014  ar &hp_object_fe_ptr;
2016 
2017  ar &number_cache;
2018 
2019  ar &mg_number_cache;
2020 
2021  // write out the number of triangulation cells and later check during
2022  // loading that this number is indeed correct; same with something that
2023  // identifies the policy
2024  const unsigned int n_cells = this->tria->n_cells();
2025  std::string policy_name =
2027 
2028  ar &n_cells &policy_name;
2029  }
2030  else
2031  {
2032  ar &this->block_info_object;
2033  ar &number_cache;
2034 
2035  ar &this->object_dof_indices;
2036  ar &this->object_dof_ptr;
2037 
2038  // write out the number of triangulation cells and later check during
2039  // loading that this number is indeed correct; same with something that
2040  // identifies the FE and the policy
2041  unsigned int n_cells = this->tria->n_cells();
2042  std::string fe_name = this->get_fe(0).get_name();
2043  std::string policy_name = internal::policy_to_string(*this->policy);
2044 
2045  ar &n_cells &fe_name &policy_name;
2046  }
2047 }
2048 
2049 
2050 
2051 template <int dim, int spacedim>
2052 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
2053 template <class Archive>
2054 void DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
2055 {
2056  if (this->hp_capability_enabled)
2057  {
2058  ar &this->object_dof_indices;
2059  ar &this->object_dof_ptr;
2060 
2061  ar &this->hp_cell_active_fe_indices;
2062  ar &this->hp_cell_future_fe_indices;
2063 
2064  ar &hp_object_fe_ptr;
2066 
2067  ar &number_cache;
2068 
2069  ar &mg_number_cache;
2070 
2071  // these are the checks that correspond to the last block in the save()
2072  // function
2073  unsigned int n_cells;
2074  std::string policy_name;
2075 
2076  ar &n_cells &policy_name;
2077 
2078  AssertThrow(
2079  n_cells == this->tria->n_cells(),
2080  ExcMessage(
2081  "The object being loaded into does not match the triangulation "
2082  "that has been stored previously."));
2083  AssertThrow(
2084  policy_name == ::internal::policy_to_string(*this->policy),
2085  ExcMessage("The policy currently associated with this DoFHandler (" +
2087  ") does not match the one that was associated with the "
2088  "DoFHandler previously stored (" +
2089  policy_name + ")."));
2090  }
2091  else
2092  {
2093  ar &this->block_info_object;
2094  ar &number_cache;
2095 
2096  object_dof_indices.clear();
2097 
2098  object_dof_ptr.clear();
2099 
2100  ar &this->object_dof_indices;
2101  ar &this->object_dof_ptr;
2102 
2103  // these are the checks that correspond to the last block in the save()
2104  // function
2105  unsigned int n_cells;
2106  std::string fe_name;
2107  std::string policy_name;
2108 
2109  ar &n_cells &fe_name &policy_name;
2110 
2111  AssertThrow(
2112  n_cells == this->tria->n_cells(),
2113  ExcMessage(
2114  "The object being loaded into does not match the triangulation "
2115  "that has been stored previously."));
2116  AssertThrow(
2117  fe_name == this->get_fe(0).get_name(),
2118  ExcMessage(
2119  "The finite element associated with this DoFHandler does not match "
2120  "the one that was associated with the DoFHandler previously stored."));
2121  AssertThrow(policy_name == internal::policy_to_string(*this->policy),
2122  ExcMessage(
2123  "The policy currently associated with this DoFHandler (" +
2125  ") does not match the one that was associated with the "
2126  "DoFHandler previously stored (" +
2127  policy_name + ")."));
2128  }
2129 }
2130 
2131 
2132 
2133 template <int dim, int spacedim>
2134 DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
2137  const unsigned int level,
2138  const unsigned int dof_number,
2139  const unsigned int dofs_per_vertex)
2140 {
2141  Assert((level >= coarsest_level) && (level <= finest_level),
2142  ExcInvalidLevel(level));
2143  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
2144 }
2145 
2146 
2147 
2148 extern template class DoFHandler<1, 1>;
2149 extern template class DoFHandler<1, 2>;
2150 extern template class DoFHandler<1, 3>;
2151 extern template class DoFHandler<2, 2>;
2152 extern template class DoFHandler<2, 3>;
2153 extern template class DoFHandler<3, 3>;
2154 
2155 
2156 #endif // DOXYGEN
2157 
2159 
2160 #endif
A small class collecting the different BlockIndices involved in global, multilevel and local computat...
Definition: block_info.h:96
types::global_dof_index & access_index(const unsigned int level, const unsigned int dof_number, const unsigned int dofs_per_vertex)
unsigned int coarsest_level
Definition: dof_handler.h:1430
void init(const unsigned int coarsest_level, const unsigned int finest_level, const unsigned int dofs_per_vertex)
unsigned int get_finest_level() const
std::unique_ptr< types::global_dof_index[]> indices
Definition: dof_handler.h:1446
unsigned int get_coarsest_level() const
cell_iterator end() const
void pre_distributed_transfer_action()
void post_transfer_action()
virtual std::size_t memory_consumption() const
unsigned int max_couplings_between_dofs() const
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
Definition: dof_handler.h:1597
std::vector< types::fe_index > get_active_fe_indices() const
std::unique_ptr< ActiveFEIndexTransfer > active_fe_index_transfer
Definition: dof_handler.h:1609
hp::FECollection< dim, spacedim > fe_collection
Definition: dof_handler.h:1517
void create_active_fe_table()
std::vector< std::vector< types::fe_index > > hp_cell_future_fe_indices
Definition: dof_handler.h:1584
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
Definition: dof_handler.h:1510
void save(Archive &ar, const unsigned int version) const
void set_active_fe_indices(const std::vector< unsigned int > &active_fe_indices)
BlockInfo block_info_object
Definition: dof_handler.h:1498
bool has_active_dofs() const
std::vector< boost::signals2::connection > tria_listeners_for_transfer
Definition: dof_handler.h:1622
level_cell_iterator end_mg() const
void renumber_dofs(const std::vector< types::global_dof_index > &new_numbers)
std::vector< types::fe_index > get_future_fe_indices() const
void renumber_dofs(const unsigned int level, 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
DoFHandler(const Triangulation< dim, spacedim > &tria)
void clear_mg_space()
void connect_to_triangulation_signals()
std::vector< std::vector< types::fe_index > > hp_cell_active_fe_indices
Definition: dof_handler.h:1578
unsigned int offset_type
Definition: dof_handler.h:542
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1590
std::vector< boost::signals2::connection > tria_listeners
Definition: dof_handler.h:1615
void post_distributed_transfer_action()
std::vector< std::array< std::vector< types::global_dof_index >, dim+1 > > object_dof_indices
Definition: dof_handler.h:1548
typename LevelSelector::CellAccessor level_cell_accessor
Definition: dof_handler.h:502
const BlockInfo & block_info() const
const Triangulation< dim, spacedim > & get_triangulation() const
void pre_transfer_action()
void clear_space()
void reinit(const Triangulation< dim, spacedim > &tria)
std::vector< std::array< std::vector< offset_type >, dim+1 > > object_dof_ptr
Definition: dof_handler.h:1559
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > mg_faces
Definition: dof_handler.h:1603
void serialize(Archive &archive, const unsigned int version)
types::fe_index active_fe_index_type
Definition: dof_handler.h:537
DoFHandler(const DoFHandler &)=delete
active_cell_iterator begin_active(const unsigned int level=0) const
void distribute_mg_dofs()
active_cell_iterator end_active(const unsigned int level) const
bool hp_capability_enabled
Definition: dof_handler.h:1504
bool has_hp_capabilities() const
void initialize_local_block_info()
types::global_dof_index n_dofs() const
void update_active_fe_table()
level_cell_iterator end_mg(const unsigned int level) const
cell_iterator end(const unsigned int level) const
typename LevelSelector::cell_iterator level_cell_iterator
Definition: dof_handler.h:505
void prepare_for_serialization_of_active_fe_indices()
std::vector<::internal::DoFHandlerImplementation::NumberCache > mg_number_cache
Definition: dof_handler.h:1540
void load(Archive &ar, const unsigned int version)
DoFHandler & operator=(const DoFHandler &)=delete
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
typename LevelSelector::face_iterator level_face_iterator
Definition: dof_handler.h:506
cell_iterator begin(const unsigned int level=0) const
std::array< std::vector< offset_type >, dim+1 > hp_object_fe_ptr
Definition: dof_handler.h:1572
MPI_Comm get_communicator() const
void clear()
const IndexSet & locally_owned_dofs() const
void get_active_fe_indices(std::vector< unsigned int > &active_fe_indices) const
void distribute_dofs(const hp::FECollection< dim, spacedim > &fe)
types::global_dof_index n_boundary_dofs(const std::map< types::boundary_id, const Function< spacedim, number > * > &boundary_ids) const
bool has_level_dofs() const
std::unique_ptr<::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > > policy
Definition: dof_handler.h:1525
typename LevelSelector::FaceAccessor level_face_accessor
Definition: dof_handler.h:503
types::global_dof_index n_dofs(const unsigned int level) const
std::array< std::vector< types::fe_index >, dim+1 > hp_object_fe_indices
Definition: dof_handler.h:1567
const hp::FECollection< dim, spacedim > & get_fe_collection() const
void set_active_fe_indices(const std::vector< types::fe_index > &active_fe_indices)
unsigned int max_couplings_between_boundary_dofs() const
void setup_policy()
types::global_dof_index n_locally_owned_dofs() const
void deserialize_active_fe_indices()
types::global_dof_index n_boundary_dofs(const std::set< types::boundary_id > &boundary_ids) const
::internal::DoFHandlerImplementation::NumberCache number_cache
Definition: dof_handler.h:1534
void set_future_fe_indices(const std::vector< types::fe_index > &future_fe_indices)
virtual ~DoFHandler() override
virtual std::string get_name() const =0
virtual MPI_Comm get_communicator() const
unsigned int n_cells() const
unsigned int size() const
Definition: collection.h:265
#define DEAL_II_DEPRECATED
Definition: config.h:178
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:477
#define DEAL_II_CXX20_REQUIRES(condition)
Definition: config.h:166
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:478
unsigned int level
Definition: grid_out.cc:4617
IteratorRange< active_cell_iterator > active_cell_iterators_on_level(const unsigned int level) const
IteratorRange< cell_iterator > cell_iterators_on_level(const unsigned int level) const
IteratorRange< active_cell_iterator > active_cell_iterators() const
IteratorRange< level_cell_iterator > mg_cell_iterators() const
IteratorRange< cell_iterator > cell_iterators() const
IteratorRange< level_cell_iterator > mg_cell_iterators_on_level(const unsigned int level) const
#define DeclException0(Exception0)
Definition: exceptions.h:467
static ::ExceptionBase & ExcInvalidLevel(int arg1)
#define Assert(cond, exc)
Definition: exceptions.h:1616
static ::ExceptionBase & ExcNotImplementedWithHP()
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:535
static ::ExceptionBase & ExcNoFESelected()
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:490
static ::ExceptionBase & ExcNoDominatedFiniteElementOnChildren()
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:512
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
#define AssertThrow(cond, exc)
Definition: exceptions.h:1705
typename ActiveSelector::FaceAccessor face_accessor
Definition: dof_handler.h:351
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:469
typename ActiveSelector::line_iterator line_iterator
Definition: dof_handler.h:360
typename ActiveSelector::face_iterator face_iterator
Definition: dof_handler.h:487
typename ActiveSelector::active_line_iterator active_line_iterator
Definition: dof_handler.h:375
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:441
typename ActiveSelector::CellAccessor cell_accessor
Definition: dof_handler.h:337
typename ActiveSelector::quad_iterator quad_iterator
Definition: dof_handler.h:384
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:419
typename ActiveSelector::active_quad_iterator active_quad_iterator
Definition: dof_handler.h:399
typename ActiveSelector::hex_iterator hex_iterator
Definition: dof_handler.h:408
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:500
Definition: hp.h:118
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
Definition: tria.cc:14833
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)
std::string policy_to_string(const ::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > &policy)
Definition: dof_handler.cc:54
const types::fe_index invalid_fe_index
Definition: types.h:228
unsigned int global_dof_index
Definition: types.h:82
unsigned short int fe_index
Definition: types.h:60
unsigned int boundary_id
Definition: types.h:141
std::map< const cell_iterator, const types::fe_index > refined_cells_fe_index
Definition: dof_handler.h:1468
std::map< const cell_iterator, const types::fe_index > persisting_cells_fe_index
Definition: dof_handler.h:1462
std::vector< types::fe_index > active_fe_indices
Definition: dof_handler.h:1482
std::map< const cell_iterator, const types::fe_index > coarsened_cells_fe_index
Definition: dof_handler.h:1475
std::unique_ptr< parallel::distributed::CellDataTransfer< dim, spacedim, std::vector< types::fe_index > > > cell_data_transfer
Definition: dof_handler.h:1492
const ::Triangulation< dim, spacedim > & tria