Hex: CGPreconditioner Class Reference

| Hex 2.2 Hydrogen-electron collision solver

Public Member Functions | Protected Attributes
CGPreconditioner Class Reference

CG iteration-based preconditioner. More...

`#include <CGPreconditioner.h>`

Inheritance diagram for CGPreconditioner:
[legend]
Collaboration diagram for CGPreconditioner:
[legend]

## Public Member Functions

| preconditionerRunTimeSelectionDefinitions (CGPreconditioner, "cg") CGPreconditioner()
| CGPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
virtual std::string | description () const
| Description of the preconditioner. More...
virtual void | precondition (BlockArray< Complex > const &r, BlockArray< Complex > &z) const
| Precondition the equation. More...
virtual void | finish ()
| Clean up memory etc. More...
int | solve_block (int ill, const cArrayView r, cArrayView z) const
virtual void | CG_init (int iblock) const
virtual void | CG_mmul (int iblock, const cArrayView p, cArrayView q) const
virtual void | CG_prec (int iblock, const cArrayView r, cArrayView z) const
virtual void | CG_exit (int iblock) const
virtual Real | CG_compute_norm (const cArrayView a) const
virtual Complex | CG_scalar_product (const cArrayView a, const cArrayView b) const
virtual void | CG_axby_operation (Complex a, cArrayView x, Complex b, const cArrayView y) const
virtual void | CG_constrain (cArrayView r) const
Public Member Functions inherited from NoPreconditioner
| preconditionerRunTimeSelectionDefinitions (NoPreconditioner, "none") NoPreconditioner()
| NoPreconditioner (CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)
| ~NoPreconditioner ()
virtual void | setup ()
| Initialize the preconditioner. More...
virtual void | update (Real E)
| Update the preconditioner for the next energy. More...
virtual std::pair< int, int > | bstates (Real E, int l1, int l2) const
| Get the number of allowed bound states. More...
virtual void | rhs (BlockArray< Complex > &chi, int ienergy, int instate) const
| Calculate the right-hand side. More...
virtual void | multiply (BlockArray< Complex > const &p, BlockArray< Complex > &q, MatrixSelection::Selection tri=MatrixSelection::Both) const
| Multiply by the matrix equation. More...
BlockSymBandMatrix< Complex > | calc_A_block (int ill, int illp, bool twoel=true) const
RadialIntegrals const & | rad_inner () const
RadialIntegrals const & | rad_full () const
RadialIntegrals const & | rad_panel () const
Public Member Functions inherited from PreconditionerBase
| baseClassRunTimeSelectionDefinitions (PreconditionerBase,(CommandLine const &cmd, InputFile const &inp, Parallel const &par, AngularBasis const &ang, Bspline const &bspline_inner, Bspline const &bspline_full, Bspline const &bspline_panel_x, Bspline const &bspline_panel_y)) PreconditionerBase()
| Dummy default constructor needed by the run-time selection. More...
virtual | ~PreconditionerBase ()
| Virtual destructor. More...
virtual void | verbose (bool b)
| Set verbosity level. More...

## Protected Attributes

iArray | n_
std::size_t | us_axby_
std::size_t | us_mmul_
std::size_t | us_norm_
std::size_t | us_prec_
std::size_t | us_spro_
Protected Attributes inherited from NoPreconditioner
Real | E_
CommandLine const * | cmd_
Parallel const * | par_
InputFile const * | inp_
AngularBasis const * | ang_
std::vector< BlockSymBandMatrix< Complex > > | A_blocks_
std::vector< std::vector< SymBandMatrix< Complex > > > | B1_blocks_
std::vector< std::vector< SymBandMatrix< Complex > > > | B2_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Cu_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Cl_blocks_
std::vector< BlockSymBandMatrix< Complex > > | E_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Fu_blocks_
std::vector< CooMatrix< LU_int_t, Complex > > | Fl_blocks_
int | max_n_
std::vector< std::pair< int, int > > | Nchan_
RadialIntegrals * | rad_inner_
RadialIntegrals * | rad_full_
RadialIntegrals * | rad_panel_
std::array< Array< cArrays >, 2 > | Xp_
std::array< Array< cArrays >, 2 > | Sp_
std::array< cArrays, 2 > | Eb_
std::array< std::vector< HlData >, 2 > | Hl_
std::shared_ptr< LUft > | luS_
Protected Attributes inherited from PreconditionerBase
bool | verbose_

## Detailed Description

