gko::multigrid::FixedCoarsening#

The simplest possible level generator: select coarse-level rows by a user-supplied index list, then use the identity for restriction and prolongation. No interpolation, no weighting — coarse value at index \(i_k\) equals fine value at index \(i_k\), and vice versa.

Use FixedCoarsening when the application already knows which rows should remain on the coarse level. Typical sources of such knowledge:

  • Geometric coarsening on a structured mesh, where every other point in each dimension is a natural coarse-level node.

  • Domain decomposition where the interface DOFs should remain on the coarse problem.

  • Custom solver schemes that benchmark a fixed-coarsening baseline against algebraic alternatives like Pgm.

Construction takes the index array of selected fine-level rows; the coarse operator is built by Galerkin projection \(A_c = R A P\) from those selectors.

template<typename ValueType = default_precision, typename IndexType = int32>
class FixedCoarsening #

Inherits from

  • public gko::EnableLinOp<FixedCoarsening<default_precision, int32>>

  • public gko::multigrid::EnableMultigridLevel<default_precision>

FixedCoarsening is a very simple coarse grid generation algorithm. It selects the coarse matrix from the fine matrix by with user-specified indices.

The user needs to specify the indices (with global numbering) of the fine matrix, they wish to be in the coarse matrix. The restriction and prolongation matrices will map to and from the coarse space without any interpolation or weighting.

Template Parameters:
  • ValueType – precision of matrix elements

  • IndexType – precision of matrix indexes

Public Functions

inline std::shared_ptr<const LinOp> get_system_matrix() const#

Returns the system operator (matrix) of the linear system.

Returns:

the system operator (matrix)

struct parameters_type#

Public Members

array<IndexType> coarse_rows#

This array specifies the rows of the fine matrix which should be selected as rows for the coarse matrix.

bool skip_sorting#

The system_matrix, which will be given to this factory, must be sorted (first by row, then by column) in order for the algorithm to work. If it is known that the matrix will be sorted, this parameter can be set to true to skip the sorting (therefore, shortening the runtime). However, if it is unknown or if the matrix is known to be not sorted, it must remain false, otherwise, this multigrid_level might be incorrect.