Reference documentation for deal.II version Git e694e60270 2021-02-25 22:28:05 -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 - 2020 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 
1219  template <int dim, int spacedim>
1220  DEAL_II_DEPRECATED void
1222  std::vector<bool> & selected_dofs);
1223 
1228  template <int dim, int spacedim>
1229  IndexSet
1231 
1274  template <int dim, int spacedim>
1275  DEAL_II_DEPRECATED void
1276  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1277  const ComponentMask & component_mask,
1278  std::vector<bool> & selected_dofs);
1279 
1312  template <int dim, int spacedim>
1313  IndexSet
1314  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1315  const ComponentMask & component_mask);
1316 
1347  template <int dim, int spacedim>
1348  DEAL_II_DEPRECATED void
1349  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1350  const BlockMask & block_mask,
1351  std::vector<bool> & selected_dofs);
1352 
1376  template <int dim, int spacedim>
1377  IndexSet
1378  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1379  const BlockMask & block_mask);
1380 
1385  template <int dim, int spacedim>
1386  void
1387  extract_level_dofs(const unsigned int level,
1388  const DoFHandler<dim, spacedim> &dof,
1389  const ComponentMask & component_mask,
1390  std::vector<bool> & selected_dofs);
1391 
1396  template <int dim, int spacedim>
1397  void
1398  extract_level_dofs(const unsigned int level,
1399  const DoFHandler<dim, spacedim> &dof,
1400  const BlockMask & component_mask,
1401  std::vector<bool> & selected_dofs);
1402 
1455  template <int dim, int spacedim>
1456  void
1458  const ComponentMask & component_mask,
1459  std::vector<bool> & selected_dofs,
1460  const std::set<types::boundary_id> &boundary_ids =
1461  std::set<types::boundary_id>());
1462 
1493  template <int dim, int spacedim>
1494  void
1496  const ComponentMask & component_mask,
1497  IndexSet & selected_dofs,
1498  const std::set<types::boundary_id> &boundary_ids =
1499  std::set<types::boundary_id>());
1500 
1517  template <int dim, int spacedim>
1518  void
1520  const DoFHandler<dim, spacedim> & dof_handler,
1521  const ComponentMask & component_mask,
1522  std::vector<bool> & selected_dofs,
1523  const std::set<types::boundary_id> &boundary_ids =
1524  std::set<types::boundary_id>());
1525 
1553  template <int dim, int spacedim, typename number = double>
1554  IndexSet
1556  const DoFHandler<dim, spacedim> &dof_handler,
1557  const std::function<
1558  bool(const typename DoFHandler<dim, spacedim>::active_cell_iterator &)>
1559  & predicate,
1560  const AffineConstraints<number> &constraints = AffineConstraints<number>());
1561 
1595  template <int dim, int spacedim>
1596  void
1598  const ComponentMask & component_mask,
1599  std::vector<std::vector<bool>> & constant_modes);
1601 
1615  template <int dim, int spacedim>
1616  void
1618  const types::subdomain_id subdomain_id,
1619  std::vector<bool> & selected_dofs);
1620 
1635  template <int dim, int spacedim>
1636  void
1638  IndexSet & dof_set);
1639 
1646  template <int dim, int spacedim>
1647  void
1649  const DoFHandler<dim, spacedim> &dof_handler,
1650  IndexSet & dof_set,
1651  const unsigned int level);
1652 
1662  template <int dim, int spacedim>
1663  void
1665  IndexSet & dof_set);
1666 
1667 
1677  template <int dim, int spacedim>
1678  std::vector<IndexSet>
1680  const DoFHandler<dim, spacedim> &dof_handler,
1681  const ComponentMask & components = ComponentMask());
1682 
1696  template <int dim, int spacedim>
1697  std::vector<IndexSet>
1699  const DoFHandler<dim, spacedim> &dof_handler);
1700 
1715  template <int dim, int spacedim>
1716  std::vector<IndexSet>
1718  const DoFHandler<dim, spacedim> &dof_handler);
1719 
1720 
1725  template <int dim, int spacedim>
1726  void
1728  const DoFHandler<dim, spacedim> &dof_handler,
1729  const unsigned int level,
1730  IndexSet & dof_set);
1731 
1732 
1763  template <int dim, int spacedim>
1764  void
1766  std::vector<types::subdomain_id> &subdomain);
1767 
1793  template <int dim, int spacedim>
1794  unsigned int
1796  const DoFHandler<dim, spacedim> &dof_handler,
1797  const types::subdomain_id subdomain);
1798 
1818  template <int dim, int spacedim>
1819  void
1821  const DoFHandler<dim, spacedim> &dof_handler,
1822  const types::subdomain_id subdomain,
1823  std::vector<unsigned int> & n_dofs_on_subdomain);
1824 
1846  template <int dim, int spacedim>
1847  IndexSet
1849  const DoFHandler<dim, spacedim> &dof_handler,
1850  const types::subdomain_id subdomain);
1851  // @}
1861 
1906  template <int dim, int spacedim>
1907  std::vector<types::global_dof_index>
1909  const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
1910  &patch);
1911 
1918  template <typename DoFHandlerType>
1919  DEAL_II_DEPRECATED std::vector<types::global_dof_index>
1921  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1922 
1943  template <int dim, int spacedim>
1944  void
1945  make_cell_patches(SparsityPattern & block_list,
1946  const DoFHandler<dim, spacedim> &dof_handler,
1947  const unsigned int level,
1948  const std::vector<bool> & selected_dofs = {},
1949  const types::global_dof_index offset = 0);
1950 
2002  template <int dim, int spacedim>
2003  std::vector<unsigned int>
2004  make_vertex_patches(SparsityPattern & block_list,
2005  const DoFHandler<dim, spacedim> &dof_handler,
2006  const unsigned int level,
2007  const bool interior_dofs_only,
2008  const bool boundary_patches = false,
2009  const bool level_boundary_patches = false,
2010  const bool single_cell_patches = false,
2011  const bool invert_vertex_mapping = false);
2012 
2027  template <int dim, int spacedim>
2028  std::vector<unsigned int>
2029  make_vertex_patches(SparsityPattern & block_list,
2030  const DoFHandler<dim, spacedim> &dof_handler,
2031  const unsigned int level,
2032  const BlockMask &exclude_boundary_dofs = BlockMask(),
2033  const bool boundary_patches = false,
2034  const bool level_boundary_patches = false,
2035  const bool single_cell_patches = false,
2036  const bool invert_vertex_mapping = false);
2037 
2075  template <int dim, int spacedim>
2076  void
2077  make_child_patches(SparsityPattern & block_list,
2078  const DoFHandler<dim, spacedim> &dof_handler,
2079  const unsigned int level,
2080  const bool interior_dofs_only,
2081  const bool boundary_dofs = false);
2082 
2102  template <int dim, int spacedim>
2103  void
2104  make_single_patch(SparsityPattern & block_list,
2105  const DoFHandler<dim, spacedim> &dof_handler,
2106  const unsigned int level,
2107  const bool interior_dofs_only = false);
2108 
2151  template <int dim, int spacedim>
2152  std::vector<types::global_dof_index>
2154  const DoFHandler<dim, spacedim> &dof_handler,
2155  const bool vector_valued_once = false,
2156  const std::vector<unsigned int> &target_component = {});
2157 
2162  template <int dim, int spacedim>
2163  DEAL_II_DEPRECATED void
2165  const DoFHandler<dim, spacedim> & dof_handler,
2166  std::vector<types::global_dof_index> &dofs_per_component,
2167  const bool vector_valued_once = false,
2168  const std::vector<unsigned int> & target_component = {});
2169 
2186  template <int dim, int spacedim>
2187  std::vector<types::global_dof_index>
2189  const std::vector<unsigned int> &target_block =
2190  std::vector<unsigned int>());
2191 
2196  template <int dim, int spacedim>
2197  DEAL_II_DEPRECATED void
2199  std::vector<types::global_dof_index> &dofs_per_block,
2200  const std::vector<unsigned int> & target_block =
2201  std::vector<unsigned int>());
2202 
2212  template <int dim, int spacedim>
2213  void
2215  std::vector<unsigned int> & active_fe_indices);
2216 
2244  template <int dim, int spacedim>
2245  unsigned int
2247  const std::vector<typename DoFHandler<dim, spacedim>::active_cell_iterator>
2248  &patch);
2249 
2256  template <typename DoFHandlerType>
2257  DEAL_II_DEPRECATED unsigned int
2259  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2260 
2283  template <int dim, int spacedim>
2284  void
2286  std::vector<types::global_dof_index> &mapping);
2287 
2298  template <int dim, int spacedim>
2299  void
2301  const std::set<types::boundary_id> &boundary_ids,
2302  std::vector<types::global_dof_index> &mapping);
2303 
2332  template <int dim, int spacedim>
2333  void
2335  const DoFHandler<dim, spacedim> &dof_handler,
2336  std::vector<Point<spacedim>> & support_points,
2337  const ComponentMask &mask = ComponentMask());
2338 
2342  template <int dim, int spacedim>
2343  void
2345  const ::hp::MappingCollection<dim, spacedim> &mapping,
2346  const DoFHandler<dim, spacedim> & dof_handler,
2347  std::vector<Point<spacedim>> & support_points,
2348  const ComponentMask & mask = ComponentMask());
2349 
2380  template <int dim, int spacedim>
2381  void
2383  const Mapping<dim, spacedim> & mapping,
2384  const DoFHandler<dim, spacedim> & dof_handler,
2385  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2386  const ComponentMask & mask = ComponentMask());
2387 
2391  template <int dim, int spacedim>
2392  void
2394  const ::hp::MappingCollection<dim, spacedim> &mapping,
2395  const DoFHandler<dim, spacedim> & dof_handler,
2396  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2397  const ComponentMask & mask = ComponentMask());
2398 
2399 
2420  template <int dim, int spacedim, class Comp>
2421  void
2423  const Mapping<dim, spacedim> & mapping,
2424  const DoFHandler<dim, spacedim> &dof_handler,
2425  std::map<Point<spacedim>, types::global_dof_index, Comp>
2426  &point_to_index_map);
2464  template <int dim, int spacedim, typename Number>
2465  void
2467  const Vector<Number> & cell_data,
2468  Vector<double> & dof_data,
2469  const unsigned int component = 0);
2470 
2471 
2548  template <int spacedim>
2549  void
2551  std::ostream & out,
2552  const std::map<types::global_dof_index, Point<spacedim>> &support_points);
2553 
2554 
2595  template <int dim, int spacedim, typename number>
2596  void
2598  const DoFHandler<dim, spacedim> &dof,
2600  AffineConstraints<number> & zero_boundary_constraints,
2601  const ComponentMask & component_mask = ComponentMask());
2602 
2613  template <int dim, int spacedim, typename number>
2614  void
2616  const DoFHandler<dim, spacedim> &dof,
2617  AffineConstraints<number> & zero_boundary_constraints,
2618  const ComponentMask & component_mask = ComponentMask());
2619 
2664 } // namespace DoFTools
2665 
2666 
2667 
2668 /* ------------------------- inline functions -------------- */
2669 
2670 #ifndef DOXYGEN
2671 
2672 namespace DoFTools
2673 {
2679  inline Coupling
2680  operator|=(Coupling &c1, const Coupling c2)
2681  {
2682  if (c2 == always)
2683  c1 = always;
2684  else if (c1 != always && c2 == nonzero)
2685  return c1 = nonzero;
2686  return c1;
2687  }
2688 
2689 
2695  inline Coupling
2696  operator|(const Coupling c1, const Coupling c2)
2697  {
2698  if (c1 == always || c2 == always)
2699  return always;
2700  if (c1 == nonzero || c2 == nonzero)
2701  return nonzero;
2702  return none;
2703  }
2704 
2705 
2706  // ---------------------- inline and template functions --------------------
2707 
2708  template <int dim, int spacedim, class Comp>
2709  void
2711  const Mapping<dim, spacedim> & mapping,
2712  const DoFHandler<dim, spacedim> &dof_handler,
2713  std::map<Point<spacedim>, types::global_dof_index, Comp>
2714  &point_to_index_map)
2715  {
2716  // let the checking of arguments be
2717  // done by the function first
2718  // called
2719  std::vector<Point<spacedim>> support_points(dof_handler.n_dofs());
2720  map_dofs_to_support_points(mapping, dof_handler, support_points);
2721  // now copy over the results of the
2722  // previous function into the
2723  // output arg
2724  point_to_index_map.clear();
2725  for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
2726  point_to_index_map[support_points[i]] = i;
2727  }
2728 
2729 
2730 
2731  template <typename DoFHandlerType, typename number>
2732  inline void
2734  const std::vector<
2736  & periodic_faces,
2737  AffineConstraints<number> & constraints,
2738  const ComponentMask & component_mask,
2739  const std::vector<unsigned int> &first_vector_components,
2740  const number periodicity_factor)
2741  {
2742  make_periodicity_constraints<DoFHandlerType::dimension,
2743  DoFHandlerType::space_dimension>(
2744  periodic_faces,
2745  constraints,
2746  component_mask,
2747  first_vector_components,
2748  periodicity_factor);
2749  }
2750 
2751 
2752 
2753  template <typename DoFHandlerType>
2754  inline std::vector<types::global_dof_index>
2756  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
2757  {
2758  return get_dofs_on_patch<DoFHandlerType::dimension,
2759  DoFHandlerType::space_dimension>(patch);
2760  }
2761 
2762 
2763 
2764  template <typename DoFHandlerType>
2765  inline unsigned int
2767  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch)
2768  {
2769  return count_dofs_on_patch<DoFHandlerType::dimension,
2770  DoFHandlerType::space_dimension>(patch);
2771  }
2772 } // namespace DoFTools
2773 
2774 #endif
2775 
2777 
2778 #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:2403
IndexSet dof_indices_with_subdomain_association(const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1685
void get_subdomain_association(const DoFHandler< dim, spacedim > &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1572
const types::subdomain_id invalid_subdomain_id
Definition: types.h:276
static ::ExceptionBase & ExcGridsDontMatch()
void count_dofs_per_block(const DoFHandler< dim, spacedim > &dof, std::vector< types::global_dof_index > &dofs_per_block, const std::vector< unsigned int > &target_block=std::vector< unsigned int >())
Definition: dof_tools.cc:2023
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:2502
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:769
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 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:1496
IndexSet extract_dofs(const DoFHandler< dim, spacedim > &dof_handler, const BlockMask &block_mask)
Definition: dof_tools.cc:494
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:2593
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:2034
std::vector< IndexSet > locally_owned_dofs_per_subdomain(const DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_tools.cc:1401
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:1291
void extract_locally_relevant_level_dofs(const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, IndexSet &dof_set)
Definition: dof_tools.cc:1239
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:2548
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:1744
types::global_dof_index n_dofs() const
Abstract base class for mapping classes.
Definition: mapping.h:303
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:1083
#define DeclException0(Exception0)
Definition: exceptions.h:470
std::vector< IndexSet > locally_owned_dofs_per_component(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &components=ComponentMask())
Definition: dof_tools.cc:506
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:394
unsigned int level
Definition: grid_out.cc:4578
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:1930
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:1092
void extract_locally_active_level_dofs(const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set, const unsigned int level)
Definition: dof_tools.cc:1161
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:851
ParameterHandler::OutputStyle operator|(const ParameterHandler::OutputStyle f1, const ParameterHandler::OutputStyle f2)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:393
void count_dofs_per_component(const DoFHandler< dim, spacedim > &dof_handler, std::vector< types::global_dof_index > &dofs_per_component, const bool vector_valued_once=false, const std::vector< unsigned int > &target_component={})
Definition: dof_tools.cc:1916
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:597
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:1386
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=std::set< types::boundary_id >())
Definition: dof_tools.cc:639
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
Definition: table.h:688
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:1197
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:2165
#define DEAL_II_DEPRECATED
Definition: config.h:156
void extract_locally_active_dofs(const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1126
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:2449
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:2684