Reference documentation for deal.II version Git b927e2c03c 2022-01-17 18:55:39 -0500
\(\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\}}\)
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > > Class Template Reference

#include <deal.II/multigrid/mg_transfer_global_coarsening.h>

Classes

struct  MGTransferScheme
 

Public Member Functions

void reinit_geometric_transfer (const DoFHandler< dim > &dof_handler_fine, const DoFHandler< dim > &dof_handler_coarse, const AffineConstraints< Number > &constraint_fine=AffineConstraints< Number >(), const AffineConstraints< Number > &constraint_coarse=AffineConstraints< Number >(), const unsigned int mg_level_fine=numbers::invalid_unsigned_int, const unsigned int mg_level_coarse=numbers::invalid_unsigned_int)
 
void reinit_polynomial_transfer (const DoFHandler< dim > &dof_handler_fine, const DoFHandler< dim > &dof_handler_coarse, const AffineConstraints< Number > &constraint_fine=AffineConstraints< Number >(), const AffineConstraints< Number > &constraint_coarse=AffineConstraints< Number >(), const unsigned int mg_level_fine=numbers::invalid_unsigned_int, const unsigned int mg_level_coarse=numbers::invalid_unsigned_int)
 
void reinit (const DoFHandler< dim > &dof_handler_fine, const DoFHandler< dim > &dof_handler_coarse, const AffineConstraints< Number > &constraint_fine=AffineConstraints< Number >(), const AffineConstraints< Number > &constraint_coarse=AffineConstraints< Number >(), const unsigned int mg_level_fine=numbers::invalid_unsigned_int, const unsigned int mg_level_coarse=numbers::invalid_unsigned_int)
 
void prolongate_and_add (LinearAlgebra::distributed::Vector< Number > &dst, const LinearAlgebra::distributed::Vector< Number > &src) const
 
void restrict_and_add (LinearAlgebra::distributed::Vector< Number > &dst, const LinearAlgebra::distributed::Vector< Number > &src) const
 
void interpolate (LinearAlgebra::distributed::Vector< Number > &dst, const LinearAlgebra::distributed::Vector< Number > &src) const
 
std::size_t memory_consumption () const
 

Static Public Member Functions

static bool fast_polynomial_transfer_supported (const unsigned int fe_degree_fine, const unsigned int fe_degree_coarse)
 

Private Member Functions

void apply_hanging_node_constraints (const MGTransferScheme &scheme, const internal::MatrixFreeFunctions::ConstraintKinds *coarse_cell_refinement_configurations_ptr, const unsigned int n_lanes_filled, const bool transpose, AlignedVector< VectorizedArray< Number >> &evaluation_data_coarse) const
 

Private Attributes

std::vector< MGTransferScheme > schemes
 
bool fine_element_is_continuous
 
std::shared_ptr< const Utilities::MPI::Partitionerpartitioner_fine
 
std::shared_ptr< const Utilities::MPI::Partitionerpartitioner_coarse
 
LinearAlgebra::distributed::Vector< Number > vec_fine
 
LinearAlgebra::distributed::Vector< Number > vec_coarse
 
std::vector< unsigned intdistribute_local_to_global_indices
 
std::vector< Number > distribute_local_to_global_values
 
std::vector< unsigned intdistribute_local_to_global_ptr
 
std::vector< Number > weights
 
std::vector< std::array< VectorizedArray< Number >, Utilities::pow(3, dim)> > weights_compressed
 
std::vector< unsigned intlevel_dof_indices_coarse
 
std::vector< unsigned intlevel_dof_indices_coarse_plain
 
std::vector< unsigned intlevel_dof_indices_fine
 
unsigned int n_components
 
std::vector< internal::MatrixFreeFunctions::ConstraintKindscoarse_cell_refinement_configurations
 

Friends

class internal::MGTwoLevelTransferImplementation
 

Detailed Description

template<int dim, typename Number>
class MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >

Class for transfer between two multigrid levels for p- or global coarsening. Specialization for LinearAlgebra::distributed::Vector.

Definition at line 197 of file mg_transfer_global_coarsening.h.

Member Function Documentation

◆ reinit_geometric_transfer()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::reinit_geometric_transfer ( const DoFHandler< dim > &  dof_handler_fine,
const DoFHandler< dim > &  dof_handler_coarse,
const AffineConstraints< Number > &  constraint_fine = AffineConstraints< Number >(),
const AffineConstraints< Number > &  constraint_coarse = AffineConstraints< Number >(),
const unsigned int  mg_level_fine = numbers::invalid_unsigned_int,
const unsigned int  mg_level_coarse = numbers::invalid_unsigned_int 
)

