Reference documentation for deal.II version GIT dad323def1 2022-06-25 19:00:02+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\}}\)
Classes | Public Member Functions | Static Public 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
 
void enable_inplace_operations_if_possible (const std::shared_ptr< const Utilities::MPI::Partitioner > &partitioner_coarse, const std::shared_ptr< const Utilities::MPI::Partitioner > &partitioner_fine)
 
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 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
 
internal::MatrixFreeFunctions::ConstraintInfo< dim, VectorizedArray< Number > > constraint_info
 
std::vector< Number > weights
 
AlignedVector< VectorizedArray< Number > > weights_compressed
 
std::vector< unsigned int > level_dof_indices_fine
 
unsigned int n_components
 

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.

The implementation of this class is explained in detail in [116].

Definition at line 212 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).

◆ enable_inplace_operations_if_possible()

template<int dim, typename Number >
void MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::enable_inplace_operations_if_possible ( const std::shared_ptr< const Utilities::MPI::Partitioner > &  partitioner_coarse,
const std::shared_ptr< const Utilities::MPI::Partitioner > &  partitioner_fine 
)

Enable inplace vector operations if external and internal vectors are compatible.

◆ 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.

Friends And Related Function Documentation

◆ internal::MGTwoLevelTransferImplementation

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

Definition at line 463 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 401 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 408 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 413 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 418 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 427 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 432 of file mg_transfer_global_coarsening.h.

◆ constraint_info

template<int dim, typename Number >
internal::MatrixFreeFunctions::ConstraintInfo<dim, VectorizedArray<Number> > MGTwoLevelTransfer< dim, LinearAlgebra::distributed::Vector< Number > >::constraint_info
private

Helper class for reading from and writing to global vectors and for applying constraints.

Definition at line 439 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 444 of file mg_transfer_global_coarsening.h.

◆ weights_compressed

template<int dim, typename Number >
AlignedVector<VectorizedArray<Number> > 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 450 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 456 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 461 of file mg_transfer_global_coarsening.h.


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