Go to the documentation of this file. 1 #ifndef PARGEMSLR_BLOCK_JACOBI_H
2 #define PARGEMSLR_BLOCK_JACOBI_H
10 #include "../utils/utils.hpp"
11 #include "../vectors/int_vector.hpp"
12 #include "../vectors/sequential_vector.hpp"
13 #include "../vectors/parallel_vector.hpp"
14 #include "../matrices/csr_matrix.hpp"
15 #include "../matrices/parallel_csr_matrix.hpp"
16 #include "../solvers/solver.hpp"
28 template <
class ParallelMatrixType,
class ParallelVectorType,
class LocalMatrixType,
class LocalVectorType,
typename DataType>
43 int _own_local_preconditioner;
110 virtual int Setup( ParallelVectorType &x, ParallelVectorType &rhs);
119 virtual int Solve( ParallelVectorType &x, ParallelVectorType &rhs);
170 virtual int MoveData(
const int &location);
virtual ~BlockJacobiClass()
The destructor of BlockJacobiClass.
Definition: block_jacobi.cpp:31
BlockJacobiClass()
The constructor of BlockJacobiClass.
Definition: block_jacobi.cpp:18
int SetLocalPreconditioner(SolverClass< LocalMatrixType, LocalVectorType, DataType > &local_precond)
Set the local preconditioenr.
Definition: block_jacobi.cpp:192
int SetOwnLocalPreconditioner(bool own_local_preconditioner)
Set the own preconditioenr. If set to true, the preconditioner will be freed when destrooy.
Definition: block_jacobi.cpp:233
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 ...
Definition: block_jacobi.cpp:68
virtual int Solve(ParallelVectorType &x, ParallelVectorType &rhs)
Solve phase. Call this function after Setup. Solve with cusparse if unified memory/device memory is u...
Definition: block_jacobi.cpp:155
SolverClass< LocalMatrixType, LocalVectorType, DataType > * GetLocalPreconditionerP()
Get the local preconditioenr.
Definition: block_jacobi.cpp:223
virtual int SetSolveLocation(const int &location)
Set the data location that the preconditioner apply to.
Definition: block_jacobi.cpp:244
The base solver class.
Definition: solver.hpp:47
virtual int Setup(ParallelVectorType &x, ParallelVectorType &rhs)
Setup the precondioner phase. Will be called by the solver if not called directly.
Definition: block_jacobi.cpp:124
virtual int MoveData(const int &location)
Move the preconditioner to another location. Only can be called after Setup.
Definition: block_jacobi.cpp:261
Block Jacobi preconditioner, only for parallel csr matrix.
Definition: block_jacobi.hpp:30
virtual long int GetNumNonzeros()
Get the total number of nonzeros.
Definition: block_jacobi.cpp:174
virtual int Clear()
Free the current precondioner.
Definition: block_jacobi.cpp:101
int SetLocalPreconditionerP(SolverClass< LocalMatrixType, LocalVectorType, DataType > *local_precond)
Set the local preconditioenr.
Definition: block_jacobi.cpp:202