deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Namespaces | Enumerations | Functions
dof_tools.h File Reference
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/index_set.h>
#include <deal.II/base/point.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/component_mask.h>
#include <deal.II/lac/affine_constraints.h>
#include <deal.II/lac/sparsity_pattern_base.h>
#include <map>
#include <ostream>
#include <set>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  DoFTools
 
namespace  DoFTools::internal
 

Enumerations

enum  DoFTools::Coupling { DoFTools::none , DoFTools::always , DoFTools::nonzero }
 

Functions

template<typename FaceIterator , typename number >
void DoFTools::internal::set_periodicity_constraints (const FaceIterator &face_1, const std_cxx20::type_identity_t< FaceIterator > &face_2, const FullMatrix< double > &transformation, AffineConstraints< number > &affine_constraints, const ComponentMask &component_mask, const unsigned char combined_orientation, const number periodicity_factor, const unsigned int level=numbers::invalid_unsigned_int)
 
DoF couplings
template<int dim, int spacedim>
void DoFTools::convert_couplings_to_blocks (const DoFHandler< dim, spacedim > &dof_handler, const Table< 2, Coupling > &table_by_component, std::vector< Table< 2, Coupling > > &tables_by_block)
 
template<int dim, int spacedim>
Table< 2, CouplingDoFTools::dof_couplings_from_component_couplings (const FiniteElement< dim, spacedim > &fe, const Table< 2, Coupling > &component_couplings)
 
template<int dim, int spacedim>
std::vector< Table< 2, Coupling > > DoFTools::dof_couplings_from_component_couplings (const hp::FECollection< dim, spacedim > &fe, const Table< 2, Coupling > &component_couplings)
 
