Reference documentation for deal.II version Git 3f1f337db3 2021-10-23 13:19:02 -0600
\(\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 - 2021 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 
30 
33 #include <deal.II/dofs/dof_faces.h>
37 
39 
40 #include <boost/serialization/split_member.hpp>
41 
42 #include <map>
43 #include <memory>
44 #include <set>
45 #include <vector>
46 
48 
49 // Forward declarations
50 #ifndef DOXYGEN
51 template <int dim, int spacedim>
52 class FiniteElement;
53 template <int dim, int 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 
313 template <int dim, int spacedim = dim>
314 class DoFHandler : public Subscriptor
315 {
316  using ActiveSelector =
318  using LevelSelector =
320 
321 public:
334  using cell_accessor = typename ActiveSelector::CellAccessor;
335 
348  using face_accessor = typename ActiveSelector::FaceAccessor;
349 
357  using line_iterator = typename ActiveSelector::line_iterator;
358 
372  using active_line_iterator = typename ActiveSelector::active_line_iterator;
373 
381  using quad_iterator = typename ActiveSelector::quad_iterator;
382 
396  using active_quad_iterator = typename ActiveSelector::active_quad_iterator;
397 
405  using hex_iterator = typename ActiveSelector::hex_iterator;
406 
416  using active_hex_iterator = typename ActiveSelector::active_hex_iterator;
417 
438  using active_cell_iterator = typename ActiveSelector::active_cell_iterator;
439 
466  using cell_iterator = typename ActiveSelector::cell_iterator;
467 
484  using face_iterator = typename ActiveSelector::face_iterator;
485 
497  using active_face_iterator = typename ActiveSelector::active_face_iterator;
498 
499  using level_cell_accessor = typename LevelSelector::CellAccessor;
500  using level_face_accessor = typename LevelSelector::FaceAccessor;
501 
502  using level_cell_iterator = typename LevelSelector::cell_iterator;
503  using level_face_iterator = typename LevelSelector::face_iterator;
504 
505 
509  static const unsigned int dimension = dim;
510 
514  static const unsigned int space_dimension = spacedim;
515 
519  static const unsigned int default_fe_index = 0;
520 
524  static const unsigned int invalid_fe_index = numbers::invalid_unsigned_int;
525 
529  using active_fe_index_type = unsigned short int;
530 
534  using offset_type = unsigned int;
535 
540  static const active_fe_index_type invalid_active_fe_index =
541  static_cast<active_fe_index_type>(-1);
542 
547  DoFHandler();
548 
553 
560  DoFHandler(const DoFHandler &) = delete;
561 
565  virtual ~DoFHandler() override;
566 
573  DoFHandler &
574  operator=(const DoFHandler &) = delete;
575 
583  void
584  initialize(const Triangulation<dim, spacedim> &tria,
585  const FiniteElement<dim, spacedim> &fe);
586 
593  void
594  initialize(const Triangulation<dim, spacedim> & tria,
596 
621  void
622  set_fe(const FiniteElement<dim, spacedim> &fe);
623 
630  void
631  set_fe(const hp::FECollection<dim, spacedim> &fe);
632 
637  void
638  set_active_fe_indices(const std::vector<unsigned int> &active_fe_indices);
639 
645  void
646  get_active_fe_indices(std::vector<unsigned int> &active_fe_indices) const;
647 
655  void
657 
687  void
688  distribute_dofs(const FiniteElement<dim, spacedim> &fe);
689 
693  void
694  distribute_dofs(const hp::FECollection<dim, spacedim> &fe);
695 
701  void
702  distribute_mg_dofs();
703 
707  bool
708  has_hp_capabilities() const;
709 
715  bool
716  has_level_dofs() const;
717 
732  bool
733  has_active_dofs() const;
734 
741  void
742  initialize_local_block_info();
743 
747  void
748  clear();
749 
802  void
803  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
804 
809  void
810  renumber_dofs(const unsigned int level,
811  const std::vector<types::global_dof_index> &new_numbers);
812 
841  unsigned int
842  max_couplings_between_dofs() const;
843 
856  unsigned int
857  max_couplings_between_boundary_dofs() const;
858 
859  /*--------------------------------------*/
860 
865  /*
866  * @{
867  */
868 
873  begin(const unsigned int level = 0) const;
874 
892  begin_active(const unsigned int level = 0) const;
893 
899  end() const;
900 
906  end(const unsigned int level) const;
907 
914  end_active(const unsigned int level) const;
915 
921  begin_mg(const unsigned int level = 0) const;
922 
928  end_mg(const unsigned int level) const;
929 
935  end_mg() const;
936 
952  cell_iterators() const;
953 
995  active_cell_iterators() const;
996 
1009  mg_cell_iterators() const;
1010 
1027  cell_iterators_on_level(const unsigned int level) const;
1028 
1045  active_cell_iterators_on_level(const unsigned int level) const;
1046 
1063  mg_cell_iterators_on_level(const unsigned int level) const;
1064 
1065  /*
1066  * @}
1067  */
1068 
1069 
1070  /*---------------------------------------*/
1071 
1072 
1097  n_dofs() const;
1098 
1107  n_dofs(const unsigned int level) const;
1108 
1114  n_boundary_dofs() const;
1115 
1127  template <typename number>
1129  n_boundary_dofs(
1130  const std::map<types::boundary_id, const Function<spacedim, number> *>
1131  &boundary_ids) const;
1132 
1138  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
1139 
1155  const BlockInfo &
1156  block_info() const;
1157 
1178  n_locally_owned_dofs() const;
1179 
1185  const IndexSet &
1186  locally_owned_dofs() const;
1187 
1192  const IndexSet &
1193  locally_owned_mg_dofs(const unsigned int level) const;
1194 
1200  get_fe(const unsigned int index = 0) const;
1201 
1207  get_fe_collection() const;
1208 
1213  get_triangulation() const;
1214 
1218  MPI_Comm
1219  get_communicator() const;
1220 
1237  void
1238  prepare_for_serialization_of_active_fe_indices();
1239 
1255  void
1256  deserialize_active_fe_indices();
1257 
1266  virtual std::size_t
1267  memory_consumption() const;
1268 
1274  template <class Archive>
1275  void
1276  save(Archive &ar, const unsigned int version) const;
1277 
1283  template <class Archive>
1284  void
1285  load(Archive &ar, const unsigned int version);
1286 
1287 #ifdef DOXYGEN
1288 
1293  template <class Archive>
1294  void
1295  serialize(Archive &archive, const unsigned int version);
1296 #else
1297  // This macro defines the serialize() method that is compatible with
1298  // the templated save() and load() method that have been implemented.
1299  BOOST_SERIALIZATION_SPLIT_MEMBER()
1300 #endif
1301 
1315  DeclException1(ExcInvalidLevel,
1316  int,
1317  << "The given level " << arg1
1318  << " is not in the valid range!");
1323  DeclException1(ExcNewNumbersNotConsecutive,
1325  << "The given list of new dof indices is not consecutive: "
1326  << "the index " << arg1 << " does not exist.");
1330  DeclException2(ExcInvalidFEIndex,
1331  int,
1332  int,
1333  << "The mesh contains a cell with an active FE index of "
1334  << arg1 << ", but the finite element collection only has "
1335  << arg2 << " elements");
1336 
1341  DeclExceptionMsg(ExcOnlyAvailableWithHP,
1342  "The current function doesn't make sense when used with a "
1343  "DoFHandler without hp-capabilities.");
1344 
1349  DeclExceptionMsg(ExcNotImplementedWithHP,
1350  "The current function has not yet been implemented for a "
1351  "DoFHandler with hp-capabilities.");
1352 
1353 private:
1361  {
1362  public:
1366  MGVertexDoFs();
1367 
1373  void
1374  init(const unsigned int coarsest_level,
1375  const unsigned int finest_level,
1376  const unsigned int dofs_per_vertex);
1377 
1381  unsigned int
1382  get_coarsest_level() const;
1383 
1387  unsigned int
1388  get_finest_level() const;
1389 
1395  get_index(const unsigned int level,
1396  const unsigned int dof_number,
1397  const unsigned int dofs_per_vertex) const;
1398 
1403  void
1404  set_index(const unsigned int level,
1405  const unsigned int dof_number,
1406  const unsigned int dofs_per_vertex,
1407  const types::global_dof_index index);
1408 
1409  private:
1413  unsigned int coarsest_level;
1414 
1418  unsigned int finest_level;
1419 
1429  std::unique_ptr<types::global_dof_index[]> indices;
1430  };
1431 
1439  {
1444  std::map<const cell_iterator, const unsigned int> persisting_cells_fe_index;
1445 
1450  std::map<const cell_iterator, const unsigned int> refined_cells_fe_index;
1451 
1456  std::map<const cell_iterator, const unsigned int> coarsened_cells_fe_index;
1457 
1463  std::vector<unsigned int> active_fe_indices;
1464 
1470  std::unique_ptr<
1471  parallel::distributed::
1472  CellDataTransfer<dim, spacedim, std::vector<unsigned int>>>
1474  };
1475 
1480 
1486 
1492 
1499 
1504  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1505  PolicyBase<dim, spacedim>>
1507 
1516 
1520  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1522 
1528  mutable std::vector<std::vector<types::global_dof_index>>
1530 
1535  mutable std::vector<std::vector<offset_type>> cell_dof_cache_ptr;
1536 
1542  mutable std::vector<std::array<std::vector<types::global_dof_index>, dim + 1>>
1544 
1553  mutable std::vector<std::array<std::vector<offset_type>, dim + 1>>
1555 
1561  mutable std::array<std::vector<active_fe_index_type>, dim + 1>
1563 
1567  mutable std::array<std::vector<offset_type>, dim + 1> hp_object_fe_ptr;
1568 
1573  mutable std::vector<std::vector<active_fe_index_type>>
1575 
1580  mutable std::vector<std::vector<active_fe_index_type>>
1582 
1587  std::vector<MGVertexDoFs> mg_vertex_dofs;
1588 
1592  std::vector<
1593  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1595 
1599  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1601 
1606  std::unique_ptr<ActiveFEIndexTransfer> active_fe_index_transfer;
1607 
1612  std::vector<boost::signals2::connection> tria_listeners;
1613 
1619  std::vector<boost::signals2::connection> tria_listeners_for_transfer;
1620 
1624  void
1625  clear_space();
1626 
1630  void
1631  clear_mg_space();
1632 
1636  template <int structdim>
1638  get_dof_index(const unsigned int obj_level,
1639  const unsigned int obj_index,
1640  const unsigned int fe_index,
1641  const unsigned int local_index) const;
1642 
1646  template <int structdim>
1647  void
1648  set_dof_index(const unsigned int obj_level,
1649  const unsigned int obj_index,
1650  const unsigned int fe_index,
1651  const unsigned int local_index,
1653 
1657  void
1658  setup_policy();
1659 
1663  void
1664  connect_to_triangulation_signals();
1665 
1677  void
1678  create_active_fe_table();
1679 
1692  void
1693  update_active_fe_table();
1694 
1704  void
1705  pre_transfer_action();
1706 
1715  void
1716  post_transfer_action();
1717 
1726  void
1727  pre_distributed_transfer_action();
1728 
1737  void
1738  post_distributed_transfer_action();
1739 
1740 
1741  // Make accessor objects friends.
1742  template <int, int, int, bool>
1743  friend class ::DoFAccessor;
1744  template <int, int, bool>
1745  friend class ::DoFCellAccessor;
1746  friend struct ::internal::DoFAccessorImplementation::Implementation;
1747  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1748 
1749  // Likewise for DoFLevel objects since they need to access the vertex dofs
1750  // in the functions that set and retrieve vertex dof indices.
1751  friend struct ::internal::DoFHandlerImplementation::Implementation;
1752  friend struct ::internal::hp::DoFHandlerImplementation::Implementation;
1753  friend struct ::internal::DoFHandlerImplementation::Policy::
1754  Implementation;
1755 
1756  // explicitly check for sensible template arguments, but not on windows
1757  // because MSVC creates bogus warnings during normal compilation
1758 #ifndef DEAL_II_MSVC
1759  static_assert(dim <= spacedim,
1760  "The dimension <dim> of a DoFHandler must be less than or "
1761  "equal to the space dimension <spacedim> in which it lives.");
1762 #endif
1763 };
1764 
1765 namespace internal
1766 {
1767  namespace hp
1768  {
1769  namespace DoFHandlerImplementation
1770  {
1782  template <int dim, int spacedim>
1783  void
1785 
1810  template <int dim, int spacedim = dim>
1811  unsigned int
1813  const typename DoFHandler<dim, spacedim>::cell_iterator &parent);
1814 
1820  "No FiniteElement has been found in your FECollection that is "
1821  "dominated by all children of a cell you are trying to coarsen!");
1822  } // namespace DoFHandlerImplementation
1823  } // namespace hp
1824 } // namespace internal
1825 
1826 #ifndef DOXYGEN
1827 
1828 /* ----------------------- Inline functions ----------------------------------
1829  */
1830 
1831 
1832 template <int dim, int spacedim>
1833 inline bool
1835 {
1836  return hp_capability_enabled;
1837 }
1838 
1839 
1840 
1841 template <int dim, int spacedim>
1842 inline bool
1844 {
1845  return mg_number_cache.size() > 0;
1846 }
1847 
1848 
1849 
1850 template <int dim, int spacedim>
1851 inline bool
1853 {
1854  return number_cache.n_global_dofs > 0;
1855 }
1856 
1857 
1858 
1859 template <int dim, int spacedim>
1862 {
1863  return number_cache.n_global_dofs;
1864 }
1865 
1866 
1867 
1868 template <int dim, int spacedim>
1870 DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1871 {
1872  Assert(has_level_dofs(),
1873  ExcMessage(
1874  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1875  Assert(level < mg_number_cache.size(), ExcInvalidLevel(level));
1876  return mg_number_cache[level].n_global_dofs;
1877 }
1878 
1879 
1880 
1881 template <int dim, int spacedim>
1884 {
1885  return number_cache.n_locally_owned_dofs;
1886 }
1887 
1888 
1889 
1890 template <int dim, int spacedim>
1891 const IndexSet &
1893 {
1894  return number_cache.locally_owned_dofs;
1895 }
1896 
1897 
1898 
1899 template <int dim, int spacedim>
1900 const IndexSet &
1901 DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
1902 {
1903  Assert(level < this->get_triangulation().n_global_levels(),
1904  ExcMessage("The given level index exceeds the number of levels "
1905  "present in the triangulation"));
1906  Assert(
1907  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1908  ExcMessage(
1909  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1910  return mg_number_cache[level].locally_owned_dofs;
1911 }
1912 
1913 
1914 
1915 template <int dim, int spacedim>
1916 inline const FiniteElement<dim, spacedim> &
1917 DoFHandler<dim, spacedim>::get_fe(const unsigned int number) const
1918 {
1919  Assert(fe_collection.size() > 0,
1920  ExcMessage("No finite element collection is associated with "
1921  "this DoFHandler"));
1922  return fe_collection[number];
1923 }
1924 
1925 
1926 
1927 template <int dim, int spacedim>
1928 inline const hp::FECollection<dim, spacedim> &
1930 {
1931  return fe_collection;
1932 }
1933 
1934 
1935 
1936 template <int dim, int spacedim>
1937 inline const Triangulation<dim, spacedim> &
1939 {
1940  Assert(tria != nullptr,
1941  ExcMessage("This DoFHandler object has not been associated "
1942  "with a triangulation."));
1943  return *tria;
1944 }
1945 
1946 
1947 
1948 template <int dim, int spacedim>
1949 inline MPI_Comm
1951 {
1952  Assert(tria != nullptr,
1953  ExcMessage("This DoFHandler object has not been associated "
1954  "with a triangulation."));
1955  return tria->get_communicator();
1956 }
1957 
1958 
1959 
1960 template <int dim, int spacedim>
1961 inline const BlockInfo &
1963 {
1964  Assert(this->hp_capability_enabled == false, ExcNotImplementedWithHP());
1965 
1966  return block_info_object;
1967 }
1968 
1969 
1970 
1971 template <int dim, int spacedim>
1972 template <typename number>
1975  const std::map<types::boundary_id, const Function<spacedim, number> *>
1976  &boundary_ids) const
1977 {
1978  Assert(!(dim == 2 && spacedim == 3) || this->hp_capability_enabled == false,
1979  ExcNotImplementedWithHP());
1980 
1981  // extract the set of boundary ids and forget about the function object
1982  // pointers
1983  std::set<types::boundary_id> boundary_ids_only;
1984  for (typename std::map<types::boundary_id,
1985  const Function<spacedim, number> *>::const_iterator p =
1986  boundary_ids.begin();
1987  p != boundary_ids.end();
1988  ++p)
1989  boundary_ids_only.insert(p->first);
1990 
1991  // then just hand everything over to the other function that does the work
1992  return n_boundary_dofs(boundary_ids_only);
1993 }
1994 
1995 
1996 
1997 namespace internal
1998 {
2006  template <int dim, int spacedim>
2007  std::string
2008  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
2009  PolicyBase<dim, spacedim> &policy);
2010 } // namespace internal
2011 
2012 
2013 
2014 template <int dim, int spacedim>
2015 template <class Archive>
2016 void
2017 DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
2018 {
2019  if (this->hp_capability_enabled)
2020  {
2021  ar &this->object_dof_indices;
2022  ar &this->object_dof_ptr;
2023 
2024  ar &this->cell_dof_cache_indices;
2025  ar &this->cell_dof_cache_ptr;
2026 
2027  ar &this->hp_cell_active_fe_indices;
2028  ar &this->hp_cell_future_fe_indices;
2029 
2030  ar &hp_object_fe_ptr;
2031  ar &hp_object_fe_indices;
2032 
2033  ar &number_cache;
2034 
2035  ar &mg_number_cache;
2036 
2037  // write out the number of triangulation cells and later check during
2038  // loading that this number is indeed correct; same with something that
2039  // identifies the policy
2040  const unsigned int n_cells = this->tria->n_cells();
2041  std::string policy_name =
2042  ::internal::policy_to_string(*this->policy);
2043 
2044  ar &n_cells &policy_name;
2045  }
2046  else
2047  {
2048  ar &this->block_info_object;
2049  ar &number_cache;
2050 
2051  ar &this->object_dof_indices;
2052  ar &this->object_dof_ptr;
2053 
2054  ar &this->cell_dof_cache_indices;
2055  ar &this->cell_dof_cache_ptr;
2056 
2057  // write out the number of triangulation cells and later check during
2058  // loading that this number is indeed correct; same with something that
2059  // identifies the FE and the policy
2060  unsigned int n_cells = this->tria->n_cells();
2061  std::string fe_name = this->get_fe(0).get_name();
2062  std::string policy_name = internal::policy_to_string(*this->policy);
2063 
2064  ar &n_cells &fe_name &policy_name;
2065  }
2066 }
2067 
2068 
2069 
2070 template <int dim, int spacedim>
2071 template <class Archive>
2072 void
2073 DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
2074 {
2075  if (this->hp_capability_enabled)
2076  {
2077  ar &this->object_dof_indices;
2078  ar &this->object_dof_ptr;
2079 
2080  ar &this->cell_dof_cache_indices;
2081  ar &this->cell_dof_cache_ptr;
2082 
2083  ar &this->hp_cell_active_fe_indices;
2084  ar &this->hp_cell_future_fe_indices;
2085 
2086  ar &hp_object_fe_ptr;
2087  ar &hp_object_fe_indices;
2088 
2089  ar &number_cache;
2090 
2091  ar &mg_number_cache;
2092 
2093  // these are the checks that correspond to the last block in the save()
2094  // function
2095  unsigned int n_cells;
2096  std::string policy_name;
2097 
2098  ar &n_cells &policy_name;
2099 
2100  AssertThrow(
2101  n_cells == this->tria->n_cells(),
2102  ExcMessage(
2103  "The object being loaded into does not match the triangulation "
2104  "that has been stored previously."));
2105  AssertThrow(
2106  policy_name == ::internal::policy_to_string(*this->policy),
2107  ExcMessage("The policy currently associated with this DoFHandler (" +
2108  ::internal::policy_to_string(*this->policy) +
2109  ") does not match the one that was associated with the "
2110  "DoFHandler previously stored (" +
2111  policy_name + ")."));
2112  }
2113  else
2114  {
2115  ar &this->block_info_object;
2116  ar &number_cache;
2117 
2118  object_dof_indices.clear();
2119 
2120  object_dof_ptr.clear();
2121 
2122  ar &this->object_dof_indices;
2123  ar &this->object_dof_ptr;
2124 
2125  ar &this->cell_dof_cache_indices;
2126  ar &this->cell_dof_cache_ptr;
2127 
2128  // these are the checks that correspond to the last block in the save()
2129  // function
2130  unsigned int n_cells;
2131  std::string fe_name;
2132  std::string policy_name;
2133 
2134  ar &n_cells &fe_name &policy_name;
2135 
2136  AssertThrow(
2137  n_cells == this->tria->n_cells(),
2138  ExcMessage(
2139  "The object being loaded into does not match the triangulation "
2140  "that has been stored previously."));
2141  AssertThrow(
2142  fe_name == this->get_fe(0).get_name(),
2143  ExcMessage(
2144  "The finite element associated with this DoFHandler does not match "
2145  "the one that was associated with the DoFHandler previously stored."));
2146  AssertThrow(policy_name == internal::policy_to_string(*this->policy),
2147  ExcMessage(
2148  "The policy currently associated with this DoFHandler (" +
2149  internal::policy_to_string(*this->policy) +
2150  ") does not match the one that was associated with the "
2151  "DoFHandler previously stored (" +
2152  policy_name + ")."));
2153  }
2154 }
2155 
2156 
2157 
2158 template <int dim, int spacedim>
2161  const unsigned int level,
2162  const unsigned int dof_number,
2163  const unsigned int dofs_per_vertex) const
2164 {
2165  Assert((level >= coarsest_level) && (level <= finest_level),
2166  ExcInvalidLevel(level));
2167  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
2168 }
2169 
2170 
2171 
2172 template <int dim, int spacedim>
2173 inline void
2175  const unsigned int level,
2176  const unsigned int dof_number,
2177  const unsigned int dofs_per_vertex,
2178  const types::global_dof_index index)
2179 {
2180  Assert((level >= coarsest_level) && (level <= finest_level),
2181  ExcInvalidLevel(level));
2182  indices[dofs_per_vertex * (level - coarsest_level) + dof_number] = index;
2183 }
2184 
2185 
2186 
2187 extern template class DoFHandler<1, 1>;
2188 extern template class DoFHandler<1, 2>;
2189 extern template class DoFHandler<1, 3>;
2190 extern template class DoFHandler<2, 2>;
2191 extern template class DoFHandler<2, 3>;
2192 extern template class DoFHandler<3, 3>;
2193 
2194 
2195 #endif // DOXYGEN
2196 
2198 
2199 #endif
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1587
const Triangulation< dim, spacedim > & get_triangulation() const
static const unsigned int invalid_unsigned_int
Definition: types.h:196
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
Definition: matrix_block.h:618
typename ActiveSelector::FaceAccessor face_accessor
Definition: dof_handler.h:348
std::array< std::vector< offset_type >, dim+1 > hp_object_fe_ptr
Definition: dof_handler.h:1567
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:532
typename LevelSelector::face_iterator level_face_iterator
Definition: dof_handler.h:503
std::map< const cell_iterator, const unsigned int > coarsened_cells_fe_index
Definition: dof_handler.h:1456
static ::ExceptionBase & ExcNoDominatedFiniteElementOnChildren()
typename ActiveSelector::quad_iterator quad_iterator
Definition: dof_handler.h:381
void communicate_future_fe_indices(DoFHandler< dim, spacedim > &dof_handler)
unsigned short int active_fe_index_type
Definition: dof_handler.h:529
const ::Triangulation< dim, spacedim > & tria
const BlockInfo & block_info() const
::internal::DoFHandlerImplementation::NumberCache number_cache
Definition: dof_handler.h:1515
std::vector< std::array< std::vector< offset_type >, dim+1 > > object_dof_ptr
Definition: dof_handler.h:1554
MPI_Comm get_communicator() const
typename ActiveSelector::CellAccessor cell_accessor
Definition: dof_handler.h:334
#define AssertThrow(cond, exc)
Definition: exceptions.h:1571
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > mg_levels
Definition: dof_handler.h:1594
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
std::vector< std::vector< active_fe_index_type > > hp_cell_future_fe_indices
Definition: dof_handler.h:1581
typename ActiveSelector::face_iterator face_iterator
Definition: dof_handler.h:484
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:497
std::vector< std::vector< types::global_dof_index > > cell_dof_cache_indices
Definition: dof_handler.h:1529
std::map< const cell_iterator, const unsigned int > refined_cells_fe_index
Definition: dof_handler.h:1450
types::global_dof_index n_locally_owned_dofs() const
BlockInfo block_info_object
Definition: dof_handler.h:1479
static ::ExceptionBase & ExcMessage(std::string arg1)
std::map< const cell_iterator, const unsigned int > persisting_cells_fe_index
Definition: dof_handler.h:1444
unsigned int dominated_future_fe_on_children(const typename DoFHandler< dim, spacedim >::cell_iterator &parent)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:509
typename LevelSelector::CellAccessor level_cell_accessor
Definition: dof_handler.h:499
typename ActiveSelector::hex_iterator hex_iterator
Definition: dof_handler.h:405
std::vector<::internal::DoFHandlerImplementation::NumberCache > mg_number_cache
Definition: dof_handler.h:1521
bool has_active_dofs() const
#define Assert(cond, exc)
Definition: exceptions.h:1461
hp::FECollection< dim, spacedim > fe_collection
Definition: dof_handler.h:1498
std::unique_ptr< ActiveFEIndexTransfer > active_fe_index_transfer
Definition: dof_handler.h:1606
std::vector< std::array< std::vector< types::global_dof_index >, dim+1 > > object_dof_indices
Definition: dof_handler.h:1543
::DoFHandler< dim, spacedim > DoFHandler
Definition: dof_handler.h:124
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:487
std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces< dim > > mg_faces
Definition: dof_handler.h:1600
#define DeclException0(Exception0)
Definition: exceptions.h:464
types::global_dof_index n_boundary_dofs() const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:401
unsigned int level
Definition: grid_out.cc:4589
SmartPointer< const Triangulation< dim, spacedim >, DoFHandler< dim, spacedim > > tria
Definition: dof_handler.h:1491
types::global_dof_index n_dofs() const
VectorType::value_type * end(VectorType &V)
typename LevelSelector::cell_iterator level_cell_iterator
Definition: dof_handler.h:502
std::unique_ptr<::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > > policy
Definition: dof_handler.h:1506
const hp::FECollection< dim, spacedim > & get_fe_collection() const
const IndexSet & locally_owned_mg_dofs(const unsigned int level) const
void set_index(const unsigned int level, const unsigned int dof_number, const unsigned int dofs_per_vertex, const types::global_dof_index index)
std::unique_ptr< parallel::distributed::CellDataTransfer< dim, spacedim, std::vector< unsigned int > > > cell_data_transfer
Definition: dof_handler.h:1473
Definition: hp.h:117
std::vector< std::vector< active_fe_index_type > > hp_cell_active_fe_indices
Definition: dof_handler.h:1574
unsigned int n_cells(const internal::TriangulationImplementation::NumberCache< 1 > &c)
Definition: tria.cc:13697
typename LevelSelector::FaceAccessor level_face_accessor
Definition: dof_handler.h:500
std::vector< unsigned int > active_fe_indices
Definition: dof_handler.h:1463
std::array< std::vector< active_fe_index_type >, dim+1 > hp_object_fe_indices
Definition: dof_handler.h:1562
typename ActiveSelector::active_line_iterator active_line_iterator
Definition: dof_handler.h:372
std::unique_ptr< types::global_dof_index[]> indices
Definition: dof_handler.h:1429
std::string policy_to_string(const ::internal::DoFHandlerImplementation::Policy::PolicyBase< dim, spacedim > &policy)
Definition: dof_handler.cc:56
bool has_hp_capabilities() const
typename ActiveSelector::line_iterator line_iterator
Definition: dof_handler.h:357
unsigned int coarsest_level
Definition: dof_handler.h:1413
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:400
VectorType::value_type * begin(VectorType &V)
types::global_dof_index get_index(const unsigned int level, const unsigned int dof_number, const unsigned int dofs_per_vertex) const
void load(Archive &ar, const unsigned int version)
void get_active_fe_indices(const DoFHandler< dim, spacedim > &dof_handler, std::vector< unsigned int > &active_fe_indices)
Definition: dof_tools.cc:1322
A small class collecting the different BlockIndices involved in global, multilevel and local computat...
Definition: block_info.h:93
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
TrilinosWrappers::types::int_type global_index(const Epetra_BlockMap &map, const ::types::global_dof_index i)
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:466
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:438
std::vector< boost::signals2::connection > tria_listeners
Definition: dof_handler.h:1612
std::vector< boost::signals2::connection > tria_listeners_for_transfer
Definition: dof_handler.h:1619
const IndexSet & locally_owned_dofs() const
bool has_level_dofs() const
#define DEAL_II_DEPRECATED
Definition: config.h:160
static ::ExceptionBase & ExcNoFESelected()
bool hp_capability_enabled
Definition: dof_handler.h:1485
typename ActiveSelector::active_quad_iterator active_quad_iterator
Definition: dof_handler.h:396
void save(Archive &ar, const unsigned int version) const
std::vector< std::vector< offset_type > > cell_dof_cache_ptr
Definition: dof_handler.h:1535
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:416