Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
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
23// 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
41namespace rheolef {
42
43// =======================================================================
44// rep
45// =======================================================================
46template<class T, class M>
47class solver_trilinos_ifpack_rep : public solver_abstract_rep<T,M> {
48public:
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
67protected:
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
Expr1::float_type T
Definition field_expr.h:230
This file is part of Rheolef.
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
Expr1::memory_type M