Reference documentation for deal.II version 9.1.0-pre
dof_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 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 class BlockMask;
43 template <int dim, typename RangeNumberType>
44 class Function;
45 template <int dim, int spacedim>
46 class FiniteElement;
47 namespace hp
48 {
49  template <int dim, int spacedim>
51  template <int dim, int spacedim>
52  class FECollection;
53 } // namespace hp
54 template <class MeshType>
56 template <int dim, int spacedim>
57 class Mapping;
58 class SparsityPattern;
59 template <int dim, class T>
60 class Table;
61 template <typename Number>
62 class Vector;
63 
64 namespace GridTools
65 {
66  template <typename CellIterator>
67  struct PeriodicFacePair;
68 }
69 
70 
190 namespace DoFTools
191 {
203  enum Coupling
204  {
208  none,
219  };
220 
235  template <int dim, int spacedim>
236  void
238  const Table<2, Coupling> &table_by_component,
239  std::vector<Table<2, Coupling>> &tables_by_block);
240 
250  template <int dim, int spacedim>
251  void
253  const Table<2, Coupling> &table_by_component,
254  std::vector<Table<2, Coupling>> &tables_by_block);
255 
261  template <int dim, int spacedim>
265  const Table<2, Coupling> & component_couplings);
266 
274  template <int dim, int spacedim>
275  std::vector<Table<2, Coupling>>
278  const Table<2, Coupling> & component_couplings);
295  template <int dim, int spacedim>
296  DEAL_II_DEPRECATED unsigned int
298 
306  template <int dim, int spacedim>
307  DEAL_II_DEPRECATED unsigned int
309 
310 
321  template <int dim, int spacedim>
322  DEAL_II_DEPRECATED unsigned int
324 
335  template <int dim, int spacedim>
336  DEAL_II_DEPRECATED unsigned int
338 
349  template <int dim, int spacedim>
350  DEAL_II_DEPRECATED unsigned int
352 
363  template <int dim, int spacedim>
364  DEAL_II_DEPRECATED unsigned int
366 
378  template <int dim, int spacedim>
379  DEAL_II_DEPRECATED unsigned int
381 
393  template <int dim, int spacedim>
394  DEAL_II_DEPRECATED unsigned int
396 
408  template <int dim, int spacedim>
409  DEAL_II_DEPRECATED bool
411 
423  template <int dim, int spacedim>
424  DEAL_II_DEPRECATED bool
426 
552  template <typename DoFHandlerType,
553  typename SparsityPatternType,
554  typename number = double>
555  void
557  const DoFHandlerType & dof_handler,
558  SparsityPatternType & sparsity_pattern,
560  const bool keep_constrained_dofs = true,
562 
628  template <typename DoFHandlerType,
629  typename SparsityPatternType,
630  typename number = double>
631  void
633  const DoFHandlerType & dof_handler,
634  const Table<2, Coupling> & coupling,
635  SparsityPatternType & sparsity_pattern,
637  const bool keep_constrained_dofs = true,
639 
660  template <typename DoFHandlerType, typename SparsityPatternType>
661  void
662  make_sparsity_pattern(const DoFHandlerType &dof_row,
663  const DoFHandlerType &dof_col,
664  SparsityPatternType & sparsity);
665 
711  template <typename DoFHandlerType, typename SparsityPatternType>
712  void
713  make_flux_sparsity_pattern(const DoFHandlerType &dof_handler,
714  SparsityPatternType & sparsity_pattern);
715 
724  template <typename DoFHandlerType,
725  typename SparsityPatternType,
726  typename number>
727  void
729  const DoFHandlerType & dof_handler,
730  SparsityPatternType & sparsity_pattern,
731  const AffineConstraints<number> &constraints,
732  const bool keep_constrained_dofs = true,
734 
735 
755  template <typename DoFHandlerType, typename SparsityPatternType>
756  void
758  const DoFHandlerType & dof,
759  SparsityPatternType & sparsity,
760  const Table<2, Coupling> &cell_integrals_mask,
761  const Table<2, Coupling> &face_integrals_mask,
763 
764 
773  template <typename DoFHandlerType,
774  typename SparsityPatternType,
775  typename number>
776  void
777  make_flux_sparsity_pattern(const DoFHandlerType & dof,
778  SparsityPatternType & sparsity,
779  const AffineConstraints<number> &constraints,
780  const bool keep_constrained_dofs,
781  const Table<2, Coupling> &couplings,
782  const Table<2, Coupling> &face_couplings,
783  const types::subdomain_id subdomain_id);
784 
794  template <typename DoFHandlerType, typename SparsityPatternType>
795  void
797  const DoFHandlerType & dof,
798  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
799  SparsityPatternType & sparsity_pattern);
800 
818  template <typename DoFHandlerType,
819  typename SparsityPatternType,
820  typename number>
821  void
823  const DoFHandlerType &dof,
824  const std::map<types::boundary_id,
826  & boundary_ids,
827  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
828  SparsityPatternType & sparsity);
829 
880  template <typename DoFHandlerType, typename number>
881  void
882  make_hanging_node_constraints(const DoFHandlerType & dof_handler,
883  AffineConstraints<number> &constraints);
884 
952  template <int dim, int spacedim>
953  void
955  const DoFHandler<dim, spacedim> & coarse_grid,
956  const unsigned int coarse_component,
957  const DoFHandler<dim, spacedim> & fine_grid,
958  const unsigned int fine_component,
959  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
960  AffineConstraints<double> & constraints);
961 
962 
979  template <int dim, int spacedim>
980  void
982  const DoFHandler<dim, spacedim> & coarse_grid,
983  const unsigned int coarse_component,
984  const DoFHandler<dim, spacedim> & fine_grid,
985  const unsigned int fine_component,
986  const InterGridMap<DoFHandler<dim, spacedim>> &coarse_to_fine_grid_map,
987  std::vector<std::map<types::global_dof_index, float>>
988  &transfer_representation);
989 
1152  template <typename FaceIterator>
1153  void
1155  const FaceIterator & face_1,
1156  const typename identity<FaceIterator>::type &face_2,
1157  AffineConstraints<double> & constraints,
1158  const ComponentMask & component_mask = ComponentMask(),
1159  const bool face_orientation = true,
1160  const bool face_flip = false,
1161  const bool face_rotation = false,
1162  const FullMatrix<double> & matrix = FullMatrix<double>(),
1163  const std::vector<unsigned int> &first_vector_components =
1164  std::vector<unsigned int>());
1165 
1166 
1167 
1189  template <typename DoFHandlerType>
1190  void
1192  const std::vector<
1194  & periodic_faces,
1195  AffineConstraints<double> & constraints,
1196  const ComponentMask & component_mask = ComponentMask(),
1197  const std::vector<unsigned int> &first_vector_components =
1198  std::vector<unsigned int>());
1199 
1200 
1201 
1232  template <typename DoFHandlerType>
1233  void
1235  const DoFHandlerType & dof_handler,
1236  const types::boundary_id b_id1,
1237  const types::boundary_id b_id2,
1238  const int direction,
1239  AffineConstraints<double> &constraints,
1240  const ComponentMask & component_mask = ComponentMask());
1241 
1242 
1243 
1268  template <typename DoFHandlerType>
1269  void
1271  const DoFHandlerType & dof_handler,
1272  const types::boundary_id b_id,
1273  const int direction,
1274  AffineConstraints<double> &constraints,
1275  const ComponentMask & component_mask = ComponentMask());
1276 
1301  template <int dim, int spacedim>
1302  void
1304  std::vector<bool> & selected_dofs);
1305 
1310  template <int dim, int spacedim>
1311  IndexSet
1313 
1347  template <int dim, int spacedim>
1348  void
1349  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1350  const ComponentMask & component_mask,
1351  std::vector<bool> & selected_dofs);
1352 
1356  template <int dim, int spacedim>
1357  void
1358  extract_dofs(const hp::DoFHandler<dim, spacedim> &dof_handler,
1359  const ComponentMask & component_mask,
1360  std::vector<bool> & selected_dofs);
1361 
1386  template <int dim, int spacedim>
1387  void
1388  extract_dofs(const DoFHandler<dim, spacedim> &dof_handler,
1389  const BlockMask & block_mask,
1390  std::vector<bool> & selected_dofs);
1391 
1395  template <int dim, int spacedim>
1396  void
1397  extract_dofs(const hp::DoFHandler<dim, spacedim> &dof_handler,
1398  const BlockMask & block_mask,
1399  std::vector<bool> & selected_dofs);
1400 
1405  template <typename DoFHandlerType>
1406  void
1407  extract_level_dofs(const unsigned int level,
1408  const DoFHandlerType &dof,
1409  const ComponentMask & component_mask,
1410  std::vector<bool> & selected_dofs);
1411 
1416  template <typename DoFHandlerType>
1417  void
1418  extract_level_dofs(const unsigned int level,
1419  const DoFHandlerType &dof,
1420  const BlockMask & component_mask,
1421  std::vector<bool> & selected_dofs);
1422 
1475  template <typename DoFHandlerType>
1476  void
1477  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1478  const ComponentMask & component_mask,
1479  std::vector<bool> & selected_dofs,
1480  const std::set<types::boundary_id> &boundary_ids =
1481  std::set<types::boundary_id>());
1482 
1513  template <typename DoFHandlerType>
1514  void
1515  extract_boundary_dofs(const DoFHandlerType & dof_handler,
1516  const ComponentMask & component_mask,
1517  IndexSet & selected_dofs,
1518  const std::set<types::boundary_id> &boundary_ids =
1519  std::set<types::boundary_id>());
1520 
1537  template <typename DoFHandlerType>
1538  void
1540  const DoFHandlerType & dof_handler,
1541  const ComponentMask & component_mask,
1542  std::vector<bool> & selected_dofs,
1543  const std::set<types::boundary_id> &boundary_ids =
1544  std::set<types::boundary_id>());
1545 
1573  template <typename DoFHandlerType, typename number = double>
1574  IndexSet
1576  const DoFHandlerType &dof_handler,
1577  const std::function<
1578  bool(const typename DoFHandlerType::active_cell_iterator &)> &predicate,
1579  const AffineConstraints<number> &constraints = AffineConstraints<number>());
1580 
1614  template <typename DoFHandlerType>
1615  void
1616  extract_constant_modes(const DoFHandlerType & dof_handler,
1617  const ComponentMask & component_mask,
1618  std::vector<std::vector<bool>> &constant_modes);
1620 
1634  template <typename DoFHandlerType>
1635  void
1636  extract_subdomain_dofs(const DoFHandlerType & dof_handler,
1637  const types::subdomain_id subdomain_id,
1638  std::vector<bool> & selected_dofs);
1639 
1640 
1650  template <typename DoFHandlerType>
1651  DEAL_II_DEPRECATED void
1652  extract_locally_owned_dofs(const DoFHandlerType &dof_handler,
1653  IndexSet & dof_set);
1654 
1655 
1670  template <typename DoFHandlerType>
1671  void
1672  extract_locally_active_dofs(const DoFHandlerType &dof_handler,
1673  IndexSet & dof_set);
1674 
1684  template <typename DoFHandlerType>
1685  void
1686  extract_locally_relevant_dofs(const DoFHandlerType &dof_handler,
1687  IndexSet & dof_set);
1688 
1705  template <typename DoFHandlerType>
1706  std::vector<IndexSet>
1707  locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1708 
1725  template <typename DoFHandlerType>
1726  std::vector<IndexSet>
1727  locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler);
1728 
1729 
1734  template <typename DoFHandlerType>
1735  void
1736  extract_locally_relevant_level_dofs(const DoFHandlerType &dof_handler,
1737  const unsigned int level,
1738  IndexSet & dof_set);
1739 
1740 
1771  template <typename DoFHandlerType>
1772  void
1773  get_subdomain_association(const DoFHandlerType & dof_handler,
1774  std::vector<types::subdomain_id> &subdomain);
1775 
1801  template <typename DoFHandlerType>
1802  unsigned int
1803  count_dofs_with_subdomain_association(const DoFHandlerType & dof_handler,
1804  const types::subdomain_id subdomain);
1805 
1825  template <typename DoFHandlerType>
1826  void
1828  const DoFHandlerType & dof_handler,
1829  const types::subdomain_id subdomain,
1830  std::vector<unsigned int> &n_dofs_on_subdomain);
1831 
1853  template <typename DoFHandlerType>
1854  IndexSet
1855  dof_indices_with_subdomain_association(const DoFHandlerType & dof_handler,
1856  const types::subdomain_id subdomain);
1857  // @}
1867 
1919  template <typename DoFHandlerType>
1920  std::vector<types::global_dof_index>
1922  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1923 
1944  template <int dim, int spacedim>
1945  void
1947  SparsityPattern & block_list,
1948  const DoFHandler<dim, spacedim> &dof_handler,
1949  const unsigned int level,
1950  const std::vector<bool> & selected_dofs = std::vector<bool>(),
1951  const types::global_dof_index offset = 0);
1952 
2004  template <typename DoFHandlerType>
2005  std::vector<unsigned int>
2006  make_vertex_patches(SparsityPattern & block_list,
2007  const DoFHandlerType &dof_handler,
2008  const unsigned int level,
2009  const bool interior_dofs_only,
2010  const bool boundary_patches = false,
2011  const bool level_boundary_patches = false,
2012  const bool single_cell_patches = false,
2013  const bool invert_vertex_mapping = false);
2014 
2029  template <typename DoFHandlerType>
2030  std::vector<unsigned int>
2031  make_vertex_patches(SparsityPattern & block_list,
2032  const DoFHandlerType &dof_handler,
2033  const unsigned int level,
2034  const BlockMask & exclude_boundary_dofs = BlockMask(),
2035  const bool boundary_patches = false,
2036  const bool level_boundary_patches = false,
2037  const bool single_cell_patches = false,
2038  const bool invert_vertex_mapping = false);
2039 
2077  template <typename DoFHandlerType>
2078  void
2079  make_child_patches(SparsityPattern & block_list,
2080  const DoFHandlerType &dof_handler,
2081  const unsigned int level,
2082  const bool interior_dofs_only,
2083  const bool boundary_dofs = false);
2084 
2104  template <typename DoFHandlerType>
2105  void
2106  make_single_patch(SparsityPattern & block_list,
2107  const DoFHandlerType &dof_handler,
2108  const unsigned int level,
2109  const bool interior_dofs_only = false);
2110 
2153  template <typename DoFHandlerType>
2154  void
2156  const DoFHandlerType & dof_handler,
2157  std::vector<types::global_dof_index> &dofs_per_component,
2158  const bool vector_valued_once = false,
2159  std::vector<unsigned int> target_component = std::vector<unsigned int>());
2160 
2177  template <typename DoFHandlerType>
2178  void
2179  count_dofs_per_block(const DoFHandlerType & dof,
2180  std::vector<types::global_dof_index> &dofs_per_block,
2181  const std::vector<unsigned int> & target_block =
2182  std::vector<unsigned int>());
2183 
2194  template <typename DoFHandlerType>
2195  void
2196  get_active_fe_indices(const DoFHandlerType & dof_handler,
2197  std::vector<unsigned int> &active_fe_indices);
2198 
2233  template <typename DoFHandlerType>
2234  unsigned int
2236  const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2237 
2260  template <typename DoFHandlerType>
2261  void
2262  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2263  std::vector<types::global_dof_index> &mapping);
2264 
2275  template <typename DoFHandlerType>
2276  void
2277  map_dof_to_boundary_indices(const DoFHandlerType & dof_handler,
2278  const std::set<types::boundary_id> &boundary_ids,
2279  std::vector<types::global_dof_index> &mapping);
2280 
2298  template <int dim, int spacedim>
2299  void
2301  const DoFHandler<dim, spacedim> &dof_handler,
2302  std::vector<Point<spacedim>> & support_points);
2303 
2308  template <int dim, int spacedim>
2309  void
2311  const ::hp::MappingCollection<dim, spacedim> &mapping,
2312  const hp::DoFHandler<dim, spacedim> & dof_handler,
2313  std::vector<Point<spacedim>> & support_points);
2314 
2342  template <int dim, int spacedim>
2343  void
2345  const Mapping<dim, spacedim> & mapping,
2346  const DoFHandler<dim, spacedim> & dof_handler,
2347  std::map<types::global_dof_index, Point<spacedim>> &support_points);
2348 
2352  template <int dim, int spacedim>
2353  void
2355  const ::hp::MappingCollection<dim, spacedim> &mapping,
2356  const hp::DoFHandler<dim, spacedim> & dof_handler,
2357  std::map<types::global_dof_index, Point<spacedim>> &support_points);
2358 
2359 
2380  template <typename DoFHandlerType, class Comp>
2381  void
2384  & mapping,
2385  const DoFHandlerType &dof_handler,
2388  Comp> & point_to_index_map);
2426  template <typename DoFHandlerType, typename Number>
2427  void
2428  distribute_cell_to_dof_vector(const DoFHandlerType &dof_handler,
2429  const Vector<Number> &cell_data,
2430  Vector<double> & dof_data,
2431  const unsigned int component = 0);
2432 
2433 
2510  template <int spacedim>
2511  void
2513  std::ostream & out,
2514  const std::map<types::global_dof_index, Point<spacedim>> &support_points);
2515 
2516 
2557  template <int dim,
2558  int spacedim,
2559  template <int, int> class DoFHandlerType,
2560  typename number>
2561  void
2563  const DoFHandlerType<dim, spacedim> &dof,
2564  const types::boundary_id boundary_id,
2565  AffineConstraints<number> & zero_boundary_constraints,
2566  const ComponentMask & component_mask = ComponentMask());
2567 
2578  template <int dim,
2579  int spacedim,
2580  template <int, int> class DoFHandlerType,
2581  typename number>
2582  void
2584  const DoFHandlerType<dim, spacedim> &dof,
2585  AffineConstraints<number> & zero_boundary_constraints,
2586  const ComponentMask & component_mask = ComponentMask());
2587 
2632 } // namespace DoFTools
2633 
2634 
2635 
2636 /* ------------------------- inline functions -------------- */
2637 
2638 #ifndef DOXYGEN
2639 
2640 namespace DoFTools
2641 {
2647  inline Coupling
2648  operator|=(Coupling &c1, const Coupling c2)
2649  {
2650  if (c2 == always)
2651  c1 = always;
2652  else if (c1 != always && c2 == nonzero)
2653  return c1 = nonzero;
2654  return c1;
2655  }
2656 
2657 
2663  inline Coupling
2664  operator|(const Coupling c1, const Coupling c2)
2665  {
2666  if (c1 == always || c2 == always)
2667  return always;
2668  if (c1 == nonzero || c2 == nonzero)
2669  return nonzero;
2670  return none;
2671  }
2672 
2673 
2674  // ---------------------- inline and template functions --------------------
2675 
2676  template <int dim, int spacedim>
2677  inline unsigned int
2679  {
2680  return dh.get_fe().dofs_per_cell;
2681  }
2682 
2683 
2684  template <int dim, int spacedim>
2685  inline unsigned int
2687  {
2688  return dh.get_fe().dofs_per_face;
2689  }
2690 
2691 
2692  template <int dim, int spacedim>
2693  inline unsigned int
2695  {
2696  return dh.get_fe().dofs_per_vertex;
2697  }
2698 
2699 
2700  template <int dim, int spacedim>
2701  inline unsigned int
2703  {
2704  return dh.get_fe().n_components();
2705  }
2706 
2707 
2708 
2709  template <int dim, int spacedim>
2710  inline bool
2712  {
2713  return dh.get_fe().is_primitive();
2714  }
2715 
2716 
2717  template <int dim, int spacedim>
2718  inline unsigned int
2720  {
2721  return dh.get_fe_collection().max_dofs_per_cell();
2722  }
2723 
2724 
2725  template <int dim, int spacedim>
2726  inline unsigned int
2728  {
2729  return dh.get_fe_collection().max_dofs_per_face();
2730  }
2731 
2732 
2733  template <int dim, int spacedim>
2734  inline unsigned int
2736  {
2737  return dh.get_fe_collection().max_dofs_per_vertex();
2738  }
2739 
2740 
2741  template <int dim, int spacedim>
2742  inline unsigned int
2744  {
2745  return dh.get_fe(0).n_components();
2746  }
2747 
2748 
2749  template <int dim, int spacedim>
2750  inline bool
2752  {
2753  return dh.get_fe(0).is_primitive();
2754  }
2755 
2756 
2757  template <typename DoFHandlerType, class Comp>
2758  void
2761  & mapping,
2762  const DoFHandlerType &dof_handler,
2765  Comp> & point_to_index_map)
2766  {
2767  // let the checking of arguments be
2768  // done by the function first
2769  // called
2770  std::vector<Point<DoFHandlerType::space_dimension>> support_points(
2771  dof_handler.n_dofs());
2772  map_dofs_to_support_points(mapping, dof_handler, support_points);
2773  // now copy over the results of the
2774  // previous function into the
2775  // output arg
2776  point_to_index_map.clear();
2777  for (types::global_dof_index i = 0; i < dof_handler.n_dofs(); ++i)
2778  point_to_index_map[support_points[i]] = i;
2779  }
2780 } // namespace DoFTools
2781 
2782 #endif
2783 
2784 DEAL_II_NAMESPACE_CLOSE
2785 
2786 #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:2316
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:2511
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:1345
const types::subdomain_id invalid_subdomain_id
Definition: types.h:255
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 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=std::vector< unsigned int >())
Definition: dof_tools.cc:1873
void make_periodicity_constraints(const FaceIterator &face_1, const typename identity< FaceIterator >::type &face_2, AffineConstraints< double > &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 >())
void get_subdomain_association(const DoFHandlerType &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1522
std::vector< types::global_dof_index > get_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2790
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())
unsigned int count_dofs_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1621
void map_dof_to_boundary_indices(const DoFHandlerType &dof_handler, std::vector< types::global_dof_index > &mapping)
Definition: dof_tools.cc:2057
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:1185
void make_hanging_node_constraints(const DoFHandlerType &dof_handler, AffineConstraints< number > &constraints)
unsigned long long int global_dof_index
Definition: types.h:72
IndexSet dof_indices_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1637
void make_sparsity_pattern(const DoFHandlerType &dof_row, const DoFHandlerType &dof_col, SparsityPatternType &sparsity)
UpdateFlags operator|(const UpdateFlags f1, const UpdateFlags f2)
Definition: tria.h:81
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:2387
static::ExceptionBase & ExcGridNotCoarser()
void extract_locally_owned_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1093
Abstract base class for mapping classes.
Definition: dof_tools.h:57
void make_cell_patches(SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const std::vector< bool > &selected_dofs=std::vector< bool >(), const types::global_dof_index offset=0)
Definition: dof_tools.cc:2418
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)
unsigned int max_dofs_per_cell(const DoFHandler< dim, spacedim > &dh)
#define DeclException0(Exception0)
Definition: exceptions.h:385
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:2238
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)
const hp::FECollection< dim, spacedim > & get_fe() const
void extract_locally_relevant_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1143
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:591
void extract_hanging_node_dofs(const DoFHandler< dim, spacedim > &dof_handler, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:1034
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:730
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:2583
Definition: hp.h:102
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:1234
std::vector< IndexSet > locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1445
void extract_locally_active_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:1105
void extract_dofs(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:402
void extract_subdomain_dofs(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:1060
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:1969
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
unsigned int count_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2761
static::ExceptionBase & ExcInvalidBoundaryIndicator()
const hp::FECollection< dim, spacedim > & get_fe_collection() const
Definition: table.h:37
void extract_level_dofs(const unsigned int level, const DoFHandlerType &dof, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:520
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:1330
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:111
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:817
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:2464