ParGeMSLR
|
Block Jacobi preconditioner, only for parallel csr matrix. More...
#include <block_jacobi.hpp>
Public Member Functions | |
BlockJacobiClass () | |
The constructor of BlockJacobiClass. More... | |
virtual int | Clear () |
Free the current precondioner. More... | |
virtual | ~BlockJacobiClass () |
The destructor of BlockJacobiClass. More... | |
BlockJacobiClass (const BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > &solver) | |
The copy constructor of BlockJacobiClass. Note that this is not the true copy. We only copy the pointer to the local preconditioner. More... | |
BlockJacobiClass (BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > &&solver) | |
The move constructor of BlockJacobiClass. More... | |
BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & | operator= (const BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > &solver) |
The = operator of BlockJacobiClass. Note that this is not the true copy. We only copy the pointer to the local preconditioner. More... | |
BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & | operator= (BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > &&solver) |
The = operator of BlockJacobiClass. More... | |
virtual int | Setup (ParallelVectorType &x, ParallelVectorType &rhs) |
Setup the precondioner phase. Will be called by the solver if not called directly. More... | |
virtual int | Solve (ParallelVectorType &x, ParallelVectorType &rhs) |
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used. More... | |
virtual long int | GetNumNonzeros () |
Get the total number of nonzeros. More... | |
int | SetLocalPreconditioner (SolverClass< LocalMatrixType, LocalVectorType, DataType > &local_precond) |
Set the local preconditioenr. More... | |
int | SetLocalPreconditionerP (SolverClass< LocalMatrixType, LocalVectorType, DataType > *local_precond) |
Set the local preconditioenr. More... | |
SolverClass< LocalMatrixType, LocalVectorType, DataType > * | GetLocalPreconditionerP () |
Get the local preconditioenr. More... | |
int | SetOwnLocalPreconditioner (bool own_local_preconditioner) |
Set the own preconditioenr. If set to true, the preconditioner will be freed when destrooy. More... | |
virtual int | SetSolveLocation (const int &location) |
Set the data location that the preconditioner apply to. More... | |
virtual int | MoveData (const int &location) |
Move the preconditioner to another location. Only can be called after Setup. More... | |
Public Member Functions inherited from pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType > | |
SolverClass () | |
The constructor of solver class. More... | |
SolverClass (const SolverClass< ParallelMatrixType, ParallelVectorType, DataType > &solver) | |
The copy constructor of solver class. More... | |
SolverClass (SolverClass< ParallelMatrixType, ParallelVectorType, DataType > &&solver) | |
The move constructor of solver class. More... | |
SolverClass< ParallelMatrixType, ParallelVectorType, DataType > & | operator= (const SolverClass< ParallelMatrixType, ParallelVectorType, DataType > &solver) |
The = operator of solver class. More... | |
SolverClass< ParallelMatrixType, ParallelVectorType, DataType > & | operator= (SolverClass< ParallelMatrixType, ParallelVectorType, DataType > &&solver) |
The = operator of solver class. More... | |
virtual | ~SolverClass () |
The destructor of solver class. More... | |
virtual int | Solve (DenseMatrixClass< DataType > &x, DenseMatrixClass< DataType > &rhs) |
Solve phase with multiple right-hand-sides. Call this function after Setup. More... | |
ParallelMatrixType * | GetMatrix () |
Get pointer to the matrix. More... | |
SolverClass< ParallelMatrixType, ParallelVectorType, DataType > * | GetPreconditioner () |
Get pointer to the preconditioner. More... | |
virtual int | SetWithParameterArray (double *params) |
Setup with parameter array. More... | |
int | SetMatrix (ParallelMatrixType &matrix) |
Set the target matrix for the current solver. More... | |
int | SetMatrixP (ParallelMatrixType *matrix) |
Set the target matrix for the current solver. More... | |
int | SetPreconditioner (SolverClass< ParallelMatrixType, ParallelVectorType, DataType > &precond) |
Set the preconditioner for the current solver. More... | |
int | SetPreconditionerP (SolverClass< ParallelMatrixType, ParallelVectorType, DataType > *precond) |
Set the preconditioner for the current solver. More... | |
bool | IsReady () const |
Check if the solver is ready to be used. More... | |
int | SetOwnMatrix (bool own_matrix) |
Set if the matrix is owned by this solver, if so, matrix is freed when free the solver. More... | |
int | SetOwnPreconditioner (bool own_preconditioner) |
Set if the preconditioner is owned by this solver, if so, preconditioner is freed when free the solver. More... | |
int | SetPrintOption (int print_option) |
Set the print option. More... | |
PrecisionEnum | GerPrecision () const |
Get the precision. More... | |
SolverTypeEnum | GetSolverType () const |
Get the solver type. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType > | |
int | CheckReadySetups (const char *str) const |
Return error is the preconditioner is ready. More... | |
Protected Attributes inherited from pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType > | |
PrecisionEnum | _solver_precision |
The precision of the solver. More... | |
SolverTypeEnum | _solver_type |
The type of the solver. More... | |
bool | _is_mixed |
Is the preconditioner a mixed precision preconditioner? More... | |
ParallelMatrixType * | _matrix |
The matrix. More... | |
bool | _own_matrix |
If the matrix is owned by this solver, default is false. More... | |
SolverClass< ParallelMatrixType, ParallelVectorType, DataType > * | _preconditioner |
The preconditioner. More... | |
bool | _own_preconditioner |
If the preconditioner is owned by this solver, default is false. More... | |
ParallelVectorType * | _solution |
Pointer to the solution, note that this vector is not going to be freed. More... | |
ParallelVectorType * | _right_hand_side |
Pointer to the right-hand-size, note that this vector is not going to be freed. More... | |
bool | _ready |
If the solver is ready. More... | |
int | _print_option |
The print option. More... | |
Block Jacobi preconditioner, only for parallel csr matrix.
template pargemslr::precond_bj_csr_par_complexd::BlockJacobiClass | ( | ) |
The constructor of BlockJacobiClass.
|
virtual |
The destructor of BlockJacobiClass.
pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::BlockJacobiClass | ( | const BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & | solver | ) |
The copy constructor of BlockJacobiClass. Note that this is not the true copy. We only copy the pointer to the local preconditioner.
The onwer is not this preconditioner.
[in] | solve | The target solver. |
pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::BlockJacobiClass | ( | BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > && | solver | ) |
The move constructor of BlockJacobiClass.
[in] | solve | The target solver. |
|
virtual |
Free the current precondioner.
Reimplemented from pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType >.
template solver_csr_seq_complexd * pargemslr::precond_bj_csr_par_complexd::GetLocalPreconditionerP | ( | ) |
Get the local preconditioenr.
|
virtual |
Get the total number of nonzeros.
Reimplemented from pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType >.
|
virtual |
Move the preconditioner to another location. Only can be called after Setup.
[in] | location | The target solver location. |
BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::operator= | ( | BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > && | solver | ) |
The = operator of BlockJacobiClass.
[in] | solve | The target solver. |
BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::operator= | ( | const BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType > & | solver | ) |
The = operator of BlockJacobiClass. Note that this is not the true copy. We only copy the pointer to the local preconditioner.
The onwer is not this preconditioner.
[in] | solve | The target solver. |
int pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::SetLocalPreconditioner | ( | SolverClass< LocalMatrixType, LocalVectorType, DataType > & | local_precond | ) |
Set the local preconditioenr.
int pargemslr::BlockJacobiClass< ParallelMatrixType, ParallelVectorType, LocalMatrixType, LocalVectorType, DataType >::SetLocalPreconditionerP | ( | SolverClass< LocalMatrixType, LocalVectorType, DataType > * | local_precond | ) |
Set the local preconditioenr.
template int pargemslr::precond_bj_csr_par_complexd::SetOwnLocalPreconditioner | ( | bool | own_local_preconditioner | ) |
Set the own preconditioenr.
|
virtual |
Set the data location that the preconditioner apply to.
[in] | location | The target solver location. |
Implements pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType >.
|
virtual |
Setup the precondioner phase. Will be called by the solver if not called directly.
[in] | x | The initial guess. |
[in] | rhs | The right-hand-side. |
Implements pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType >.
|
virtual |
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is used.
[in,out] | x | The initial guess. |
[in] | rhs | The right-hand-side. |
Implements pargemslr::SolverClass< ParallelMatrixType, ParallelVectorType, DataType >.