Hex  2.2
Hydrogen-electron collision solver
Data Structures | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
DOMPreconditioner Class Reference

Domain decomposition preconditioner. More...

#include <DOMPreconditioner.h>

Inheritance diagram for DOMPreconditioner:
Inheritance graph
[legend]
Collaboration diagram for DOMPreconditioner:
Collaboration graph
[legend]

Data Structures

class  PanelSolution
 

Public Member Functions

 preconditionerRunTimeSelectionDefinitions (DOMPreconditioner, "DOM") DOMPreconditioner()
 
 DOMPreconditioner (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 setup ()
 Initialize the preconditioner. More...
 
virtual void update (Real E)
 Update the preconditioner for the next energy. More...
 
virtual void precondition (BlockArray< Complex > const &r, BlockArray< Complex > &z) const
 Precondition the equation. More...
 
virtual void finish ()
 Clean up memory etc. More...
 
- 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 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 Types

enum  Neighbours {
  Left = 0, Right = 1, Down = 2, Up = 3,
  nNbrs = 4
}
 

Protected Member Functions

int rev (int dir) const
 
void solvePanel (int cycle, int cycles, std::vector< PanelSolution > &p, int i, int j) const
 
void correctSource (cBlockArray &chi, std::vector< PanelSolution > const &panels, int ipanel, int jpanel) const
 
Complex couplingMatrixElement (int ill, int illp, int i, int j, int k, int l) const
 
void knotSubsequence (int ipanel, int npanels, Bspline const &bspline, rArray &rknots, rArray &cknots1, rArray &cknots2) const
 
void splitResidual (cBlockArray const &r, std::vector< PanelSolution > &p) const
 
void collectSolution (cBlockArray &z, std::vector< PanelSolution > &p) const
 

Protected Attributes

int gap_
 
- 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_
 
RadialIntegralsrad_inner_
 
RadialIntegralsrad_full_
 
RadialIntegralsrad_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< LUftluS_
 
- Protected Attributes inherited from PreconditionerBase
bool verbose_
 

Detailed Description

This preconditioner splits the simulated domain into several non-overlapping subdomains and solves the smaller per-subdomain problems in a sequence. The numbering of the domains is as follows:

* 
* ┌──┬──┬──┐
* │2 │5 │8 │
* ├──┼──┼──┤
* │1 │4 │7 │
* ├──┼──┼──┤
* │0 │3 │6 │
* └──┴──┴──┘
* 
* 

Member Enumeration Documentation

◆ Neighbours

Enumerator
Left 
Right 
Down 
Up 
nNbrs 

Constructor & Destructor Documentation

◆ DOMPreconditioner()

DOMPreconditioner::DOMPreconditioner ( 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 
)

Member Function Documentation

◆ collectSolution()

void DOMPreconditioner::collectSolution ( cBlockArray &  z,
std::vector< PanelSolution > &  p 
) const
protected

◆ correctSource()

void DOMPreconditioner::correctSource ( cBlockArray &  chi,
std::vector< PanelSolution > const &  panels,
int  ipanel,
int  jpanel 
) const
protected

◆ couplingMatrixElement()

Complex DOMPreconditioner::couplingMatrixElement ( int  ill,
int  illp,
int  i,
int  j,
int  k,
int  l 
) const
protected

◆ description()

std::string DOMPreconditioner::description ( ) const
virtual

Simple documentation of the preconditioner.

Reimplemented from NoPreconditioner.

◆ finish()

void DOMPreconditioner::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.

◆ knotSubsequence()

void DOMPreconditioner::knotSubsequence ( int  ipanel,
int  npanels,
Bspline const &  bspline,
rArray &  rknots,
rArray &  cknots1,
rArray &  cknots2 
) const
protected

◆ precondition()

void DOMPreconditioner::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.

◆ preconditionerRunTimeSelectionDefinitions()

DOMPreconditioner::preconditionerRunTimeSelectionDefinitions ( DOMPreconditioner  ,
"DOM"   
)
inline

◆ rev()

int DOMPreconditioner::rev ( int  dir) const
inlineprotected

◆ setup()

void DOMPreconditioner::setup ( )
virtual

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

Reimplemented from NoPreconditioner.

◆ solvePanel()

void DOMPreconditioner::solvePanel ( int  cycle,
int  cycles,
std::vector< PanelSolution > &  p,
int  i,
int  j 
) const
protected

◆ splitResidual()

void DOMPreconditioner::splitResidual ( cBlockArray const &  r,
std::vector< PanelSolution > &  p 
) const
protected

◆ update()

void DOMPreconditioner::update ( Real  E)
virtual

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

Reimplemented from NoPreconditioner.

Field Documentation

◆ gap_

int DOMPreconditioner::gap_
protected

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