Set up global coarsening between the given DoFHandler objects ( dof_handler_fine and dof_handler_coarse). The transfer can be only performed on active levels.

◆ reinit_polynomial_transfer()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::reinit_polynomial_transfer ( const DoFHandler< dim > &  dof_handler_fine,
const DoFHandler< dim > &  dof_handler_coarse,
const AffineConstraints< Number > &  constraint_fine = AffineConstraints< Number >(),
const AffineConstraints< Number > &  constraint_coarse = AffineConstraints< Number >(),
const unsigned int  mg_level_fine = numbers::invalid_unsigned_int,
const unsigned int  mg_level_coarse = numbers::invalid_unsigned_int 
)

Set up polynomial coarsening between the given DoFHandler objects ( dof_handler_fine and dof_handler_coarse). Polynomial transfers can be only performed on active levels (numbers::invalid_unsigned_int) or on coarse-grid levels, i.e., levels without hanging nodes.

Note
The function polynomial_transfer_supported() can be used to check if the given polynomial coarsening strategy is supported.

◆ reinit()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::reinit ( const DoFHandler< dim > &  dof_handler_fine,
const DoFHandler< dim > &  dof_handler_coarse,
const AffineConstraints< Number > &  constraint_fine = AffineConstraints< Number >(),
const AffineConstraints< Number > &  constraint_coarse = AffineConstraints< Number >(),
const unsigned int  mg_level_fine = numbers::invalid_unsigned_int,
const unsigned int  mg_level_coarse = numbers::invalid_unsigned_int 
)

Set up transfer operator between the given DoFHandler objects ( dof_handler_fine and dof_handler_coarse). Depending on the underlying Triangulation objects polynomial or geometrical global coarsening is performed.

Note
While geometric transfer can be only performed on active levels (numbers::invalid_unsigned_int), polynomial transfers can also be performed on coarse-grid levels, i.e., levels without hanging nodes.
The function polynomial_transfer_supported() can be used to check if the given polynomial coarsening strategy is supported.

◆ fast_polynomial_transfer_supported()

template<int dim, typename Number >
static bool MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::fast_polynomial_transfer_supported ( const unsigned int  fe_degree_fine,
const unsigned int  fe_degree_coarse 
)
static

Check if a fast templated version of the polynomial transfer between fe_degree_fine and fe_degree_coarse is available.

Note
Currently, the polynomial coarsening strategies: 1) go-to-one, 2) bisect, and 3) decrease-by-one are precompiled with templates for degrees up to 9.

◆ prolongate_and_add()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::prolongate_and_add ( LinearAlgebra::distributed::Vector< Number > &  dst,
const LinearAlgebra::distributed::Vector< Number > &  src 
) const

Perform prolongation.

◆ restrict_and_add()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::restrict_and_add ( LinearAlgebra::distributed::Vector< Number > &  dst,
const LinearAlgebra::distributed::Vector< Number > &  src 
) const

Perform restriction.

◆ interpolate()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::interpolate ( LinearAlgebra::distributed::Vector< Number > &  dst,
const LinearAlgebra::distributed::Vector< Number > &  src 
) const

Perform interpolation of a solution vector from the fine level to the coarse level. This function is different from restriction, where a weighted residual is transferred to a coarser level (transposition of prolongation matrix).

◆ memory_consumption()

template<int dim, typename Number >
std::size_t MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::memory_consumption ( ) const

Return the memory consumption of the allocated memory in this class.

◆ apply_hanging_node_constraints()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::apply_hanging_node_constraints ( const MGTransferScheme &  scheme,
const internal::MatrixFreeFunctions::ConstraintKinds coarse_cell_refinement_configurations_ptr,
const unsigned int  n_lanes_filled,
const bool  transpose,
AlignedVector< VectorizedArray< Number >> &  evaluation_data_coarse 
) const
private

Apply hanging-node constrains with fast algorithm.

Friends And Related Function Documentation

◆ internal::MGTwoLevelTransferImplementation

template<int dim, typename Number >
friend class internal::MGTwoLevelTransferImplementation
friend

Definition at line 471 of file mg_transfer_global_coarsening.h.

Member Data Documentation

◆ schemes

template<int dim, typename Number >
std::vector<MGTransferScheme> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::schemes
private

Transfer schemes.

Definition at line 376 of file mg_transfer_global_coarsening.h.

