~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to skit/plib2/solver_mumps.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RHEOLEF_SOLVER_MUMPS_H
 
2
#define _RHEOLEF_SOLVER_MUMPS_H
 
3
///
 
4
/// This file is part of Rheolef.
 
5
///
 
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
 
7
///
 
8
/// Rheolef is free software; you can redistribute it and/or modify
 
9
/// it under the terms of the GNU General Public License as published by
 
10
/// the Free Software Foundation; either version 2 of the License, or
 
11
/// (at your option) any later version.
 
12
///
 
13
/// Rheolef is distributed in the hope that it will be useful,
 
14
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
/// GNU General Public License for more details.
 
17
///
 
18
/// You should have received a copy of the GNU General Public License
 
19
/// along with Rheolef; if not, write to the Free Software
 
20
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
21
///
 
22
/// =========================================================================
 
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 typename csr<T,M>::size_type size_type;
 
44
 
 
45
// allocator:
 
46
 
 
47
  solver_mumps_rep()
 
48
   : solver_abstract_rep<T,M>(solver_option_type()),
 
49
     _has_mumps_instance(false),
 
50
     _mumps_par(),
 
51
     _row(),
 
52
     _col(),
 
53
     _a00(0)
 
54
    {}
 
55
  explicit solver_mumps_rep (const csr<T,M>& a, const solver_option_type& opt = solver_option_type());
 
56
  void update_values (const csr<T,M>& a);
 
57
  ~solver_mumps_rep ();
 
58
 
 
59
// accessors:
 
60
 
 
61
  vec<T,M> trans_solve (const vec<T,M>& rhs) const;
 
62
  vec<T,M> solve       (const vec<T,M>& rhs) const;
 
63
 
 
64
protected:
 
65
// data:
 
66
  bool                    _has_mumps_instance;
 
67
  mutable DMUMPS_STRUC_C  _mumps_par;
 
68
  std::vector<int>        _row; // (i,j) matrix sparse tructure for mumps
 
69
  std::vector<int>        _col;
 
70
  T                       _a00; // circumvent a bug when matrix size <= 1...
 
71
};
 
72
 
 
73
} // namespace rheolef
 
74
#endif // MUMPS
 
75
#endif // _RHEOLEF_SOLVER_MUMPS_H