Rheolef  7.1
an efficient C++ finite element environment
solver_mumps.h
Go to the documentation of this file.
1 #ifndef _RHEOLEF_SOLVER_MUMPS_H
2 #define _RHEOLEF_SOLVER_MUMPS_H
23 // solver implementation: interface
24 //
25 
26 #include "rheolef/config.h"
27 
28 #ifdef _RHEOLEF_HAVE_MUMPS
29 
30 #include "rheolef/solver.h"
31 #include "dmumps_c.h"
32 
33 namespace rheolef {
34 
35 // =======================================================================
36 // rep
37 // =======================================================================
38 template<class T, class M>
39 class solver_mumps_rep : public solver_abstract_rep<T,M> {
40 public:
41 // typedef:
42 
43  typedef solver_abstract_rep<T,M> base;
44  typedef typename base::size_type size_type;
45  typedef typename base::determinant_type determinant_type;
46 
47 // allocator:
48 
49  explicit solver_mumps_rep (const csr<T,M>& a, const solver_option& opt = solver_option());
50  solver_abstract_rep<T,M>* clone() const;
51  bool initialized() const { return true; }
52  void update_values (const csr<T,M>& a);
53  ~solver_mumps_rep ();
54 
55 // accessors:
56 
57  vec<T,M> trans_solve (const vec<T,M>& rhs) const;
58  vec<T,M> solve (const vec<T,M>& rhs) const;
59  determinant_type det() const { return _det; }
60 
61 protected:
62 // data:
63  bool _has_mumps_instance;
64  bool _drop_ext_nnz; // when building schur complement
65  mutable DMUMPS_STRUC_C _mumps_par;
66  std::vector<MUMPS_INT> _row; // (i,j) matrix sparse tructure for mumps
67  std::vector<MUMPS_INT> _col;
68  std::vector<double> _val;
69  double _a00; // circumvent a bug when matrix size <= 1...
70  determinant_type _det;
71 };
72 template <class T, class M>
73 inline
74 solver_abstract_rep<T,M>*
75 solver_mumps_rep<T,M>::clone() const
76 {
77  typedef solver_mumps_rep<T,M> rep;
78  return new_macro (rep(*this));
79 }
80 
81 } // namespace rheolef
82 #endif // MUMPS
83 #endif // _RHEOLEF_SOLVER_MUMPS_H
field::size_type size_type
Definition: branch.cc:425
size_t size_type
Definition: basis_get.cc:76
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