Reference documentation for deal.II version Git 1aa49a030b 2021-12-07 05:12:24 -0500
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
dof_tools.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_dof_tools_h
17 #define dealii_dof_tools_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 #include <deal.II/base/index_set.h>
24 #include <deal.II/base/point.h>
25 
27 
29 
30 #include <deal.II/hp/dof_handler.h>
31 
33 
34 #include <map>
35 #include <ostream>
36 #include <set>
37 #include <vector>
38 
39 
41 
42 // Forward declarations
43 #ifndef DOXYGEN
44 class BlockMask;
45 template <int dim, typename RangeNumberType>
46 class Function;
47 template <int dim, int spacedim>
48 class FiniteElement;
49 namespace hp
50 {
51  template <int dim, int spacedim>
52  class MappingCollection;
53  template <int dim, int spacedim>
54  class FECollection;
55 } // namespace hp
56 template <class MeshType>
57 class InterGridMap;
58 template <int dim, int spacedim>
59 class Mapping;
60 class SparsityPattern;
61 template <int dim, class T>
62 class Table;
63 template <typename Number>
64 class Vector;
65 
66 namespace GridTools
67 {
68  template <typename CellIterator>
69  struct PeriodicFacePair;
70 }
71 
72 namespace DoFTools
73 {
74  namespace internal
75  {
76  /*
77  * Default value of the face_has_flux_coupling parameter of
78  * make_flux_sparsity_pattern. Defined here (instead of using a default
79  * lambda in the parameter list) to avoid a bug in gcc where the same lambda
80  * gets defined multiple times.
81  */
82  template <int dim, int spacedim>
83  inline bool
84  always_couple_on_faces(
86  const unsigned int)
87  {
88  return true;
89  }
90  } // namespace internal
91 } // namespace DoFTools
92 
93 #endif
94 
213 namespace DoFTools
214 {
226  enum Coupling
227  {
231  none,
244  };
245 
258  template <int dim, int spacedim>
259  void
261  const Table<2, Coupling> &table_by_component,
262  std::vector<Table<2, Coupling>> &tables_by_block);
263 
269  template <int dim, int spacedim>
273  const Table<2, Coupling> & component_couplings);
274 
282  template <int dim, int spacedim>
283  std::vector<Table<2, Coupling>>
286  const Table<2, Coupling> & component_couplings);
412  template <int dim,
413  int spacedim,
414  typename SparsityPatternType,
415  typename number = double>
416  void
418  const DoFHandler<dim, spacedim> &dof_handler,
419  SparsityPatternType & sparsity_pattern,
421  const bool keep_constrained_dofs = true,
423 
489  template <int dim,
490  int spacedim,
491  typename SparsityPatternType,
492  typename number = double>
493  void
495  const DoFHandler<dim, spacedim> &dof_handler,
496  const Table<2, Coupling> & coupling,
497  SparsityPatternType & sparsity_pattern,
499  const bool keep_constrained_dofs = true,
501 
522  template <int dim, int spacedim, typename SparsityPatternType>
523  void
525  const DoFHandler<dim, spacedim> &dof_col,
526  SparsityPatternType & sparsity);
527 
573  template <int dim, int spacedim, typename SparsityPatternType>
574  void
576  SparsityPatternType & sparsity_pattern);
577 
586  template <int dim,
587  int spacedim,
588  typename SparsityPatternType,
589  typename number>
590  void
592  const DoFHandler<dim, spacedim> &dof_handler,
593  SparsityPatternType & sparsity_pattern,
594  const AffineConstraints<number> &constraints,
595  const bool keep_constrained_dofs = true,
597 
598 
618  template <int dim, int spacedim, typename SparsityPatternType>
619  void
621  const DoFHandler<dim, spacedim> &dof,
622  SparsityPatternType & sparsity,
623  const Table<2, Coupling> & cell_integrals_mask,
624  const Table<2, Coupling> & face_integrals_mask,
626 
627 
654  template <int dim,
655  int spacedim,
656  typename SparsityPatternType,
657  typename number>
658  void
660  const DoFHandler<dim, spacedim> &dof,
661  SparsityPatternType & sparsity,
662  const AffineConstraints<number> &constraints,
663  const bool keep_constrained_dofs,
664  const Table<2, Coupling> & couplings,
665  const Table<2, Coupling> & face_couplings,
667  const std::function<
669  const unsigned int)> &face_has_flux_coupling =
670  &internal::always_couple_on_faces<dim, spacedim>);
671 
681  template <int dim, int spacedim, typename SparsityPatternType>
682  void
684  const DoFHandler<dim, spacedim> & dof,
685  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
686  SparsityPatternType & sparsity_pattern);
687 
705  template <int dim,
706  int spacedim,
707  typename SparsityPatternType,
708  typename number>
709  void
711  const DoFHandler<dim, spacedim> &dof,
712  const std::map<types::boundary_id, const Function<spacedim, number> *>
713  & boundary_ids,
714  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
715  SparsityPatternType & sparsity);
716 
764  template <int dim, int spacedim, typename number>
765  void
767  AffineConstraints<number> & constraints);
768 
836  template <int dim, int spacedim>
837  void
839  const DoFHandler<dim, spacedim> & coarse_grid,
840  const unsigned int coarse_component,
841  const DoFHandler<dim, spacedim> & fine_grid,
842  const unsigned int fine_component,
843  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
844  AffineConstraints<double> & constraints);
845 
846 
863  template <int dim, int spacedim>
864  void
866  const DoFHandler<dim, spacedim> & coarse_grid,
867  const unsigned int coarse_component,
868  const DoFHandler<dim, spacedim> & fine_grid,
869  const unsigned int fine_component,
870  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
871  std::vector<std::map<types::global_dof_index, float>>
872  &transfer_representation);
873 
1048  template <typename FaceIterator, typename number>
1049  void
1051  const FaceIterator & face_1,
1052  const typename identity<FaceIterator>::type &face_2,
1053  AffineConstraints<number> & constraints,
1054  const ComponentMask & component_mask = ComponentMask(),
1055  const bool face_orientation = true,
1056  const bool face_flip = false,
1057  const bool face_rotation = false,
1059  const std::vector<unsigned int> &first_vector_components =
1060  std::vector<unsigned int>(),
1061  const number periodicity_factor = 1.);
1062 
1063 
1064 
1084  template <int dim, int spacedim, typename number>
1085  void
1087  const std::vector<GridTools::PeriodicFacePair<
1088  typename DoFHandler<dim, spacedim>::cell_iterator>> &periodic_faces,
1089  AffineConstraints<number> & constraints,
1090  const ComponentMask & component_mask = ComponentMask(),
1091  const std::vector<unsigned int> &first_vector_components =
1092  std::vector<unsigned int>(),
1093  const number periodicity_factor = 1.);
1094 
1101  template <typename DoFHandlerType, typename number>
1102  DEAL_II_DEPRECATED void
1104  const std::vector<
1106  & periodic_faces,
1107  AffineConstraints<number> & constraints,
1108  const ComponentMask & component_mask = ComponentMask(),
1109  const std::vector<unsigned int> &first_vector_components =
1110  std::vector<unsigned int>(),
1111  const number periodicity_factor = 1.);
1112 
1113 
1114 
1144  template <int dim, int spacedim, typename number>
1145  void
1147  const DoFHandler<dim, spacedim> &dof_handler,
1148  const types::boundary_id b_id1,
1149  const types::boundary_id b_id2,
1150  const unsigned int direction,
1151  AffineConstraints<number> & constraints,
1152  const ComponentMask & component_mask = ComponentMask(),
1153  const number periodicity_factor = 1.);
1154 
1155 
1156 
1182  template <int dim, int spacedim, typename number>
1183  void
1185  const DoFHandler<dim, spacedim> &dof_handler,
1186  const types::boundary_id b_id,
1187  const unsigned int direction,
1188  AffineConstraints<number> & constraints,
1189  const ComponentMask & component_mask = ComponentMask(),
1190  const number periodicity_factor = 1.);
1191 
1209  template <int dim, int spacedim>
1210  IndexSet
1212 
1245  template <int dim, int spacedim>
1246  IndexSet
1247  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1248  const ComponentMask & component_mask);
1249 
1273  template <int dim, int spacedim>
1274  IndexSet
1275  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1276  const BlockMask & block_mask);
1277 
1282  template <int dim, int spacedim>
1283  void
1284  extract_level_dofs(const unsigned int level,
1285  const DoFHandler<dim, spacedim> &dof,
1286  const ComponentMask & component_mask,
1287  std::vector<bool> & selected_dofs);
1288 
1293  template <int dim, int spacedim>
1294  void
1295  extract_level_dofs(const unsigned int level,
1296  const DoFHandler<dim, spacedim> &dof,
1297  const BlockMask & component_mask,
1298  std::vector<bool> & selected_dofs);
1299 
1354  template <int dim, int spacedim>
1355  DEAL_II_DEPRECATED void
1357  const ComponentMask & component_mask,
1358  std::vector<bool> & selected_dofs,
1359  const std::set<types::boundary_id> &boundary_ids = {});
1360 
1403  template <int dim, int spacedim>
1404  IndexSet
1406  const ComponentMask &component_mask = ComponentMask(),
1407  const std::set<types::boundary_id> &boundary_ids = {});
1408 
1415  template <int dim, int spacedim>
1416  DEAL_II_DEPRECATED void
1418  const ComponentMask & component_mask,
1419  IndexSet & selected_dofs,
1420  const std::set<types::boundary_id> &boundary_ids = {});
1421 
1438  template <int dim, int spacedim>
1439  void
1441  const DoFHandler<dim, spacedim> & dof_handler,
1442  const ComponentMask & component_mask,
1443  std::vector<bool> & selected_dofs,
1444  const std::set<types::boundary_id> &boundary_ids =
1445  std::set<types::boundary_id>());
1446 
1474  template <int dim, int spacedim, typename number = double>
1475  IndexSet
1477  const DoFHandler<dim, spacedim> &dof_handler,
1478  const std::function<
1479  bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
1480  & predicate,
1481  const AffineConstraints<number> &constraints = AffineConstraints<number>());
1482 
1516  template <int dim, int spacedim>
1517  void
1519  const ComponentMask & component_mask,
1520  std::vector<std::vector<bool>> & constant_modes);
1522 
1536  template <int dim, int spacedim>
1537  void
1539  const types::subdomain_id subdomain_id,
1540  std::vector<bool> & selected_dofs);
1541 
1556  template <int dim, int spacedim>
1557  void
1559  IndexSet & dof_set);
1560 
1567  template <int dim, int spacedim>
1568  void
1570  const DoFHandler<dim, spacedim> &dof_handler,
1571  IndexSet & dof_set,
1572  const unsigned int level);
1573 
1583  template <int dim, int spacedim>
1584  void
1586  IndexSet & dof_set);
1587 
1588 
1598  template <int dim, int spacedim>
1599  std::vector<IndexSet>
1601  const DoFHandler<dim, spacedim> &dof_handler,
1602  const ComponentMask & components = ComponentMask());
1603 
1617  template <int dim, int spacedim>
1618  std::vector<IndexSet>
1620  const DoFHandler<dim, spacedim> &dof_handler);
1621 
1636  template <int dim, int spacedim>
1637  std::vector<IndexSet>
1639  const DoFHandler<dim, spacedim> &dof_handler);
1640 
1641 
1646  template <int dim, int spacedim>
1647  void
1649  const DoFHandler<dim, spacedim> &dof_handler,
1650  const unsigned int level,
1651  IndexSet & dof_set);
1652 
1653 
1684  template <int dim, int spacedim>
1685  void
1687  std::vector<types::subdomain_id> &subdomain);
1688 
1714  template <int dim, int spacedim>
1715  unsigned int
1717  const DoFHandler<dim, spacedim> &dof_handler,
1718  const types::subdomain_id subdomain);
1719 
1739  template <int dim, int spacedim>
1740  void
1742  const DoFHandler<dim, spacedim> &dof_handler,
1743  const types::subdomain_id subdomain,
1744  std::vector<unsigned int> & n_dofs_on_subdomain);
1745 
1767  template <int dim, int spacedim>
1768  IndexSet
1770  const DoFHandler<dim, spacedim> &dof_handler,
1771  const types::subdomain_id subdomain);
1772  // @}
1782 
1827  template <int dim, int spacedim>
1828  std::vector<types::global_dof_index>
1830  const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
1831  &patch);
1832 
1839  template <typename DoFHandlerType>
1840  DEAL_II_DEPRECATED std::vector<types::global_dof_index>
1842  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1843 
1864  template <int dim, int spacedim>
1865  void
1866  make_cell_patches(SparsityPattern & block_list,
1867  const DoFHandler<dim, spacedim> &dof_handler,
1868  const unsigned int level,
1869  const std::vector<bool> & selected_dofs = {},
1870  const types::global_dof_index offset = 0);
1871 
1923  template <int dim, int spacedim>
1924  std::vector<unsigned int>
1925  make_vertex_patches(SparsityPattern & block_list,
1926  const DoFHandler<dim, spacedim> &dof_handler,
1927  const unsigned int level,
1928  const bool interior_dofs_only,
1929  const bool boundary_patches = false,
1930  const bool level_boundary_patches = false,
1931  const bool single_cell_patches = false,
1932  const bool invert_vertex_mapping = false);
1933 
1948  template <int dim, int spacedim>
1949  std::vector<unsigned int>
1950  make_vertex_patches(SparsityPattern & block_list,
1951  const DoFHandler<dim, spacedim> &dof_handler,
1952  const unsigned int level,
1953  const BlockMask &exclude_boundary_dofs = BlockMask(),
1954  const bool boundary_patches = false,
1955  const bool level_boundary_patches = false,
1956  const bool single_cell_patches = false,
1957  const bool invert_vertex_mapping = false);
1958 
1996  template <int dim, int spacedim>
1997  void
1998  make_child_patches(SparsityPattern & block_list,
1999  const DoFHandler<dim, spacedim> &dof_handler,
2000  const unsigned int level,
2001  const bool interior_dofs_only,
2002  const bool boundary_dofs = false);
2003 
2023  template <int dim, int spacedim>
2024  void
2025  make_single_patch(SparsityPattern & block_list,
2026  const DoFHandler<dim, spacedim> &dof_handler,
2027  const unsigned int level,
2028  const bool interior_dofs_only = false);
2029 
2072  template <int dim, int spacedim>
2073  std::vector<types::global_dof_index>
2075  const DoFHandler<dim, spacedim> &dof_handler,
2076  const bool vector_valued_once = false,
2077  const std::vector<unsigned int> &target_component = {});
2078 
2095  template <int dim, int spacedim>
2096  std::vector<types::global_dof_index>
2098  const std::vector<unsigned int> &target_block =
2099  std::vector<unsigned int>());
2100 
2110  template <int dim, int spacedim>
2111  void
2113  std::vector<unsigned int> & active_fe_indices);
2114 
2142  template <int dim, int spacedim>
2143  unsigned int
2145  const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
2146  &patch);
2147 
2154  template <typename DoFHandlerType>
2155  DEAL_II_DEPRECATED unsigned int
2157  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2158 
2181  template <int dim, int spacedim>
2182  void
2184  std::vector<types::global_dof_index> &mapping);
2185 
2196  template <int dim, int spacedim>
2197  void
2199  const std::set<types::boundary_id> &boundary_ids,
2200  std::vector<types::global_dof_index> &mapping);
2201 
2230  template <int dim, int spacedim>
2231  void
2233  const DoFHandler<dim, spacedim> &dof_handler,
2234  std::vector<Point<spacedim>> & support_points,
2235  const ComponentMask &mask = ComponentMask());
2236 
2240  template <int dim, int spacedim>
2241  void
2243  const ::hp::MappingCollection<dim, spacedim> &mapping,
2244  const DoFHandler<dim, spacedim> & dof_handler,
2245  std::vector<Point<spacedim>> & support_points,
2246  const ComponentMask & mask = ComponentMask());
2247 
2278  template <int dim, int spacedim>
2279  void
2281  const Mapping<dim, spacedim> & mapping,
2282  const DoFHandler<dim, spacedim> & dof_handler,
2283  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2284  const ComponentMask & mask = ComponentMask());
2285 
2289  template <int dim, int spacedim>
2290  void
2292  const ::hp::MappingCollection<dim, spacedim> &mapping,
2293  const DoFHandler<dim, spacedim> & dof_handler,
2294  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2295  const ComponentMask & mask = ComponentMask());
2296 
2297 
2318  template <int dim, int spacedim, class Comp>
2319  void
2321  const Mapping<dim, spacedim> & mapping,
2322  const DoFHandler<dim, spacedim> &dof_handler,
2323  std::map<Point<spacedim>, types::global_dof_index, Comp>
2324  &point_to_index_map);
2362  template <int dim, int spacedim, typename Number>
2363  void
2365  const Vector<Number> & cell_data,
2366  Vector<double> & dof_data,
2367  const unsigned int component = 0);
2368 
2369 
2446  template <int spacedim>
2447  void
2449  std::ostream & out,
2450  const std::map<types::global_dof_index, Point<spacedim>> &support_points);
2451 
2452 
2493  template <int dim, int spacedim, typename number>
2494  void
2496  const DoFHandler<dim, spacedim> &dof,
2498  AffineConstraints<number> & zero_boundary_constraints,
2499  const ComponentMask & component_mask = ComponentMask());
2500 
2511  template <int dim, int spacedim, typename number>
2512  void
2514  const DoFHandler<dim, spacedim> &dof,
2515  AffineConstraints<number> & zero_boundary_constraints,
2516  const ComponentMask & component_mask = ComponentMask());
2517 
2562 } // namespace DoFTools
2563 
2564 
2565 
2566 /* ------------------------- inline functions -------------- */
2567 
2568 #ifndef DOXYGEN
2569 
2570 namespace DoFTools
2571 {
2577  inline Coupling
2578  operator|=(Coupling &c1, const Coupling c2)
2579  {
2580  if (c2 == always)
2581  c1 = always;
2582  else if (c1 != always && c2 == nonzero)
2583  return c1 = nonzero;
2584  return c1;
2585  }
2586 
2587 
2593  inline Coupling
2594  operator|(const Coupling c1, const Coupling c2)
2595  {
2596  if (c1 == always || c2 == always)
2597  return always;
2598  if (c1 == nonzero || c2 == nonzero)
2599  return nonzero;
2600  return none;
2601  }
2602 
2603 
2604  // ---------------------- inline and template functions --------------------
2605 
2606  template <int dim, int spacedim, class Comp>
2607  void
2609  const Mapping<dim, spacedim> & mapping,
2610  const DoFHandler<dim, spacedim> &dof_handler,
2611  std::map<Point<spacedim>, types::global_dof_index, Comp>
2612  &point_to_index_map)
2613  {
2614  // let the checking of arguments be
2615  // done by the function first
2616  // called
2617  std::vector<Point<spacedim>> support_points(dof_handler.n_dofs());
2618  map_dofs_to_support_points(mapping, dof_handler, support_points);
2619  // now copy over the results of the
2620  // previous function into the
2621  // output arg
2622  point_to_index_map.clear();
2623  for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
2624  point_to_index_map[support_points[i]] = i;
2625  }
2626 
2627 
2628 
2629  template <typename DoFHandlerType, typename number>
2630  inline void
2632  const std::vector<
2634  & periodic_faces,
2635  AffineConstraints<number> & constraints,
2636  const ComponentMask & component_mask,
2637  const std::vector<unsigned int> &first_vector_components,
2638  const number periodicity_factor)
2639  {
2640  make_periodicity_constraints<DoFHandlerType::dimension,
2641  DoFHandlerType::space_dimension>(
2642  periodic_faces,
2643  constraints,
2644  component_mask,
2645  first_vector_components,
2646  periodicity_factor);
2647  }
2648 
2649 
2650 
2651  template <typename DoFHandlerType>
2652  inline std::vector<types::global_dof_index>
2654  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
2655  {
2656  return get_dofs_on_patch<DoFHandlerType::dimension,
2657  DoFHandlerType::space_dimension>(patch);
2658  }
2659 
2660 
2661 
2662  template <typename DoFHandlerType>
2663  inline unsigned int
2665  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
2666  {
2667  return count_dofs_on_patch<DoFHandlerType::dimension,
2668  DoFHandlerType::space_dimension>(patch);
2669  }
2670 } // namespace DoFTools
2671 
2672 #endif
2673 
2675 
2676 #endif
void write_gnuplot_dof_support_point_info(std::ostream &out, const std::map< types::global_dof_index, Point< spacedim >> &support_points)
Definition: dof_tools.cc:2272
IndexSet dof_indices_with_subdomain_association(const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1592
void get_subdomain_association(const DoFHandler< dim, spacedim > &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1485
const types::subdomain_id invalid_subdomain_id
Definition: types.h:276
static ::ExceptionBase & ExcGridsDontMatch()
Contents is actually a matrix.
void make_cell_patches(SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const std::vector< bool > &selected_dofs={}, const types::global_dof_index offset=0)
Definition: dof_tools.cc:2364
void extract_dofs_with_support_on_boundary(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< bool > &selected_dofs, const std::set< types::boundary_id > &boundary_ids=std::set< types::boundary_id >())
Definition: dof_tools.cc:718
void map_dofs_to_support_points(const ::hp::MappingCollection< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::map< types::global_dof_index, Point< spacedim >> &support_points, const ComponentMask &mask=ComponentMask())
void extract_boundary_dofs(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, IndexSet &selected_dofs, const std::set< types::boundary_id > &boundary_ids={})
Definition: dof_tools.cc:576
void map_support_points_to_dofs(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::map< Point< spacedim >, types::global_dof_index, Comp > &point_to_index_map)
std::vector< IndexSet > locally_relevant_dofs_per_subdomain(const DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_tools.cc:1409
IndexSet extract_dofs(const DoFHandler< dim, spacedim > &dof_handler, const BlockMask &block_mask)
Definition: dof_tools.cc:431
static ::ExceptionBase & ExcFiniteElementsDontMatch()
void make_child_patches(SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const bool interior_dofs_only, const bool boundary_dofs=false)
Definition: dof_tools.cc:2449
std::vector< types::global_dof_index > count_dofs_per_fe_block(const DoFHandler< dim, spacedim > &dof, const std::vector< unsigned int > &target_block=std::vector< unsigned int >())
Definition: dof_tools.cc:1911
std::vector< IndexSet > locally_owned_dofs_per_subdomain(const DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_tools.cc:1314
std::vector< Table< 2, Coupling > > dof_couplings_from_component_couplings(const hp::FECollection< dim, spacedim > &fe, const Table< 2, Coupling > &component_couplings)
void extract_constant_modes(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< std::vector< bool >> &constant_modes)
Definition: dof_tools.cc:1207
void extract_locally_relevant_level_dofs(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, IndexSet &dof_set)
Definition: dof_tools.cc:1159
void make_boundary_sparsity_pattern(const DoFHandler< dim, spacedim > &dof, const std::map< types::boundary_id, const Function< spacedim, number > *> &boundary_ids, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternType &sparsity)
void make_single_patch(SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const bool interior_dofs_only=false)
Definition: dof_tools.cc:2407
std::vector< types::global_dof_index > get_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
unsigned int subdomain_id
Definition: types.h:43
static ::ExceptionBase & ExcGridNotCoarser()
void make_periodicity_constraints(const DoFHandler< dim, spacedim > &dof_handler, const types::boundary_id b_id, const unsigned int direction, AffineConstraints< number > &constraints, const ComponentMask &component_mask=ComponentMask(), const number periodicity_factor=1.)
void count_dofs_with_subdomain_association(const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain, std::vector< unsigned int > &n_dofs_on_subdomain)
Definition: dof_tools.cc:1648
Abstract base class for mapping classes.
Definition: mapping.h:310
void make_sparsity_pattern(const DoFHandler< dim, spacedim > &dof_row, const DoFHandler< dim, spacedim > &dof_col, SparsityPatternType &sparsity)
IndexSet extract_hanging_node_dofs(const DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_tools.cc:1012
#define DeclException0(Exception0)
Definition: exceptions.h:464
std::vector< IndexSet > locally_owned_dofs_per_component(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &components=ComponentMask())
Definition: dof_tools.cc:443
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:404
unsigned int level
Definition: grid_out.cc:4573
types::global_dof_index n_dofs() const
void compute_intergrid_transfer_representation(const DoFHandler< dim, spacedim > &coarse_grid, const unsigned int coarse_component, const DoFHandler< dim, spacedim > &fine_grid, const unsigned int fine_component, const InterGridMap< DoFHandler< dim, spacedim >> &coarse_to_fine_grid_map, std::vector< std::map< types::global_dof_index, float >> &transfer_representation)
void make_zero_boundary_constraints(const DoFHandler< dim, spacedim > &dof, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
Definition: hp.h:117
std::vector< types::global_dof_index > count_dofs_per_fe_component(const DoFHandler< dim, spacedim > &dof_handler, const bool vector_valued_once=false, const std::vector< unsigned int > &target_component={})
Definition: dof_tools.cc:1819
void extract_subdomain_dofs(const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:1021
void extract_locally_active_level_dofs(const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set, const unsigned int level)
Definition: dof_tools.cc:1084
unsigned int global_dof_index
Definition: types.h:76
UpdateFlags & operator|=(UpdateFlags &f1, const UpdateFlags f2)
void make_flux_sparsity_pattern(const DoFHandler< dim, spacedim > &dof, SparsityPatternType &sparsity, const AffineConstraints< number > &constraints, const bool keep_constrained_dofs, const Table< 2, Coupling > &couplings, const Table< 2, Coupling > &face_couplings, const types::subdomain_id subdomain_id, const std::function< bool(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, const unsigned int)> &face_has_flux_coupling=&internal::always_couple_on_faces< dim, spacedim >)
IndexSet extract_dofs_with_support_contained_within(const DoFHandler< dim, spacedim > &dof_handler, const std::function< bool(const typename DoFHandler< dim, spacedim >::active_cell_iterator &)> &predicate, const AffineConstraints< number > &constraints=AffineConstraints< number >())
Definition: dof_tools.cc:800
ParameterHandler::OutputStyle operator|(const ParameterHandler::OutputStyle f1, const ParameterHandler::OutputStyle f2)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:403
void extract_level_dofs(const unsigned int level, const DoFHandler< dim, spacedim > &dof, const BlockMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:533
void distribute_cell_to_dof_vector(const DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &cell_data, Vector< double > &dof_data, const unsigned int component=0)
Definition: dof_tools.cc:306
unsigned int count_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
void get_active_fe_indices(const DoFHandler< dim, spacedim > &dof_handler, std::vector< unsigned int > &active_fe_indices)
Definition: dof_tools.cc:1302
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:466
void extract_locally_relevant_dofs(const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1120
typename ActiveSelector::active_cell_iterator active_cell_iterator
Definition: dof_handler.h:438
void compute_intergrid_constraints(const DoFHandler< dim, spacedim > &coarse_grid, const unsigned int coarse_component, const DoFHandler< dim, spacedim > &fine_grid, const unsigned int fine_component, const InterGridMap< DoFHandler< dim, spacedim >> &coarse_to_fine_grid_map, AffineConstraints< double > &constraints)
void map_dof_to_boundary_indices(const DoFHandler< dim, spacedim > &dof_handler, const std::set< types::boundary_id > &boundary_ids, std::vector< types::global_dof_index > &mapping)
Definition: dof_tools.cc:2039
#define DEAL_II_DEPRECATED
Definition: config.h:160
void extract_locally_active_dofs(const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1052
unsigned int boundary_id
Definition: types.h:129
static ::ExceptionBase & ExcNoFESelected()
void convert_couplings_to_blocks(const DoFHandler< dim, spacedim > &dof_handler, const Table< 2, Coupling > &table_by_component, std::vector< Table< 2, Coupling >> &tables_by_block)
Definition: dof_tools.cc:2311
void make_hanging_node_constraints(const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< number > &constraints)
std::vector< unsigned int > make_vertex_patches(SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const BlockMask &exclude_boundary_dofs=BlockMask(), const bool boundary_patches=false, const bool level_boundary_patches=false, const bool single_cell_patches=false, const bool invert_vertex_mapping=false)
Definition: dof_tools.cc:2535