PARALUTION  1.0.0
PARALUTION
preconditioner_saddlepoint.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_PRECONDITIONER_SADDLEPOINT_HPP_
2 #define PARALUTION_PRECONDITIONER_SADDLEPOINT_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 DiagJacobiSaddlePointPrecond : public Preconditioner<OperatorType, VectorType, ValueType> {
14 
15 public:
16 
19 
20  virtual void Print(void) const;
21  virtual void Clear(void);
22 
23  virtual void Set(Solver<OperatorType, VectorType, ValueType> &K_Solver,
25 
26  virtual void Build(void);
27 
28  virtual void Solve(const VectorType &rhs,
29  VectorType *x);
30 
31 protected:
32 
34 
35  OperatorType A_;
36  OperatorType K_, S_;
37 
40 
44  unsigned int precond_mat_format_;
45 
46  VectorType x_;
47  VectorType x_1_;
48  VectorType x_2_;
49  VectorType x_1tmp_;
50 
51  VectorType rhs_;
52  VectorType rhs_1_;
53  VectorType rhs_2_;
54 
57 
59  int size_;
60 
61  virtual void MoveToHostLocalData_(void);
62  virtual void MoveToAcceleratorLocalData_(void);
63 
64 };
65 
66 
67 }
68 
69 #endif // PARALUTION_PRECONDITIONER_SADDLEPOINT_HPP_
Definition: preconditioner_saddlepoint.hpp:13
VectorType x_
Definition: preconditioner_saddlepoint.hpp:46
VectorType x_2_
Definition: preconditioner_saddlepoint.hpp:48
VectorType x_1_
Definition: preconditioner_saddlepoint.hpp:47
int K_nnz_
Definition: preconditioner_saddlepoint.hpp:39
VectorType rhs_
Definition: preconditioner_saddlepoint.hpp:51
virtual void MoveToAcceleratorLocalData_(void)
Move all local data to the accelerator.
Definition: preconditioner_saddlepoint.cpp:304
VectorType x_1tmp_
Definition: preconditioner_saddlepoint.hpp:49
virtual ~DiagJacobiSaddlePointPrecond()
Definition: preconditioner_saddlepoint.cpp:33
int K_nrow_
The sizes of the K_ matrix.
Definition: preconditioner_saddlepoint.hpp:39
virtual void Print(void) const
Print information about the solver.
Definition: preconditioner_saddlepoint.cpp:89
Solver< OperatorType, VectorType, ValueType > * S_solver_
Definition: preconditioner_saddlepoint.hpp:56
OperatorType K_
Definition: preconditioner_saddlepoint.hpp:36
Base preconditioner class.
Definition: preconditioner.hpp:10
virtual void Clear(void)
Clear (free all local data) the solver.
Definition: preconditioner_saddlepoint.cpp:43
VectorType rhs_2_
Definition: preconditioner_saddlepoint.hpp:53
virtual void Solve(const VectorType &rhs, VectorType *x)
Solve Operator x = rhs.
Definition: preconditioner_saddlepoint.cpp:227
Solver< OperatorType, VectorType, ValueType > * K_solver_
Definition: preconditioner_saddlepoint.hpp:55
virtual void MoveToHostLocalData_(void)
Move all local data to the host.
Definition: preconditioner_saddlepoint.cpp:276
virtual void Build(void)
Build the solver (data allocation, structure computation, numerical computation)
Definition: preconditioner_saddlepoint.cpp:122
VectorType rhs_1_
Definition: preconditioner_saddlepoint.hpp:52
Definition: backend_manager.cpp:43
OperatorType A_
A_ is decomposed into , where.
Definition: preconditioner_saddlepoint.hpp:35
int size_
Definition: preconditioner_saddlepoint.hpp:59
const IndexType const IndexType const IndexType const ValueType const ValueType const ValueType * x
Definition: cuda_kernels_coo.hpp:91
DiagJacobiSaddlePointPrecond()
Definition: preconditioner_saddlepoint.cpp:17
OperatorType S_
Definition: preconditioner_saddlepoint.hpp:36
The base class for all solvers and preconditioners.
Definition: solver.hpp:12
bool op_mat_format_
Keep the precond matrix in CSR or not.
Definition: preconditioner_saddlepoint.hpp:42
LocalVector< int > permutation_
Definition: preconditioner_saddlepoint.hpp:58
virtual void Set(Solver< OperatorType, VectorType, ValueType > &K_Solver, Solver< OperatorType, VectorType, ValueType > &S_Solver)
Definition: preconditioner_saddlepoint.cpp:110
unsigned int precond_mat_format_
Precond matrix format.
Definition: preconditioner_saddlepoint.hpp:44