Reference documentation for deal.II version Git bef661081b 2019-09-23 12:55:27 -0400
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
dof_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_dof_tools_h
17 #define dealii_dof_tools_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #include <deal.II/base/exceptions.h>
23 #include <deal.II/base/index_set.h>
24 #include <deal.II/base/point.h>
25 
26 #include <deal.II/dofs/dof_handler.h>
27 
28 #include <deal.II/fe/component_mask.h>
29 
30 #include <deal.II/hp/dof_handler.h>
31 
32 #include <deal.II/lac/affine_constraints.h>
33 
34 #include <map>
35 #include <ostream>
36 #include <set>
37 #include <vector>
38 
39 
40 DEAL_II_NAMESPACE_OPEN
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 #endif
72 
192 namespace DoFTools
193 {
205  enum Coupling
206  {
210  none,
223  };
224 
239  template <int dim, int spacedim>
240  void
242  const Table<2, Coupling> &table_by_component,
243  std::vector<Table<2, Coupling>> &tables_by_block);
244 
254  template <int dim, int spacedim>
255  void
257  const Table<2, Coupling> &table_by_component,
258  std::vector<Table<2, Coupling>> &tables_by_block);
259 
265  template <int dim, int spacedim>
269  const Table<2, Coupling> & component_couplings);
270 
278  template <int dim, int spacedim>
279  std::vector<Table<2, Coupling>>
282  const Table<2, Coupling> & component_couplings);
301  template <int dim, int spacedim>
302  DEAL_II_DEPRECATED unsigned int
304 
312  template <int dim, int spacedim>
313  DEAL_II_DEPRECATED unsigned int
315 
316 
327  template <int dim, int spacedim>
328  DEAL_II_DEPRECATED unsigned int
330 
341  template <int dim, int spacedim>
342  DEAL_II_DEPRECATED unsigned int
344 
355  template <int dim, int spacedim>
356  DEAL_II_DEPRECATED unsigned int
358 
369  template <int dim, int spacedim>
370  DEAL_II_DEPRECATED unsigned int
372 
384  template <int dim, int spacedim>
385  DEAL_II_DEPRECATED unsigned int
387 
399  template <int dim, int spacedim>
400  DEAL_II_DEPRECATED unsigned int
402 
414  template <int dim, int spacedim>
415  DEAL_II_DEPRECATED bool
417 
429  template <int dim, int spacedim>
430  DEAL_II_DEPRECATED bool
432 
558  template <typename DoFHandlerType,
559  typename SparsityPatternType,
560  typename number = double>
561  void
563  const DoFHandlerType & dof_handler,
564  SparsityPatternType & sparsity_pattern,
566  const bool keep_constrained_dofs = true,
568 
634  template <typename DoFHandlerType,
635  typename SparsityPatternType,
636  typename number = double>
637  void
639  const DoFHandlerType & dof_handler,
640  const Table<2, Coupling> & coupling,
641  SparsityPatternType & sparsity_pattern,
643  const bool keep_constrained_dofs = true,
645 
666  template <typename DoFHandlerType, typename SparsityPatternType>
667  void
668  make_sparsity_pattern(const DoFHandlerType &dof_row,
669  const DoFHandlerType &dof_col,
670  SparsityPatternType & sparsity);
671 
717  template <typename DoFHandlerType, typename SparsityPatternType>
718  void
719  make_flux_sparsity_pattern(const DoFHandlerType &dof_handler,
720  SparsityPatternType & sparsity_pattern);
721 
730  template <typename DoFHandlerType,
731  typename SparsityPatternType,
732  typename number>
733  void
735  const DoFHandlerType & dof_handler,
736  SparsityPatternType & sparsity_pattern,
737  const AffineConstraints<number> &constraints,
738  const bool keep_constrained_dofs = true,
740 
741 
761  template <typename DoFHandlerType, typename SparsityPatternType>
762  void
764  const DoFHandlerType & dof,
765  SparsityPatternType & sparsity,
766  const Table<2, Coupling> &cell_integrals_mask,
767  const Table<2, Coupling> &face_integrals_mask,
769 
770 
779  template <typename DoFHandlerType,
780  typename SparsityPatternType,
781  typename number>
782  void
783  make_flux_sparsity_pattern(const DoFHandlerType & dof,
784  SparsityPatternType & sparsity,
785  const AffineConstraints<number> &constraints,
786  const bool keep_constrained_dofs,
787  const Table<2, Coupling> &couplings,
788  const Table<2, Coupling> &face_couplings,
789  const types::subdomain_id subdomain_id);
790 
800  template <typename DoFHandlerType, typename SparsityPatternType>
801  void
803  const DoFHandlerType & dof,
804  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
805  SparsityPatternType & sparsity_pattern);
806 
824  template <typename DoFHandlerType,
825  typename SparsityPatternType,
826  typename number>
827  void
829  const DoFHandlerType &dof,
830  const std::map<types::boundary_id,
832  & boundary_ids,
833  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
834  SparsityPatternType & sparsity);
835 
886  template <typename DoFHandlerType, typename number>
887  void
888  make_hanging_node_constraints(const DoFHandlerType & dof_handler,
889  AffineConstraints<number> &constraints);
890 
958  template <int dim, int spacedim>
959  void
961  const DoFHandler<dim, spacedim> & coarse_grid,
962  const unsigned int coarse_component,
963  const DoFHandler<dim, spacedim> & fine_grid,
964  const unsigned int fine_component,
965  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
966  AffineConstraints<double> & constraints);
967 
968 
985  template <int dim, int spacedim>
986  void
988  const DoFHandler<dim, spacedim> & coarse_grid,
989  const unsigned int coarse_component,
990  const DoFHandler<dim, spacedim> & fine_grid,
991  const unsigned int fine_component,
992  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
993  std::vector<std::map<types::global_dof_index, float>>
994  &transfer_representation);
995 
1158  template <typename FaceIterator, typename number>
1159  void
1161  const FaceIterator & face_1,
1162  const typename identity<FaceIterator>::type &face_2,
1163  AffineConstraints<number> & constraints,
1164  const ComponentMask & component_mask = ComponentMask(),
1165  const bool face_orientation = true,
1166  const bool face_flip = false,
1167  const bool face_rotation = false,
1168  const FullMatrix<double> & matrix = FullMatrix<double>(),
1169  const std::vector<unsigned int> &first_vector_components =
1170  std::vector<unsigned int>());
1171 
1172 
1173 
1195  template <typename DoFHandlerType, typename number>
1196  void
1198  const std::vector<
1200  & periodic_faces,
1201  AffineConstraints<number> & constraints,
1202  const ComponentMask & component_mask = ComponentMask(),
1203  const std::vector<unsigned int> &first_vector_components =
1204  std::vector<unsigned int>());
1205 
1206 
1207 
1238  template <typename DoFHandlerType, typename number>
1239  void
1241  const DoFHandlerType & dof_handler,
1242  const types::boundary_id b_id1,
1243  const types::boundary_id b_id2,
1244  const int direction,
1245  AffineConstraints<number> &constraints,
1246  const ComponentMask & component_mask = ComponentMask());
1247 
1248 
1249 
1274  template <typename DoFHandlerType, typename number>
1275  void
1277  const DoFHandlerType & dof_handler,
1278  const types::boundary_id b_id,
1279  const int direction,
1280  AffineConstraints<number> &constraints,
1281  const ComponentMask & component_mask = ComponentMask());
1282 
1307  template <int dim, int spacedim>
1308  void
1310  std::vector<bool> & selected_dofs);
1311 
1316  template <int dim, int spacedim>
1317  IndexSet
1319 
1356  template <typename DoFHandlerType>
1357  void
1358  extract_dofs(const DoFHandlerType &dof_handler,
1359  const ComponentMask & component_mask,
1360  std::vector<bool> & selected_dofs);
1361 
1386  template <typename DoFHandlerType>
1387  void
1388  extract_dofs(const DoFHandlerType &dof_handler,
1389  const BlockMask & block_mask,
1390  std::vector<bool> & selected_dofs);
1391 
1396  template <typename DoFHandlerType>
1397  void
1398  extract_level_dofs(const unsigned int level,
1399  const DoFHandlerType &dof,
1400  const ComponentMask & component_mask,
1401  std::vector<bool> & selected_dofs);
1402 
1407  template <typename DoFHandlerType>
1408  void
1409  extract_level_dofs(const unsigned int level,
1410  const DoFHandlerType &dof,
1411  const BlockMask & component_mask,
1412  std::vector<bool> & selected_dofs);
1413 
1466  template <typename DoFHandlerType>
1467  void
1468  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1469  const ComponentMask & component_mask,
1470  std::vector<bool> & selected_dofs,
1471  const std::set<types::boundary_id> &boundary_ids =
1472  std::set<types::boundary_id>());
1473 
1504  template <typename DoFHandlerType>
1505  void
1506  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1507  const ComponentMask & component_mask,
1508  IndexSet & selected_dofs,
1509  const std::set<types::boundary_id> &boundary_ids =
1510  std::set<types::boundary_id>());
1511 
1528  template <typename DoFHandlerType>
1529  void
1531  const DoFHandlerType & dof_handler,
1532  const ComponentMask & component_mask,
1533  std::vector<bool> & selected_dofs,
1534  const std::set<types::boundary_id> &boundary_ids =
1535  std::set<types::boundary_id>());
1536 
1564  template <typename DoFHandlerType, typename number = double>
1565  IndexSet
1567  const DoFHandlerType &dof_handler,
1568  const std::function<
1569  bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
1570  const AffineConstraints<number> &constraints = AffineConstraints<number>());
1571 
1605  template <typename DoFHandlerType>
1606  void
1607  extract_constant_modes(const DoFHandlerType & dof_handler,
1608  const ComponentMask & component_mask,
1609  std::vector<std::vector<bool>> &constant_modes);
1611 
1625  template <typename DoFHandlerType>
1626  void
1627  extract_subdomain_dofs(const DoFHandlerType & dof_handler,
1628  const types::subdomain_id subdomain_id,
1629  std::vector<bool> & selected_dofs);
1630 
1631 
1641  template <typename DoFHandlerType>
1642  DEAL_II_DEPRECATED void
1643  extract_locally_owned_dofs(const DoFHandlerType &dof_handler,
1644  IndexSet & dof_set);
1645 
1646 
1661  template <typename DoFHandlerType>
1662  void
1663  extract_locally_active_dofs(const DoFHandlerType &dof_handler,
1664  IndexSet & dof_set);
1665 
1675  template <typename DoFHandlerType>
1676  void
1677  extract_locally_relevant_dofs(const DoFHandlerType &dof_handler,
1678  IndexSet & dof_set);
1679 
1696  template <typename DoFHandlerType>
1697  std::vector<IndexSet>
1698  locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1699 
1716  template <typename DoFHandlerType>
1717  std::vector<IndexSet>
1718  locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1719 
1720 
1725  template <typename DoFHandlerType>
1726  void
1727  extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler,
1728  const unsigned int level,
1729  IndexSet & dof_set);
1730 
1731 
1762  template <typename DoFHandlerType>
1763  void
1764  get_subdomain_association(const DoFHandlerType & dof_handler,
1765  std::vector<types::subdomain_id> &subdomain);
1766 
1792  template <typename DoFHandlerType>
1793  unsigned int
1794  count_dofs_with_subdomain_association(const DoFHandlerType & dof_handler,
1795  const types::subdomain_id subdomain);
1796 
1816  template <typename DoFHandlerType>
1817  void
1819  const DoFHandlerType & dof_handler,
1820  const types::subdomain_id subdomain,
1821  std::vector<unsigned int> &n_dofs_on_subdomain);
1822 
1844  template <typename DoFHandlerType>
1845  IndexSet
1846  dof_indices_with_subdomain_association(const DoFHandlerType & dof_handler,
1847  const types::subdomain_id subdomain);
1848  // @}
1858 
1910  template <typename DoFHandlerType>
1911  std::vector<types::global_dof_index>
1913  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1914 
1935  template <int dim, int spacedim>
1936  void
1937  make_cell_patches(SparsityPattern & block_list,
1938  const DoFHandler<dim, spacedim> &dof_handler,
1939  const unsigned int level,
1940  const std::vector<bool> & selected_dofs = {},
1941  const types::global_dof_index offset = 0);
1942 
1994  template <typename DoFHandlerType>
1995  std::vector<unsigned int>
1996  make_vertex_patches(SparsityPattern & block_list,
1997  const DoFHandlerType &dof_handler,
1998  const unsigned int level,
1999  const bool interior_dofs_only,
2000  const bool boundary_patches = false,
2001  const bool level_boundary_patches = false,
2002  const bool single_cell_patches = false,
2003  const bool invert_vertex_mapping = false);
2004 
2019  template <typename DoFHandlerType>
2020  std::vector<unsigned int>
2021  make_vertex_patches(SparsityPattern & block_list,
2022  const DoFHandlerType &dof_handler,
2023  const unsigned int level,
2024  const BlockMask & exclude_boundary_dofs = BlockMask(),
2025  const bool boundary_patches = false,
2026  const bool level_boundary_patches = false,
2027  const bool single_cell_patches = false,
2028  const bool invert_vertex_mapping = false);
2029 
2067  template <typename DoFHandlerType>
2068  void
2069  make_child_patches(SparsityPattern & block_list,
2070  const DoFHandlerType &dof_handler,
2071  const unsigned int level,
2072  const bool interior_dofs_only,
2073  const bool boundary_dofs = false);
2074 
2094  template <typename DoFHandlerType>
2095  void
2096  make_single_patch(SparsityPattern & block_list,
2097  const DoFHandlerType &dof_handler,
2098  const unsigned int level,
2099  const bool interior_dofs_only = false);
2100 
2143  template <typename DoFHandlerType>
2144  void
2146  const DoFHandlerType & dof_handler,
2147  std::vector<types::global_dof_index> &dofs_per_component,
2148  const bool vector_valued_once = false,
2149  std::vector<unsigned int> target_component = {});
2150 
2167  template <typename DoFHandlerType>
2168  void
2169  count_dofs_per_block(const DoFHandlerType & dof,
2170  std::vector<types::global_dof_index> &dofs_per_block,
2171  const std::vector<unsigned int> & target_block =
2172  std::vector<unsigned int>());
2173 
2184  template <typename DoFHandlerType>
2185  void
2186  get_active_fe_indices(const DoFHandlerType & dof_handler,
2187  std::vector<unsigned int> &active_fe_indices);
2188 
2223  template <typename DoFHandlerType>
2224  unsigned int
2226  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2227 
2250  template <typename DoFHandlerType>
2251  void
2252  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2253  std::vector<types::global_dof_index> &mapping);
2254 
2265  template <typename DoFHandlerType>
2266  void
2267  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2268  const std::set<types::boundary_id> &boundary_ids,
2269  std::vector<types::global_dof_index> &mapping);
2270 
2288  template <int dim, int spacedim>
2289  void
2291  const DoFHandler<dim, spacedim> &dof_handler,
2292  std::vector<Point<spacedim>> & support_points);
2293 
2298  template <int dim, int spacedim>
2299  void
2301  const ::hp::MappingCollection<dim, spacedim> &mapping,
2302  const hp::DoFHandler<dim, spacedim> & dof_handler,
2303  std::vector<Point<spacedim>> & support_points);
2304 
2332  template <int dim, int spacedim>
2333  void
2335  const Mapping<dim, spacedim> & mapping,
2336  const DoFHandler<dim, spacedim> & dof_handler,
2337  std::map<types::global_dof_index, Point<spacedim>> &support_points);
2338 
2342  template <int dim, int spacedim>
2343  void
2345  const ::hp::MappingCollection<dim, spacedim> &mapping,
2346  const hp::DoFHandler<dim, spacedim> & dof_handler,
2347  std::map<types::global_dof_index, Point<spacedim>> &support_points);
2348 
2349 
2370  template <typename DoFHandlerType, class Comp>
2371  void
2374  & mapping,
2375  const DoFHandlerType &dof_handler,
2378  Comp> & point_to_index_map);
2416  template <typename DoFHandlerType, typename Number>
2417  void
2418  distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler,
2419  const Vector<Number> &cell_data,
2420  Vector<double> & dof_data,
2421  const unsigned int component = 0);
2422 
2423 
2500  template <int spacedim>
2501  void
2503  std::ostream & out,
2504  const std::map<types::global_dof_index, Point<spacedim>> &support_points);
2505 
2506 
2547  template <int dim,
2548  int spacedim,
2549  template <int, int> class DoFHandlerType,
2550  typename number>
2551  void
2553  const DoFHandlerType<dim, spacedim> &dof,
2554  const types::boundary_id boundary_id,
2555  AffineConstraints<number> & zero_boundary_constraints,
2556  const ComponentMask & component_mask = ComponentMask());
2557 
2568  template <int dim,
2569  int spacedim,
2570  template <int, int> class DoFHandlerType,
2571  typename number>
2572  void
2574  const DoFHandlerType<dim, spacedim> &dof,
2575  AffineConstraints<number> & zero_boundary_constraints,
2576  const ComponentMask & component_mask = ComponentMask());
2577 
2622 } // namespace DoFTools
2623 
2624 
2625 
2626 /* ------------------------- inline functions -------------- */
2627 
2628 #ifndef DOXYGEN
2629 
2630 namespace DoFTools
2631 {
2637  inline Coupling
2638  operator|=(Coupling &c1, const Coupling c2)
2639  {
2640  if (c2 == always)
2641  c1 = always;
2642  else if (c1 != always && c2 == nonzero)
2643  return c1 = nonzero;
2644  return c1;
2645  }
2646 
2647 
2653  inline Coupling
2654  operator|(const Coupling c1, const Coupling c2)
2655  {
2656  if (c1 == always || c2 == always)
2657  return always;
2658  if (c1 == nonzero || c2 == nonzero)
2659  return nonzero;
2660  return none;
2661  }
2662 
2663 
2664  // ---------------------- inline and template functions --------------------
2665 
2666  template <int dim, int spacedim>
2667  inline unsigned int
2669  {
2670  return dh.get_fe().dofs_per_cell;
2671  }
2672 
2673 
2674  template <int dim, int spacedim>
2675  inline unsigned int
2677  {
2678  return dh.get_fe().dofs_per_face;
2679  }
2680 
2681 
2682  template <int dim, int spacedim>
2683  inline unsigned int
2685  {
2686  return dh.get_fe().dofs_per_vertex;
2687  }
2688 
2689 
2690  template <int dim, int spacedim>
2691  inline unsigned int
2693  {
2694  return dh.get_fe().n_components();
2695  }
2696 
2697 
2698 
2699  template <int dim, int spacedim>
2700  inline bool
2702  {
2703  return dh.get_fe().is_primitive();
2704  }
2705 
2706 
2707  template <int dim, int spacedim>
2708  inline unsigned int
2710  {
2711  return dh.get_fe_collection().max_dofs_per_cell();
2712  }
2713 
2714 
2715  template <int dim, int spacedim>
2716  inline unsigned int
2718  {
2719  return dh.get_fe_collection().max_dofs_per_face();
2720  }
2721 
2722 
2723  template <int dim, int spacedim>
2724  inline unsigned int
2726  {
2727  return dh.get_fe_collection().max_dofs_per_vertex();
2728  }
2729 
2730 
2731  template <int dim, int spacedim>
2732  inline unsigned int
2734  {
2735  return dh.get_fe(0).n_components();
2736  }
2737 
2738 
2739  template <int dim, int spacedim>
2740  inline bool
2742  {
2743  return dh.get_fe(0).is_primitive();
2744  }
2745 
2746 
2747  template <typename DoFHandlerType, class Comp>
2748  void
2751  & mapping,
2752  const DoFHandlerType &dof_handler,
2755  Comp> & point_to_index_map)
2756  {
2757  // let the checking of arguments be
2758  // done by the function first
2759  // called
2760  std::vector<Point<DoFHandlerType::space_dimension>> support_points(
2761  dof_handler.n_dofs());
2762  map_dofs_to_support_points(mapping, dof_handler, support_points);
2763  // now copy over the results of the
2764  // previous function into the
2765  // output arg
2766  point_to_index_map.clear();
2767  for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
2768  point_to_index_map[support_points[i]] = i;
2769  }
2770 } // namespace DoFTools
2771 
2772 #endif
2773 
2774 DEAL_II_NAMESPACE_CLOSE
2775 
2776 #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:2242
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:2437
unsigned int max_dofs_per_vertex(const DoFHandler< dim, spacedim > &dh)
std::vector< IndexSet > locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1273
const types::subdomain_id invalid_subdomain_id
Definition: types.h:279
static ::ExceptionBase & ExcGridsDontMatch()
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)
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:2344
void get_subdomain_association(const DoFHandlerType &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1448
std::vector< types::global_dof_index > get_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2717
const hp::FECollection< dim, spacedim > & get_fe() const
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)
bool fe_is_primitive(const DoFHandler< dim, spacedim > &dh)
static ::ExceptionBase & ExcFiniteElementsDontMatch()
void make_zero_boundary_constraints(const DoFHandlerType< dim, spacedim > &dof, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
void extract_dofs(const DoFHandlerType &dof_handler, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:402
unsigned int count_dofs_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1547
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
void map_dof_to_boundary_indices(const DoFHandlerType &dof_handler, std::vector< types::global_dof_index > &mapping)
Definition: dof_tools.cc:1983
Table< 2, Coupling > dof_couplings_from_component_couplings(const FiniteElement< dim, spacedim > &fe, const Table< 2, Coupling > &component_couplings)
void extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler, const unsigned int level, IndexSet &dof_set)
Definition: dof_tools.cc:1121
void make_hanging_node_constraints(const DoFHandlerType &dof_handler, AffineConstraints< number > &constraints)
LinearAlgebra::distributed::Vector< Number > Vector
IndexSet dof_indices_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1563
void make_sparsity_pattern(const DoFHandlerType &dof_row, const DoFHandlerType &dof_col, SparsityPatternType &sparsity)
UpdateFlags operator|(const UpdateFlags f1, const UpdateFlags f2)
unsigned int max_dofs_per_face(const DoFHandler< dim, spacedim > &dh)
unsigned int subdomain_id
Definition: types.h:43
void convert_couplings_to_blocks(const hp::DoFHandler< dim, spacedim > &dof_handler, const Table< 2, Coupling > &table_by_component, std::vector< Table< 2, Coupling >> &tables_by_block)
Definition: dof_tools.cc:2313
static ::ExceptionBase & ExcGridNotCoarser()
void extract_locally_owned_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1032
Abstract base class for mapping classes.
Definition: mapping.h:301
unsigned int max_dofs_per_cell(const DoFHandler< dim, spacedim > &dh)
#define DeclException0(Exception0)
Definition: exceptions.h:473
void map_dofs_to_support_points(const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::vector< Point< spacedim >> &support_points)
Definition: dof_tools.cc:2164
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 extract_locally_relevant_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1079
void extract_boundary_dofs(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:533
void extract_hanging_node_dofs(const DoFHandler< dim, spacedim > &dof_handler, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:973
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:672
std::vector< unsigned int > make_vertex_patches(SparsityPattern &block_list, const DoFHandlerType &dof_handler, const unsigned int level, const bool interior_dofs_only, 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:2509
const hp::FECollection< dim, spacedim > & get_fe_collection() const
Definition: hp.h:117
unsigned int global_dof_index
Definition: types.h:89
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:1170
std::vector< IndexSet > locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1373
void extract_locally_active_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1044
void extract_subdomain_dofs(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:999
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:1895
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)
void make_periodicity_constraints(const FaceIterator &face_1, const typename identity< FaceIterator >::type &face_2, AffineConstraints< number > &constraints, const ComponentMask &component_mask=ComponentMask(), const bool face_orientation=true, const bool face_flip=false, const bool face_rotation=false, const FullMatrix< double > &matrix=FullMatrix< double >(), const std::vector< unsigned int > &first_vector_components=std::vector< unsigned int >())
unsigned int count_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2688
static ::ExceptionBase & ExcInvalidBoundaryIndicator()
Definition: table.h:699
void extract_level_dofs(const unsigned int level, const DoFHandlerType &dof, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:462
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)
unsigned int n_components(const DoFHandler< dim, spacedim > &dh)
void get_active_fe_indices(const DoFHandlerType &dof_handler, std::vector< unsigned int > &active_fe_indices)
Definition: dof_tools.cc:1258
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:317
unsigned int boundary_id
Definition: types.h:125
static ::ExceptionBase & ExcNoFESelected()
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:759
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:2390
void count_dofs_per_component(const DoFHandlerType &dof_handler, std::vector< types::global_dof_index > &dofs_per_component, const bool vector_valued_once=false, std::vector< unsigned int > target_component={})
Definition: dof_tools.cc:1799