Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::JacobiSmoother< T > Class Template Reference

Jacobi smoother for AlgVector/SpMatrix linear systems. More...

#include <AMReX_Smoother_MV.H>

Public Member Functions

 JacobiSmoother (SpMatrix< T > const *a_A, bool a_l1=false)
 Construct a smoother that operates on a_A.
 
int setNumIters (int a_niters)
 Update how many Jacobi sweeps to perform per apply.
 
void setWeight (T w)
 Set the relaxation weight. Call this after setL1(), which resets it.
 
void setL1 (bool b)
 
void operator() (AlgVector< T > &xvec, AlgVector< T > const &bvec, bool with_initial_guess=false)
 Apply the smoother to solve approximately for xvec.
 
AlgVector< T > const & scaling ()
 Diagonal or l1 scaling vector. The first call is collective.
 

Detailed Description

template<typename T>
class amrex::JacobiSmoother< T >

Jacobi smoother for AlgVector/SpMatrix linear systems.

Performs x += w * (b - A x) / d sweeps, where d is the diagonal of A (weighted Jacobi, weight 2/3 by default) or, with setL1(true), the l1 row norm sign(a_ii) * sum_j |a_ij| (l1-Jacobi, weight 1 by default), which converges for any symmetric positive definite matrix [Baker, Falgout, Kolev, Yang, SIAM J. Sci. Comput. 33 (2011), 2864-2887].

Constructor & Destructor Documentation

◆ JacobiSmoother()

template<typename T >
amrex::JacobiSmoother< T >::JacobiSmoother ( SpMatrix< T > const *  a_A,
bool  a_l1 = false 
)
inlineexplicit

Construct a smoother that operates on a_A.

Parameters
a_ASparse matrix supplying diagonal entries and SpMV.
a_l1Use l1-Jacobi scaling.

Member Function Documentation

◆ operator()()

template<typename T >
void amrex::JacobiSmoother< T >::operator() ( AlgVector< T > &  xvec,
AlgVector< T > const &  bvec,
bool  with_initial_guess = false 
)
inline

Apply the smoother to solve approximately for xvec.

Parameters
xvecSolution vector updated in place.
bvecRHS vector.
with_initial_guessTrue if xvec already holds an initial guess.

◆ scaling()

template<typename T >
AlgVector< T > const & amrex::JacobiSmoother< T >::scaling ( )
inline

Diagonal or l1 scaling vector. The first call is collective.

◆ setL1()

template<typename T >
void amrex::JacobiSmoother< T >::setL1 ( bool  b)
inline

Switch between l1-Jacobi and weighted Jacobi, resetting the weight to the default of the new mode.

◆ setNumIters()

template<typename T >
int amrex::JacobiSmoother< T >::setNumIters ( int  a_niters)
inline

Update how many Jacobi sweeps to perform per apply.

Parameters
a_nitersDesired number of smoothing iterations (4 by default).
Returns
Previous iteration count.

◆ setWeight()

template<typename T >
void amrex::JacobiSmoother< T >::setWeight ( T  w)
inline

Set the relaxation weight. Call this after setL1(), which resets it.


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