Reference documentation for deal.II version Git a2518c4284 2020-04-02 19:23:00 +0200
\(\newcommand{\vcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\vcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
dof_handler.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1998 - 2019 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 
23 #include <deal.II/base/exceptions.h>
24 #include <deal.II/base/function.h>
25 #include <deal.II/base/index_set.h>
26 #include <deal.II/base/iterator_range.h>
27 #include <deal.II/base/smartpointer.h>
28 
29 #include <deal.II/distributed/tria_base.h>
30 
31 #include <deal.II/dofs/block_info.h>
32 #include <deal.II/dofs/deprecated_function_map.h>
33 #include <deal.II/dofs/dof_accessor.h>
34 #include <deal.II/dofs/dof_faces.h>
35 #include <deal.II/dofs/dof_iterator_selector.h>
36 #include <deal.II/dofs/dof_levels.h>
37 #include <deal.II/dofs/number_cache.h>
38 
39 #include <deal.II/hp/fe_collection.h>
40 
41 #include <boost/serialization/split_member.hpp>
42 
43 #include <map>
44 #include <memory>
45 #include <set>
46 #include <vector>
47 
48 DEAL_II_NAMESPACE_OPEN
49 
50 // Forward declarations
51 #ifndef DOXYGEN
52 template <int dim, int spacedim>
53 class FiniteElement;
54 template <int dim, int spacedim>
55 class Triangulation;
56 
57 namespace internal
58 {
59  namespace DoFHandlerImplementation
60  {
61  struct Implementation;
62 
63  namespace Policy
64  {
65  template <int dim, int spacedim>
66  class PolicyBase;
67  struct Implementation;
68  } // namespace Policy
69  } // namespace DoFHandlerImplementation
70 
71  namespace DoFAccessorImplementation
72  {
73  struct Implementation;
74  }
75 
76  namespace DoFCellAccessorImplementation
77  {
78  struct Implementation;
79  }
80 } // namespace internal
81 #endif
82 
204 template <int dim, int spacedim = dim>
205 class DoFHandler : public Subscriptor
206 {
207  using ActiveSelector = ::internal::DoFHandlerImplementation::
208  Iterators<DoFHandler<dim, spacedim>, false>;
209  using LevelSelector = ::internal::DoFHandlerImplementation::
210  Iterators<DoFHandler<dim, spacedim>, true>;
211 
212 public:
225  using cell_accessor = typename ActiveSelector::CellAccessor;
226 
239  using face_accessor = typename ActiveSelector::FaceAccessor;
240 
248  using line_iterator = typename ActiveSelector::line_iterator;
249 
263  using active_line_iterator = typename ActiveSelector::active_line_iterator;
264 
272  using quad_iterator = typename ActiveSelector::quad_iterator;
273 
287  using active_quad_iterator = typename ActiveSelector::active_quad_iterator;
288 
296  using hex_iterator = typename ActiveSelector::hex_iterator;
297 
307  using active_hex_iterator = typename ActiveSelector::active_hex_iterator;
308 
329  using active_cell_iterator = typename ActiveSelector::active_cell_iterator;
330 
357  using cell_iterator = typename ActiveSelector::cell_iterator;
358 
375  using face_iterator = typename ActiveSelector::face_iterator;
376 
388  using active_face_iterator = typename ActiveSelector::active_face_iterator;
389 
390  using level_cell_accessor = typename LevelSelector::CellAccessor;
391  using level_face_accessor = typename LevelSelector::FaceAccessor;
392 
393  using level_cell_iterator = typename LevelSelector::cell_iterator;
394  using level_face_iterator = typename LevelSelector::face_iterator;
395 
396 
400  static const unsigned int dimension = dim;
401 
405  static const unsigned int space_dimension = spacedim;
406 
410  static const bool is_hp_dof_handler = false;
411 
423  DEAL_II_DEPRECATED
424  static const types::global_dof_index invalid_dof_index =
426 
436  static const unsigned int default_fe_index = 0;
437 
443  DoFHandler();
444 
449 
456  DoFHandler(const DoFHandler &) = delete;
457 
461  virtual ~DoFHandler() override;
462 
469  DoFHandler &
470  operator=(const DoFHandler &) = delete;
471 
476  void
477  initialize(const Triangulation<dim, spacedim> &tria,
478  const FiniteElement<dim, spacedim> &fe);
479 
501  virtual void
502  set_fe(const FiniteElement<dim, spacedim> &fe);
503 
533  virtual void
534  distribute_dofs(const FiniteElement<dim, spacedim> &fe);
535 
541  virtual void
542  distribute_mg_dofs();
543 
549  bool
550  has_level_dofs() const;
551 
566  bool
567  has_active_dofs() const;
568 
575  void
576  initialize_local_block_info();
577 
581  virtual void
582  clear();
583 
636  void
637  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
638 
643  void
644  renumber_dofs(const unsigned int level,
645  const std::vector<types::global_dof_index> &new_numbers);
646 
675  unsigned int
676  max_couplings_between_dofs() const;
677 
690  unsigned int
691  max_couplings_between_boundary_dofs() const;
692 
693  /*--------------------------------------*/
694 
699  /*
700  * @{
701  */
702 
707  begin(const unsigned int level = 0) const;
708 
726  begin_active(const unsigned int level = 0) const;
727 
733  end() const;
734 
740  end(const unsigned int level) const;
741 
748  end_active(const unsigned int level) const;
749 
750 
755  level_cell_iterator
756  begin_mg(const unsigned int level = 0) const;
757 
762  level_cell_iterator
763  end_mg(const unsigned int level) const;
764 
769  level_cell_iterator
770  end_mg() const;
771 
787  cell_iterators() const;
788 
830  active_cell_iterators() const;
831 
844  mg_cell_iterators() const;
845 
862  cell_iterators_on_level(const unsigned int level) const;
863 
880  active_cell_iterators_on_level(const unsigned int level) const;
881 
899  mg_cell_iterators_on_level(const unsigned int level) const;
900 
901  /*
902  * @}
903  */
904 
905 
906  /*---------------------------------------*/
907 
908 
933  n_dofs() const;
934 
943  n_dofs(const unsigned int level) const;
944 
950  n_boundary_dofs() const;
951 
963  template <typename number>
965  n_boundary_dofs(
966  const std::map<types::boundary_id, const Function<spacedim, number> *>
967  &boundary_ids) const;
968 
974  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
975 
991  const BlockInfo &
992  block_info() const;
993 
994 
1015  n_locally_owned_dofs() const;
1016 
1022  const IndexSet &
1023  locally_owned_dofs() const;
1024 
1029  const IndexSet &
1030  locally_owned_mg_dofs(const unsigned int level) const;
1031 
1049  std::vector<IndexSet>
1050  compute_locally_owned_dofs_per_processor() const;
1051 
1072  std::vector<types::global_dof_index>
1073  compute_n_locally_owned_dofs_per_processor() const;
1074 
1090  std::vector<IndexSet>
1091  compute_locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1092 
1105  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1106  locally_owned_dofs_per_processor() const;
1107 
1123  DEAL_II_DEPRECATED const std::vector<types::global_dof_index> &
1124  n_locally_owned_dofs_per_processor() const;
1125 
1139  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1140  locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1141 
1148  get_fe(const unsigned int index = 0) const;
1149 
1157  get_fe_collection() const;
1158 
1163  get_triangulation() const;
1164 
1173  virtual std::size_t
1174  memory_consumption() const;
1175 
1180  template <class Archive>
1181  void
1182  save(Archive &ar, const unsigned int version) const;
1183 
1188  template <class Archive>
1189  void
1190  load(Archive &ar, const unsigned int version);
1191 
1192  BOOST_SERIALIZATION_SPLIT_MEMBER()
1193 
1194 
1198  DeclException0(ExcGridsDoNotMatch);
1208  DeclException1(ExcNewNumbersNotConsecutive,
1209  types::global_dof_index,
1210  << "The given list of new dof indices is not consecutive: "
1211  << "the index " << arg1 << " does not exist.");
1216  DeclException1(ExcInvalidLevel,
1217  int,
1218  << "The given level " << arg1
1219  << " is not in the valid range!");
1229  DeclException1(ExcEmptyLevel,
1230  int,
1231  << "You tried to do something on level " << arg1
1232  << ", but this level is empty.");
1233 
1234 
1235 private:
1239  BlockInfo block_info_object;
1240 
1244  SmartPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
1245  tria;
1246 
1247 
1252  hp::FECollection<dim, spacedim> fe_collection;
1253 
1258  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1259  PolicyBase<dim, spacedim>>
1260  policy;
1261 
1269  ::internal::DoFHandlerImplementation::NumberCache number_cache;
1270 
1274  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1275  mg_number_cache;
1276 
1284  {
1285  public:
1289  MGVertexDoFs();
1290 
1296  void
1297  init(const unsigned int coarsest_level,
1298  const unsigned int finest_level,
1299  const unsigned int dofs_per_vertex);
1300 
1304  unsigned int
1305  get_coarsest_level() const;
1306 
1310  unsigned int
1311  get_finest_level() const;
1312 
1318  get_index(const unsigned int level,
1319  const unsigned int dof_number,
1320  const unsigned int dofs_per_vertex) const;
1321 
1326  void
1327  set_index(const unsigned int level,
1328  const unsigned int dof_number,
1329  const unsigned int dofs_per_vertex,
1330  const types::global_dof_index index);
1331 
1332  private:
1336  unsigned int coarsest_level;
1337 
1341  unsigned int finest_level;
1342 
1352  std::unique_ptr<types::global_dof_index[]> indices;
1353  };
1354 
1358  void
1359  clear_space();
1360 
1364  void
1365  clear_mg_space();
1366 
1367  template <int structdim>
1369  get_dof_index(const unsigned int obj_level,
1370  const unsigned int obj_index,
1371  const unsigned int fe_index,
1372  const unsigned int local_index) const;
1373 
1374  template <int structdim>
1375  void
1376  set_dof_index(const unsigned int obj_level,
1377  const unsigned int obj_index,
1378  const unsigned int fe_index,
1379  const unsigned int local_index,
1380  const types::global_dof_index global_index) const;
1381 
1385  std::vector<types::global_dof_index> vertex_dofs;
1386 
1391  std::vector<MGVertexDoFs> mg_vertex_dofs;
1392 
1397  std::vector<
1398  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1400 
1401  std::vector<
1402  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1403  mg_levels;
1404 
1410  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1412 
1413  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1414  mg_faces;
1415 
1416  // Make accessor objects friends.
1417  template <int, class, bool>
1418  friend class DoFAccessor;
1419  template <class, bool>
1420  friend class DoFCellAccessor;
1421  friend struct ::internal::DoFAccessorImplementation::Implementation;
1422  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1423 
1424  friend struct ::internal::DoFHandlerImplementation::Implementation;
1425  friend struct ::internal::DoFHandlerImplementation::Policy::
1426  Implementation;
1427 
1428  // explicitly check for sensible template arguments, but not on windows
1429  // because MSVC creates bogus warnings during normal compilation
1430 #ifndef DEAL_II_MSVC
1431  static_assert(dim <= spacedim,
1432  "The dimension <dim> of a DoFHandler must be less than or "
1433  "equal to the space dimension <spacedim> in which it lives.");
1434 #endif
1435 };
1436 
1437 
1438 
1439 #ifndef DOXYGEN
1440 
1441 /* ----------------------- Inline functions ----------------------------------
1442  */
1443 
1444 
1445 template <int dim, int spacedim>
1446 inline bool
1448 {
1449  return mg_number_cache.size() > 0;
1450 }
1451 
1452 
1453 
1454 template <int dim, int spacedim>
1455 inline bool
1457 {
1458  return number_cache.n_global_dofs > 0;
1459 }
1460 
1461 
1462 
1463 template <int dim, int spacedim>
1466 {
1467  return number_cache.n_global_dofs;
1468 }
1469 
1470 
1471 
1472 template <int dim, int spacedim>
1474 DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1475 {
1476  Assert(has_level_dofs(),
1477  ExcMessage(
1478  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1479  Assert(level < mg_number_cache.size(), ExcInvalidLevel(level));
1480  return mg_number_cache[level].n_global_dofs;
1481 }
1482 
1483 
1484 
1485 template <int dim, int spacedim>
1488 {
1489  return number_cache.n_locally_owned_dofs;
1490 }
1491 
1492 
1493 
1494 template <int dim, int spacedim>
1495 const IndexSet &
1497 {
1498  return number_cache.locally_owned_dofs;
1499 }
1500 
1501 
1502 
1503 template <int dim, int spacedim>
1504 const IndexSet &
1505 DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
1506 {
1507  Assert(level < this->get_triangulation().n_global_levels(),
1508  ExcMessage("The given level index exceeds the number of levels "
1509  "present in the triangulation"));
1510  Assert(
1511  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1512  ExcMessage(
1513  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1514  return mg_number_cache[level].locally_owned_dofs;
1515 }
1516 
1517 
1518 
1519 template <int dim, int spacedim>
1520 const std::vector<types::global_dof_index> &
1522 {
1523  if (number_cache.n_locally_owned_dofs_per_processor.empty() &&
1524  number_cache.n_global_dofs > 0)
1525  {
1527  number_cache)
1528  .n_locally_owned_dofs_per_processor =
1529  compute_n_locally_owned_dofs_per_processor();
1530  }
1531  return number_cache.n_locally_owned_dofs_per_processor;
1532 }
1533 
1534 
1535 
1536 template <int dim, int spacedim>
1537 const std::vector<IndexSet> &
1539 {
1540  if (number_cache.locally_owned_dofs_per_processor.empty() &&
1541  number_cache.n_global_dofs > 0)
1542  {
1544  number_cache)
1545  .locally_owned_dofs_per_processor =
1546  compute_locally_owned_dofs_per_processor();
1547  }
1548  return number_cache.locally_owned_dofs_per_processor;
1549 }
1550 
1551 
1552 
1553 template <int dim, int spacedim>
1554 const std::vector<IndexSet> &
1556  const unsigned int level) const
1557 {
1558  Assert(level < this->get_triangulation().n_global_levels(),
1559  ExcMessage("The given level index exceeds the number of levels "
1560  "present in the triangulation"));
1561  Assert(
1562  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1563  ExcMessage(
1564  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1565  if (mg_number_cache[level].locally_owned_dofs_per_processor.empty() &&
1566  mg_number_cache[level].n_global_dofs > 0)
1567  {
1569  mg_number_cache[level])
1570  .locally_owned_dofs_per_processor =
1571  compute_locally_owned_mg_dofs_per_processor(level);
1572  }
1573  return mg_number_cache[level].locally_owned_dofs_per_processor;
1574 }
1575 
1576 
1577 
1578 template <int dim, int spacedim>
1579 std::vector<types::global_dof_index>
1581 {
1583  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1584  &this->get_triangulation()));
1585  if (tr != nullptr)
1586  return number_cache.get_n_locally_owned_dofs_per_processor(
1587  tr->get_communicator());
1588  else
1589  return number_cache.get_n_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1590 }
1591 
1592 
1593 
1594 template <int dim, int spacedim>
1595 std::vector<IndexSet>
1597 {
1599  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1600  &this->get_triangulation()));
1601  if (tr != nullptr)
1602  return number_cache.get_locally_owned_dofs_per_processor(
1603  tr->get_communicator());
1604  else
1605  return number_cache.get_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1606 }
1607 
1608 
1609 
1610 template <int dim, int spacedim>
1611 std::vector<IndexSet>
1613  const unsigned int level) const
1614 {
1615  Assert(level < this->get_triangulation().n_global_levels(),
1616  ExcMessage("The given level index exceeds the number of levels "
1617  "present in the triangulation"));
1618  Assert(
1619  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1620  ExcMessage(
1621  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1623  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1624  &this->get_triangulation()));
1625  if (tr != nullptr)
1626  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1627  tr->get_communicator());
1628  else
1629  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1630  MPI_COMM_SELF);
1631 }
1632 
1633 
1634 
1635 template <int dim, int spacedim>
1636 inline const FiniteElement<dim, spacedim> &
1637 DoFHandler<dim, spacedim>::get_fe(const unsigned int index) const
1638 {
1639  (void)index;
1640  Assert(index == 0,
1641  ExcMessage(
1642  "There is only one FiniteElement stored. The index must be zero!"));
1643  return get_fe_collection()[0];
1644 }
1645 
1646 
1647 
1648 template <int dim, int spacedim>
1649 inline const hp::FECollection<dim, spacedim> &
1651 {
1652  Assert(
1653  fe_collection.size() > 0,
1654  ExcMessage(
1655  "You are trying to access the DoFHandler's FECollection object before it has been initialized."));
1656  return fe_collection;
1657 }
1658 
1659 
1660 
1661 template <int dim, int spacedim>
1662 inline const Triangulation<dim, spacedim> &
1664 {
1665  Assert(tria != nullptr,
1666  ExcMessage("This DoFHandler object has not been associated "
1667  "with a triangulation."));
1668  return *tria;
1669 }
1670 
1671 
1672 
1673 template <int dim, int spacedim>
1674 inline const BlockInfo &
1676 {
1677  return block_info_object;
1678 }
1679 
1680 
1681 
1682 template <int dim, int spacedim>
1683 template <typename number>
1686  const std::map<types::boundary_id, const Function<spacedim, number> *>
1687  &boundary_ids) const
1688 {
1689  // extract the set of boundary ids and forget about the function object
1690  // pointers
1691  std::set<types::boundary_id> boundary_ids_only;
1692  for (typename std::map<types::boundary_id,
1693  const Function<spacedim, number> *>::const_iterator p =
1694  boundary_ids.begin();
1695  p != boundary_ids.end();
1696  ++p)
1697  boundary_ids_only.insert(p->first);
1698 
1699  // then just hand everything over to the other function that does the work
1700  return n_boundary_dofs(boundary_ids_only);
1701 }
1702 
1703 
1704 
1705 namespace internal
1706 {
1714  template <int dim, int spacedim>
1715  std::string
1716  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
1717  PolicyBase<dim, spacedim> &policy);
1718 } // namespace internal
1719 
1720 
1721 
1722 template <int dim, int spacedim>
1723 template <class Archive>
1724 void
1725 DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
1726 {
1727  ar &block_info_object;
1728  ar &vertex_dofs;
1729  ar &number_cache;
1730 
1731  // some versions of gcc have trouble with loading vectors of
1732  // std::unique_ptr objects because std::unique_ptr does not
1733  // have a copy constructor. do it one level at a time
1734  unsigned int n_levels = levels.size();
1735  ar & n_levels;
1736  for (unsigned int i = 0; i < levels.size(); ++i)
1737  ar &levels[i];
1738 
1739  // boost dereferences a nullptr when serializing a nullptr
1740  // at least up to 1.65.1. This causes problems with clang-5.
1741  // Therefore, work around it.
1742  bool faces_is_nullptr = (faces.get() == nullptr);
1743  ar & faces_is_nullptr;
1744  if (!faces_is_nullptr)
1745  ar &faces;
1746 
1747  // write out the number of triangulation cells and later check during
1748  // loading that this number is indeed correct; same with something that
1749  // identifies the FE and the policy
1750  unsigned int n_cells = tria->n_cells();
1751  std::string fe_name = this->get_fe(0).get_name();
1752  std::string policy_name = internal::policy_to_string(*policy);
1753 
1754  ar &n_cells &fe_name &policy_name;
1755 }
1756 
1757 
1758 
1759 template <int dim, int spacedim>
1760 template <class Archive>
1761 void
1762 DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
1763 {
1764  ar &block_info_object;
1765  ar &vertex_dofs;
1766  ar &number_cache;
1767 
1768  // boost::serialization can restore pointers just fine, but if the
1769  // pointer object still points to something useful, that object is not
1770  // destroyed and we end up with a memory leak. consequently, first delete
1771  // previous content before re-loading stuff
1772  levels.clear();
1773  faces.reset();
1774 
1775  // some versions of gcc have trouble with loading vectors of
1776  // std::unique_ptr objects because std::unique_ptr does not
1777  // have a copy constructor. do it one level at a time
1778  unsigned int size;
1779  ar & size;
1780  levels.resize(size);
1781  for (unsigned int i = 0; i < levels.size(); ++i)
1782  {
1783  std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<dim>> level;
1784  ar & level;
1785  levels[i] = std::move(level);
1786  }
1787 
1788  // Workaround for nullptr, see in save().
1789  bool faces_is_nullptr = true;
1790  ar & faces_is_nullptr;
1791  if (!faces_is_nullptr)
1792  ar &faces;
1793 
1794  // these are the checks that correspond to the last block in the save()
1795  // function
1796  unsigned int n_cells;
1797  std::string fe_name;
1798  std::string policy_name;
1799 
1800  ar &n_cells &fe_name &policy_name;
1801 
1802  AssertThrow(n_cells == tria->n_cells(),
1803  ExcMessage(
1804  "The object being loaded into does not match the triangulation "
1805  "that has been stored previously."));
1806  AssertThrow(
1807  fe_name == this->get_fe(0).get_name(),
1808  ExcMessage(
1809  "The finite element associated with this DoFHandler does not match "
1810  "the one that was associated with the DoFHandler previously stored."));
1811  AssertThrow(policy_name == internal::policy_to_string(*policy),
1812  ExcMessage(
1813  "The policy currently associated with this DoFHandler (" +
1814  internal::policy_to_string(*policy) +
1815  ") does not match the one that was associated with the "
1816  "DoFHandler previously stored (" +
1817  policy_name + ")."));
1818 }
1819 
1820 
1821 
1822 template <int dim, int spacedim>
1825  const unsigned int level,
1826  const unsigned int dof_number,
1827  const unsigned int dofs_per_vertex) const
1828 {
1829  Assert((level >= coarsest_level) && (level <= finest_level),
1830  ExcInvalidLevel(level));
1831  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
1832 }
1833 
1834 
1835 
1836 template <int dim, int spacedim>
1837 inline void
1839  const unsigned int level,
1840  const unsigned int dof_number,
1841  const unsigned int dofs_per_vertex,
1842  const types::global_dof_index index)
1843 {
1844  Assert((level >= coarsest_level) && (level <= finest_level),
1845  ExcInvalidLevel(level));
1846  indices[dofs_per_vertex * (level - coarsest_level) + dof_number] = index;
1847 }
1848 
1849 
1850 #endif // DOXYGEN
1851 
1852 DEAL_II_NAMESPACE_CLOSE
1853 
1854 #endif
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1391
const Triangulation< dim, spacedim > & get_triangulation() const
typename ActiveSelector::FaceAccessor face_accessor
Definition: dof_handler.h:239
typename ActiveSelector::quad_iterator quad_iterator
Definition: dof_handler.h:272
std::vector< IndexSet > compute_locally_owned_mg_dofs_per_processor(const unsigned int level) const
static const unsigned int spacedim
const BlockInfo & block_info() const
const std::vector< IndexSet > & locally_owned_mg_dofs_per_processor(const unsigned int level) const
typename ActiveSelector::CellAccessor cell_accessor
Definition: dof_handler.h:225
STL namespace.
#define AssertThrow(cond, exc)
Definition: exceptions.h:1531
static ::ExceptionBase & ExcFacesHaveNoLevel()
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
typename ActiveSelector::face_iterator face_iterator
Definition: dof_handler.h:375
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:388
int level() const
types::global_dof_index n_locally_owned_dofs() const
const std::vector< types::global_dof_index > & n_locally_owned_dofs_per_processor() const
static ::ExceptionBase & ExcMessage(std::string arg1)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:518
const Triangulation< dim, spacedim > * tria
typename ActiveSelector::hex_iterator hex_iterator
Definition: dof_handler.h:296
Definition: types.h:32
std::vector< types::global_dof_index > compute_n_locally_owned_dofs_per_processor() const
bool has_active_dofs() const
#define Assert(cond, exc)
Definition: exceptions.h:1419
#define DeclException0(Exception0)
Definition: exceptions.h:473
types::global_dof_index n_boundary_dofs() const
std::vector< types::global_dof_index > n_locally_owned_dofs_per_processor
Definition: number_cache.h:169
types::global_dof_index n_dofs() const
int index() const
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<::internal::DoFHandlerImplementation::DoFFaces< dim > > faces
Definition: dof_handler.h:1411
Definition: hp.h:117
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
Definition: dof_handler.h:1399
virtual const MPI_Comm & get_communicator() const
Definition: tria_base.cc:167
typename ActiveSelector::active_line_iterator active_line_iterator
Definition: dof_handler.h:263
std::unique_ptr< types::global_dof_index[]> indices
Definition: dof_handler.h:1352
unsigned int global_dof_index
Definition: types.h:77
const Triangulation< dim, spacedim > & get_triangulation() const
static const unsigned int dim
const std::vector< IndexSet > & locally_owned_dofs_per_processor() const
typename ActiveSelector::line_iterator line_iterator
Definition: dof_handler.h:248
unsigned int coarsest_level
Definition: dof_handler.h:1336
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)
std::vector< IndexSet > locally_owned_dofs_per_processor
Definition: number_cache.h:180
A small class collecting the different BlockIndices involved in global, multilevel and local computat...
Definition: block_info.h:99
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:357
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:329
const types::global_dof_index invalid_dof_index
Definition: types.h:205
std::vector< IndexSet > compute_locally_owned_dofs_per_processor() const
const IndexSet & locally_owned_dofs() const
bool has_level_dofs() const
unsigned int boundary_id
Definition: types.h:128
typename ActiveSelector::active_quad_iterator active_quad_iterator
Definition: dof_handler.h:287
void save(Archive &ar, const unsigned int version) const
std::vector< types::global_dof_index > vertex_dofs
Definition: dof_handler.h:1385
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:307