◆ fine_element_is_continuous

template<int dim, typename Number >
bool MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::fine_element_is_continuous
private

Flag if the finite elements on the fine cells are continuous. If yes, the multiplicity of DoF sharing a vertex/line as well as constraints have to be taken into account via weights.

Definition at line 383 of file mg_transfer_global_coarsening.h.

◆ partitioner_fine

template<int dim, typename Number >
std::shared_ptr<const Utilities::MPI::Partitioner> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::partitioner_fine
private

Partitioner needed by the intermediate vector.

Definition at line 388 of file mg_transfer_global_coarsening.h.

◆ partitioner_coarse

template<int dim, typename Number >
std::shared_ptr<const Utilities::MPI::Partitioner> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::partitioner_coarse
private

Partitioner needed by the intermediate vector.

Definition at line 393 of file mg_transfer_global_coarsening.h.

◆ vec_fine

template<int dim, typename Number >
LinearAlgebra::distributed::Vector<Number> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::vec_fine
mutableprivate

Internal vector needed for collecting all degrees of freedom of the fine cells. It is only initialized if the fine-level DoF indices touch DoFs other than the locally active ones (which we always assume can be accessed by the given vectors in the prolongate/restrict functions), otherwise it is left at size zero.

Definition at line 402 of file mg_transfer_global_coarsening.h.

◆ vec_coarse

template<int dim, typename Number >
LinearAlgebra::distributed::Vector<Number> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::vec_coarse
mutableprivate

Internal vector on that the actual prolongation/restriction is performed.

Definition at line 407 of file mg_transfer_global_coarsening.h.

◆ distribute_local_to_global_indices

template<int dim, typename Number >
std::vector<unsigned int> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::distribute_local_to_global_indices
private

Constraint-entry indices for performing manual constraint_coarse.distribute_local_to_global().

Definition at line 413 of file mg_transfer_global_coarsening.h.

◆ distribute_local_to_global_values

template<int dim, typename Number >
std::vector<Number> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::distribute_local_to_global_values
private

Constraint-entry values for performing manual constraint_coarse.distribute_local_to_global().

Definition at line 419 of file mg_transfer_global_coarsening.h.

◆ distribute_local_to_global_ptr

template<int dim, typename Number >
std::vector<unsigned int> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::distribute_local_to_global_ptr
private

Pointers to the constraint entries for performing manual constraint_coarse.distribute_local_to_global().

Definition at line 425 of file mg_transfer_global_coarsening.h.

◆ weights

template<int dim, typename Number >
std::vector<Number> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::weights
private

Weights for continuous elements.

Definition at line 430 of file mg_transfer_global_coarsening.h.

◆ weights_compressed

template<int dim, typename Number >
std::vector<std::array<VectorizedArray<Number>, Utilities::pow(3, dim)> > MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::weights_compressed
private

Weights for continuous elements, compressed into 3^dim doubles per cell if possible.

Definition at line 437 of file mg_transfer_global_coarsening.h.

◆ level_dof_indices_coarse

template<int dim, typename Number >
std::vector<unsigned int> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::level_dof_indices_coarse
private

DoF indices of the coarse cells, expressed in indices local to the MPI rank.

Definition at line 443 of file mg_transfer_global_coarsening.h.

◆ level_dof_indices_coarse_plain

template<int dim, typename Number >
std::vector<unsigned int> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::level_dof_indices_coarse_plain
private

DoF indices of the coarse cells, expressed in indices local to the MPI rank.

Definition at line 449 of file mg_transfer_global_coarsening.h.

◆ level_dof_indices_fine

template<int dim, typename Number >
std::vector<unsigned int> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::level_dof_indices_fine
private

DoF indices of the fine cells, expressed in indices local to the MPI rank.

Definition at line 455 of file mg_transfer_global_coarsening.h.

◆ n_components

template<int dim, typename Number >
unsigned int MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::n_components
private

Number of components.

Definition at line 460 of file mg_transfer_global_coarsening.h.

◆ coarse_cell_refinement_configurations

template<int dim, typename Number >
std::vector<internal::MatrixFreeFunctions::ConstraintKinds> MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::coarse_cell_refinement_configurations
private

Refinement configuration of the coarse cells, needed for fast application of hanging-node constraints. If no hanging-node constraints have to be applied or the fast algorithm is not applicable, the vector is empty.

Definition at line 469 of file mg_transfer_global_coarsening.h.


The documentation for this class was generated from the following file: