Loading...
Searching...
No Matches
terra::linalg::solvers::Chebyshev< OperatorT > Class Template Reference

Chebyshev accelerated Jacobi iterative solver for linear systems. More...

#include <chebyshev.hpp>

Public Types

using OperatorType = OperatorT
 Operator type to be solved.
 
using SolutionVectorType = SrcOf< OperatorType >
 Solution vector type.
 
using RHSVectorType = DstOf< OperatorType >
 Right-hand side vector type.
 
using ScalarType = SolutionVectorType::ScalarType
 Scalar type for computations.
 

Public Member Functions

 Chebyshev (const int order, const SolutionVectorType &inverse_diagonal, const std::vector< SolutionVectorType > &tmps, const int iterations=1, const int max_ev_power_iterations=50)
 Construct a Chebyshev accelerated Jacobi solver.
 
void solve_impl (OperatorType &A, SolutionVectorType &x, const RHSVectorType &b)
 Solve the linear system using the Chebyshev iteration. Applies the update rule for the specified number of iterations.
 
SolutionVectorTypeget_inverse_diagonal ()
 
void refresh_max_eigenvalue_estimate_in_next_solve ()
 

Detailed Description

template<OperatorLike OperatorT>
class terra::linalg::solvers::Chebyshev< OperatorT >

Chebyshev accelerated Jacobi iterative solver for linear systems.

Computes (given an order \(p \geq 1, \ p \in \mathbb{N}\))

\[ x^{k+1} = x^k + \alpha_k \, D^{-1}(b - A x^k) + \beta_k \, d^k, \quad d^0 = 0 \]

for \(k = 0\) up to \(k+1 = p\), where \(D = \mathrm{diag}(A)\), and the coefficients \( \alpha_k \) and \( \beta_k \) are computed recursively from

\[ \begin{aligned} \rho_0 &= \frac{\delta}{\theta}, \quad \\ \rho_{k+1} &= (2(\theta/\delta) - \rho_k)^{-1}, \quad \\ \alpha_0 &= \theta^{-1}, \\ \alpha_k &= \frac{2 \, \rho_{k+1}}{\delta}, \quad \\ \beta_0 &= 0, \\ \beta_k &= \rho_{k+1} \rho_k, \\ d_0 &= 0, \\ d_k &= x^{k+1} - x^{k} = \alpha_k D^{-1}(b - A x^k) + \beta_k d_{k-1} \end{aligned} \]

with \( \theta = (\lambda_{\max} + \lambda_{\min})/2 \) and \( \delta = (\lambda_{\max} - \lambda_{\min})/2\) , and \( \lambda_{\min}, \lambda_{\max} \) the eigenvalue bounds of \( D^{-1}A \).

The max eigenvalue \(\lambda_{\max}\) is estimated before the first solve (or if requested via refresh_max_eigenvalue_estimate_in_next_solve()) applying a specified number of power iterations. A safety margin is added to hopefully ensure that the estimate is not too far off. The minimum eigenvalue is the obtained by scaling the maximum eigenvalue.

Each iteration executes \(p\) matrix-vector products (plus some vector-vector operations). Setting the order \(p = 1\) recovers the standard weighted Jacobi relaxation. If unsure, try low-order settings with \(p = 2\) or \(p = 3\).

The number of iterations repeats the entire process. For instance, setting the iterations \(\text{it} = 10\) will perform \(\text{it} \times p\) updates.

Satisfies the SolverLike concept (see solver.hpp).

Template Parameters
OperatorTOperator type (must satisfy OperatorLike).

Member Typedef Documentation

◆ OperatorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Chebyshev< OperatorT >::OperatorType = OperatorT

Operator type to be solved.

◆ RHSVectorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Chebyshev< OperatorT >::RHSVectorType = DstOf< OperatorType >

Right-hand side vector type.

◆ ScalarType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Chebyshev< OperatorT >::ScalarType = SolutionVectorType::ScalarType

Scalar type for computations.

◆ SolutionVectorType

template<OperatorLike OperatorT>
using terra::linalg::solvers::Chebyshev< OperatorT >::SolutionVectorType = SrcOf< OperatorType >

Solution vector type.

Constructor & Destructor Documentation

◆ Chebyshev()

template<OperatorLike OperatorT>
terra::linalg::solvers::Chebyshev< OperatorT >::Chebyshev ( const int  order,
const SolutionVectorType inverse_diagonal,
const std::vector< SolutionVectorType > &  tmps,
const int  iterations = 1,
const int  max_ev_power_iterations = 50 
)
inline

Construct a Chebyshev accelerated Jacobi solver.

Parameters
orderChebyshev order \(p >= 1\). Equivalent to weighted Jacobi for \(p = 1\).
inverse_diagonalInverse of the diagonal of the operator (D^-1).
tmpsTemporary vectors for workspace. We need 2 here.
iterationsNumber of Chebyshev iterations to perform.
max_ev_power_iterationsNumber of power iterations executed to estimate the max eigenvalue of ((D^-1)A). An additional safety margin is added internally during the setup of the Chebyshev solver.

Member Function Documentation

◆ get_inverse_diagonal()

template<OperatorLike OperatorT>
SolutionVectorType & terra::linalg::solvers::Chebyshev< OperatorT >::get_inverse_diagonal ( )
inline

◆ refresh_max_eigenvalue_estimate_in_next_solve()

template<OperatorLike OperatorT>
void terra::linalg::solvers::Chebyshev< OperatorT >::refresh_max_eigenvalue_estimate_in_next_solve ( )
inline

◆ solve_impl()

template<OperatorLike OperatorT>
void terra::linalg::solvers::Chebyshev< OperatorT >::solve_impl ( OperatorType A,
SolutionVectorType x,
const RHSVectorType b 
)
inline

Solve the linear system using the Chebyshev iteration. Applies the update rule for the specified number of iterations.

Parameters
AOperator (matrix).
xSolution vector (output).
bRight-hand side vector (input).

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