Sparsity pattern generation
template<int dim, int spacedim, typename number = double>
void DoFTools::make_sparsity_pattern (const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
 
template<int dim, int spacedim, typename number = double>
void DoFTools::make_sparsity_pattern (const DoFHandler< dim, spacedim > &dof_handler, const Table< 2, Coupling > &coupling, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints={}, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
 
template<int dim, int spacedim>
void DoFTools::make_sparsity_pattern (const DoFHandler< dim, spacedim > &dof_row, const DoFHandler< dim, spacedim > &dof_col, SparsityPatternBase &sparsity)
 
template<int dim, int spacedim>
void DoFTools::make_flux_sparsity_pattern (const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_flux_sparsity_pattern (const DoFHandler< dim, spacedim > &dof_handler, SparsityPatternBase &sparsity_pattern, const AffineConstraints< number > &constraints, const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
 
template<int dim, int spacedim>
void DoFTools::make_flux_sparsity_pattern (const DoFHandler< dim, spacedim > &dof, SparsityPatternBase &sparsity, const Table< 2, Coupling > &cell_integrals_mask, const Table< 2, Coupling > &face_integrals_mask, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_flux_sparsity_pattern (const DoFHandler< dim, spacedim > &dof, SparsityPatternBase &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, const std::function< bool(const typename DoFHandler< dim, spacedim >::active_cell_iterator &, const unsigned int)> &face_has_flux_coupling=&internal::always_couple_on_faces< dim, spacedim >)
 
template<int dim, int spacedim>
void DoFTools::make_boundary_sparsity_pattern (const DoFHandler< dim, spacedim > &dof, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternBase &sparsity_pattern)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_boundary_sparsity_pattern (const DoFHandler< dim, spacedim > &dof, const std::map< types::boundary_id, const Function< spacedim, number > * > &boundary_ids, const std::vector< types::global_dof_index > &dof_to_boundary_mapping, SparsityPatternBase &sparsity)
 
Hanging nodes and other constraints
template<int dim, int spacedim, typename number >
void DoFTools::make_hanging_node_constraints (const DoFHandler< dim, spacedim > &dof_handler, AffineConstraints< number > &constraints)
 
template<int dim, int spacedim>
void DoFTools::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)
 
template<int dim, int spacedim>
void DoFTools::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)
 
Periodic boundary conditions
template<typename FaceIterator , typename number >
void DoFTools::make_periodicity_constraints (const FaceIterator &face_1, const std_cxx20::type_identity_t< FaceIterator > &face_2, AffineConstraints< number > &constraints, const ComponentMask &component_mask={}, const unsigned char combined_orientation=ReferenceCell::default_combined_face_orientation(), const FullMatrix< double > &matrix=FullMatrix< double >(), const std::vector< unsigned int > &first_vector_components=std::vector< unsigned int >(), const number periodicity_factor=1.)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_periodicity_constraints (const std::vector< GridTools::PeriodicFacePair< typename DoFHandler< dim, spacedim >::cell_iterator > > &periodic_faces, AffineConstraints< number > &constraints, const ComponentMask &component_mask={}, const std::vector< unsigned int > &first_vector_components=std::vector< unsigned int >(), const number periodicity_factor=1.)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_periodicity_constraints (const DoFHandler< dim, spacedim > &dof_handler, const types::boundary_id b_id1, const types::boundary_id b_id2, const unsigned int direction, AffineConstraints< number > &constraints, const ComponentMask &component_mask={}, const number periodicity_factor=1.)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_periodicity_constraints (const DoFHandler< dim, spacedim > &dof_handler, const types::boundary_id b_id, const unsigned int direction, AffineConstraints< number > &constraints, const ComponentMask &component_mask={}, const number periodicity_factor=1.)
 
Identifying subsets of degrees of freedom with particular properties
template<int dim, int spacedim>
IndexSet DoFTools::extract_hanging_node_dofs (const DoFHandler< dim, spacedim > &dof_handler)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_dofs (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_dofs (const DoFHandler< dim, spacedim > &dof_handler, const BlockMask &block_mask)
 
template<int dim, int spacedim>
void DoFTools::extract_level_dofs (const unsigned int level, const DoFHandler< dim, spacedim > &dof, const ComponentMask &component_mask, std::vector< bool > &selected_dofs)
 
template<int dim, int spacedim>
void DoFTools::extract_level_dofs (const unsigned int level, const DoFHandler< dim, spacedim > &dof, const BlockMask &component_mask, std::vector< bool > &selected_dofs)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_boundary_dofs (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask={}, const std::set< types::boundary_id > &boundary_ids={})
 
template<int dim, int spacedim>
void DoFTools::extract_dofs_with_support_on_boundary (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< bool > &selected_dofs, const std::set< types::boundary_id > &boundary_ids=std::set< types::boundary_id >())
 
template<int dim, int spacedim, typename number = double>
IndexSet DoFTools::extract_dofs_with_support_contained_within (const DoFHandler< dim, spacedim > &dof_handler, const std::function< bool(const typename DoFHandler< dim, spacedim >::active_cell_iterator &)> &predicate, const AffineConstraints< number > &constraints={})
 
template<int dim, int spacedim>
std::vector< std::vector< bool > > DoFTools::extract_constant_modes (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask={})
 
template<int dim, int spacedim>
void DoFTools::extract_constant_modes (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< std::vector< bool > > &constant_modes)
 
template<int dim, int spacedim>
std::vector< std::vector< bool > > DoFTools::extract_level_constant_modes (const unsigned int level, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask={})
 
template<int dim, int spacedim>
void DoFTools::extract_level_constant_modes (const unsigned int level, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask, std::vector< std::vector< bool > > &constant_modes)
 
template<int dim, int spacedim>
std::vector< std::vector< double > > DoFTools::extract_rigid_body_modes (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask={})
 
template<int dim, int spacedim>
std::vector< std::vector< double > > DoFTools::extract_level_rigid_body_modes (const unsigned int level, const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &component_mask={})
 
Coupling between DoFHandler objects on different dimensions
template<int dim, int spacedim>
std::map< typename DoFHandler< dim - 1, spacedim >::active_cell_iterator, std::pair< typename DoFHandler< dim, spacedim >::active_cell_iterator, unsigned int > > DoFTools::map_boundary_to_bulk_dof_iterators (const std::map< typename Triangulation< dim - 1, spacedim >::cell_iterator, typename Triangulation< dim, spacedim >::face_iterator > &c1_to_c0, const DoFHandler< dim, spacedim > &c0_dh, const DoFHandler< dim - 1, spacedim > &c1_dh)
 
Parallelization and domain decomposition
template<int dim, int spacedim>
void DoFTools::extract_subdomain_dofs (const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain_id, std::vector< bool > &selected_dofs)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_locally_active_dofs (const DoFHandler< dim, spacedim > &dof_handler)
 
template<int dim, int spacedim>
void DoFTools::extract_locally_active_dofs (const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_locally_active_level_dofs (const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level)
 
template<int dim, int spacedim>
void DoFTools::extract_locally_active_level_dofs (const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set, const unsigned int level)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_locally_relevant_dofs (const DoFHandler< dim, spacedim > &dof_handler)
 
template<int dim, int spacedim>
void DoFTools::extract_locally_relevant_dofs (const DoFHandler< dim, spacedim > &dof_handler, IndexSet &dof_set)
 
template<int dim, int spacedim>
std::vector< IndexSetDoFTools::locally_owned_dofs_per_component (const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &components={})
 
template<int dim, int spacedim>
std::vector< IndexSetDoFTools::locally_owned_dofs_per_subdomain (const DoFHandler< dim, spacedim > &dof_handler)
 
template<int dim, int spacedim>
std::vector< IndexSetDoFTools::locally_relevant_dofs_per_subdomain (const DoFHandler< dim, spacedim > &dof_handler)
 
template<int dim, int spacedim>
IndexSet DoFTools::extract_locally_relevant_level_dofs (const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level)
 
template<int dim, int spacedim>
void DoFTools::extract_locally_relevant_level_dofs (const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, IndexSet &dof_set)
 
template<int dim, int spacedim>
void DoFTools::get_subdomain_association (const DoFHandler< dim, spacedim > &dof_handler, std::vector< types::subdomain_id > &subdomain)
 
template<int dim, int spacedim>
unsigned int DoFTools::count_dofs_with_subdomain_association (const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain)
 
template<int dim, int spacedim>
void DoFTools::count_dofs_with_subdomain_association (const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain, std::vector< unsigned int > &n_dofs_on_subdomain)
 
template<int dim, int spacedim>
IndexSet DoFTools::dof_indices_with_subdomain_association (const DoFHandler< dim, spacedim > &dof_handler, const types::subdomain_id subdomain)
 
DoF indices on patches of cells

Create structures containing a large set of degrees of freedom for small patches of cells. The resulting objects can be used in RelaxationBlockSOR and related classes to implement Schwarz preconditioners and smoothers, where the subdomains consist of small numbers of cells only.

template<int dim, int spacedim>
std::vector< types::global_dof_indexDoFTools::get_dofs_on_patch (const std::vector< typename DoFHandler< dim, spacedim >::active_cell_iterator > &patch)
 
template<int dim, int spacedim>
void DoFTools::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)
 
template<int dim, int spacedim>
std::vector< unsigned intDoFTools::make_vertex_patches (SparsityPattern &block_list, const DoFHandler< dim, spacedim > &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)
 
template<int dim, int spacedim>
std::vector< unsigned intDoFTools::make_vertex_patches (SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const BlockMask &exclude_boundary_dofs=BlockMask(), const bool boundary_patches=false, const bool level_boundary_patches=false, const bool single_cell_patches=false, const bool invert_vertex_mapping=false)
 
template<int dim, int spacedim>
void DoFTools::make_child_patches (SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const bool interior_dofs_only, const bool boundary_dofs=false)
 
template<int dim, int spacedim>
void DoFTools::make_single_patch (SparsityPattern &block_list, const DoFHandler< dim, spacedim > &dof_handler, const unsigned int level, const bool interior_dofs_only=false)
 
Counting degrees of freedom and related functions
template<int dim, int spacedim>
std::vector< types::global_dof_indexDoFTools::count_dofs_per_fe_component (const DoFHandler< dim, spacedim > &dof_handler, const bool vector_valued_once=false, const std::vector< unsigned int > &target_component={})
 
template<int dim, int spacedim>
std::vector< types::global_dof_indexDoFTools::count_dofs_per_fe_block (const DoFHandler< dim, spacedim > &dof, const std::vector< unsigned int > &target_block=std::vector< unsigned int >())
 
template<int dim, int spacedim>
void DoFTools::get_active_fe_indices (const DoFHandler< dim, spacedim > &dof_handler, std::vector< unsigned int > &active_fe_indices)
 
template<int dim, int spacedim>
unsigned int DoFTools::count_dofs_on_patch (const std::vector< typename DoFHandler< dim, spacedim >::active_cell_iterator > &patch)
 
Functions that return different DoF mappings
template<int dim, int spacedim>
void DoFTools::map_dof_to_boundary_indices (const DoFHandler< dim, spacedim > &dof_handler, std::vector< types::global_dof_index > &mapping)
 
template<int dim, int spacedim>
void DoFTools::map_dof_to_boundary_indices (const DoFHandler< dim, spacedim > &dof_handler, const std::set< types::boundary_id > &boundary_ids, std::vector< types::global_dof_index > &mapping)
 
template<int dim, int spacedim>
void DoFTools::map_dofs_to_support_points (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::vector< Point< spacedim > > &support_points, const ComponentMask &mask={})
 
template<int dim, int spacedim>
void DoFTools::map_dofs_to_support_points (const hp::MappingCollection< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::vector< Point< spacedim > > &support_points, const ComponentMask &mask={})
 
template<int dim, int spacedim>
std::map< types::global_dof_index, Point< spacedim > > DoFTools::map_dofs_to_support_points (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &mask={})
 
template<int dim, int spacedim>
std::map< types::global_dof_index, Point< spacedim > > DoFTools::map_dofs_to_support_points (const hp::MappingCollection< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, const ComponentMask &mask={})
 
template<int dim, int spacedim>
void DoFTools::map_dofs_to_support_points (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::map< types::global_dof_index, Point< spacedim > > &support_points, const ComponentMask &mask={})
 
template<int dim, int spacedim>
void DoFTools::map_dofs_to_support_points (const hp::MappingCollection< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::map< types::global_dof_index, Point< spacedim > > &support_points, const ComponentMask &mask={})
 
template<int dim, int spacedim, class Comp >
void DoFTools::map_support_points_to_dofs (const Mapping< dim, spacedim > &mapping, const DoFHandler< dim, spacedim > &dof_handler, std::map< Point< spacedim >, types::global_dof_index, Comp > &point_to_index_map)
 
Miscellaneous
template<int dim, int spacedim, typename Number >
void DoFTools::distribute_cell_to_dof_vector (const DoFHandler< dim, spacedim > &dof_handler, const Vector< Number > &cell_data, Vector< double > &dof_data, const unsigned int component=0)
 
template<int spacedim>
void DoFTools::write_gnuplot_dof_support_point_info (std::ostream &out, const std::map< types::global_dof_index, Point< spacedim > > &support_points)
 
template<int dim, int spacedim, typename number >
void DoFTools::make_zero_boundary_constraints (const DoFHandler< dim, spacedim > &dof, const types::boundary_id boundary_id, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask={})
 
template<int dim, int spacedim, typename number >
void DoFTools::make_zero_boundary_constraints (const DoFHandler< dim, spacedim > &dof, AffineConstraints< number > &zero_boundary_constraints, const ComponentMask &component_mask={})
 
Exceptions
static ::ExceptionBaseDoFTools::ExcFiniteElementsDontMatch ()
 
static ::ExceptionBaseDoFTools::ExcGridNotCoarser ()
 
static ::ExceptionBaseDoFTools::ExcGridsDontMatch ()
 
static ::ExceptionBaseDoFTools::ExcNoFESelected ()
 
static ::ExceptionBaseDoFTools::ExcInvalidBoundaryIndicator ()