Reference documentation for deal.II version 8.4.2
dof_tools.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2016 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 at
12 // the top level of the deal.II distribution.
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 #include <deal.II/base/exceptions.h>
22 #include <deal.II/base/table.h>
23 #include <deal.II/base/index_set.h>
24 #include <deal.II/base/point.h>
25 #include <deal.II/lac/constraint_matrix.h>
26 #include <deal.II/lac/sparsity_pattern.h>
27 #include <deal.II/dofs/function_map.h>
28 #include <deal.II/dofs/dof_handler.h>
29 #include <deal.II/fe/fe.h>
30 #include <deal.II/fe/component_mask.h>
31 #include <deal.II/hp/mapping_collection.h>
32 
33 #include <vector>
34 #include <set>
35 #include <map>
36 
37 DEAL_II_NAMESPACE_OPEN
38 
39 template<int dim, class T> class Table;
40 class SparsityPattern;
41 template <typename number> class Vector;
42 template <int dim, typename Number> class Function;
43 template <int dim, int spacedim> class FiniteElement;
44 template <int dim, int spacedim> class DoFHandler;
45 namespace hp
46 {
47  template <int dim, int spacedim> class DoFHandler;
48  template <int dim, int spacedim> class MappingCollection;
49 }
50 class ConstraintMatrix;
51 template <class MeshType> class InterGridMap;
52 template <int dim, int spacedim> class Mapping;
53 
54 namespace GridTools
55 {
56  template <typename CellIterator> struct PeriodicFacePair;
57 }
58 
59 //TODO: map_support_points_to_dofs should generate a multimap, rather than just a map, since several dofs may be located at the same support point
60 
180 namespace DoFTools
181 {
193  enum Coupling
194  {
198  none,
209  };
210 
221  template <int dim, int spacedim>
222  unsigned int
223  max_dofs_per_cell (const DoFHandler<dim,spacedim> &dh);
224 
230  template <int dim, int spacedim>
231  unsigned int
232  max_dofs_per_cell (const hp::DoFHandler<dim,spacedim> &dh);
233 
234 
243  template <int dim, int spacedim>
244  unsigned int
245  max_dofs_per_face (const DoFHandler<dim,spacedim> &dh);
246 
255  template <int dim, int spacedim>
256  unsigned int
257  max_dofs_per_face (const hp::DoFHandler<dim,spacedim> &dh);
258 
267  template <int dim, int spacedim>
268  unsigned int
269  max_dofs_per_vertex (const DoFHandler<dim,spacedim> &dh);
270 
279  template <int dim, int spacedim>
280  unsigned int
281  max_dofs_per_vertex (const hp::DoFHandler<dim,spacedim> &dh);
282 
292  template <int dim, int spacedim>
293  unsigned int
294  n_components (const DoFHandler<dim,spacedim> &dh);
295 
305  template <int dim, int spacedim>
306  unsigned int
307  n_components (const hp::DoFHandler<dim,spacedim> &dh);
308 
318  template <int dim, int spacedim>
319  bool
320  fe_is_primitive (const DoFHandler<dim,spacedim> &dh);
321 
331  template <int dim, int spacedim>
332  bool
333  fe_is_primitive (const hp::DoFHandler<dim,spacedim> &dh);
334 
459  template <typename DoFHandlerType, typename SparsityPatternType>
460  void
461  make_sparsity_pattern (const DoFHandlerType &dof_handler,
462  SparsityPatternType &sparsity_pattern,
463  const ConstraintMatrix &constraints = ConstraintMatrix(),
464  const bool keep_constrained_dofs = true,
466 
532  template <typename DoFHandlerType, typename SparsityPatternType>
533  void
534  make_sparsity_pattern (const DoFHandlerType &dof_handler,
535  const Table<2, Coupling> &coupling,
536  SparsityPatternType &sparsity_pattern,
537  const ConstraintMatrix &constraints = ConstraintMatrix(),
538  const bool keep_constrained_dofs = true,
540 
561  template <typename DoFHandlerType, typename SparsityPatternType>
562  void
563  make_sparsity_pattern (const DoFHandlerType &dof_row,
564  const DoFHandlerType &dof_col,
565  SparsityPatternType &sparsity);
566 
612  template<typename DoFHandlerType, typename SparsityPatternType>
613  void
614  make_flux_sparsity_pattern (const DoFHandlerType &dof_handler,
615  SparsityPatternType &sparsity_pattern);
616 
625  template<typename DoFHandlerType, typename SparsityPatternType>
626  void
627  make_flux_sparsity_pattern (const DoFHandlerType &dof_handler,
628  SparsityPatternType &sparsity_pattern,
629  const ConstraintMatrix &constraints,
630  const bool keep_constrained_dofs = true,
632 
652  template <typename DoFHandlerType, typename SparsityPatternType>
653  void
654  make_flux_sparsity_pattern (const DoFHandlerType &dof,
655  SparsityPatternType &sparsity,
656  const Table<2,Coupling> &cell_integrals_mask,
657  const Table<2,Coupling> &face_integrals_mask);
658 
668  template <typename DoFHandlerType, typename SparsityPatternType>
669  void
670  make_boundary_sparsity_pattern (const DoFHandlerType &dof,
671  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
672  SparsityPatternType &sparsity_pattern);
673 
690  template <typename DoFHandlerType, typename SparsityPatternType>
691  void
693  (const DoFHandlerType &dof,
694  const typename FunctionMap<DoFHandlerType::space_dimension>::type &boundary_ids,
695  const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
696  SparsityPatternType &sparsity);
697 
744  template <typename DoFHandlerType>
745  void
746  make_hanging_node_constraints (const DoFHandlerType &dof_handler,
747  ConstraintMatrix &constraints);
748 
816  template <int dim, int spacedim>
817  void
819  const unsigned int coarse_component,
820  const DoFHandler<dim,spacedim> &fine_grid,
821  const unsigned int fine_component,
822  const InterGridMap<DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
823  ConstraintMatrix &constraints);
824 
825 
842  template <int dim, int spacedim>
843  void
845  const unsigned int coarse_component,
846  const DoFHandler<dim,spacedim> &fine_grid,
847  const unsigned int fine_component,
848  const InterGridMap<DoFHandler<dim,spacedim> > &coarse_to_fine_grid_map,
849  std::vector<std::map<types::global_dof_index, float> > &transfer_representation);
850 
1010  template<typename FaceIterator>
1011  void
1013  (const FaceIterator &face_1,
1014  const typename identity<FaceIterator>::type &face_2,
1015  ::ConstraintMatrix &constraint_matrix,
1016  const ComponentMask &component_mask = ComponentMask(),
1017  const bool face_orientation = true,
1018  const bool face_flip = false,
1019  const bool face_rotation = false,
1020  const FullMatrix<double> &matrix = FullMatrix<double>(),
1021  const std::vector<unsigned int> &first_vector_components = std::vector<unsigned int>());
1022 
1023 
1024 
1046  template<typename DoFHandlerType>
1047  void
1050  &periodic_faces,
1051  ::ConstraintMatrix &constraint_matrix,
1052  const ComponentMask &component_mask = ComponentMask(),
1053  const std::vector<unsigned int> &first_vector_components = std::vector<unsigned int>());
1054 
1055 
1056 
1087  template<typename DoFHandlerType>
1088  void
1090  (const DoFHandlerType &dof_handler,
1091  const types::boundary_id b_id1,
1092  const types::boundary_id b_id2,
1093  const int direction,
1094  ::ConstraintMatrix &constraint_matrix,
1095  const ComponentMask &component_mask = ComponentMask());
1096 
1097 
1098 
1123  template<typename DoFHandlerType>
1124  void
1126  (const DoFHandlerType &dof_handler,
1127  const types::boundary_id b_id,
1128  const int direction,
1129  ::ConstraintMatrix &constraint_matrix,
1130  const ComponentMask &component_mask = ComponentMask());
1131 
1160  template <typename DoFHandlerType, typename Number>
1161  void
1162  distribute_cell_to_dof_vector (const DoFHandlerType &dof_handler,
1163  const Vector<Number> &cell_data,
1164  Vector<double> &dof_data,
1165  const unsigned int component = 0);
1166 
1201  template <int dim, int spacedim>
1202  void
1203  extract_dofs (const DoFHandler<dim,spacedim> &dof_handler,
1204  const ComponentMask &component_mask,
1205  std::vector<bool> &selected_dofs);
1206 
1210  template <int dim, int spacedim>
1211  void
1212  extract_dofs (const hp::DoFHandler<dim,spacedim> &dof_handler,
1213  const ComponentMask &component_mask,
1214  std::vector<bool> &selected_dofs);
1215 
1234  template <int dim, int spacedim>
1235  void
1236  extract_dofs (const DoFHandler<dim,spacedim> &dof_handler,
1237  const BlockMask &block_mask,
1238  std::vector<bool> &selected_dofs);
1239 
1243  template <int dim, int spacedim>
1244  void
1245  extract_dofs (const hp::DoFHandler<dim,spacedim> &dof_handler,
1246  const BlockMask &block_mask,
1247  std::vector<bool> &selected_dofs);
1248 
1253  template <typename DoFHandlerType>
1254  void
1255  extract_level_dofs (const unsigned int level,
1256  const DoFHandlerType &dof,
1257  const ComponentMask &component_mask,
1258  std::vector<bool> &selected_dofs);
1259 
1264  template <typename DoFHandlerType>
1265  void
1266  extract_level_dofs (const unsigned int level,
1267  const DoFHandlerType &dof,
1268  const BlockMask &component_mask,
1269  std::vector<bool> &selected_dofs);
1270 
1321  template <typename DoFHandlerType>
1322  void
1323  extract_boundary_dofs (const DoFHandlerType &dof_handler,
1324  const ComponentMask &component_mask,
1325  std::vector<bool> &selected_dofs,
1326  const std::set<types::boundary_id> &boundary_ids = std::set<types::boundary_id>());
1327 
1358  template <typename DoFHandlerType>
1359  void
1360  extract_boundary_dofs (const DoFHandlerType &dof_handler,
1361  const ComponentMask &component_mask,
1362  IndexSet &selected_dofs,
1363  const std::set<types::boundary_id> &boundary_ids = std::set<types::boundary_id>());
1364 
1381  template <typename DoFHandlerType>
1382  void
1383  extract_dofs_with_support_on_boundary (const DoFHandlerType &dof_handler,
1384  const ComponentMask &component_mask,
1385  std::vector<bool> &selected_dofs,
1386  const std::set<types::boundary_id> &boundary_ids = std::set<types::boundary_id>());
1387 
1421  template <typename DoFHandlerType>
1422  void
1423  extract_constant_modes (const DoFHandlerType &dof_handler,
1424  const ComponentMask &component_mask,
1425  std::vector<std::vector<bool> > &constant_modes);
1426 
1442  template <int dim, int spacedim>
1443  void
1445  std::vector<bool> &selected_dofs);
1447 
1461  template <typename DoFHandlerType>
1462  void
1463  extract_subdomain_dofs (const DoFHandlerType &dof_handler,
1464  const types::subdomain_id subdomain_id,
1465  std::vector<bool> &selected_dofs);
1466 
1467 
1474  template <typename DoFHandlerType>
1475  void
1476  extract_locally_owned_dofs (const DoFHandlerType &dof_handler,
1477  IndexSet &dof_set);
1478 
1479 
1494  template <typename DoFHandlerType>
1495  void
1496  extract_locally_active_dofs (const DoFHandlerType &dof_handler,
1497  IndexSet &dof_set);
1498 
1508  template <typename DoFHandlerType>
1509  void
1510  extract_locally_relevant_dofs (const DoFHandlerType &dof_handler,
1511  IndexSet &dof_set);
1512 
1529  template <typename DoFHandlerType>
1530  std::vector<IndexSet>
1531  locally_owned_dofs_per_subdomain (const DoFHandlerType &dof_handler);
1532 
1549  template <typename DoFHandlerType>
1550  std::vector<IndexSet>
1551  locally_relevant_dofs_per_subdomain (const DoFHandlerType &dof_handler);
1552 
1553 
1558  template <typename DoFHandlerType>
1559  void
1560  extract_locally_relevant_level_dofs (const DoFHandlerType &dof_handler,
1561  const unsigned int level,
1562  IndexSet &dof_set);
1563 
1564 
1595  template <typename DoFHandlerType>
1596  void
1597  get_subdomain_association (const DoFHandlerType &dof_handler,
1598  std::vector<types::subdomain_id> &subdomain);
1599 
1625  template <typename DoFHandlerType>
1626  unsigned int
1627  count_dofs_with_subdomain_association (const DoFHandlerType &dof_handler,
1628  const types::subdomain_id subdomain);
1629 
1649  template <typename DoFHandlerType>
1650  void
1651  count_dofs_with_subdomain_association (const DoFHandlerType &dof_handler,
1652  const types::subdomain_id subdomain,
1653  std::vector<unsigned int> &n_dofs_on_subdomain);
1654 
1675  template <typename DoFHandlerType>
1676  IndexSet
1677  dof_indices_with_subdomain_association (const DoFHandlerType &dof_handler,
1678  const types::subdomain_id subdomain);
1679  // @}
1700  template <typename DoFHandlerType, class Sparsity>
1701  void make_cell_patches(Sparsity &block_list,
1702  const DoFHandlerType &dof_handler,
1703  const unsigned int level,
1704  const std::vector<bool> &selected_dofs = std::vector<bool>(),
1705  types::global_dof_index offset = 0);
1706 
1745  template <typename DoFHandlerType>
1746  void make_vertex_patches(SparsityPattern &block_list,
1747  const DoFHandlerType &dof_handler,
1748  const unsigned int level,
1749  const bool interior_dofs_only,
1750  const bool boundary_patches = false,
1751  const bool level_boundary_patches = false,
1752  const bool single_cell_patches = false);
1753 
1791  template <typename DoFHandlerType>
1792  void make_child_patches(SparsityPattern &block_list,
1793  const DoFHandlerType &dof_handler,
1794  const unsigned int level,
1795  const bool interior_dofs_only,
1796  const bool boundary_dofs = false);
1797 
1817  template <typename DoFHandlerType>
1818  void make_single_patch(SparsityPattern &block_list,
1819  const DoFHandlerType &dof_handler,
1820  const unsigned int level,
1821  const bool interior_dofs_only = false);
1822 
1865  template <typename DoFHandlerType>
1866  void
1867  count_dofs_per_component (const DoFHandlerType &dof_handler,
1868  std::vector<types::global_dof_index> &dofs_per_component,
1869  const bool vector_valued_once = false,
1870  std::vector<unsigned int> target_component
1871  = std::vector<unsigned int>());
1872 
1889  template <typename DoFHandlerType>
1890  void
1891  count_dofs_per_block (const DoFHandlerType &dof,
1892  std::vector<types::global_dof_index> &dofs_per_block,
1893  const std::vector<unsigned int> &target_block
1894  = std::vector<unsigned int>());
1895 
1906  template <typename DoFHandlerType>
1907  void
1908  get_active_fe_indices (const DoFHandlerType &dof_handler,
1909  std::vector<unsigned int> &active_fe_indices);
1910 
1945  template <typename DoFHandlerType>
1946  unsigned int
1947  count_dofs_on_patch (const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1948 
2000  template <typename DoFHandlerType>
2001  std::vector<types::global_dof_index>
2002  get_dofs_on_patch (const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2003 
2021  template <typename DoFHandlerType>
2022  void
2023  map_dof_to_boundary_indices (const DoFHandlerType &dof_handler,
2024  std::vector<types::global_dof_index> &mapping);
2025 
2036  template <typename DoFHandlerType>
2037  void
2038  map_dof_to_boundary_indices (const DoFHandlerType &dof_handler,
2039  const std::set<types::boundary_id> &boundary_ids,
2040  std::vector<types::global_dof_index> &mapping);
2041 
2059  template <int dim, int spacedim>
2060  void
2062  const DoFHandler<dim,spacedim> &dof_handler,
2063  std::vector<Point<spacedim> > &support_points);
2064 
2069  template <int dim, int spacedim>
2070  void
2071  map_dofs_to_support_points (const ::hp::MappingCollection<dim,spacedim> &mapping,
2072  const hp::DoFHandler<dim,spacedim> &dof_handler,
2073  std::vector<Point<spacedim> > &support_points);
2074 
2102  template <int dim, int spacedim>
2103  void
2105  const DoFHandler<dim,spacedim> &dof_handler,
2106  std::map<types::global_dof_index, Point<spacedim> > &support_points);
2107 
2111  template <int dim, int spacedim>
2112  void
2113  map_dofs_to_support_points (const ::hp::MappingCollection<dim,spacedim> &mapping,
2114  const hp::DoFHandler<dim,spacedim> &dof_handler,
2115  std::map<types::global_dof_index, Point<spacedim> > &support_points);
2116 
2117 
2133  template <typename DoFHandlerType, class Comp>
2134  void
2137  const DoFHandlerType &dof_handler,
2138  std::map<Point<DoFHandlerType::space_dimension>, types::global_dof_index, Comp> &point_to_index_map);
2139 
2149  template <int dim, int spacedim>
2150  void
2152  const Table<2, Coupling> &table_by_component,
2153  std::vector<Table<2,Coupling> > &tables_by_block);
2154 
2195  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2196  void
2197  make_zero_boundary_constraints (const DoFHandlerType<dim,spacedim> &dof,
2198  const types::boundary_id boundary_id,
2199  ConstraintMatrix &zero_boundary_constraints,
2200  const ComponentMask &component_mask = ComponentMask());
2201 
2212  template <int dim, int spacedim, template <int, int> class DoFHandlerType>
2213  void
2214  make_zero_boundary_constraints (const DoFHandlerType<dim,spacedim> &dof,
2215  ConstraintMatrix &zero_boundary_constraints,
2216  const ComponentMask &component_mask = ComponentMask());
2217 
2218 
2228  template <int dim, int spacedim>
2229  void
2231  const Table<2, Coupling> &table_by_component,
2232  std::vector<Table<2,Coupling> > &tables_by_block);
2233 
2239  template <int dim, int spacedim>
2242  const Table<2,Coupling> &component_couplings);
2243 
2251  template <int dim, int spacedim>
2252  std::vector<Table<2,Coupling> >
2254  const Table<2,Coupling> &component_couplings);
2260  DeclException0 (ExcFiniteElementsDontMatch);
2266  DeclException0 (ExcGridNotCoarser);
2273  DeclException0 (ExcGridsDontMatch);
2280  DeclException0 (ExcNoFESelected);
2286  DeclException0 (ExcInvalidBoundaryIndicator);
2287 }
2288 
2289 
2290 
2291 /* ------------------------- inline functions -------------- */
2292 
2293 #ifndef DOXYGEN
2294 
2295 namespace DoFTools
2296 {
2302  inline
2304  const Coupling c2)
2305  {
2306  if (c2 == always)
2307  c1 = always;
2308  else if (c1 != always && c2 == nonzero)
2309  return c1 = nonzero;
2310  return c1;
2311  }
2312 
2313 
2319  inline
2320  Coupling operator | (const Coupling c1,
2321  const Coupling c2)
2322  {
2323  if (c1 == always || c2 == always)
2324  return always;
2325  if (c1 == nonzero || c2 == nonzero)
2326  return nonzero;
2327  return none;
2328  }
2329 
2330 
2331 // ---------------------- inline and template functions --------------------
2332 
2333  template <int dim, int spacedim>
2334  inline
2335  unsigned int
2336  max_dofs_per_cell (const DoFHandler<dim,spacedim> &dh)
2337  {
2338  return dh.get_fe().dofs_per_cell;
2339  }
2340 
2341 
2342  template <int dim, int spacedim>
2343  inline
2344  unsigned int
2345  max_dofs_per_face (const DoFHandler<dim,spacedim> &dh)
2346  {
2347  return dh.get_fe().dofs_per_face;
2348  }
2349 
2350 
2351  template <int dim, int spacedim>
2352  inline
2353  unsigned int
2354  max_dofs_per_vertex (const DoFHandler<dim,spacedim> &dh)
2355  {
2356  return dh.get_fe().dofs_per_vertex;
2357  }
2358 
2359 
2360  template <int dim, int spacedim>
2361  inline
2362  unsigned int
2363  n_components (const DoFHandler<dim,spacedim> &dh)
2364  {
2365  return dh.get_fe().n_components();
2366  }
2367 
2368 
2369 
2370  template <int dim, int spacedim>
2371  inline
2372  bool
2373  fe_is_primitive (const DoFHandler<dim,spacedim> &dh)
2374  {
2375  return dh.get_fe().is_primitive();
2376  }
2377 
2378 
2379  template <int dim, int spacedim>
2380  inline
2381  unsigned int
2382  max_dofs_per_cell (const hp::DoFHandler<dim,spacedim> &dh)
2383  {
2384  return dh.get_fe().max_dofs_per_cell ();
2385  }
2386 
2387 
2388  template <int dim, int spacedim>
2389  inline
2390  unsigned int
2391  max_dofs_per_face (const hp::DoFHandler<dim,spacedim> &dh)
2392  {
2393  return dh.get_fe().max_dofs_per_face ();
2394  }
2395 
2396 
2397  template <int dim, int spacedim>
2398  inline
2399  unsigned int
2400  max_dofs_per_vertex (const hp::DoFHandler<dim,spacedim> &dh)
2401  {
2402  return dh.get_fe().max_dofs_per_vertex ();
2403  }
2404 
2405 
2406  template <int dim, int spacedim>
2407  inline
2408  unsigned int
2409  n_components (const hp::DoFHandler<dim,spacedim> &dh)
2410  {
2411  return dh.get_fe()[0].n_components();
2412  }
2413 
2414 
2415  template <int dim, int spacedim>
2416  inline
2417  bool
2418  fe_is_primitive (const hp::DoFHandler<dim,spacedim> &dh)
2419  {
2420  return dh.get_fe()[0].is_primitive();
2421  }
2422 
2423 
2424  template <typename DoFHandlerType, class Comp>
2425  void
2427  (
2429  const DoFHandlerType &dof_handler,
2430  std::map<Point<DoFHandlerType::space_dimension>, types::global_dof_index, Comp> &point_to_index_map)
2431  {
2432  // let the checking of arguments be
2433  // done by the function first
2434  // called
2435  std::vector<Point<DoFHandlerType::space_dimension> > support_points (dof_handler.n_dofs());
2436  map_dofs_to_support_points (mapping, dof_handler, support_points);
2437  // now copy over the results of the
2438  // previous function into the
2439  // output arg
2440  point_to_index_map.clear ();
2441  for (types::global_dof_index i=0; i<dof_handler.n_dofs(); ++i)
2442  point_to_index_map[support_points[i]] = i;
2443  }
2444 }
2445 
2446 #endif
2447 
2448 DEAL_II_NAMESPACE_CLOSE
2449 
2450 #endif
void 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)
Definition: dof_tools.cc:2178
static const unsigned int invalid_unsigned_int
Definition: types.h:164
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:2113
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)
std::vector< IndexSet > locally_owned_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1130
const types::subdomain_id invalid_subdomain_id
Definition: types.h:239
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:1575
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:1901
void get_subdomain_association(const DoFHandlerType &dof_handler, std::vector< types::subdomain_id > &subdomain)
Definition: dof_tools.cc:1252
std::vector< types::global_dof_index > get_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2324
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)
unsigned int count_dofs_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1343
const FiniteElement< dim, spacedim > & get_fe() const
void map_dof_to_boundary_indices(const DoFHandlerType &dof_handler, std::vector< types::global_dof_index > &mapping)
Definition: dof_tools.cc:1740
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:983
IndexSet dof_indices_with_subdomain_association(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain)
Definition: dof_tools.cc:1358
void make_sparsity_pattern(const DoFHandlerType &dof_row, const DoFHandlerType &dof_col, SparsityPatternType &sparsity)
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, ConstraintMatrix &constraints)
const hp::FECollection< dim, spacedim > & get_fe() const
void make_hanging_node_constraints(const DoFHandlerType &dof_handler, ConstraintMatrix &constraints)
unsigned int global_dof_index
Definition: types.h:88
void extract_locally_owned_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:896
Abstract base class for mapping classes.
Definition: dof_tools.h:52
#define DeclException0(Exception0)
Definition: exceptions.h:522
UpdateFlags operator|(UpdateFlags f1, UpdateFlags f2)
std::map< types::boundary_id, const Function< dim, Number > * > type
Definition: function_map.h:81
void extract_locally_relevant_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:944
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:519
void extract_hanging_node_dofs(const DoFHandler< dim, spacedim > &dof_handler, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:852
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:653
unsigned int subdomain_id
Definition: types.h:42
Definition: hp.h:102
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:2007
std::vector< IndexSet > locally_relevant_dofs_per_subdomain(const DoFHandlerType &dof_handler)
Definition: dof_tools.cc:1189
void extract_locally_active_dofs(const DoFHandlerType &dof_handler, IndexSet &dof_set)
Definition: dof_tools.cc:908
void extract_dofs(const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:336
void make_boundary_sparsity_pattern(const DoFHandlerType &dof, const typename FunctionMap< DoFHandlerType::space_dimension >::type &boundary_ids, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternType &sparsity)
void extract_subdomain_dofs(const DoFHandlerType &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:863
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:1661
void make_flux_sparsity_pattern(const DoFHandlerType &dof, SparsityPatternType &sparsity, const Table< 2, Coupling > &cell_integrals_mask, const Table< 2, Coupling > &face_integrals_mask)
unsigned int count_dofs_on_patch(const std::vector< typename DoFHandlerType::active_cell_iterator > &patch)
Definition: dof_tools.cc:2296
UpdateFlags & operator|=(UpdateFlags &f1, UpdateFlags f2)
void make_cell_patches(Sparsity &block_list, const DoFHandlerType &dof_handler, const unsigned int level, const std::vector< bool > &selected_dofs=std::vector< bool >(), types::global_dof_index offset=0)
Definition: dof_tools.cc:2036
Definition: table.h:33
void make_zero_boundary_constraints(const DoFHandlerType< dim, spacedim > &dof, ConstraintMatrix &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
unsigned char boundary_id
Definition: types.h:110
void extract_level_dofs(const unsigned int level, const DoFHandlerType &dof, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
Definition: dof_tools.cc:453
void make_periodicity_constraints(const FaceIterator &face_1, const typename identity< FaceIterator >::type &face_2, ::ConstraintMatrix &constraint_matrix, 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_active_fe_indices(const DoFHandlerType &dof_handler, std::vector< unsigned int > &active_fe_indices)
Definition: dof_tools.cc:1116
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:254
void extract_constant_modes(const DoFHandlerType &dof_handler, const ComponentMask &component_mask, std::vector< std::vector< bool > > &constant_modes)
Definition: dof_tools.cc:1029
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:2070