Hex  2.2
Hydrogen-electron collision solver
Public Member Functions | Protected Attributes
PreconditionerBase Class Reference

Preconditioner template. More...

#include <preconditioners.h>

Inheritance diagram for PreconditionerBase:
Inheritance graph
[legend]

Public Member Functions

 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 std::string description () const
 Description of the preconditioner. More...
 
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 finish ()
 Clean up memory etc. More...
 
virtual void rhs (BlockArray< Complex > &chi, int ie, int instate) const
 Calculate the right-hand side. More...
 
virtual void multiply (BlockArray< Complex > const &p, BlockArray< Complex > &q, MatrixSelection::Selection tri=MatrixSelection::BlockBoth|MatrixSelection::Both) const
 Multiply by the matrix equation. More...
 
virtual void precondition (BlockArray< Complex > const &r, BlockArray< Complex > &z) const
 Precondition the equation. More...
 
virtual void verbose (bool b)
 Set verbosity level. More...
 

Protected Attributes

bool verbose_
 

Detailed Description

This interface class declares all necessary methods that a valid preconditioner object needs to implement. The preconditioner thus needs to be able to multiply a vector by the matrix of the set of equations that is to be solved and, of course, to precondition the solution by solving the auxiliary preconditioner equation \( \mathbf{M}\mathbf{z} = \mathbf{r} \).

Constructor & Destructor Documentation

◆ ~PreconditionerBase()

virtual PreconditionerBase::~PreconditionerBase ( )
inlinevirtual

To be overridden in derived classes.

Member Function Documentation

◆ baseClassRunTimeSelectionDefinitions()

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)   
)
inline

◆ bstates()

virtual std::pair<int,int> PreconditionerBase::bstates ( Real  E,
int  l1,
int  l2 
) const
inlinevirtual

Returns the number of energetically allowed bound states of the first and second particle with specific angular momenta. This is necessary because it determines the size of the solution vector.

This function can be called only after a call to the setup function, where it is assumed that the initialization of these numbers takes place.

The energy is in Ry.

Reimplemented in NoPreconditioner.

◆ description()

virtual std::string PreconditionerBase::description ( ) const
inlinevirtual

◆ finish()

virtual void PreconditionerBase::finish ( )
inlinevirtual

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 in GPUCGPreconditioner, KPACGPreconditioner, HybCGPreconditioner, DOMPreconditioner, ILUCGPreconditioner, CGPreconditioner, NoPreconditioner, and CoupledPreconditioner.

◆ multiply()

virtual void PreconditionerBase::multiply ( BlockArray< Complex > const &  p,
BlockArray< Complex > &  q,
MatrixSelection::Selection  tri = MatrixSelection::BlockBoth | MatrixSelection::Both 
) const
inlinevirtual

This function implements matrix multiplication by the matrix of the set of equations that is to be solved.

Reimplemented in GPUCGPreconditioner, and NoPreconditioner.

◆ precondition()

virtual void PreconditionerBase::precondition ( BlockArray< Complex > const &  r,
BlockArray< Complex > &  z 
) const
inlinevirtual

This function preconditions the equation, solving the preconditioner equation

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

It may use the MPI environment.

Reimplemented in GPUCGPreconditioner, DOMPreconditioner, NoPreconditioner, CGPreconditioner, GMGPreconditioner, and CoupledPreconditioner.

◆ rhs()

virtual void PreconditionerBase::rhs ( BlockArray< Complex > &  chi,
int  ie,
int  instate 
) const
inlinevirtual

Reimplemented in NoPreconditioner.

◆ setup()

virtual void PreconditionerBase::setup ( )
inlinevirtual

This function contains all computation intensive preparations for the preconditioner, e.g. computation of radial integrals. It may use only SMP environment.

Reimplemented in GPUCGPreconditioner, KPACGPreconditioner, HybCGPreconditioner, DOMPreconditioner, ILUCGPreconditioner, GMGPreconditioner, and NoPreconditioner.

◆ update()

virtual void PreconditionerBase::update ( Real  E)
inlinevirtual

This function updates the preconditioner for another right hand side. It may use the MPI environment. The energy is in Ry.

Reimplemented in HybCGPreconditioner, DOMPreconditioner, ILUCGPreconditioner, GMGPreconditioner, NoPreconditioner, and CoupledPreconditioner.

◆ verbose()

virtual void PreconditionerBase::verbose ( bool  b)
inlinevirtual

Determine whether the preconditioner will produce a text output.

Field Documentation

◆ verbose_

bool PreconditionerBase::verbose_
protected

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