Rheolef  7.1
an efficient C++ finite element environment
solver_umfpack.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_SOLVER_UMFPACK_H
2 #define _RHEOLEF_SOLVER_UMFPACK_H
3 // solver implementation: interface
24 //
25 
26 #include "rheolef/config.h"
27 
28 #ifdef _RHEOLEF_HAVE_UMFPACK
29 
30 #include "rheolef/solver.h"
31 extern "C" {
32 #include <umfpack.h>
33 }
34 namespace rheolef {
35 
36 // =======================================================================
37 // rep
38 // =======================================================================
39 template<class T, class M>
41 public:
42 // typedef:
43 
45  typedef typename base::size_type size_type;
47 
48 // allocator:
49 
51  explicit solver_umfpack_rep (const csr<T,M>& a, const solver_option& opt = solver_option());
53  bool initialized() const { return true; }
54  void update_values (const csr<T,M>& a);
56 
57 // accessors:
58 
59  vec<T,M> trans_solve (const vec<T,M>& rhs) const;
60  vec<T,M> solve (const vec<T,M>& rhs) const;
61  determinant_type det() const { return _det; }
62 
63 protected:
64 // data:
65  int _n;
66  void* _numeric;
67  int* _ia_p;
68  int* _ja_p;
69  T* _a_p; // TODO: only used when T=double yet
71  double _control [UMFPACK_INFO];
72  mutable double _info [UMFPACK_INFO];
73 
74 // internal:
75  void _set_control();
76  void _destroy();
77  void _solve (int transpose_flag, const vec<T,M>& b, vec<T,M>& x) const;
78 private:
81 };
82 template <class T, class M>
83 inline
86 {
87  typedef solver_umfpack_rep<T,M> rep;
88  return new_macro (rep(*this));
89 }
90 
91 } // namespace rheolef
92 #endif // _RHEOLEF_HAVE_UMFPACK
93 #endif // _RHEOLEF_SOLVER_UMFPACK_H
rheolef::solver_umfpack_rep::_info
double _info[UMFPACK_INFO]
Definition: solver_umfpack.h:72
rheolef::solver_umfpack_rep::base
solver_abstract_rep< T, M > base
Definition: solver_umfpack.h:44
mkgeo_ball.b
int b
Definition: mkgeo_ball.sh:152
rheolef::solver_umfpack_rep::_a_p
T * _a_p
Definition: solver_umfpack.h:69
rheolef::solver_umfpack_rep::clone
solver_abstract_rep< T, M > * clone() const
Definition: solver_umfpack.h:85
rheolef::solver_umfpack_rep::det
determinant_type det() const
Definition: solver_umfpack.h:61
rheolef::solver_umfpack_rep::solve
vec< T, M > solve(const vec< T, M > &rhs) const
Definition: solver_umfpack.cc:187
rheolef::solver_umfpack_rep::_control
double _control[UMFPACK_INFO]
Definition: solver_umfpack.h:71
rheolef::solver_umfpack_rep::_ia_p
int * _ia_p
Definition: solver_umfpack.h:67
rheolef::vec
see the vec page for the full documentation
Definition: vec.h:79
rheolef::solver_abstract_rep::determinant_type
Definition: solver.h:215
rheolef::solver_umfpack_rep::_n
int _n
Definition: solver_umfpack.h:65
rheolef::solver_umfpack_rep::initialized
bool initialized() const
Definition: solver_umfpack.h:53
rheolef::solver_umfpack_rep::size_type
base::size_type size_type
Definition: solver_umfpack.h:45
rheolef::solver_umfpack_rep::_destroy
void _destroy()
Definition: solver_umfpack.cc:137
rheolef::solver_abstract_rep
Definition: solver.h:191
rheolef::solver_umfpack_rep::_ja_p
int * _ja_p
Definition: solver_umfpack.h:68
a
Definition: diffusion_isotropic.h:25
rheolef::csr
see the csr page for the full documentation
Definition: csr.h:317
rheolef::solver_umfpack_rep::_set_control
void _set_control()
Definition: solver_umfpack.cc:125
rheolef::solver_umfpack_rep::_det
determinant_type _det
Definition: solver_umfpack.h:70
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
rheolef::solver_abstract_rep::size_type
csr< T, M >::size_type size_type
Definition: solver.h:193
rheolef::solver_umfpack_rep::~solver_umfpack_rep
~solver_umfpack_rep()
Definition: solver_umfpack.cc:131
rheolef::solver_umfpack_rep::trans_solve
vec< T, M > trans_solve(const vec< T, M > &rhs) const
Definition: solver_umfpack.cc:196
rheolef::solver_umfpack_rep
Definition: solver_umfpack.h:40
rheolef::solver_umfpack_rep::_solve
void _solve(int transpose_flag, const vec< T, M > &b, vec< T, M > &x) const
Definition: solver_umfpack.cc:180
rheolef::solver_umfpack_rep::solver_umfpack_rep
solver_umfpack_rep()
Definition: solver_umfpack.cc:73
rheolef::solver_umfpack_rep::update_values
void update_values(const csr< T, M > &a)
Definition: solver_umfpack.cc:147
T
Expr1::float_type T
Definition: field_expr.h:261
rheolef::solver_umfpack_rep::_numeric
void * _numeric
Definition: solver_umfpack.h:66
rheolef::solver_option
see the solver_option page for the full documentation
Definition: solver_option.h:155
rheolef::solver_umfpack_rep::determinant_type
base::determinant_type determinant_type
Definition: solver_umfpack.h:46