Reference documentation for deal.II version Git e849c0d71e 2019-06-17 10:40:29 -0400
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
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/dofs/block_info.h>
30 #include <deal.II/dofs/deprecated_function_map.h>
31 #include <deal.II/dofs/dof_faces.h>
32 #include <deal.II/dofs/dof_iterator_selector.h>
33 #include <deal.II/dofs/dof_levels.h>
34 #include <deal.II/dofs/number_cache.h>
35 
36 #include <deal.II/hp/fe_collection.h>
37 
38 #include <boost/serialization/split_member.hpp>
39 
40 #include <map>
41 #include <memory>
42 #include <set>
43 #include <vector>
44 
45 DEAL_II_NAMESPACE_OPEN
46 
47 template <int dim, int spacedim>
48 class FiniteElement;
49 template <int dim, int spacedim>
51 
52 namespace internal
53 {
54  namespace DoFHandlerImplementation
55  {
56  struct Implementation;
57 
58  namespace Policy
59  {
60  template <int dim, int spacedim>
61  class PolicyBase;
62  struct Implementation;
63  } // namespace Policy
64  } // namespace DoFHandlerImplementation
65 
66  namespace DoFAccessorImplementation
67  {
68  struct Implementation;
69  }
70 
71  namespace DoFCellAccessorImplementation
72  {
73  struct Implementation;
74  }
75 } // namespace internal
76 
77 
199 template <int dim, int spacedim = dim>
200 class DoFHandler : public Subscriptor
201 {
202  using ActiveSelector = ::internal::DoFHandlerImplementation::
203  Iterators<DoFHandler<dim, spacedim>, false>;
204  using LevelSelector = ::internal::DoFHandlerImplementation::
205  Iterators<DoFHandler<dim, spacedim>, true>;
206 
207 public:
220  using cell_accessor = typename ActiveSelector::CellAccessor;
221 
234  using face_accessor = typename ActiveSelector::FaceAccessor;
235 
243  using line_iterator = typename ActiveSelector::line_iterator;
244 
258  using active_line_iterator = typename ActiveSelector::active_line_iterator;
259 
267  using quad_iterator = typename ActiveSelector::quad_iterator;
268 
282  using active_quad_iterator = typename ActiveSelector::active_quad_iterator;
283 
291  using hex_iterator = typename ActiveSelector::hex_iterator;
292 
302  using active_hex_iterator = typename ActiveSelector::active_hex_iterator;
303 
324  using active_cell_iterator = typename ActiveSelector::active_cell_iterator;
325 
352  using cell_iterator = typename ActiveSelector::cell_iterator;
353 
370  using face_iterator = typename ActiveSelector::face_iterator;
371 
383  using active_face_iterator = typename ActiveSelector::active_face_iterator;
384 
385  using level_cell_accessor = typename LevelSelector::CellAccessor;
386  using level_face_accessor = typename LevelSelector::FaceAccessor;
387 
388  using level_cell_iterator = typename LevelSelector::cell_iterator;
389  using level_face_iterator = typename LevelSelector::face_iterator;
390 
391 
395  static const unsigned int dimension = dim;
396 
400  static const unsigned int space_dimension = spacedim;
401 
405  static const bool is_hp_dof_handler = false;
406 
418  DEAL_II_DEPRECATED
419  static const types::global_dof_index invalid_dof_index =
421 
431  static const unsigned int default_fe_index = 0;
432 
438  DoFHandler();
439 
444 
451  DoFHandler(const DoFHandler &) = delete;
452 
456  virtual ~DoFHandler() override;
457 
464  DoFHandler &
465  operator=(const DoFHandler &) = delete;
466 
471  void
472  initialize(const Triangulation<dim, spacedim> &tria,
473  const FiniteElement<dim, spacedim> &fe);
474 
496  virtual void
497  set_fe(const FiniteElement<dim, spacedim> &fe);
498 
528  virtual void
529  distribute_dofs(const FiniteElement<dim, spacedim> &fe);
530 
539  DEAL_II_DEPRECATED
540  virtual void
541  distribute_mg_dofs(const FiniteElement<dim, spacedim> &fe);
542 
548  virtual void
549  distribute_mg_dofs();
550 
556  bool
557  has_level_dofs() const;
558 
573  bool
574  has_active_dofs() const;
575 
582  void
583  initialize_local_block_info();
584 
588  virtual void
589  clear();
590 
643  void
644  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
645 
650  void
651  renumber_dofs(const unsigned int level,
652  const std::vector<types::global_dof_index> &new_numbers);
653 
682  unsigned int
683  max_couplings_between_dofs() const;
684 
697  unsigned int
698  max_couplings_between_boundary_dofs() const;
699 
700  /*--------------------------------------*/
701 
706  /*
707  * @{
708  */
709 
714  begin(const unsigned int level = 0) const;
715 
733  begin_active(const unsigned int level = 0) const;
734 
740  end() const;
741 
747  end(const unsigned int level) const;
748 
755  end_active(const unsigned int level) const;
756 
757 
762  level_cell_iterator
763  begin_mg(const unsigned int level = 0) const;
764 
769  level_cell_iterator
770  end_mg(const unsigned int level) const;
771 
776  level_cell_iterator
777  end_mg() const;
778 
794  cell_iterators() const;
795 
837  active_cell_iterators() const;
838 
851  mg_cell_iterators() const;
852 
869  cell_iterators_on_level(const unsigned int level) const;
870 
887  active_cell_iterators_on_level(const unsigned int level) const;
888 
906  mg_cell_iterators_on_level(const unsigned int level) const;
907 
908  /*
909  * @}
910  */
911 
912 
913  /*---------------------------------------*/
914 
915 
940  n_dofs() const;
941 
950  n_dofs(const unsigned int level) const;
951 
956  n_boundary_dofs() const;
957 
968  template <typename number>
970  n_boundary_dofs(
971  const std::map<types::boundary_id, const Function<spacedim, number> *>
972  &boundary_ids) const;
973 
979  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
980 
996  const BlockInfo &
997  block_info() const;
998 
999 
1019  unsigned int
1020  n_locally_owned_dofs() const;
1021 
1027  const IndexSet &
1028  locally_owned_dofs() const;
1029 
1034  const IndexSet &
1035  locally_owned_mg_dofs(const unsigned int level) const;
1036 
1054  std::vector<IndexSet>
1055  compute_locally_owned_dofs_per_processor() const;
1056 
1077  std::vector<types::global_dof_index>
1078  compute_n_locally_owned_dofs_per_processor() const;
1079 
1095  std::vector<IndexSet>
1096  compute_locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1097 
1110  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1111  locally_owned_dofs_per_processor() const;
1112 
1128  DEAL_II_DEPRECATED const std::vector<types::global_dof_index> &
1129  n_locally_owned_dofs_per_processor() const;
1130 
1144  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1145  locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1146 
1153  get_fe(const unsigned int index = 0) const;
1154 
1162  get_fe_collection() const;
1163 
1168  get_triangulation() const;
1169 
1178  virtual std::size_t
1179  memory_consumption() const;
1180 
1185  template <class Archive>
1186  void
1187  save(Archive &ar, const unsigned int version) const;
1188 
1193  template <class Archive>
1194  void
1195  load(Archive &ar, const unsigned int version);
1196 
1197  BOOST_SERIALIZATION_SPLIT_MEMBER()
1198 
1199 
1203  DeclException0(ExcGridsDoNotMatch);
1213  DeclException1(ExcNewNumbersNotConsecutive,
1214  types::global_dof_index,
1215  << "The given list of new dof indices is not consecutive: "
1216  << "the index " << arg1 << " does not exist.");
1221  DeclException1(ExcInvalidLevel,
1222  int,
1223  << "The given level " << arg1
1224  << " is not in the valid range!");
1234  DeclException1(ExcEmptyLevel,
1235  int,
1236  << "You tried to do something on level " << arg1
1237  << ", but this level is empty.");
1238 
1239 
1240 private:
1244  BlockInfo block_info_object;
1245 
1249  SmartPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
1250  tria;
1251 
1252 
1257  hp::FECollection<dim, spacedim> fe_collection;
1258 
1263  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1264  PolicyBase<dim, spacedim>>
1265  policy;
1266 
1274  ::internal::DoFHandlerImplementation::NumberCache number_cache;
1275 
1279  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1280  mg_number_cache;
1281 
1289  {
1290  public:
1294  MGVertexDoFs();
1295 
1301  void
1302  init(const unsigned int coarsest_level,
1303  const unsigned int finest_level,
1304  const unsigned int dofs_per_vertex);
1305 
1309  unsigned int
1310  get_coarsest_level() const;
1311 
1315  unsigned int
1316  get_finest_level() const;
1317 
1323  get_index(const unsigned int level,
1324  const unsigned int dof_number,
1325  const unsigned int dofs_per_vertex) const;
1326 
1331  void
1332  set_index(const unsigned int level,
1333  const unsigned int dof_number,
1334  const unsigned int dofs_per_vertex,
1335  const types::global_dof_index index);
1336 
1337  private:
1341  unsigned int coarsest_level;
1342 
1346  unsigned int finest_level;
1347 
1357  std::unique_ptr<types::global_dof_index[]> indices;
1358  };
1359 
1363  void
1364  clear_space();
1365 
1369  void
1370  clear_mg_space();
1371 
1372  template <int structdim>
1374  get_dof_index(const unsigned int obj_level,
1375  const unsigned int obj_index,
1376  const unsigned int fe_index,
1377  const unsigned int local_index) const;
1378 
1379  template <int structdim>
1380  void
1381  set_dof_index(const unsigned int obj_level,
1382  const unsigned int obj_index,
1383  const unsigned int fe_index,
1384  const unsigned int local_index,
1385  const types::global_dof_index global_index) const;
1386 
1390  std::vector<types::global_dof_index> vertex_dofs;
1391 
1396  std::vector<MGVertexDoFs> mg_vertex_dofs;
1397 
1402  std::vector<
1403  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1405 
1406  std::vector<
1407  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1408  mg_levels;
1409 
1415  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1417 
1418  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1419  mg_faces;
1420 
1424  template <int, class, bool>
1425  friend class DoFAccessor;
1426  template <class, bool>
1427  friend class DoFCellAccessor;
1428  friend struct ::internal::DoFAccessorImplementation::Implementation;
1429  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1430 
1431  friend struct ::internal::DoFHandlerImplementation::Implementation;
1432  friend struct ::internal::DoFHandlerImplementation::Policy::
1433  Implementation;
1434 
1435  // explicitly check for sensible template arguments, but not on windows
1436  // because MSVC creates bogus warnings during normal compilation
1437 #ifndef DEAL_II_MSVC
1438  static_assert(dim <= spacedim,
1439  "The dimension <dim> of a DoFHandler must be less than or "
1440  "equal to the space dimension <spacedim> in which it lives.");
1441 #endif
1442 };
1443 
1444 
1445 
1446 #ifndef DOXYGEN
1447 
1448 /* ----------------------- Inline functions ----------------------------------
1449  */
1450 
1451 
1452 template <int dim, int spacedim>
1453 inline bool
1455 {
1456  return mg_number_cache.size() > 0;
1457 }
1458 
1459 
1460 
1461 template <int dim, int spacedim>
1462 inline bool
1464 {
1465  return number_cache.n_global_dofs > 0;
1466 }
1467 
1468 
1469 
1470 template <int dim, int spacedim>
1473 {
1474  return number_cache.n_global_dofs;
1475 }
1476 
1477 
1478 
1479 template <int dim, int spacedim>
1481 DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1482 {
1483  Assert(has_level_dofs(),
1484  ExcMessage(
1485  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1486  Assert(level < mg_number_cache.size(), ExcInvalidLevel(level));
1487  return mg_number_cache[level].n_global_dofs;
1488 }
1489 
1490 
1491 
1492 template <int dim, int spacedim>
1493 unsigned int
1495 {
1496  return number_cache.n_locally_owned_dofs;
1497 }
1498 
1499 
1500 
1501 template <int dim, int spacedim>
1502 const IndexSet &
1504 {
1505  return number_cache.locally_owned_dofs;
1506 }
1507 
1508 
1509 
1510 template <int dim, int spacedim>
1511 const IndexSet &
1512 DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
1513 {
1514  Assert(level < this->get_triangulation().n_global_levels(),
1515  ExcMessage("The given level index exceeds the number of levels "
1516  "present in the triangulation"));
1517  Assert(
1518  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1519  ExcMessage(
1520  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1521  return mg_number_cache[level].locally_owned_dofs;
1522 }
1523 
1524 
1525 
1526 template <int dim, int spacedim>
1527 const std::vector<types::global_dof_index> &
1529 {
1530  if (number_cache.n_locally_owned_dofs_per_processor.empty() &&
1531  number_cache.n_global_dofs > 0)
1532  {
1534  number_cache)
1535  .n_locally_owned_dofs_per_processor =
1536  compute_n_locally_owned_dofs_per_processor();
1537  }
1538  return number_cache.n_locally_owned_dofs_per_processor;
1539 }
1540 
1541 
1542 
1543 template <int dim, int spacedim>
1544 const std::vector<IndexSet> &
1546 {
1547  if (number_cache.locally_owned_dofs_per_processor.empty() &&
1548  number_cache.n_global_dofs > 0)
1549  {
1551  number_cache)
1552  .locally_owned_dofs_per_processor =
1553  compute_locally_owned_dofs_per_processor();
1554  }
1555  return number_cache.locally_owned_dofs_per_processor;
1556 }
1557 
1558 
1559 
1560 template <int dim, int spacedim>
1561 const std::vector<IndexSet> &
1563  const unsigned int level) const
1564 {
1565  Assert(level < this->get_triangulation().n_global_levels(),
1566  ExcMessage("The given level index exceeds the number of levels "
1567  "present in the triangulation"));
1568  Assert(
1569  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1570  ExcMessage(
1571  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1572  if (mg_number_cache[level].locally_owned_dofs_per_processor.empty() &&
1573  mg_number_cache[level].n_global_dofs > 0)
1574  {
1576  mg_number_cache[level])
1577  .locally_owned_dofs_per_processor =
1578  compute_locally_owned_mg_dofs_per_processor(level);
1579  }
1580  return mg_number_cache[level].locally_owned_dofs_per_processor;
1581 }
1582 
1583 
1584 
1585 template <int dim, int spacedim>
1586 std::vector<types::global_dof_index>
1588 {
1590  (dynamic_cast<const parallel::Triangulation<dim, spacedim> *>(
1591  &this->get_triangulation()));
1592  if (tr != nullptr)
1593  return number_cache.get_n_locally_owned_dofs_per_processor(
1594  tr->get_communicator());
1595  else
1596  return number_cache.get_n_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1597 }
1598 
1599 
1600 
1601 template <int dim, int spacedim>
1602 std::vector<IndexSet>
1604 {
1606  (dynamic_cast<const parallel::Triangulation<dim, spacedim> *>(
1607  &this->get_triangulation()));
1608  if (tr != nullptr)
1609  return number_cache.get_locally_owned_dofs_per_processor(
1610  tr->get_communicator());
1611  else
1612  return number_cache.get_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1613 }
1614 
1615 
1616 
1617 template <int dim, int spacedim>
1618 std::vector<IndexSet>
1620  const unsigned int level) const
1621 {
1622  Assert(level < this->get_triangulation().n_global_levels(),
1623  ExcMessage("The given level index exceeds the number of levels "
1624  "present in the triangulation"));
1625  Assert(
1626  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1627  ExcMessage(
1628  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1630  (dynamic_cast<const parallel::Triangulation<dim, spacedim> *>(
1631  &this->get_triangulation()));
1632  if (tr != nullptr)
1633  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1634  tr->get_communicator());
1635  else
1636  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1637  MPI_COMM_SELF);
1638 }
1639 
1640 
1641 
1642 template <int dim, int spacedim>
1643 inline const FiniteElement<dim, spacedim> &
1644 DoFHandler<dim, spacedim>::get_fe(const unsigned int index) const
1645 {
1646  (void)index;
1647  Assert(index == 0,
1648  ExcMessage(
1649  "There is only one FiniteElement stored. The index must be zero!"));
1650  return get_fe_collection()[0];
1651 }
1652 
1653 
1654 
1655 template <int dim, int spacedim>
1656 inline const hp::FECollection<dim, spacedim> &
1658 {
1659  Assert(
1660  fe_collection.size() > 0,
1661  ExcMessage(
1662  "You are trying to access the DoFHandler's FECollection object before it has been initialized."));
1663  return fe_collection;
1664 }
1665 
1666 
1667 
1668 template <int dim, int spacedim>
1669 inline const Triangulation<dim, spacedim> &
1671 {
1672  Assert(tria != nullptr,
1673  ExcMessage("This DoFHandler object has not been associated "
1674  "with a triangulation."));
1675  return *tria;
1676 }
1677 
1678 
1679 
1680 template <int dim, int spacedim>
1681 inline const BlockInfo &
1683 {
1684  return block_info_object;
1685 }
1686 
1687 
1688 
1689 template <int dim, int spacedim>
1690 template <typename number>
1693  const std::map<types::boundary_id, const Function<spacedim, number> *>
1694  &boundary_ids) const
1695 {
1696  // extract the set of boundary ids and forget about the function object
1697  // pointers
1698  std::set<types::boundary_id> boundary_ids_only;
1699  for (typename std::map<types::boundary_id,
1700  const Function<spacedim, number> *>::const_iterator p =
1701  boundary_ids.begin();
1702  p != boundary_ids.end();
1703  ++p)
1704  boundary_ids_only.insert(p->first);
1705 
1706  // then just hand everything over to the other function that does the work
1707  return n_boundary_dofs(boundary_ids_only);
1708 }
1709 
1710 
1711 
1712 namespace internal
1713 {
1721  template <int dim, int spacedim>
1722  std::string
1723  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
1724  PolicyBase<dim, spacedim> &policy);
1725 } // namespace internal
1726 
1727 
1728 
1729 template <int dim, int spacedim>
1730 template <class Archive>
1731 void
1732 DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
1733 {
1734  ar &block_info_object;
1735  ar &vertex_dofs;
1736  ar &number_cache;
1737 
1738  // some versions of gcc have trouble with loading vectors of
1739  // std::unique_ptr objects because std::unique_ptr does not
1740  // have a copy constructor. do it one level at a time
1741  unsigned int n_levels = levels.size();
1742  ar & n_levels;
1743  for (unsigned int i = 0; i < levels.size(); ++i)
1744  ar &levels[i];
1745 
1746  // boost dereferences a nullptr when serializing a nullptr
1747  // at least up to 1.65.1. This causes problems with clang-5.
1748  // Therefore, work around it.
1749  bool faces_is_nullptr = (faces.get() == nullptr);
1750  ar & faces_is_nullptr;
1751  if (!faces_is_nullptr)
1752  ar &faces;
1753 
1754  // write out the number of triangulation cells and later check during
1755  // loading that this number is indeed correct; same with something that
1756  // identifies the FE and the policy
1757  unsigned int n_cells = tria->n_cells();
1758  std::string fe_name = this->get_fe(0).get_name();
1759  std::string policy_name = internal::policy_to_string(*policy);
1760 
1761  ar &n_cells &fe_name &policy_name;
1762 }
1763 
1764 
1765 
1766 template <int dim, int spacedim>
1767 template <class Archive>
1768 void
1769 DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
1770 {
1771  ar &block_info_object;
1772  ar &vertex_dofs;
1773  ar &number_cache;
1774 
1775  // boost::serialization can restore pointers just fine, but if the
1776  // pointer object still points to something useful, that object is not
1777  // destroyed and we end up with a memory leak. consequently, first delete
1778  // previous content before re-loading stuff
1779  levels.clear();
1780  faces.reset();
1781 
1782  // some versions of gcc have trouble with loading vectors of
1783  // std::unique_ptr objects because std::unique_ptr does not
1784  // have a copy constructor. do it one level at a time
1785  unsigned int size;
1786  ar & size;
1787  levels.resize(size);
1788  for (unsigned int i = 0; i < levels.size(); ++i)
1789  {
1790  std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<dim>> level;
1791  ar & level;
1792  levels[i] = std::move(level);
1793  }
1794 
1795  // Workaround for nullptr, see in save().
1796  bool faces_is_nullptr = true;
1797  ar & faces_is_nullptr;
1798  if (!faces_is_nullptr)
1799  ar &faces;
1800 
1801  // these are the checks that correspond to the last block in the save()
1802  // function
1803  unsigned int n_cells;
1804  std::string fe_name;
1805  std::string policy_name;
1806 
1807  ar &n_cells &fe_name &policy_name;
1808 
1809  AssertThrow(n_cells == tria->n_cells(),
1810  ExcMessage(
1811  "The object being loaded into does not match the triangulation "
1812  "that has been stored previously."));
1813  AssertThrow(
1814  fe_name == this->get_fe(0).get_name(),
1815  ExcMessage(
1816  "The finite element associated with this DoFHandler does not match "
1817  "the one that was associated with the DoFHandler previously stored."));
1818  AssertThrow(policy_name == internal::policy_to_string(*policy),
1819  ExcMessage(
1820  "The policy currently associated with this DoFHandler (" +
1821  internal::policy_to_string(*policy) +
1822  ") does not match the one that was associated with the "
1823  "DoFHandler previously stored (" +
1824  policy_name + ")."));
1825 }
1826 
1827 
1828 
1829 template <int dim, int spacedim>
1832  const unsigned int level,
1833  const unsigned int dof_number,
1834  const unsigned int dofs_per_vertex) const
1835 {
1836  Assert((level >= coarsest_level) && (level <= finest_level),
1837  ExcInvalidLevel(level));
1838  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
1839 }
1840 
1841 
1842 
1843 template <int dim, int spacedim>
1844 inline void
1846  const unsigned int level,
1847  const unsigned int dof_number,
1848  const unsigned int dofs_per_vertex,
1849  const types::global_dof_index index)
1850 {
1851  Assert((level >= coarsest_level) && (level <= finest_level),
1852  ExcInvalidLevel(level));
1853  indices[dofs_per_vertex * (level - coarsest_level) + dof_number] = index;
1854 }
1855 
1856 
1857 #endif // DOXYGEN
1858 
1859 DEAL_II_NAMESPACE_CLOSE
1860 
1861 #endif
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1396
const Triangulation< dim, spacedim > & get_triangulation() const
typename ActiveSelector::FaceAccessor face_accessor
Definition: dof_handler.h:234
typename ActiveSelector::quad_iterator quad_iterator
Definition: dof_handler.h:267
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:220
STL namespace.
#define AssertThrow(cond, exc)
Definition: exceptions.h:1519
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:370
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:383
int level() const
unsigned int 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:291
Definition: types.h:31
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:1407
virtual MPI_Comm get_communicator() const
Definition: tria_base.cc:155
#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:1416
Definition: hp.h:117
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
Definition: dof_handler.h:1404
typename ActiveSelector::active_line_iterator active_line_iterator
Definition: dof_handler.h:258
std::unique_ptr< types::global_dof_index[]> indices
Definition: dof_handler.h:1357
unsigned int global_dof_index
Definition: types.h:89
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:243
unsigned int coarsest_level
Definition: dof_handler.h:1341
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:96
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:352
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:324
const types::global_dof_index invalid_dof_index
Definition: types.h:188
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:111
typename ActiveSelector::active_quad_iterator active_quad_iterator
Definition: dof_handler.h:282
void save(Archive &ar, const unsigned int version) const
std::vector< types::global_dof_index > vertex_dofs
Definition: dof_handler.h:1390
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:302