PARALUTION  1.0.0
PARALUTION
preconditioner_blockprecond.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_PRECONDITIONER_BLOCKPRECOND_HPP_
2 #define PARALUTION_PRECONDITIONER_BLOCKPRECOND_HPP_
3 
4 #include "../solver.hpp"
5 #include "preconditioner.hpp"
6 #include "../../base/local_vector.hpp"
7 
8 #include <vector>
9 
10 namespace paralution {
11 
12 template <class OperatorType, class VectorType, typename ValueType>
13 class BlockPreconditioner : public Preconditioner<OperatorType, VectorType, ValueType> {
14 
15 public:
16 
18  virtual ~BlockPreconditioner();
19 
20  virtual void Print(void) const;
21  virtual void Clear(void);
22 
23  virtual void Set(const int n,
24  const int *size,
26 
27  virtual void SetDiagonalSolver(void);
28  virtual void SetLSolver(void);
29 
30  virtual void SetExternalLastMatrix(const OperatorType &mat);
31 
32  virtual void Build(void);
33 
34  virtual void Solve(const VectorType &rhs,
35  VectorType *x);
36 
37 protected:
38 
39  // The operator decomposition
40  OperatorType ***A_block_;
41  OperatorType *A_last_;
42 
46  unsigned int precond_mat_format_;
47 
48  VectorType **x_block_;
49  VectorType **tmp_block_;
50 
53 
55 
56 
58 
59  virtual void MoveToHostLocalData_(void);
60  virtual void MoveToAcceleratorLocalData_(void);
61 
62 
63 };
64 
65 
66 }
67 
68 #endif // PARALUTION_PRECONDITIONER_BLOCKPRECOND_HPP_
Solver< OperatorType, VectorType, ValueType > ** D_solver_
Definition: preconditioner_blockprecond.hpp:54
Definition: preconditioner_blockprecond.hpp:13
virtual void Set(const int n, const int *size, Solver< OperatorType, VectorType, ValueType > **D_solver)
Definition: preconditioner_blockprecond.cpp:110
OperatorType *** A_block_
Definition: preconditioner_blockprecond.hpp:40
virtual void SetDiagonalSolver(void)
Definition: preconditioner_blockprecond.cpp:135
virtual void SetExternalLastMatrix(const OperatorType &mat)
Definition: preconditioner_blockprecond.cpp:155
virtual void Print(void) const
Print information about the solver.
Definition: preconditioner_blockprecond.cpp:92
VectorType ** tmp_block_
Definition: preconditioner_blockprecond.hpp:49
BlockPreconditioner()
Definition: preconditioner_blockprecond.cpp:18
bool diag_solve_
Definition: preconditioner_blockprecond.hpp:57
virtual void SetLSolver(void)
Definition: preconditioner_blockprecond.cpp:145
virtual void Solve(const VectorType &rhs, VectorType *x)
Solve Operator x = rhs.
Definition: preconditioner_blockprecond.cpp:279
Base preconditioner class.
Definition: preconditioner.hpp:10
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: preconditioner_blockprecond.cpp:366
unsigned int precond_mat_format_
Precond matrix format.
Definition: preconditioner_blockprecond.hpp:46
virtual ~BlockPreconditioner()
Definition: preconditioner_blockprecond.cpp:35
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: preconditioner_blockprecond.cpp:173
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: preconditioner_blockprecond.cpp:45
Definition: backend_manager.cpp:43
OperatorType * A_last_
Definition: preconditioner_blockprecond.hpp:41
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
The base class for all solvers and preconditioners.
Definition: solver.hpp:12
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: preconditioner_blockprecond.cpp:343
bool op_mat_format_
Keep the precond matrix in CSR or not.
Definition: preconditioner_blockprecond.hpp:44
VectorType ** x_block_
Definition: preconditioner_blockprecond.hpp:48
int num_blocks_
Definition: preconditioner_blockprecond.hpp:51
int * block_sizes_
Definition: preconditioner_blockprecond.hpp:52