Rheolef  7.1
an efficient C++ finite element environment
solver_trilinos_ifpack.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_SOLVER_TRILINOS_IFPACK_H
2 #define _RHEOLEF_SOLVER_TRILINOS_IFPACK_H
3 // solver implementation: interface
24 //
25 
26 #include "rheolef/config.h"
27 
28 #if defined(_RHEOLEF_HAVE_TRILINOS) && defined(_RHEOLEF_HAVE_MPI)
29 
30 #include "rheolef/solver.h"
31 
32 #ifdef _RHEOLEF_HAVE_MPI
33 # include "mpi.h"
34 # include "Epetra_MpiComm.h"
35 #else // _RHEOLEF_HAVE_MPI
36 # include "Epetra_SerialComm.h"
37 #endif // _RHEOLEF_HAVE_MPI
38 #include "Epetra_CrsMatrix.h"
39 #include "Ifpack_Preconditioner.h"
40 
41 namespace rheolef {
42 
43 // =======================================================================
44 // rep
45 // =======================================================================
46 template<class T, class M>
47 class solver_trilinos_ifpack_rep : public solver_abstract_rep<T,M> {
48 public:
49 
50 // allocator:
51 
52  solver_trilinos_ifpack_rep()
53  : solver_abstract_rep<T,M>(solver_option()),
54  _ilu_ptr(0),
55  _petra_ownership_ptr(0)
56  {}
57  explicit solver_trilinos_ifpack_rep (const csr<T,M>& a, const solver_option& opt = solver_option());
58  void update_values (const csr<T,M>& a);
59  bool initialized() const { return true; }
60  ~solver_trilinos_ifpack_rep ();
61 
62 // accessors:
63 
64  vec<T,M> trans_solve (const vec<T,M>& rhs) const;
65  vec<T,M> solve (const vec<T,M>& rhs) const;
66 
67 protected:
68 // internal:
69  void destroy_values ();
70  void solve (const vec<T,M>& rhs, bool transpose, vec<T,M>& x) const;
71 // data:
72  Ifpack_Preconditioner* _ilu_ptr;
73  Epetra_Map* _petra_ownership_ptr;
74 };
75 
76 } // namespace rheolef
77 #endif // defined(_RHEOLEF_HAVE_TRILINOS) && defined(_RHEOLEF_HAVE_MPI)
78 #endif // _RHEOLEF_SOLVER_TRILINOS_IFPACK_H
a
Definition: diffusion_isotropic.h:25
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::solve
void solve(tiny_matrix< T > &a, tiny_vector< size_t > &piv, const tiny_vector< T > &b, tiny_vector< T > &x)
Definition: tiny_lu.h:92
M
Expr1::memory_type M
Definition: vec_expr_v2.h:416
T
Expr1::float_type T
Definition: field_expr.h:261