16 #ifndef dealii_dof_tools_h 17 #define dealii_dof_tools_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/exceptions.h> 23 #include <deal.II/base/index_set.h> 24 #include <deal.II/base/point.h> 26 #include <deal.II/dofs/dof_handler.h> 28 #include <deal.II/fe/component_mask.h> 30 #include <deal.II/hp/dof_handler.h> 32 #include <deal.II/lac/affine_constraints.h> 40 DEAL_II_NAMESPACE_OPEN
43 template <
int dim,
typename RangeNumberType>
45 template <
int dim,
int spacedim>
49 template <
int dim,
int spacedim>
51 template <
int dim,
int spacedim>
54 template <
class MeshType>
56 template <
int dim,
int spacedim>
59 template <
int dim,
class T>
61 template <
typename Number>
66 template <
typename CellIterator>
67 struct PeriodicFacePair;
235 template <
int dim,
int spacedim>
250 template <
int dim,
int spacedim>
261 template <
int dim,
int spacedim>
274 template <
int dim,
int spacedim>
275 std::vector<Table<2, Coupling>>
295 template <
int dim,
int spacedim>
296 DEAL_II_DEPRECATED
unsigned int 306 template <
int dim,
int spacedim>
307 DEAL_II_DEPRECATED
unsigned int 321 template <
int dim,
int spacedim>
322 DEAL_II_DEPRECATED
unsigned int 335 template <
int dim,
int spacedim>
336 DEAL_II_DEPRECATED
unsigned int 349 template <
int dim,
int spacedim>
350 DEAL_II_DEPRECATED
unsigned int 363 template <
int dim,
int spacedim>
364 DEAL_II_DEPRECATED
unsigned int 378 template <
int dim,
int spacedim>
379 DEAL_II_DEPRECATED
unsigned int 393 template <
int dim,
int spacedim>
394 DEAL_II_DEPRECATED
unsigned int 408 template <
int dim,
int spacedim>
409 DEAL_II_DEPRECATED
bool 423 template <
int dim,
int spacedim>
424 DEAL_II_DEPRECATED
bool 552 template <
typename DoFHandlerType,
553 typename SparsityPatternType,
554 typename number =
double>
557 const DoFHandlerType & dof_handler,
558 SparsityPatternType & sparsity_pattern,
560 const bool keep_constrained_dofs =
true,
628 template <
typename DoFHandlerType,
629 typename SparsityPatternType,
630 typename number =
double>
633 const DoFHandlerType & dof_handler,
635 SparsityPatternType & sparsity_pattern,
637 const bool keep_constrained_dofs =
true,
660 template <
typename DoFHandlerType,
typename SparsityPatternType>
663 const DoFHandlerType &dof_col,
664 SparsityPatternType & sparsity);
711 template <
typename DoFHandlerType,
typename SparsityPatternType>
714 SparsityPatternType & sparsity_pattern);
724 template <
typename DoFHandlerType,
725 typename SparsityPatternType,
729 const DoFHandlerType & dof_handler,
730 SparsityPatternType & sparsity_pattern,
732 const bool keep_constrained_dofs =
true,
755 template <
typename DoFHandlerType,
typename SparsityPatternType>
758 const DoFHandlerType & dof,
759 SparsityPatternType & sparsity,
773 template <
typename DoFHandlerType,
774 typename SparsityPatternType,
778 SparsityPatternType & sparsity,
780 const bool keep_constrained_dofs,
794 template <
typename DoFHandlerType,
typename SparsityPatternType>
797 const DoFHandlerType & dof,
798 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
799 SparsityPatternType & sparsity_pattern);
818 template <
typename DoFHandlerType,
819 typename SparsityPatternType,
823 const DoFHandlerType &dof,
827 const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
828 SparsityPatternType & sparsity);
880 template <
typename DoFHandlerType,
typename number>
952 template <
int dim,
int spacedim>
956 const unsigned int coarse_component,
958 const unsigned int fine_component,
979 template <
int dim,
int spacedim>
983 const unsigned int coarse_component,
985 const unsigned int fine_component,
987 std::vector<std::map<types::global_dof_index, float>>
988 &transfer_representation);
1152 template <
typename FaceIterator>
1155 const FaceIterator & face_1,
1156 const typename identity<FaceIterator>::type &face_2,
1159 const bool face_orientation =
true,
1160 const bool face_flip =
false,
1161 const bool face_rotation =
false,
1163 const std::vector<unsigned int> &first_vector_components =
1164 std::vector<unsigned int>());
1189 template <
typename DoFHandlerType>
1197 const std::vector<unsigned int> &first_vector_components =
1198 std::vector<unsigned int>());
1232 template <
typename DoFHandlerType>
1235 const DoFHandlerType & dof_handler,
1238 const int direction,
1268 template <
typename DoFHandlerType>
1271 const DoFHandlerType & dof_handler,
1273 const int direction,
1301 template <
int dim,
int spacedim>
1304 std::vector<bool> & selected_dofs);
1310 template <
int dim,
int spacedim>
1347 template <
int dim,
int spacedim>
1351 std::vector<bool> & selected_dofs);
1356 template <
int dim,
int spacedim>
1360 std::vector<bool> & selected_dofs);
1386 template <
int dim,
int spacedim>
1390 std::vector<bool> & selected_dofs);
1395 template <
int dim,
int spacedim>
1399 std::vector<bool> & selected_dofs);
1405 template <
typename DoFHandlerType>
1408 const DoFHandlerType &dof,
1410 std::vector<bool> & selected_dofs);
1416 template <
typename DoFHandlerType>
1419 const DoFHandlerType &dof,
1421 std::vector<bool> & selected_dofs);
1475 template <
typename DoFHandlerType>
1479 std::vector<bool> & selected_dofs,
1480 const std::set<types::boundary_id> &boundary_ids =
1481 std::set<types::boundary_id>());
1513 template <
typename DoFHandlerType>
1518 const std::set<types::boundary_id> &boundary_ids =
1519 std::set<types::boundary_id>());
1537 template <
typename DoFHandlerType>
1540 const DoFHandlerType & dof_handler,
1542 std::vector<bool> & selected_dofs,
1543 const std::set<types::boundary_id> &boundary_ids =
1544 std::set<types::boundary_id>());
1573 template <
typename DoFHandlerType,
typename number =
double>
1576 const DoFHandlerType &dof_handler,
1577 const std::function<
1578 bool(
const typename DoFHandlerType::active_cell_iterator &)> &predicate,
1614 template <
typename DoFHandlerType>
1618 std::vector<std::vector<bool>> &constant_modes);
1634 template <
typename DoFHandlerType>
1638 std::vector<bool> & selected_dofs);
1650 template <
typename DoFHandlerType>
1651 DEAL_II_DEPRECATED
void 1670 template <
typename DoFHandlerType>
1684 template <
typename DoFHandlerType>
1705 template <
typename DoFHandlerType>
1706 std::vector<IndexSet>
1725 template <
typename DoFHandlerType>
1726 std::vector<IndexSet>
1734 template <
typename DoFHandlerType>
1737 const unsigned int level,
1771 template <
typename DoFHandlerType>
1774 std::vector<types::subdomain_id> &subdomain);
1801 template <
typename DoFHandlerType>
1825 template <
typename DoFHandlerType>
1828 const DoFHandlerType & dof_handler,
1830 std::vector<unsigned int> &n_dofs_on_subdomain);
1853 template <
typename DoFHandlerType>
1919 template <
typename DoFHandlerType>
1920 std::vector<types::global_dof_index>
1922 const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
1944 template <
int dim,
int spacedim>
1949 const unsigned int level,
1950 const std::vector<bool> & selected_dofs = std::vector<bool>(),
2004 template <
typename DoFHandlerType>
2005 std::vector<unsigned int>
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);
2029 template <
typename DoFHandlerType>
2030 std::vector<unsigned int>
2032 const DoFHandlerType &dof_handler,
2033 const unsigned int level,
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);
2077 template <
typename DoFHandlerType>
2080 const DoFHandlerType &dof_handler,
2081 const unsigned int level,
2082 const bool interior_dofs_only,
2083 const bool boundary_dofs =
false);
2104 template <
typename DoFHandlerType>
2107 const DoFHandlerType &dof_handler,
2108 const unsigned int level,
2109 const bool interior_dofs_only =
false);
2153 template <
typename DoFHandlerType>
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>());
2177 template <
typename DoFHandlerType>
2180 std::vector<types::global_dof_index> &dofs_per_block,
2181 const std::vector<unsigned int> & target_block =
2182 std::vector<unsigned int>());
2194 template <
typename DoFHandlerType>
2197 std::vector<unsigned int> &active_fe_indices);
2233 template <
typename DoFHandlerType>
2236 const std::vector<typename DoFHandlerType::active_cell_iterator> &patch);
2260 template <
typename DoFHandlerType>
2263 std::vector<types::global_dof_index> &mapping);
2275 template <
typename DoFHandlerType>
2278 const std::set<types::boundary_id> &boundary_ids,
2279 std::vector<types::global_dof_index> &mapping);
2298 template <
int dim,
int spacedim>
2308 template <
int dim,
int spacedim>
2311 const ::hp::MappingCollection<dim, spacedim> &mapping,
2342 template <
int dim,
int spacedim>
2352 template <
int dim,
int spacedim>
2355 const ::hp::MappingCollection<dim, spacedim> &mapping,
2380 template <
typename DoFHandlerType,
class Comp>
2385 const DoFHandlerType &dof_handler,
2388 Comp> & point_to_index_map);
2426 template <
typename DoFHandlerType,
typename Number>
2431 const unsigned int component = 0);
2510 template <
int spacedim>
2559 template <
int,
int>
class DoFHandlerType,
2563 const DoFHandlerType<dim, spacedim> &dof,
2580 template <
int,
int>
class DoFHandlerType,
2584 const DoFHandlerType<dim, spacedim> &dof,
2652 else if (c1 != always && c2 == nonzero)
2666 if (c1 == always || c2 == always)
2668 if (c1 == nonzero || c2 == nonzero)
2676 template <
int dim,
int spacedim>
2680 return dh.
get_fe().dofs_per_cell;
2684 template <
int dim,
int spacedim>
2688 return dh.
get_fe().dofs_per_face;
2692 template <
int dim,
int spacedim>
2696 return dh.
get_fe().dofs_per_vertex;
2700 template <
int dim,
int spacedim>
2704 return dh.
get_fe().n_components();
2709 template <
int dim,
int spacedim>
2713 return dh.
get_fe().is_primitive();
2717 template <
int dim,
int spacedim>
2725 template <
int dim,
int spacedim>
2733 template <
int dim,
int spacedim>
2741 template <
int dim,
int spacedim>
2745 return dh.
get_fe(0).n_components();
2749 template <
int dim,
int spacedim>
2753 return dh.
get_fe(0).is_primitive();
2757 template <
typename DoFHandlerType,
class Comp>
2762 const DoFHandlerType &dof_handler,
2765 Comp> & point_to_index_map)
2770 std::vector<Point<DoFHandlerType::space_dimension>> support_points(
2771 dof_handler.n_dofs());
2776 point_to_index_map.clear();
2778 point_to_index_map[support_points[i]] = i;
2784 DEAL_II_NAMESPACE_CLOSE
const types::subdomain_id invalid_subdomain_id
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)
static::ExceptionBase & ExcFiniteElementsDontMatch()
void make_zero_boundary_constraints(const DoFHandlerType< dim, spacedim > &dof, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask=ComponentMask())
void make_hanging_node_constraints(const DoFHandlerType &dof_handler, AffineConstraints< number > &constraints)
unsigned long long int global_dof_index
void make_sparsity_pattern(const DoFHandlerType &dof_row, const DoFHandlerType &dof_col, SparsityPatternType &sparsity)
UpdateFlags operator|(const UpdateFlags f1, const UpdateFlags f2)
unsigned int subdomain_id
static::ExceptionBase & ExcGridNotCoarser()
Abstract base class for mapping classes.
void make_boundary_sparsity_pattern(const DoFHandlerType &dof, const std::map< types::boundary_id, const Function< DoFHandlerType::space_dimension, number > * > &boundary_ids, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternType &sparsity)
#define DeclException0(Exception0)
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
UpdateFlags & operator|=(UpdateFlags &f1, const UpdateFlags f2)
const FiniteElement< dim, spacedim > & get_fe(const unsigned int index=0) const
static::ExceptionBase & ExcInvalidBoundaryIndicator()
const hp::FECollection< dim, spacedim > & get_fe_collection() const
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)
static::ExceptionBase & ExcNoFESelected()