Reference documentation for deal.II version Git c1d6723b63 2020-01-25 23:51:38 -0500
\(\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 
544  DEAL_II_DEPRECATED
545  virtual void
546  distribute_mg_dofs(const FiniteElement<dim, spacedim> &fe);
547 
553  virtual void
554  distribute_mg_dofs();
555 
561  bool
562  has_level_dofs() const;
563 
578  bool
579  has_active_dofs() const;
580 
587  void
588  initialize_local_block_info();
589 
593  virtual void
594  clear();
595 
648  void
649  renumber_dofs(const std::vector<types::global_dof_index> &new_numbers);
650 
655  void
656  renumber_dofs(const unsigned int level,
657  const std::vector<types::global_dof_index> &new_numbers);
658 
687  unsigned int
688  max_couplings_between_dofs() const;
689 
702  unsigned int
703  max_couplings_between_boundary_dofs() const;
704 
705  /*--------------------------------------*/
706 
711  /*
712  * @{
713  */
714 
719  begin(const unsigned int level = 0) const;
720 
738  begin_active(const unsigned int level = 0) const;
739 
745  end() const;
746 
752  end(const unsigned int level) const;
753 
760  end_active(const unsigned int level) const;
761 
762 
767  level_cell_iterator
768  begin_mg(const unsigned int level = 0) const;
769 
774  level_cell_iterator
775  end_mg(const unsigned int level) const;
776 
781  level_cell_iterator
782  end_mg() const;
783 
799  cell_iterators() const;
800 
842  active_cell_iterators() const;
843 
856  mg_cell_iterators() const;
857 
874  cell_iterators_on_level(const unsigned int level) const;
875 
892  active_cell_iterators_on_level(const unsigned int level) const;
893 
911  mg_cell_iterators_on_level(const unsigned int level) const;
912 
913  /*
914  * @}
915  */
916 
917 
918  /*---------------------------------------*/
919 
920 
945  n_dofs() const;
946 
955  n_dofs(const unsigned int level) const;
956 
962  n_boundary_dofs() const;
963 
975  template <typename number>
977  n_boundary_dofs(
978  const std::map<types::boundary_id, const Function<spacedim, number> *>
979  &boundary_ids) const;
980 
986  n_boundary_dofs(const std::set<types::boundary_id> &boundary_ids) const;
987 
1003  const BlockInfo &
1004  block_info() const;
1005 
1006 
1026  unsigned int
1027  n_locally_owned_dofs() const;
1028 
1034  const IndexSet &
1035  locally_owned_dofs() const;
1036 
1041  const IndexSet &
1042  locally_owned_mg_dofs(const unsigned int level) const;
1043 
1061  std::vector<IndexSet>
1062  compute_locally_owned_dofs_per_processor() const;
1063 
1084  std::vector<types::global_dof_index>
1085  compute_n_locally_owned_dofs_per_processor() const;
1086 
1102  std::vector<IndexSet>
1103  compute_locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1104 
1117  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1118  locally_owned_dofs_per_processor() const;
1119 
1135  DEAL_II_DEPRECATED const std::vector<types::global_dof_index> &
1136  n_locally_owned_dofs_per_processor() const;
1137 
1151  DEAL_II_DEPRECATED const std::vector<IndexSet> &
1152  locally_owned_mg_dofs_per_processor(const unsigned int level) const;
1153 
1160  get_fe(const unsigned int index = 0) const;
1161 
1169  get_fe_collection() const;
1170 
1175  get_triangulation() const;
1176 
1185  virtual std::size_t
1186  memory_consumption() const;
1187 
1192  template <class Archive>
1193  void
1194  save(Archive &ar, const unsigned int version) const;
1195 
1200  template <class Archive>
1201  void
1202  load(Archive &ar, const unsigned int version);
1203 
1204  BOOST_SERIALIZATION_SPLIT_MEMBER()
1205 
1206 
1210  DeclException0(ExcGridsDoNotMatch);
1220  DeclException1(ExcNewNumbersNotConsecutive,
1221  types::global_dof_index,
1222  << "The given list of new dof indices is not consecutive: "
1223  << "the index " << arg1 << " does not exist.");
1228  DeclException1(ExcInvalidLevel,
1229  int,
1230  << "The given level " << arg1
1231  << " is not in the valid range!");
1241  DeclException1(ExcEmptyLevel,
1242  int,
1243  << "You tried to do something on level " << arg1
1244  << ", but this level is empty.");
1245 
1246 
1247 private:
1251  BlockInfo block_info_object;
1252 
1256  SmartPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
1257  tria;
1258 
1259 
1264  hp::FECollection<dim, spacedim> fe_collection;
1265 
1270  std::unique_ptr<::internal::DoFHandlerImplementation::Policy::
1271  PolicyBase<dim, spacedim>>
1272  policy;
1273 
1281  ::internal::DoFHandlerImplementation::NumberCache number_cache;
1282 
1286  std::vector<::internal::DoFHandlerImplementation::NumberCache>
1287  mg_number_cache;
1288 
1296  {
1297  public:
1301  MGVertexDoFs();
1302 
1308  void
1309  init(const unsigned int coarsest_level,
1310  const unsigned int finest_level,
1311  const unsigned int dofs_per_vertex);
1312 
1316  unsigned int
1317  get_coarsest_level() const;
1318 
1322  unsigned int
1323  get_finest_level() const;
1324 
1330  get_index(const unsigned int level,
1331  const unsigned int dof_number,
1332  const unsigned int dofs_per_vertex) const;
1333 
1338  void
1339  set_index(const unsigned int level,
1340  const unsigned int dof_number,
1341  const unsigned int dofs_per_vertex,
1342  const types::global_dof_index index);
1343 
1344  private:
1348  unsigned int coarsest_level;
1349 
1353  unsigned int finest_level;
1354 
1364  std::unique_ptr<types::global_dof_index[]> indices;
1365  };
1366 
1370  void
1371  clear_space();
1372 
1376  void
1377  clear_mg_space();
1378 
1379  template <int structdim>
1381  get_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) const;
1385 
1386  template <int structdim>
1387  void
1388  set_dof_index(const unsigned int obj_level,
1389  const unsigned int obj_index,
1390  const unsigned int fe_index,
1391  const unsigned int local_index,
1392  const types::global_dof_index global_index) const;
1393 
1397  std::vector<types::global_dof_index> vertex_dofs;
1398 
1403  std::vector<MGVertexDoFs> mg_vertex_dofs;
1404 
1409  std::vector<
1410  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1412 
1413  std::vector<
1414  std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel<dim>>>
1415  mg_levels;
1416 
1422  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1424 
1425  std::unique_ptr<::internal::DoFHandlerImplementation::DoFFaces<dim>>
1426  mg_faces;
1427 
1428  // Make accessor objects friends.
1429  template <int, class, bool>
1430  friend class DoFAccessor;
1431  template <class, bool>
1432  friend class DoFCellAccessor;
1433  friend struct ::internal::DoFAccessorImplementation::Implementation;
1434  friend struct ::internal::DoFCellAccessorImplementation::Implementation;
1435 
1436  friend struct ::internal::DoFHandlerImplementation::Implementation;
1437  friend struct ::internal::DoFHandlerImplementation::Policy::
1438  Implementation;
1439 
1440  // explicitly check for sensible template arguments, but not on windows
1441  // because MSVC creates bogus warnings during normal compilation
1442 #ifndef DEAL_II_MSVC
1443  static_assert(dim <= spacedim,
1444  "The dimension <dim> of a DoFHandler must be less than or "
1445  "equal to the space dimension <spacedim> in which it lives.");
1446 #endif
1447 };
1448 
1449 
1450 
1451 #ifndef DOXYGEN
1452 
1453 /* ----------------------- Inline functions ----------------------------------
1454  */
1455 
1456 
1457 template <int dim, int spacedim>
1458 inline bool
1460 {
1461  return mg_number_cache.size() > 0;
1462 }
1463 
1464 
1465 
1466 template <int dim, int spacedim>
1467 inline bool
1469 {
1470  return number_cache.n_global_dofs > 0;
1471 }
1472 
1473 
1474 
1475 template <int dim, int spacedim>
1478 {
1479  return number_cache.n_global_dofs;
1480 }
1481 
1482 
1483 
1484 template <int dim, int spacedim>
1486 DoFHandler<dim, spacedim>::n_dofs(const unsigned int level) const
1487 {
1488  Assert(has_level_dofs(),
1489  ExcMessage(
1490  "n_dofs(level) can only be called after distribute_mg_dofs()"));
1491  Assert(level < mg_number_cache.size(), ExcInvalidLevel(level));
1492  return mg_number_cache[level].n_global_dofs;
1493 }
1494 
1495 
1496 
1497 template <int dim, int spacedim>
1498 unsigned int
1500 {
1501  return number_cache.n_locally_owned_dofs;
1502 }
1503 
1504 
1505 
1506 template <int dim, int spacedim>
1507 const IndexSet &
1509 {
1510  return number_cache.locally_owned_dofs;
1511 }
1512 
1513 
1514 
1515 template <int dim, int spacedim>
1516 const IndexSet &
1517 DoFHandler<dim, spacedim>::locally_owned_mg_dofs(const unsigned int level) const
1518 {
1519  Assert(level < this->get_triangulation().n_global_levels(),
1520  ExcMessage("The given level index exceeds the number of levels "
1521  "present in the triangulation"));
1522  Assert(
1523  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1524  ExcMessage(
1525  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1526  return mg_number_cache[level].locally_owned_dofs;
1527 }
1528 
1529 
1530 
1531 template <int dim, int spacedim>
1532 const std::vector<types::global_dof_index> &
1534 {
1535  if (number_cache.n_locally_owned_dofs_per_processor.empty() &&
1536  number_cache.n_global_dofs > 0)
1537  {
1539  number_cache)
1540  .n_locally_owned_dofs_per_processor =
1541  compute_n_locally_owned_dofs_per_processor();
1542  }
1543  return number_cache.n_locally_owned_dofs_per_processor;
1544 }
1545 
1546 
1547 
1548 template <int dim, int spacedim>
1549 const std::vector<IndexSet> &
1551 {
1552  if (number_cache.locally_owned_dofs_per_processor.empty() &&
1553  number_cache.n_global_dofs > 0)
1554  {
1556  number_cache)
1557  .locally_owned_dofs_per_processor =
1558  compute_locally_owned_dofs_per_processor();
1559  }
1560  return number_cache.locally_owned_dofs_per_processor;
1561 }
1562 
1563 
1564 
1565 template <int dim, int spacedim>
1566 const std::vector<IndexSet> &
1568  const unsigned int level) const
1569 {
1570  Assert(level < this->get_triangulation().n_global_levels(),
1571  ExcMessage("The given level index exceeds the number of levels "
1572  "present in the triangulation"));
1573  Assert(
1574  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1575  ExcMessage(
1576  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1577  if (mg_number_cache[level].locally_owned_dofs_per_processor.empty() &&
1578  mg_number_cache[level].n_global_dofs > 0)
1579  {
1581  mg_number_cache[level])
1582  .locally_owned_dofs_per_processor =
1583  compute_locally_owned_mg_dofs_per_processor(level);
1584  }
1585  return mg_number_cache[level].locally_owned_dofs_per_processor;
1586 }
1587 
1588 
1589 
1590 template <int dim, int spacedim>
1591 std::vector<types::global_dof_index>
1593 {
1595  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1596  &this->get_triangulation()));
1597  if (tr != nullptr)
1598  return number_cache.get_n_locally_owned_dofs_per_processor(
1599  tr->get_communicator());
1600  else
1601  return number_cache.get_n_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1602 }
1603 
1604 
1605 
1606 template <int dim, int spacedim>
1607 std::vector<IndexSet>
1609 {
1611  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1612  &this->get_triangulation()));
1613  if (tr != nullptr)
1614  return number_cache.get_locally_owned_dofs_per_processor(
1615  tr->get_communicator());
1616  else
1617  return number_cache.get_locally_owned_dofs_per_processor(MPI_COMM_SELF);
1618 }
1619 
1620 
1621 
1622 template <int dim, int spacedim>
1623 std::vector<IndexSet>
1625  const unsigned int level) const
1626 {
1627  Assert(level < this->get_triangulation().n_global_levels(),
1628  ExcMessage("The given level index exceeds the number of levels "
1629  "present in the triangulation"));
1630  Assert(
1631  mg_number_cache.size() == this->get_triangulation().n_global_levels(),
1632  ExcMessage(
1633  "The level dofs are not set up properly! Did you call distribute_mg_dofs()?"));
1635  (dynamic_cast<const parallel::TriangulationBase<dim, spacedim> *>(
1636  &this->get_triangulation()));
1637  if (tr != nullptr)
1638  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1639  tr->get_communicator());
1640  else
1641  return mg_number_cache[level].get_locally_owned_dofs_per_processor(
1642  MPI_COMM_SELF);
1643 }
1644 
1645 
1646 
1647 template <int dim, int spacedim>
1648 inline const FiniteElement<dim, spacedim> &
1649 DoFHandler<dim, spacedim>::get_fe(const unsigned int index) const
1650 {
1651  (void)index;
1652  Assert(index == 0,
1653  ExcMessage(
1654  "There is only one FiniteElement stored. The index must be zero!"));
1655  return get_fe_collection()[0];
1656 }
1657 
1658 
1659 
1660 template <int dim, int spacedim>
1661 inline const hp::FECollection<dim, spacedim> &
1663 {
1664  Assert(
1665  fe_collection.size() > 0,
1666  ExcMessage(
1667  "You are trying to access the DoFHandler's FECollection object before it has been initialized."));
1668  return fe_collection;
1669 }
1670 
1671 
1672 
1673 template <int dim, int spacedim>
1674 inline const Triangulation<dim, spacedim> &
1676 {
1677  Assert(tria != nullptr,
1678  ExcMessage("This DoFHandler object has not been associated "
1679  "with a triangulation."));
1680  return *tria;
1681 }
1682 
1683 
1684 
1685 template <int dim, int spacedim>
1686 inline const BlockInfo &
1688 {
1689  return block_info_object;
1690 }
1691 
1692 
1693 
1694 template <int dim, int spacedim>
1695 template <typename number>
1698  const std::map<types::boundary_id, const Function<spacedim, number> *>
1699  &boundary_ids) const
1700 {
1701  // extract the set of boundary ids and forget about the function object
1702  // pointers
1703  std::set<types::boundary_id> boundary_ids_only;
1704  for (typename std::map<types::boundary_id,
1705  const Function<spacedim, number> *>::const_iterator p =
1706  boundary_ids.begin();
1707  p != boundary_ids.end();
1708  ++p)
1709  boundary_ids_only.insert(p->first);
1710 
1711  // then just hand everything over to the other function that does the work
1712  return n_boundary_dofs(boundary_ids_only);
1713 }
1714 
1715 
1716 
1717 namespace internal
1718 {
1726  template <int dim, int spacedim>
1727  std::string
1728  policy_to_string(const ::internal::DoFHandlerImplementation::Policy::
1729  PolicyBase<dim, spacedim> &policy);
1730 } // namespace internal
1731 
1732 
1733 
1734 template <int dim, int spacedim>
1735 template <class Archive>
1736 void
1737 DoFHandler<dim, spacedim>::save(Archive &ar, const unsigned int) const
1738 {
1739  ar &block_info_object;
1740  ar &vertex_dofs;
1741  ar &number_cache;
1742 
1743  // some versions of gcc have trouble with loading vectors of
1744  // std::unique_ptr objects because std::unique_ptr does not
1745  // have a copy constructor. do it one level at a time
1746  unsigned int n_levels = levels.size();
1747  ar & n_levels;
1748  for (unsigned int i = 0; i < levels.size(); ++i)
1749  ar &levels[i];
1750 
1751  // boost dereferences a nullptr when serializing a nullptr
1752  // at least up to 1.65.1. This causes problems with clang-5.
1753  // Therefore, work around it.
1754  bool faces_is_nullptr = (faces.get() == nullptr);
1755  ar & faces_is_nullptr;
1756  if (!faces_is_nullptr)
1757  ar &faces;
1758 
1759  // write out the number of triangulation cells and later check during
1760  // loading that this number is indeed correct; same with something that
1761  // identifies the FE and the policy
1762  unsigned int n_cells = tria->n_cells();
1763  std::string fe_name = this->get_fe(0).get_name();
1764  std::string policy_name = internal::policy_to_string(*policy);
1765 
1766  ar &n_cells &fe_name &policy_name;
1767 }
1768 
1769 
1770 
1771 template <int dim, int spacedim>
1772 template <class Archive>
1773 void
1774 DoFHandler<dim, spacedim>::load(Archive &ar, const unsigned int)
1775 {
1776  ar &block_info_object;
1777  ar &vertex_dofs;
1778  ar &number_cache;
1779 
1780  // boost::serialization can restore pointers just fine, but if the
1781  // pointer object still points to something useful, that object is not
1782  // destroyed and we end up with a memory leak. consequently, first delete
1783  // previous content before re-loading stuff
1784  levels.clear();
1785  faces.reset();
1786 
1787  // some versions of gcc have trouble with loading vectors of
1788  // std::unique_ptr objects because std::unique_ptr does not
1789  // have a copy constructor. do it one level at a time
1790  unsigned int size;
1791  ar & size;
1792  levels.resize(size);
1793  for (unsigned int i = 0; i < levels.size(); ++i)
1794  {
1795  std::unique_ptr<internal::DoFHandlerImplementation::DoFLevel<dim>> level;
1796  ar & level;
1797  levels[i] = std::move(level);
1798  }
1799 
1800  // Workaround for nullptr, see in save().
1801  bool faces_is_nullptr = true;
1802  ar & faces_is_nullptr;
1803  if (!faces_is_nullptr)
1804  ar &faces;
1805 
1806  // these are the checks that correspond to the last block in the save()
1807  // function
1808  unsigned int n_cells;
1809  std::string fe_name;
1810  std::string policy_name;
1811 
1812  ar &n_cells &fe_name &policy_name;
1813 
1814  AssertThrow(n_cells == tria->n_cells(),
1815  ExcMessage(
1816  "The object being loaded into does not match the triangulation "
1817  "that has been stored previously."));
1818  AssertThrow(
1819  fe_name == this->get_fe(0).get_name(),
1820  ExcMessage(
1821  "The finite element associated with this DoFHandler does not match "
1822  "the one that was associated with the DoFHandler previously stored."));
1823  AssertThrow(policy_name == internal::policy_to_string(*policy),
1824  ExcMessage(
1825  "The policy currently associated with this DoFHandler (" +
1826  internal::policy_to_string(*policy) +
1827  ") does not match the one that was associated with the "
1828  "DoFHandler previously stored (" +
1829  policy_name + ")."));
1830 }
1831 
1832 
1833 
1834 template <int dim, int spacedim>
1837  const unsigned int level,
1838  const unsigned int dof_number,
1839  const unsigned int dofs_per_vertex) const
1840 {
1841  Assert((level >= coarsest_level) && (level <= finest_level),
1842  ExcInvalidLevel(level));
1843  return indices[dofs_per_vertex * (level - coarsest_level) + dof_number];
1844 }
1845 
1846 
1847 
1848 template <int dim, int spacedim>
1849 inline void
1851  const unsigned int level,
1852  const unsigned int dof_number,
1853  const unsigned int dofs_per_vertex,
1854  const types::global_dof_index index)
1855 {
1856  Assert((level >= coarsest_level) && (level <= finest_level),
1857  ExcInvalidLevel(level));
1858  indices[dofs_per_vertex * (level - coarsest_level) + dof_number] = index;
1859 }
1860 
1861 
1862 #endif // DOXYGEN
1863 
1864 DEAL_II_NAMESPACE_CLOSE
1865 
1866 #endif
std::vector< MGVertexDoFs > mg_vertex_dofs
Definition: dof_handler.h:1403
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: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:375
typename ActiveSelector::active_face_iterator active_face_iterator
Definition: dof_handler.h:388
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:296
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:1423
Definition: hp.h:117
std::vector< std::unique_ptr<::internal::DoFHandlerImplementation::DoFLevel< dim > > > levels
Definition: dof_handler.h:1411
virtual const MPI_Comm & get_communicator() const
Definition: tria_base.cc:171
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:1364
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:248
unsigned int coarsest_level
Definition: dof_handler.h:1348
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: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:287
void save(Archive &ar, const unsigned int version) const
std::vector< types::global_dof_index > vertex_dofs
Definition: dof_handler.h:1397
typename ActiveSelector::active_hex_iterator active_hex_iterator
Definition: dof_handler.h:307