Reference documentation for deal.II version Git e159ac89de 2020-06-06 19:38:41 +0200
\(\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 <typename DoFHandlerType>
83  inline bool
84  always_couple_on_faces(
85  const typename DoFHandlerType::active_cell_iterator &,
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 
260  template <int dim, int spacedim>
261  void
263  const Table<2, Coupling> &table_by_component,
264  std::vector<Table<2, Coupling>> &tables_by_block);
265 
275  template <int dim, int spacedim>
276  void
278  const Table<2, Coupling> &table_by_component,
279  std::vector<Table<2, Coupling>> &tables_by_block);
280 
286  template <int dim, int spacedim>
290  const Table<2, Coupling> & component_couplings);
291 
299  template <int dim, int spacedim>
300  std::vector<Table<2, Coupling>>
303  const Table<2, Coupling> & component_couplings);
322  template <int dim, int spacedim>
323  DEAL_II_DEPRECATED unsigned int
325 
333  template <int dim, int spacedim>
334  DEAL_II_DEPRECATED unsigned int
336 
337 
348  template <int dim, int spacedim>
349  DEAL_II_DEPRECATED unsigned int
351 
362  template <int dim, int spacedim>
363  DEAL_II_DEPRECATED unsigned int
365 
376  template <int dim, int spacedim>
377  DEAL_II_DEPRECATED unsigned int
379 
390  template <int dim, int spacedim>
391  DEAL_II_DEPRECATED unsigned int
393 
405  template <int dim, int spacedim>
406  DEAL_II_DEPRECATED unsigned int
408 
420  template <int dim, int spacedim>
421  DEAL_II_DEPRECATED unsigned int
423 
435  template <int dim, int spacedim>
436  DEAL_II_DEPRECATED bool
438 
450  template <int dim, int spacedim>
451  DEAL_II_DEPRECATED bool
453 
579  template <typename DoFHandlerType,
580  typename SparsityPatternType,
581  typename number = double>
582  void
584  const DoFHandlerType & dof_handler,
585  SparsityPatternType & sparsity_pattern,
587  const bool keep_constrained_dofs = true,
589 
655  template <typename DoFHandlerType,
656  typename SparsityPatternType,
657  typename number = double>
658  void
660  const DoFHandlerType & dof_handler,
661  const Table<2, Coupling> & coupling,
662  SparsityPatternType & sparsity_pattern,
664  const bool keep_constrained_dofs = true,
666 
687  template <typename DoFHandlerType, typename SparsityPatternType>
688  void
689  make_sparsity_pattern(const DoFHandlerType &dof_row,
690  const DoFHandlerType &dof_col,
691  SparsityPatternType & sparsity);
692 
738  template <typename DoFHandlerType, typename SparsityPatternType>
739  void
740  make_flux_sparsity_pattern(const DoFHandlerType &dof_handler,
741  SparsityPatternType & sparsity_pattern);
742 
751  template <typename DoFHandlerType,
752  typename SparsityPatternType,
753  typename number>
754  void
756  const DoFHandlerType & dof_handler,
757  SparsityPatternType & sparsity_pattern,
758  const AffineConstraints<number> &constraints,
759  const bool keep_constrained_dofs = true,
761 
762 
782  template <typename DoFHandlerType, typename SparsityPatternType>
783  void
785  const DoFHandlerType & dof,
786  SparsityPatternType & sparsity,
787  const Table<2, Coupling> &cell_integrals_mask,
788  const Table<2, Coupling> &face_integrals_mask,
790 
791 
818  template <typename DoFHandlerType,
819  typename SparsityPatternType,
820  typename number>
821  void
823  const DoFHandlerType & dof,
824  SparsityPatternType & sparsity,
825  const AffineConstraints<number> &constraints,
826  const bool keep_constrained_dofs,
827  const Table<2, Coupling> & couplings,
828  const Table<2, Coupling> & face_couplings,
830  const std::function<
831  bool(const typename DoFHandlerType::active_cell_iterator &,
832  const unsigned int)> &face_has_flux_coupling =
833  &internal::always_couple_on_faces<DoFHandlerType>);
834 
844  template <typename DoFHandlerType, typename SparsityPatternType>
845  void
847  const DoFHandlerType & dof,
848  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
849  SparsityPatternType & sparsity_pattern);
850 
868  template <typename DoFHandlerType,
869  typename SparsityPatternType,
870  typename number>
871  void
873  const DoFHandlerType &dof,
874  const std::map<types::boundary_id,
876  & boundary_ids,
877  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
878  SparsityPatternType & sparsity);
879 
930  template <typename DoFHandlerType, typename number>
931  void
932  make_hanging_node_constraints(const DoFHandlerType & dof_handler,
933  AffineConstraints<number> &constraints);
934 
1002  template <int dim, int spacedim>
1003  void
1005  const DoFHandler<dim, spacedim> & coarse_grid,
1006  const unsigned int coarse_component,
1007  const DoFHandler<dim, spacedim> & fine_grid,
1008  const unsigned int fine_component,
1009  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
1010  AffineConstraints<double> & constraints);
1011 
1012 
1029  template <int dim, int spacedim>
1030  void
1032  const DoFHandler<dim, spacedim> & coarse_grid,
1033  const unsigned int coarse_component,
1034  const DoFHandler<dim, spacedim> & fine_grid,
1035  const unsigned int fine_component,
1036  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
1037  std::vector<std::map<types::global_dof_index, float>>
1038  &transfer_representation);
1039 
1214  template <typename FaceIterator, typename number>
1215  void
1217  const FaceIterator & face_1,
1218  const typename identity<FaceIterator>::type &face_2,
1219  AffineConstraints<number> & constraints,
1220  const ComponentMask & component_mask = ComponentMask(),
1221  const bool face_orientation = true,
1222  const bool face_flip = false,
1223  const bool face_rotation = false,
1225  const std::vector<unsigned int> &first_vector_components =
1226  std::vector<unsigned int>(),
1227  const number periodicity_factor = 1.);
1228 
1229 
1230 
1250  template <typename DoFHandlerType, typename number>
1251  void
1253  const std::vector<
1255  & periodic_faces,
1256  AffineConstraints<number> & constraints,
1257  const ComponentMask & component_mask = ComponentMask(),
1258  const std::vector<unsigned int> &first_vector_components =
1259  std::vector<unsigned int>(),
1260  const number periodicity_factor = 1.);
1261 
1262 
1263 
1293  template <typename DoFHandlerType, typename number>
1294  void
1296  const DoFHandlerType & dof_handler,
1297  const types::boundary_id b_id1,
1298  const types::boundary_id b_id2,
1299  const unsigned int direction,
1300  AffineConstraints<number> &constraints,
1301  const ComponentMask & component_mask = ComponentMask(),
1302  const number periodicity_factor = 1.);
1303 
1304 
1305 
1331  template <typename DoFHandlerType, typename number>
1332  void
1334  const DoFHandlerType & dof_handler,
1335  const types::boundary_id b_id,
1336  const unsigned int direction,
1337  AffineConstraints<number> &constraints,
1338  const ComponentMask & component_mask = ComponentMask(),
1339  const number periodicity_factor = 1.);
1340 
1368  template <int dim, int spacedim>
1369  DEAL_II_DEPRECATED void
1371  std::vector<bool> & selected_dofs);
1372 
1377  template <int dim, int spacedim>
1378  IndexSet
1380 
1423  template <typename DoFHandlerType>
1424  DEAL_II_DEPRECATED void
1425  extract_dofs(const DoFHandlerType &dof_handler,
1426  const ComponentMask & component_mask,
1427  std::vector<bool> & selected_dofs);
1428 
1461  template <typename DoFHandlerType>
1462  IndexSet
1463  extract_dofs(const DoFHandlerType &dof_handler,
1464  const ComponentMask & component_mask);
1465 
1496  template <typename DoFHandlerType>
1497  DEAL_II_DEPRECATED void
1498  extract_dofs(const DoFHandlerType &dof_handler,
1499  const BlockMask & block_mask,
1500  std::vector<bool> & selected_dofs);
1501 
1525  template <typename DoFHandlerType>
1526  IndexSet
1527  extract_dofs(const DoFHandlerType &dof_handler, const BlockMask &block_mask);
1528 
1533  template <typename DoFHandlerType>
1534  void
1535  extract_level_dofs(const unsigned int level,
1536  const DoFHandlerType &dof,
1537  const ComponentMask & component_mask,
1538  std::vector<bool> & selected_dofs);
1539 
1544  template <typename DoFHandlerType>
1545  void
1546  extract_level_dofs(const unsigned int level,
1547  const DoFHandlerType &dof,
1548  const BlockMask & component_mask,
1549  std::vector<bool> & selected_dofs);
1550 
1603  template <typename DoFHandlerType>
1604  void
1605  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1606  const ComponentMask & component_mask,
1607  std::vector<bool> & selected_dofs,
1608  const std::set<types::boundary_id> &boundary_ids =
1609  std::set<types::boundary_id>());
1610 
1641  template <typename DoFHandlerType>
1642  void
1643  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1644  const ComponentMask & component_mask,
1645  IndexSet & selected_dofs,
1646  const std::set<types::boundary_id> &boundary_ids =
1647  std::set<types::boundary_id>());
1648 
1665  template <typename DoFHandlerType>
1666  void
1668  const DoFHandlerType & dof_handler,
1669  const ComponentMask & component_mask,
1670  std::vector<bool> & selected_dofs,
1671  const std::set<types::boundary_id> &boundary_ids =
1672  std::set<types::boundary_id>());
1673 
1701  template <typename DoFHandlerType, typename number = double>
1702  IndexSet
1704  const DoFHandlerType &dof_handler,
1705  const std::function<
1706  bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
1707  const AffineConstraints<number> &constraints = AffineConstraints<number>());
1708 
1742  template <typename DoFHandlerType>
1743  void
1744  extract_constant_modes(const DoFHandlerType & dof_handler,
1745  const ComponentMask & component_mask,
1746  std::vector<std::vector<bool>> &constant_modes);
1748 
1762  template <typename DoFHandlerType>
1763  void
1764  extract_subdomain_dofs(const DoFHandlerType & dof_handler,
1765  const types::subdomain_id subdomain_id,
1766  std::vector<bool> & selected_dofs);
1767 
1768 
1778  template <typename DoFHandlerType>
1779  DEAL_II_DEPRECATED void
1780  extract_locally_owned_dofs(const DoFHandlerType &dof_handler,
1781  IndexSet & dof_set);
1782 
1783 
1798  template <typename DoFHandlerType>
1799  void
1800  extract_locally_active_dofs(const DoFHandlerType &dof_handler,
1801  IndexSet & dof_set);
1802 
1812  template <typename DoFHandlerType>
1813  void
1814  extract_locally_relevant_dofs(const DoFHandlerType &dof_handler,
1815  IndexSet & dof_set);
1816 
1817 
1827  template <typename DoFHandlerType>
1828  std::vector<IndexSet>
1830  const DoFHandlerType &dof_handler,
1831  const ComponentMask & components = ComponentMask());
1832 
1846  template <typename DoFHandlerType>
1847  std::vector<IndexSet>
1848  locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1849 
1864  template <typename DoFHandlerType>
1865  std::vector<IndexSet>
1866  locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1867 
1868 
1873  template <typename DoFHandlerType>
1874  void
1875  extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler,
1876  const unsigned int level,
1877  IndexSet & dof_set);
1878 
1879 
1910  template <typename DoFHandlerType>
1911  void
1912  get_subdomain_association(const DoFHandlerType & dof_handler,
1913  std::vector<types::subdomain_id> &subdomain);
1914 
1940  template <typename DoFHandlerType>
1941  unsigned int
1942  count_dofs_with_subdomain_association(const DoFHandlerType & dof_handler,
1943  const types::subdomain_id subdomain);
1944 
1964  template <typename DoFHandlerType>
1965  void
1967  const DoFHandlerType & dof_handler,
1968  const types::subdomain_id subdomain,
1969  std::vector<unsigned int> &n_dofs_on_subdomain);
1970 
1992  template <typename DoFHandlerType>
1993  IndexSet
1994  dof_indices_with_subdomain_association(const DoFHandlerType & dof_handler,
1995  const types::subdomain_id subdomain);
1996  // @}
2006 
2056  template <typename DoFHandlerType>
2057  std::vector<types::global_dof_index>
2059  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2060 
2081  template <int dim, int spacedim>
2082  void
2083  make_cell_patches(SparsityPattern & block_list,
2084  const DoFHandler<dim, spacedim> &dof_handler,
2085  const unsigned int level,
2086  const std::vector<bool> & selected_dofs = {},
2087  const types::global_dof_index offset = 0);
2088 
2140  template <typename DoFHandlerType>
2141  std::vector<unsigned int>
2142  make_vertex_patches(SparsityPattern & block_list,
2143  const DoFHandlerType &dof_handler,
2144  const unsigned int level,
2145  const bool interior_dofs_only,
2146  const bool boundary_patches = false,
2147  const bool level_boundary_patches = false,
2148  const bool single_cell_patches = false,
2149  const bool invert_vertex_mapping = false);
2150 
2165  template <typename DoFHandlerType>
2166  std::vector<unsigned int>
2167  make_vertex_patches(SparsityPattern & block_list,
2168  const DoFHandlerType &dof_handler,
2169  const unsigned int level,
2170  const BlockMask & exclude_boundary_dofs = BlockMask(),
2171  const bool boundary_patches = false,
2172  const bool level_boundary_patches = false,
2173  const bool single_cell_patches = false,
2174  const bool invert_vertex_mapping = false);
2175 
2213  template <typename DoFHandlerType>
2214  void
2215  make_child_patches(SparsityPattern & block_list,
2216  const DoFHandlerType &dof_handler,
2217  const unsigned int level,
2218  const bool interior_dofs_only,
2219  const bool boundary_dofs = false);
2220 
2240  template <typename DoFHandlerType>
2241  void
2242  make_single_patch(SparsityPattern & block_list,
2243  const DoFHandlerType &dof_handler,
2244  const unsigned int level,
2245  const bool interior_dofs_only = false);
2246 
2289  template <typename DoFHandlerType>
2290  std::vector<types::global_dof_index>
2292  const DoFHandlerType & dof_handler,
2293  const bool vector_valued_once = false,
2294  const std::vector<unsigned int> &target_component = {});
2295 
2300  template <typename DoFHandlerType>
2301  DEAL_II_DEPRECATED void
2303  const DoFHandlerType & dof_handler,
2304  std::vector<types::global_dof_index> &dofs_per_component,
2305  const bool vector_valued_once = false,
2306  const std::vector<unsigned int> & target_component = {});
2307 
2324  template <typename DoFHandlerType>
2325  std::vector<types::global_dof_index>
2326  count_dofs_per_fe_block(const DoFHandlerType & dof,
2327  const std::vector<unsigned int> &target_block =
2328  std::vector<unsigned int>());
2329 
2334  template <typename DoFHandlerType>
2335  DEAL_II_DEPRECATED void
2336  count_dofs_per_block(const DoFHandlerType & dof,
2337  std::vector<types::global_dof_index> &dofs_per_block,
2338  const std::vector<unsigned int> & target_block =
2339  std::vector<unsigned int>());
2340 
2351  template <typename DoFHandlerType>
2352  void
2353  get_active_fe_indices(const DoFHandlerType & dof_handler,
2354  std::vector<unsigned int> &active_fe_indices);
2355 
2388  template <typename DoFHandlerType>
2389  unsigned int
2391  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2392 
2415  template <typename DoFHandlerType>
2416  void
2417  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2418  std::vector<types::global_dof_index> &mapping);
2419 
2430  template <typename DoFHandlerType>
2431  void
2432  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2433  const std::set<types::boundary_id> &boundary_ids,
2434  std::vector<types::global_dof_index> &mapping);
2435 
2464  template <int dim, int spacedim>
2465  void
2467  const DoFHandler<dim, spacedim> &dof_handler,
2468  std::vector<Point<spacedim>> & support_points,
2469  const ComponentMask &mask = ComponentMask());
2470 
2474  template <int dim, int spacedim>
2475  void
2477  const ::hp::MappingCollection<dim, spacedim> &mapping,
2478  const hp::DoFHandler<dim, spacedim> & dof_handler,
2479  std::vector<Point<spacedim>> & support_points,
2480  const ComponentMask & mask = ComponentMask());
2481 
2512  template <int dim, int spacedim>
2513  void
2515  const Mapping<dim, spacedim> & mapping,
2516  const DoFHandler<dim, spacedim> & dof_handler,
2517  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2518  const ComponentMask & mask = ComponentMask());
2519 
2523  template <int dim, int spacedim>
2524  void
2526  const ::hp::MappingCollection<dim, spacedim> &mapping,
2527  const hp::DoFHandler<dim, spacedim> & dof_handler,
2528  std::map<types::global_dof_index, Point<spacedim>> &support_points,
2529  const ComponentMask & mask = ComponentMask());
2530 
2531 
2552  template <typename DoFHandlerType, class Comp>
2553  void
2556  & mapping,
2557  const DoFHandlerType &dof_handler,
2560  Comp> & point_to_index_map);
2598  template <typename DoFHandlerType, typename Number>
2599  void
2600  distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler,
2601  const Vector<Number> &cell_data,
2602  Vector<double> & dof_data,
2603  const unsigned int component = 0);
2604 
2605 
2682  template <int spacedim>
2683  void
2685  std::ostream & out,
2686  const std::map<types::global_dof_index, Point<spacedim>> &support_points);
2687 
2688 
2729  template <int dim,
2730  int spacedim,
2731  template <int, int> class DoFHandlerType,
2732  typename number>
2733  void
2735  const DoFHandlerType<dim, spacedim> &dof,
2737  AffineConstraints<number> & zero_boundary_constraints,
2738  const ComponentMask & component_mask = ComponentMask());
2739 
2750  template <int dim,
2751  int spacedim,
2752  template <int, int> class DoFHandlerType,
2753  typename number>
2754  void
2756  const DoFHandlerType<dim, spacedim> &dof,
2757  AffineConstraints<number> & zero_boundary_constraints,
2758  const ComponentMask & component_mask = ComponentMask());
2759 
2804 } // namespace DoFTools
2805 
2806 
2807 
2808 /* ------------------------- inline functions -------------- */
2809 
2810 #ifndef DOXYGEN
2811 
2812 namespace DoFTools
2813 {
2819  inline Coupling
2820  operator|=(Coupling &c1, const Coupling c2)
2821  {
2822  if (c2 == always)
2823  c1 = always;
2824  else if (c1 != always && c2 == nonzero)
2825  return c1 = nonzero;
2826  return c1;
2827  }
2828 
2829 
2835  inline Coupling
2836  operator|(const Coupling c1, const Coupling c2)
2837  {
2838  if (c1 == always || c2 == always)
2839  return always;
2840  if (c1 == nonzero || c2 == nonzero)
2841  return nonzero;
2842  return none;
2843  }
2844 
2845 
2846  // ---------------------- inline and template functions --------------------
2847 
2848  template <int dim, int spacedim>
2849  inline unsigned int
2851  {
2852  return dh.get_fe().dofs_per_cell;
2853  }
2854 
2855 
2856  template <int dim, int spacedim>
2857  inline unsigned int
2859  {
2860  return dh.get_fe().dofs_per_face;
2861  }
2862 
2863 
2864  template <int dim, int spacedim>
2865  inline unsigned int
2867  {
2868  return dh.get_fe().dofs_per_vertex;
2869  }
2870 
2871 
2872  template <int dim, int spacedim>
2873  inline unsigned int
2875  {
2876  return dh.get_fe().n_components();
2877  }
2878 
2879 
2880 
2881  template <int dim, int spacedim>
2882  inline bool
2884  {
2885  return dh.get_fe().is_primitive();
2886  }
2887 
2888 
2889  template <int dim, int spacedim>
2890  inline unsigned int
2892  {
2893  return dh.get_fe_collection().max_dofs_per_cell();
2894  }
2895 
2896 
2897  template <int dim, int spacedim>
2898  inline unsigned int
2900  {
2901  return dh.get_fe_collection().max_dofs_per_face();
2902  }
2903 
2904 
2905  template <int dim, int spacedim>
2906  inline unsigned int
2908  {
2909  return dh.get_fe_collection().max_dofs_per_vertex();
2910  }
2911 
2912 
2913  template <int dim, int spacedim>
2914  inline unsigned int
2916  {
2917  return dh.get_fe(0).n_components();
2918  }
2919 
2920 
2921  template <int dim, int spacedim>
2922  inline bool
2924  {
2925  return dh.get_fe(0).is_primitive();
2926  }
2927 
2928 
2929  template <typename DoFHandlerType, class Comp>
2930  void
2933  & mapping,
2934  const DoFHandlerType &dof_handler,
2937  Comp> & point_to_index_map)
2938  {
2939  // let the checking of arguments be
2940  // done by the function first
2941  // called
2942  std::vector<Point<DoFHandlerType::space_dimension>> support_points(
2943  dof_handler.n_dofs());
2944  map_dofs_to_support_points(mapping, dof_handler, support_points);
2945  // now copy over the results of the
2946  // previous function into the
2947  // output arg
2948  point_to_index_map.clear();
2949  for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
2950  point_to_index_map[support_points[i]] = i;
2951  }
2952 } // namespace DoFTools
2953 
2954 #endif
2955 
2957 
2958 #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:2394
void make_child_patches(SparsityPattern &block_list, const DoFHandlerType &dof_handler, const unsigned int level, const bool interior_dofs_only, const bool boundary_dofs=false)
Definition: dof_tools.cc:2588
std::vector< IndexSet > locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1375
const types::subdomain_id invalid_subdomain_id
Definition: types.h:285
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:2496
unsigned int max_dofs_per_vertex(const hp::DoFHandler< dim, spacedim > &dh)
void get_subdomain_association(const DoFHandlerType &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1550
std::vector< types::global_dof_index > get_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2864
void map_support_points_to_dofs(const Mapping< DoFHandlerType::dimension, DoFHandlerType::space_dimension > &mapping, const DoFHandlerType &dof_handler, std::map< Point< DoFHandlerType::space_dimension >, types::global_dof_index, Comp > &point_to_index_map)
std::vector< types::global_dof_index > count_dofs_per_fe_block(const DoFHandlerType &dof, const std::vector< unsigned int > &target_block=std::vector< unsigned int >())
Definition: dof_tools.cc:2012
static ::ExceptionBase & ExcFiniteElementsDontMatch()
void make_zero_boundary_constraints(const DoFHandlerType< dim, spacedim > &dof, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
void make_flux_sparsity_pattern(const DoFHandlerType &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 DoFHandlerType::active_cell_iterator &, const unsigned int)> &face_has_flux_coupling=&internal::always_couple_on_faces< DoFHandlerType >)
void extract_boundary_dofs(const DoFHandlerType &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:664
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
void extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler, const unsigned int level, IndexSet &dof_set)
Definition: dof_tools.cc:1215
void make_hanging_node_constraints(const DoFHandlerType &dof_handler, AffineConstraints< number > &constraints)
std::vector< Table< 2, Coupling > > dof_couplings_from_component_couplings(const hp::FECollection< dim, spacedim > &fe, const Table< 2, Coupling > &component_couplings)
std::vector< unsigned int > make_vertex_patches(SparsityPattern &block_list, const DoFHandlerType &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:2681
IndexSet dof_indices_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1665
void make_sparsity_pattern(const DoFHandlerType &dof_row, const DoFHandlerType &dof_col, SparsityPatternType &sparsity)
void make_periodicity_constraints(const DoFHandlerType &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.)
unsigned int subdomain_id
Definition: types.h:43
bool fe_is_primitive(const hp::DoFHandler< dim, spacedim > &dh)
static ::ExceptionBase & ExcGridNotCoarser()
unsigned int max_dofs_per_face(const hp::DoFHandler< dim, spacedim > &dh)
void count_dofs_per_component(const DoFHandlerType &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:1892
void extract_locally_owned_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1126
Abstract base class for mapping classes.
Definition: mapping.h:301
unsigned int max_dofs_per_cell(const hp::DoFHandler< dim, spacedim > &dh)
IndexSet extract_hanging_node_dofs(const DoFHandler< dim, spacedim > &dof_handler)
Definition: dof_tools.cc:1084
#define DeclException0(Exception0)
Definition: exceptions.h:470
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:361
unsigned int level
Definition: grid_out.cc:4355
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 map_dofs_to_support_points(const ::hp::MappingCollection< dim, spacedim > &mapping, const hp::DoFHandler< dim, spacedim > &dof_handler, std::map< types::global_dof_index, Point< spacedim >> &support_points, const ComponentMask &mask=ComponentMask())
void map_dof_to_boundary_indices(const DoFHandlerType &dof_handler, const std::set< types::boundary_id > &boundary_ids, std::vector< types::global_dof_index > &mapping)
Definition: dof_tools.cc:2149
void extract_locally_relevant_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1173
void extract_dofs_with_support_on_boundary(const DoFHandlerType &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:772
std::vector< types::global_dof_index > count_dofs_per_fe_component(const DoFHandlerType &dof_handler, const bool vector_valued_once=false, const std::vector< unsigned int > &target_component={})
Definition: dof_tools.cc:1906
const hp::FECollection< dim, spacedim > & get_fe_collection() const
Definition: hp.h:117
IndexSet extract_dofs(const DoFHandlerType &dof_handler, const BlockMask &block_mask)
Definition: dof_tools.cc:521
unsigned int global_dof_index
Definition: types.h:76
UpdateFlags & operator|=(UpdateFlags &f1, const UpdateFlags f2)
void extract_constant_modes(const DoFHandlerType &dof_handler, const ComponentMask &component_mask, std::vector< std::vector< bool >> &constant_modes)
Definition: dof_tools.cc:1264
unsigned int n_components(const hp::DoFHandler< dim, spacedim > &dh)
std::vector< IndexSet > locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1475
void extract_locally_active_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1138
std::vector< IndexSet > locally_owned_dofs_per_component(const DoFHandlerType &dof_handler, const ComponentMask &components=ComponentMask())
Definition: dof_tools.cc:532
void extract_subdomain_dofs(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:1093
void count_dofs_per_block(const DoFHandlerType &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:2001
ParameterHandler::OutputStyle operator|(const ParameterHandler::OutputStyle f1, const ParameterHandler::OutputStyle f2)
void make_boundary_sparsity_pattern(const DoFHandlerType &dof, const std::map< types::boundary_id, const Function< DoFHandlerType::space_dimension, number > *> &boundary_ids, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternType &sparsity)
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:360
unsigned int count_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2835
void count_dofs_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain, std::vector< unsigned int > &n_dofs_on_subdomain)
Definition: dof_tools.cc:1722
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index) const
Definition: table.h:687
void extract_level_dofs(const unsigned int level, const DoFHandlerType &dof, const BlockMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:621
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 get_active_fe_indices(const DoFHandlerType &dof_handler, std::vector< unsigned int > &active_fe_indices)
Definition: dof_tools.cc:1360
void distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler, const Vector< Number > &cell_data, Vector< double > &dof_data, const unsigned int component=0)
Definition: dof_tools.cc:312
#define DEAL_II_DEPRECATED
Definition: config.h:150
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:2440
IndexSet extract_dofs_with_support_contained_within(const DoFHandlerType &dof_handler, const std::function< bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate, const AffineConstraints< number > &constraints=AffineConstraints< number >())
Definition: dof_tools.cc:855
void make_single_patch(SparsityPattern &block_list, const DoFHandlerType &dof_handler, const unsigned int level, const bool interior_dofs_only=false)
Definition: dof_tools.cc:2542