16 #ifndef dealii_dof_tools_h
17 #define dealii_dof_tools_h
45 template <
int dim,
typename RangeNumberType>
47 template <
int dim,
int spacedim>
51 template <
int dim,
int spacedim>
52 class MappingCollection;
53 template <
int dim,
int spacedim>
56 template <
class MeshType>
58 template <
int dim,
int spacedim>
61 template <
int dim,
class T>
63 template <
typename Number>
68 template <
typename CellIterator>
69 struct PeriodicFacePair;
82 template <
typename DoFHandlerType>
84 always_couple_on_faces(
85 const typename DoFHandlerType::active_cell_iterator &,
261 template <
int dim,
int spacedim>
276 template <
int dim,
int spacedim>
287 template <
int dim,
int spacedim>
300 template <
int dim,
int spacedim>
301 std::vector<Table<2, Coupling>>
323 template <
int dim,
int spacedim>
334 template <
int dim,
int spacedim>
349 template <
int dim,
int spacedim>
363 template <
int dim,
int spacedim>
377 template <
int dim,
int spacedim>
391 template <
int dim,
int spacedim>
406 template <
int dim,
int spacedim>
421 template <
int dim,
int spacedim>
436 template <
int dim,
int spacedim>
451 template <
int dim,
int spacedim>
580 template <
typename DoFHandlerType,
581 typename SparsityPatternType,
582 typename number =
double>
585 const DoFHandlerType & dof_handler,
586 SparsityPatternType & sparsity_pattern,
588 const bool keep_constrained_dofs =
true,
656 template <
typename DoFHandlerType,
657 typename SparsityPatternType,
658 typename number =
double>
661 const DoFHandlerType & dof_handler,
663 SparsityPatternType & sparsity_pattern,
665 const bool keep_constrained_dofs =
true,
688 template <
typename DoFHandlerType,
typename SparsityPatternType>
691 const DoFHandlerType &dof_col,
692 SparsityPatternType & sparsity);
739 template <
typename DoFHandlerType,
typename SparsityPatternType>
742 SparsityPatternType & sparsity_pattern);
752 template <
typename DoFHandlerType,
753 typename SparsityPatternType,
757 const DoFHandlerType & dof_handler,
758 SparsityPatternType & sparsity_pattern,
760 const bool keep_constrained_dofs =
true,
783 template <
typename DoFHandlerType,
typename SparsityPatternType>
786 const DoFHandlerType & dof,
787 SparsityPatternType & sparsity,
819 template <
typename DoFHandlerType,
820 typename SparsityPatternType,
824 const DoFHandlerType & dof,
825 SparsityPatternType & sparsity,
827 const bool keep_constrained_dofs,
832 bool(
const typename DoFHandlerType::active_cell_iterator &,
833 const unsigned int)> &face_has_flux_coupling =
834 &internal::always_couple_on_faces<DoFHandlerType>);
845 template <
typename DoFHandlerType,
typename SparsityPatternType>
848 const DoFHandlerType & dof,
849 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
850 SparsityPatternType & sparsity_pattern);
869 template <
typename DoFHandlerType,
870 typename SparsityPatternType,
874 const DoFHandlerType &dof,
878 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
879 SparsityPatternType & sparsity);
931 template <
typename DoFHandlerType,
typename number>
1003 template <
int dim,
int spacedim>
1007 const unsigned int coarse_component,
1009 const unsigned int fine_component,
1030 template <
int dim,
int spacedim>
1034 const unsigned int coarse_component,
1036 const unsigned int fine_component,
1038 std::vector<std::map<types::global_dof_index, float>>
1039 &transfer_representation);
1217 template <
typename FaceIterator,
typename number>
1220 const FaceIterator & face_1,
1224 const bool face_orientation =
true,
1225 const bool face_flip =
false,
1226 const bool face_rotation =
false,
1228 const std::vector<unsigned int> &first_vector_components =
1229 std::vector<unsigned int>(),
1230 const number periodicity_factor = 1.);
1255 template <
typename DoFHandlerType,
typename number>
1263 const std::vector<unsigned int> &first_vector_components =
1264 std::vector<unsigned int>(),
1265 const number periodicity_factor = 1.);
1300 template <
typename DoFHandlerType,
typename number>
1303 const DoFHandlerType & dof_handler,
1306 const unsigned int direction,
1309 const number periodicity_factor = 1.);
1338 template <
typename DoFHandlerType,
typename number>
1341 const DoFHandlerType & dof_handler,
1343 const unsigned int direction,
1346 const number periodicity_factor = 1.);
1375 template <
int dim,
int spacedim>
1378 std::vector<bool> & selected_dofs);
1384 template <
int dim,
int spacedim>
1430 template <
typename DoFHandlerType>
1434 std::vector<bool> & selected_dofs);
1468 template <
typename DoFHandlerType>
1503 template <
typename DoFHandlerType>
1507 std::vector<bool> & selected_dofs);
1532 template <
typename DoFHandlerType>
1540 template <
typename DoFHandlerType>
1543 const DoFHandlerType &dof,
1545 std::vector<bool> & selected_dofs);
1551 template <
typename DoFHandlerType>
1554 const DoFHandlerType &dof,
1556 std::vector<bool> & selected_dofs);
1610 template <
typename DoFHandlerType>
1614 std::vector<bool> & selected_dofs,
1615 const std::set<types::boundary_id> &boundary_ids =
1616 std::set<types::boundary_id>());
1648 template <
typename DoFHandlerType>
1653 const std::set<types::boundary_id> &boundary_ids =
1654 std::set<types::boundary_id>());
1672 template <
typename DoFHandlerType>
1675 const DoFHandlerType & dof_handler,
1677 std::vector<bool> & selected_dofs,
1678 const std::set<types::boundary_id> &boundary_ids =
1679 std::set<types::boundary_id>());
1708 template <
typename DoFHandlerType,
typename number =
double>
1711 const DoFHandlerType &dof_handler,
1712 const std::function<
1713 bool(
const typename DoFHandlerType::active_cell_iterator &)> &predicate,
1749 template <
typename DoFHandlerType>
1753 std::vector<std::vector<bool>> &constant_modes);
1769 template <
typename DoFHandlerType>
1773 std::vector<bool> & selected_dofs);
1785 template <
typename DoFHandlerType>
1805 template <
typename DoFHandlerType>
1819 template <
typename DoFHandlerType>
1836 template <
typename DoFHandlerType>
1837 std::vector<IndexSet>
1839 const DoFHandlerType &dof_handler,
1857 template <
typename DoFHandlerType>
1858 std::vector<IndexSet>
1877 template <
typename DoFHandlerType>
1878 std::vector<IndexSet>
1886 template <
typename DoFHandlerType>
1889 const unsigned int level,
1923 template <
typename DoFHandlerType>
1926 std::vector<types::subdomain_id> &subdomain);
1953 template <
typename DoFHandlerType>
1977 template <
typename DoFHandlerType>
1980 const DoFHandlerType & dof_handler,
1982 std::vector<unsigned int> &n_dofs_on_subdomain);
2005 template <
typename DoFHandlerType>
2071 template <
typename DoFHandlerType>
2072 std::vector<types::global_dof_index>
2074 const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2096 template <
int dim,
int spacedim>
2100 const unsigned int level,
2101 const std::vector<bool> & selected_dofs = {},
2155 template <
typename DoFHandlerType>
2156 std::vector<unsigned int>
2158 const DoFHandlerType &dof_handler,
2159 const unsigned int level,
2160 const bool interior_dofs_only,
2161 const bool boundary_patches =
false,
2162 const bool level_boundary_patches =
false,
2163 const bool single_cell_patches =
false,
2164 const bool invert_vertex_mapping =
false);
2180 template <
typename DoFHandlerType>
2181 std::vector<unsigned int>
2183 const DoFHandlerType &dof_handler,
2184 const unsigned int level,
2186 const bool boundary_patches =
false,
2187 const bool level_boundary_patches =
false,
2188 const bool single_cell_patches =
false,
2189 const bool invert_vertex_mapping =
false);
2228 template <
typename DoFHandlerType>
2231 const DoFHandlerType &dof_handler,
2232 const unsigned int level,
2233 const bool interior_dofs_only,
2234 const bool boundary_dofs =
false);
2255 template <
typename DoFHandlerType>
2258 const DoFHandlerType &dof_handler,
2259 const unsigned int level,
2260 const bool interior_dofs_only =
false);
2304 template <
typename DoFHandlerType>
2305 std::vector<types::global_dof_index>
2307 const DoFHandlerType & dof_handler,
2308 const bool vector_valued_once =
false,
2309 const std::vector<unsigned int> &target_component = {});
2315 template <
typename DoFHandlerType>
2318 const DoFHandlerType & dof_handler,
2319 std::vector<types::global_dof_index> &dofs_per_component,
2320 const bool vector_valued_once =
false,
2321 const std::vector<unsigned int> & target_component = {});
2339 template <
typename DoFHandlerType>
2340 std::vector<types::global_dof_index>
2342 const std::vector<unsigned int> &target_block =
2343 std::vector<unsigned int>());
2349 template <
typename DoFHandlerType>
2352 std::vector<types::global_dof_index> &dofs_per_block,
2353 const std::vector<unsigned int> & target_block =
2354 std::vector<unsigned int>());
2366 template <
typename DoFHandlerType>
2369 std::vector<unsigned int> &active_fe_indices);
2405 template <
typename DoFHandlerType>
2408 const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2432 template <
typename DoFHandlerType>
2435 std::vector<types::global_dof_index> &mapping);
2447 template <
typename DoFHandlerType>
2450 const std::set<types::boundary_id> &boundary_ids,
2451 std::vector<types::global_dof_index> &mapping);
2481 template <
int dim,
int spacedim>
2491 template <
int dim,
int spacedim>
2494 const ::hp::MappingCollection<dim, spacedim> &mapping,
2529 template <
int dim,
int spacedim>
2540 template <
int dim,
int spacedim>
2543 const ::hp::MappingCollection<dim, spacedim> &mapping,
2569 template <
typename DoFHandlerType,
class Comp>
2574 const DoFHandlerType &dof_handler,
2577 Comp> & point_to_index_map);
2615 template <
typename DoFHandlerType,
typename Number>
2618 const Vector<Number> &cell_data,
2620 const unsigned int component = 0);
2699 template <
int spacedim>
2748 template <
int,
int>
class DoFHandlerType,
2752 const DoFHandlerType<dim, spacedim> &dof,
2769 template <
int,
int>
class DoFHandlerType,
2773 const DoFHandlerType<dim, spacedim> &dof,
2865 template <
int dim,
int spacedim>
2869 return dh.
get_fe().dofs_per_cell;
2873 template <
int dim,
int spacedim>
2877 return dh.
get_fe().dofs_per_face;
2881 template <
int dim,
int spacedim>
2885 return dh.
get_fe().dofs_per_vertex;
2889 template <
int dim,
int spacedim>
2893 return dh.
get_fe().n_components();
2898 template <
int dim,
int spacedim>
2902 return dh.
get_fe().is_primitive();
2906 template <
int dim,
int spacedim>
2914 template <
int dim,
int spacedim>
2922 template <
int dim,
int spacedim>
2930 template <
int dim,
int spacedim>
2934 return dh.
get_fe(0).n_components();
2938 template <
int dim,
int spacedim>
2942 return dh.
get_fe(0).is_primitive();
2946 template <
typename DoFHandlerType,
class Comp>
2951 const DoFHandlerType &dof_handler,
2954 Comp> & point_to_index_map)
2959 std::vector<Point<DoFHandlerType::space_dimension>> support_points(
2960 dof_handler.n_dofs());
2965 point_to_index_map.clear();
2967 point_to_index_map[support_points[i]] = i;