Reference documentation for deal.II version Git d3646d97a1 2019-11-19 14:29:22 -0500
\(\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/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_faces.h>
34 #include <deal.II/dofs/dof_iterator_selector.h>
35 #include <deal.II/dofs/dof_levels.h>
36 #include <deal.II/dofs/number_cache.h>
37 
38 #include <deal.II/hp/fe_collection.h>
39 
40 #include <boost/serialization/split_member.hpp>
41 
42 #include <map>
43 #include <memory>
44 #include <set>
45 #include <vector>
46 
47 DEAL_II_NAMESPACE_OPEN
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 } // namespace internal
80 #endif
81 
203 template <int dim, int spacedim = dim>
204 class DoFHandler : public Subscriptor
205 {
206  using ActiveSelector = ::internal::DoFHandlerImplementation::
207  Iterators<DoFHandler<dim, spacedim>, false>;
208  using LevelSelector = ::internal::DoFHandlerImplementation::
209  Iterators<DoFHandler<dim, spacedim>, true>;
210 
211 public:
224  using cell_accessor = typename ActiveSelector::CellAccessor;
225 
238  using face_accessor = typename ActiveSelector::FaceAccessor;
239 
247  using line_iterator = typename ActiveSelector::line_iterator;
248 
262  using active_line_iterator = typename ActiveSelector::active_line_iterator;
263 
271  using quad_iterator = typename ActiveSelector::quad_iterator;
272 
286  using active_quad_iterator = typename ActiveSelector::active_quad_iterator;
287 
295  using hex_iterator = typename ActiveSelector::hex_iterator;
296 
306  using active_hex_iterator = typename ActiveSelector::active_hex_iterator;
307 
328  using active_cell_iterator = typename ActiveSelector::active_cell_iterator;
329 
356  using cell_iterator = typename ActiveSelector::cell_iterator;
357 
374  using face_iterator = typename ActiveSelector::face_iterator;
375 
387  using active_face_iterator = typename ActiveSelector::active_face_iterator;
388 
389  using level_cell_accessor = typename LevelSelector::CellAccessor;
390  using level_face_accessor = typename LevelSelector::FaceAccessor;
391 
392  using level_cell_iterator = typename LevelSelector::cell_iterator;
393  using level_face_iterator = typename LevelSelector::face_iterator;
394 
395 
399  static const unsigned int dimension = dim;
400 
404  static const unsigned int space_dimension = spacedim;
405 
409  static const bool is_hp_dof_handler = false;
410 
422  DEAL_II_DEPRECATED
423  static const types::global_dof_index invalid_dof_index =
425 
435  static const unsigned int default_fe_index = 0;
436 
442  DoFHandler();
443 
448 
455  DoFHandler(const DoFHandler &) = delete;
456 
460  virtual ~DoFHandler() override;
461 
468  DoFHandler &
469  operator=(const DoFHandler &) = delete;
470 
475  void
476  initialize(const Triangulation<dim, spacedim> &tria,
477  const FiniteElement<dim, spacedim> &fe);
478 
500  virtual void
501  set_fe(const FiniteElement<dim, spacedim> &fe);
502 
532  virtual void
533  distribute_dofs(const FiniteElement<dim, spacedim> &fe);
534 
543  DEAL_II_DEPRECATED
544  virtual void
545  distribute_mg_dofs(const FiniteElement<dim, spacedim> &fe);
546 
552  virtual void
553  distribute_mg_dofs();
554 
560  bool
561  has_level_dofs() const;
562 
577  bool
578  has_active_dofs() const;
579 
586  void
587  initialize_local_block_info();
588 
592  virtual void
593  clear();
594 
647  void
648  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
649 
654  void
655  renumber_dofs(const unsigned int level,
656  const std::vector<types::global_dof_index> &new_numbers);
657 
686  unsigned int
687  max_couplings_between_dofs() const;
688 
701  unsigned int
702  max_couplings_between_boundary_dofs() const;
703 
704  /*--------------------------------------*/
705 
710  /*
711  * @{
712  */
713 
718  begin(const unsigned int level = 0) const;
719 
737  begin_active(const unsigned int level = 0) const;
738 
744  end() const;
745 
751  end(const unsigned int level) const;
752 
759  end_active(const unsigned int level) const;
760 
761 
766  level_cell_iterator
767  begin_mg(const unsigned int level = 0) const;
768 
773  level_cell_iterator
774  end_mg(const unsigned int level) const;
775 
780  level_cell_iterator
781  end_mg() const;
782 
798  cell_iterators() const;
799 
841  active_cell_iterators() const;
842 
855  mg_cell_iterators() const;
856 
873  cell_iterators_on_level(const unsigned int level) const;
874 
891  active_cell_iterators_on_level(const unsigned int level) const;
892 
910  mg_cell_iterators_on_level(const unsigned int level) const;
911 
912  /*
913  * @}
914  */
915 
916 
917  /*---------------------------------------*/
918 
919 
944  n_dofs() const;
945 
954  n_dofs(const unsigned int level) const;
955 
961  n_boundary_dofs() const;
962 
974  template <typename number>
976  n_boundary_dofs(
977  const std::map<types::boundary_id, const Function<spacedim, number> *>
978  &boundary_ids) const;
979 
985  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
986 
1002  const BlockInfo &
1003  block_info() const;
1004 
1005 
1025  unsigned int
1026  n_locally_owned_dofs() const;
1027 
1033  const IndexSet &
1034  locally_owned_dofs() const;
1035 
1040  const IndexSet &
1041  locally_owned_mg_dofs(const unsigned int level) const;
1042 
1060  std::vector<IndexSet>
1061  compute_locally_owned_dofs_per_processor() const;
1062 
1083  std::vector<types::global_dof_index>
1084  compute_n_locally_owned_dofs_per_processor() const;
1085 
1101  std::vector<IndexSet>
1102  compute_locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1103 
1116  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1117  locally_owned_dofs_per_processor() const;
1118 
1134  DEAL_II_DEPRECATED const std::vector<types::global_dof_index> &
1135  n_locally_owned_dofs_per_processor() const;
1136 
1150  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1151  locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1152 
1159  get_fe(const unsigned int index = 0) const;
1160 
1168  get_fe_collection() const;
1169 
1174  get_triangulation() const;
1175 
1184  virtual std::size_t
1185  memory_consumption() const;
1186 
1191  template <class Archive>
1192  void
1193  save(Archive &ar, const unsigned int version) const;
1194 
1199  template <class Archive>
1200  void
1201  load(Archive &ar, const unsigned int version);
1202 
1203  BOOST_SERIALIZATION_SPLIT_MEMBER()
1204 
1205 
1209  DeclException0(ExcGridsDoNotMatch);
1219  DeclException1(ExcNewNumbersNotConsecutive,
1220  types::global_dof_index,
1221  << "The given list of new dof indices is not consecutive: "
1222  << "the index " << arg1 << " does not exist.");
1227  DeclException1(ExcInvalidLevel,
1228  int,
1229  << "The given level " << arg1
1230  << " is not in the valid range!");
1240  DeclException1(ExcEmptyLevel,
1241  int,
1242  << "You tried to do something on level " << arg1
1243  << ", but this level is empty.");
1244 
1245 
1246 private:
1250  BlockInfo block_info_object;
1251 
1255  SmartPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
1256  tria;
1257 
1258 
1263  hp::FECollection<dim, spacedim> fe_collection;
1264 
1269  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1270  PolicyBase<dim, spacedim>>
1271  policy;
1272 
1280  ::internal::DoFHandlerImplementation::NumberCache number_cache;
1281 
1285  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1286  mg_number_cache;
1287 
1295  {
1296  public:
1300  MGVertexDoFs();
1301 
1307  void
1308  init(const unsigned int coarsest_level,
1309  const unsigned int finest_level,
1310  const unsigned int dofs_per_vertex);
1311 
1315  unsigned int
1316  get_coarsest_level() const;
1317 
1321  unsigned int
1322  get_finest_level() const;
1323 
1329  get_index(const unsigned int level,
1330  const unsigned int dof_number,
1331  const unsigned int dofs_per_vertex) const;
1332 
1337  void
1338  set_index(const unsigned int level,
1339  const unsigned int dof_number,
1340  const unsigned int dofs_per_vertex,
1341  const types::global_dof_index index);
1342 
1343  private:
1347  unsigned int coarsest_level;
1348 
1352  unsigned int finest_level;
1353 
1363  std::unique_ptr<types::global_dof_index[]> indices;
1364  };
1365 
1369  void
1370  clear_space();
1371 
1375  void
1376  clear_mg_space();
1377 
1378  template <int structdim>
1380  get_dof_index(const unsigned int obj_level,
1381  const unsigned int obj_index,
1382  const unsigned int fe_index,
1383  const unsigned int local_index) const;
1384 
1385  template <int structdim>
1386  void
1387  set_dof_index(const unsigned int obj_level,
1388  const unsigned int obj_index,
1389  const unsigned int fe_index,
1390  const unsigned int local_index,
1391  const types::global_dof_index global_index) const;
1392 
1396  std::vector<types::global_dof_index> vertex_dofs;
1397 
1402  std::vector<MGVertexDoFs> mg_vertex_dofs;
1403 
1408  std::vector<
1409  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1411 
1412  std::vector<
1413  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1414  mg_levels;
1415 
1421  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1423 
1424  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1425  mg_faces;
1426 
1427  // Make accessor objects friends.
1428  template <int, class, bool>
1429  friend class DoFAccessor;
1430  template <class, bool>
1431  friend class DoFCellAccessor;
1432  friend struct ::internal::DoFAccessorImplementation::Implementation;
1433  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1434 
1435  friend struct ::internal::DoFHandlerImplementation::Implementation;
1436  friend struct ::internal::DoFHandlerImplementation::Policy::
1437  Implementation;
1438 
1439  // explicitly check for sensible template arguments, but not on windows
1440  // because MSVC creates bogus warnings during normal compilation
1441 #ifndef DEAL_II_MSVC
1442  static_assert(dim <= spacedim,
1443  "The dimension <dim> of a DoFHandler must be less than or "
1444  "equal to the space dimension <spacedim> in which it lives.");
1445 #endif
1446 };
1447 
1448 
1449 
1450 #ifndef DOXYGEN
1451 
1452 /* ----------------------- Inline functions ----------------------------------
1453  */
1454 
1455 
1456 template <int dim, int spacedim>
1457 inline bool
1459 {
1460  return mg_number_cache.size() > 0;
1461 }
1462 
1463 
1464 
1465 template <int dim, int spacedim>
1466 inline bool
1468 {
1469  return number_cache.n_global_dofs > 0;
1470 }
1471 
1472 
1473 
1474 template <int dim, int spacedim>
1477 {
1478  return number_cache.n_global_dofs;
1479 }
1480 
1481 
1482 
1483 template <int dim, int spacedim>
1485 DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1486 {
1487  Assert(has_level_dofs(),
1488  ExcMessage(
1489  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1490  Assert(level < mg_number_cache.size(), ExcInvalidLevel(level));
1491  return mg_number_cache[level].n_global_dofs;
1492 }
1493 
1494 
1495 
1496 template <int dim, int spacedim>
1497 unsigned int
1499 {
1500  return number_cache.n_locally_owned_dofs;
1501 }
1502 
1503 
1504 
1505 template <int dim, int spacedim>
1506 const IndexSet &
1508 {
1509  return number_cache.locally_owned_dofs;
1510 }
1511 
1512 
1513 
1514 template <int dim, int spacedim>
1515 const IndexSet &
1516 DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
1517 {
1518  Assert(level < this->get_triangulation().n_global_levels(),
1519  ExcMessage("The given level index exceeds the number of levels "
1520  "present in the triangulation"));
1521  Assert(
1522  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1523  ExcMessage(
1524  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1525  return mg_number_cache[level].locally_owned_dofs;
1526 }
1527 
1528 
1529 
1530 template <int dim, int spacedim>
1531 const std::vector<types::global_dof_index> &
1533 {
1534  if (number_cache.n_locally_owned_dofs_per_processor.empty() &&
1535  number_cache.n_global_dofs > 0)
1536  {
1538  number_cache)
1539  .n_locally_owned_dofs_per_processor =
1540  compute_n_locally_owned_dofs_per_processor();
1541  }
1542  return number_cache.n_locally_owned_dofs_per_processor;
1543 }
1544 
1545 
1546 
1547 template <int dim, int spacedim>
1548 const std::vector<IndexSet> &
1550 {
1551  if (number_cache.locally_owned_dofs_per_processor.empty() &&
1552  number_cache.n_global_dofs > 0)
1553  {
1555  number_cache)
1556  .locally_owned_dofs_per_processor =
1557  compute_locally_owned_dofs_per_processor();
1558  }
1559  return number_cache.locally_owned_dofs_per_processor;
1560 }
1561 
1562 
1563 
1564 template <int dim, int spacedim>
1565 const std::vector<IndexSet> &
1567  const unsigned int level) const
1568 {
1569  Assert(level < this->get_triangulation().n_global_levels(),
1570  ExcMessage("The given level index exceeds the number of levels "
1571  "present in the triangulation"));
1572  Assert(
1573  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1574  ExcMessage(
1575  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1576  if (mg_number_cache[level].locally_owned_dofs_per_processor.empty() &&
1577  mg_number_cache[level].n_global_dofs > 0)
1578  {
1580  mg_number_cache[level])
1581  .locally_owned_dofs_per_processor =
1582  compute_locally_owned_mg_dofs_per_processor(level);
1583  }
1584  return mg_number_cache[level].locally_owned_dofs_per_processor;
1585 }
1586 
1587 
1588 
1589 template <int dim, int spacedim>
1590 std::vector<types::global_dof_index>
1592 {
1594  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1595  &this->get_triangulation()));
1596  if (tr != nullptr)
1597  return number_cache.get_n_locally_owned_dofs_per_processor(
1598  tr->get_communicator());
1599  else
1600  return number_cache.get_n_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1601 }
1602 
1603 
1604 
1605 template <int dim, int spacedim>
1606 std::vector<IndexSet>
1608 {
1610  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1611  &this->get_triangulation()));
1612  if (tr != nullptr)
1613  return number_cache.get_locally_owned_dofs_per_processor(
1614  tr->get_communicator());
1615  else
1616  return number_cache.get_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1617 }
1618 
1619 
1620 
1621 template <int dim, int spacedim>
1622 std::vector<IndexSet>
1624  const unsigned int level) const
1625 {
1626  Assert(level < this->get_triangulation().n_global_levels(),
1627  ExcMessage("The given level index exceeds the number of levels "
1628  "present in the triangulation"));
1629  Assert(
1630  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1631  ExcMessage(
1632  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1634  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1635  &this->get_triangulation()));
1636  if (tr != nullptr)
1637  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1638  tr->get_communicator());
1639  else
1640  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1641  MPI_COMM_SELF);
1642 }
1643 
1644 
1645 
1646 template <int dim, int spacedim>
1647 inline const FiniteElement<dim, spacedim> &
1648 DoFHandler<dim, spacedim>::get_fe(const unsigned int index) const
1649 {
1650  (void)index;
1651  Assert(index == 0,
1652  ExcMessage(
1653  "There is only one FiniteElement stored. The index must be zero!"));
1654  return get_fe_collection()[0];
1655 }
1656 
1657 
1658 
1659 template <int dim, int spacedim>
1660 inline const hp::FECollection<dim, spacedim> &
1662 {
1663  Assert(
1664  fe_collection.size() > 0,
1665  ExcMessage(
1666  "You are trying to access the DoFHandler's FECollection object before it has been initialized."));
1667  return fe_collection;
1668 }
1669 
1670 
1671 
1672 template <int dim, int spacedim>
1673 inline const Triangulation<dim, spacedim> &
1675 {
1676  Assert(tria != nullptr,
1677  ExcMessage("This DoFHandler object has not been associated "
1678  "with a triangulation."));
1679  return *tria;
1680 }
1681 
1682 
1683 
1684 template <int dim, int spacedim>
1685 inline const BlockInfo &
1687 {
1688  return block_info_object;
1689 }
1690 
1691 
1692 
1693 template <int dim, int spacedim>
1694 template <typename number>
1697  const std::map<types::boundary_id, const Function<spacedim, number> *>
1698  &boundary_ids) const
1699 {
1700  // extract the set of boundary ids and forget about the function object
1701  // pointers
1702  std::set<types::boundary_id> boundary_ids_only;
1703  for (typename std::map<types::boundary_id,
1704  const Function<spacedim, number> *>::const_iterator p =
1705  boundary_ids.begin();
1706  p != boundary_ids.end();
1707  ++p)
1708  boundary_ids_only.insert(p->first);
1709 
1710  // then just hand everything over to the other function that does the work
1711  return n_boundary_dofs(boundary_ids_only);
1712 }
1713 
1714 
1715 
1716 namespace internal
1717 {
1725  template <int dim, int spacedim>
1726  std::string
1727  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
1728  PolicyBase<dim, spacedim> &policy);
1729 } // namespace internal
1730 
1731 
1732 
1733 template <int dim, int spacedim>
1734 template <class Archive>
1735 void
1736 DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
1737 {
1738  ar &block_info_object;
1739  ar &vertex_dofs;
1740  ar &number_cache;
1741 
1742  // some versions of gcc have trouble with loading vectors of
1743  // std::unique_ptr objects because std::unique_ptr does not
1744  // have a copy constructor. do it one level at a time
1745  unsigned int n_levels = levels.size();
1746  ar & n_levels;
1747  for (unsigned int i = 0; i < levels.size(); ++i)
1748  ar &levels[i];
1749 
1750  // boost dereferences a nullptr when serializing a nullptr
1751  // at least up to 1.65.1. This causes problems with clang-5.
1752  // Therefore, work around it.
1753  bool faces_is_nullptr = (faces.get() == nullptr);
1754  ar & faces_is_nullptr;
1755  if (!faces_is_nullptr)
1756  ar &faces;
1757 
1758  // write out the number of triangulation cells and later check during
1759  // loading that this number is indeed correct; same with something that
1760  // identifies the FE and the policy
1761  unsigned int n_cells = tria->n_cells();
1762  std::string fe_name = this->get_fe(0).get_name();
1763  std::string policy_name = internal::policy_to_string(*policy);
1764 
1765  ar &n_cells &fe_name &policy_name;
1766 }
1767 
1768 
1769 
1770 template <int dim, int spacedim>
1771 template <class Archive>
1772 void
1773 DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
1774 {
1775  ar &block_info_object;
1776  ar &vertex_dofs;
1777  ar &number_cache;
1778 
1779  // boost::serialization can restore pointers just fine, but if the
1780  // pointer object still points to something useful, that object is not
1781  // destroyed and we end up with a memory leak. consequently, first delete
1782  // previous content before re-loading stuff
1783  levels.clear();
1784  faces.reset();
1785 
1786  // some versions of gcc have trouble with loading vectors of
1787  // std::unique_ptr objects because std::unique_ptr does not
1788  // have a copy constructor. do it one level at a time
1789  unsigned int size;
1790  ar & size;
1791  levels.resize(size);
1792  for (unsigned int i = 0; i < levels.size(); ++i)
1793  {
1794  std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<dim>> level;
1795  ar & level;
1796  levels[i] = std::move(level);
1797  }
1798 
1799  // Workaround for nullptr, see in save().
1800  bool faces_is_nullptr = true;
1801  ar & faces_is_nullptr;
1802  if (!faces_is_nullptr)
1803  ar &faces;
1804 
1805  // these are the checks that correspond to the last block in the save()
1806  // function
1807  unsigned int n_cells;
1808  std::string fe_name;
1809  std::string policy_name;
1810 
1811  ar &n_cells &fe_name &policy_name;
1812 
1813  AssertThrow(n_cells == tria->n_cells(),
1814  ExcMessage(
1815  "The object being loaded into does not match the triangulation "
1816  "that has been stored previously."));
1817  AssertThrow(
1818  fe_name == this->get_fe(0).get_name(),
1819  ExcMessage(
1820  "The finite element associated with this DoFHandler does not match "
1821  "the one that was associated with the DoFHandler previously stored."));
1822  AssertThrow(policy_name == internal::policy_to_string(*policy),
1823  ExcMessage(
1824  "The policy currently associated with this DoFHandler (" +
1825  internal::policy_to_string(*policy) +
1826  ") does not match the one that was associated with the "
1827  "DoFHandler previously stored (" +
1828  policy_name + ")."));
1829 }
1830 
1831 
1832 
1833 template <int dim, int spacedim>
1836  const unsigned int level,
1837  const unsigned int dof_number,
1838  const unsigned int dofs_per_vertex) const
1839 {
1840  Assert((level >= coarsest_level) && (level <= finest_level),
1841  ExcInvalidLevel(level));
1842  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
1843 }
1844 
1845 
1846 
1847 template <int dim, int spacedim>
1848 inline void
1850  const unsigned int level,
1851  const unsigned int dof_number,
1852  const unsigned int dofs_per_vertex,
1853  const types::global_dof_index index)
1854 {
1855  Assert((level >= coarsest_level) && (level <= finest_level),
1856  ExcInvalidLevel(level));
1857  indices[dofs_per_vertex * (level - coarsest_level) + dof_number] = index;
1858 }
1859 
1860 
1861 #endif // DOXYGEN
1862 
1863 DEAL_II_NAMESPACE_CLOSE
1864 
1865 #endif
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1402
const Triangulation< dim, spacedim > & get_triangulation() const
typename ActiveSelector::FaceAccessor face_accessor
Definition: dof_handler.h:238
typename ActiveSelector::quad_iterator quad_iterator
Definition: dof_handler.h:271
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:224
STL namespace.
#define AssertThrow(cond, exc)
Definition: exceptions.h:1523
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:374
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:387
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:295
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:1411
#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:1422
Definition: hp.h:117
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
Definition: dof_handler.h:1410
virtual const MPI_Comm & get_communicator() const
Definition: tria_base.cc:171
typename ActiveSelector::active_line_iterator active_line_iterator
Definition: dof_handler.h:262
std::unique_ptr< types::global_dof_index[]> indices
Definition: dof_handler.h:1363
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:247
unsigned int coarsest_level
Definition: dof_handler.h:1347
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:97
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:356
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:328
const types::global_dof_index invalid_dof_index
Definition: types.h:202
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:125
typename ActiveSelector::active_quad_iterator active_quad_iterator
Definition: dof_handler.h:286
void save(Archive &ar, const unsigned int version) const
std::vector< types::global_dof_index > vertex_dofs
Definition: dof_handler.h:1396
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:306