This class adds some preconditioning capabilities to its base class NoPreconditioner. The preconditioning is done by diagonal block solution using the conjugate gradients solver (which itself is non-preconditioned).

## Constructor & Destructor Documentation

## ◆ CGPreconditioner()

CGPreconditioner::CGPreconditioner | ( | CommandLine const & | cmd,
|  | InputFile const & | inp,
|  | Parallel const & | par,
|  | AngularBasis const & | ang,
|  | Bspline const & | bspline_inner,
|  | Bspline const & | bspline_full,
|  | Bspline const & | bspline_panel_x,
|  | Bspline const & | bspline_panel_y
| ) |  |

inline

## Member Function Documentation

## ◆ CG_axby_operation()

void CGPreconditioner::CG_axby_operation | ( | Complex | a,
|  | cArrayView | x,
|  | Complex | b,
|  | const cArrayView | y
| ) |  | const

virtual

## ◆ CG_compute_norm()

Real CGPreconditioner::CG_compute_norm | ( | const cArrayView | a | ) | const

virtual

## ◆ CG_constrain()

void CGPreconditioner::CG_constrain | ( | cArrayView | r | ) | const

virtual

## ◆ CG_exit()

void CGPreconditioner::CG_exit | ( | int | iblock | ) | const

virtual

Reimplemented in KPACGPreconditioner, HybCGPreconditioner, and ILUCGPreconditioner.

## ◆ CG_init()

void CGPreconditioner::CG_init | ( | int | iblock | ) | const

virtual

Reimplemented in KPACGPreconditioner, HybCGPreconditioner, and ILUCGPreconditioner.

## ◆ CG_mmul()

void CGPreconditioner::CG_mmul | ( | int | iblock,
|  | const cArrayView | p,
|  | cArrayView | q
| ) |  | const

virtual

Reimplemented in HybCGPreconditioner.

## ◆ CG_prec()

void CGPreconditioner::CG_prec | ( | int | iblock,
|  | const cArrayView | r,
|  | cArrayView | z
| ) |  | const

virtual

Reimplemented in KPACGPreconditioner, HybCGPreconditioner, and ILUCGPreconditioner.

## ◆ CG_scalar_product()

Complex CGPreconditioner::CG_scalar_product | ( | const cArrayView | a,
|  | const cArrayView | b
| ) |  | const

virtual

## ◆ description()

std::string CGPreconditioner::description | ( |  | ) | const

virtual

Simple documentation of the preconditioner.

Reimplemented from NoPreconditioner.

Reimplemented in GPUCGPreconditioner, KPACGPreconditioner, HybCGPreconditioner, and ILUCGPreconditioner.

## ◆ finish()

void CGPreconditioner::finish | ( |  | ) |

virtual

This function is called when the preconditioner will no longer be used to release resources. To re-enable the same preconditioner then would require a new call to setup.

Reimplemented from NoPreconditioner.

Reimplemented in GPUCGPreconditioner, KPACGPreconditioner, HybCGPreconditioner, and ILUCGPreconditioner.

## ◆ precondition()

void CGPreconditioner::precondition | ( | BlockArray< Complex > const & | r,
|  | BlockArray< Complex > & | z
| ) |  | const

virtual

This function preconditions the equation, solving the preconditioner equation

\[ \mathbf{M}\mathbf{z} = \mathbf{r} \ . \]

It may use the MPI environment.

Reimplemented from NoPreconditioner.

Reimplemented in GPUCGPreconditioner.

## ◆ preconditionerRunTimeSelectionDefinitions()

CGPreconditioner::preconditionerRunTimeSelectionDefinitions | ( | CGPreconditioner | ,
|  | "cg" |
| ) |  |

inline

## ◆ solve_block()

int CGPreconditioner::solve_block | ( | int | ill,
|  | const cArrayView | r,
|  | cArrayView | z
| ) |  | const

## Field Documentation

## ◆ n_

iArray CGPreconditioner::n_

mutableprotected

## ◆ us_axby_

std::size_t CGPreconditioner::us_axby_

mutableprotected

## ◆ us_mmul_

std::size_t CGPreconditioner::us_mmul_

mutableprotected

## ◆ us_norm_

std::size_t CGPreconditioner::us_norm_

mutableprotected

## ◆ us_prec_

std::size_t CGPreconditioner::us_prec_

mutableprotected

## ◆ us_spro_

std::size_t CGPreconditioner::us_spro_

mutableprotected

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

- src/preconditioners/CGPreconditioner.h
- src/preconditioners/CGPreconditioner.cpp