1
// Copyright (C) 2005 Garth N. Wells.
1
// Copyright (C) 2006 Anders Logg.
2
2
// Licensed under the GNU GPL Version 2.
4
// First added: 2005-12-02
4
// First added: 2006-08-16
5
// Last changed: 2006-08-16
7
7
#include <dolfin/GMRES.h>
9
9
using namespace dolfin;
11
//-----------------------------------------------------------------------------
12
GMRES::GMRES() : KrylovSolver(gmres)
16
//-----------------------------------------------------------------------------
17
GMRES::GMRES(Preconditioner::Type preconditioner_type) : KrylovSolver(gmres, preconditioner_type)
21
//-----------------------------------------------------------------------------
12
//-----------------------------------------------------------------------------
13
dolfin::uint GMRES::solve(const PETScMatrix& A, PETScVector& x,
14
const PETScVector& b, Preconditioner pc)
16
PETScKrylovSolver solver(gmres, pc);
17
return solver.solve(A, x, b);
19
//-----------------------------------------------------------------------------
20
dolfin::uint GMRES::solve(const PETScKrylovMatrix& A, PETScVector& x,
21
const PETScVector& b, Preconditioner pc)
23
PETScKrylovSolver solver(gmres, pc);
24
return solver.solve(A, x, b);
26
//-----------------------------------------------------------------------------
27
dolfin::uint GMRES::solve(const PETScMatrix& A, PETScVector& x,
28
const PETScVector& b, PETScPreconditioner& pc)
30
PETScKrylovSolver solver(gmres, pc);
31
return solver.solve(A, x, b);
33
//-----------------------------------------------------------------------------
34
dolfin::uint GMRES::solve(const PETScKrylovMatrix& A, PETScVector& x,
35
const PETScVector& b, PETScPreconditioner& pc)
37
PETScKrylovSolver solver(gmres, pc);
38
return solver.solve(A, x, b);
40
//-----------------------------------------------------------------------------
43
//-----------------------------------------------------------------------------
44
dolfin::uint GMRES::solve(const uBlasMatrix<ublas_dense_matrix>& A,
45
uBlasVector& x, const uBlasVector& b,
48
uBlasKrylovSolver solver(gmres, pc);
49
return solver.solve(A, x, b);
51
//-----------------------------------------------------------------------------
52
dolfin::uint GMRES::solve(const uBlasMatrix<ublas_sparse_matrix>& A,
53
uBlasVector& x, const uBlasVector& b,
56
uBlasKrylovSolver solver(gmres, pc);
57
return solver.solve(A, x, b);
59
//-----------------------------------------------------------------------------
60
dolfin::uint GMRES::solve(const uBlasKrylovMatrix& A, uBlasVector& x,
61
const uBlasVector& b, Preconditioner pc)
63
uBlasKrylovSolver solver(gmres, pc);
64
return solver.solve(A, x, b);
66
//-----------------------------------------------------------------------------
67
dolfin::uint GMRES::solve(const uBlasMatrix<ublas_dense_matrix>& A,
68
uBlasVector& x, const uBlasVector& b,
69
uBlasPreconditioner& pc)
71
uBlasKrylovSolver solver(gmres, pc);
72
return solver.solve(A, x, b);
74
//-----------------------------------------------------------------------------
75
dolfin::uint GMRES::solve(const uBlasMatrix<ublas_sparse_matrix>& A,
76
uBlasVector& x, const uBlasVector& b,
77
uBlasPreconditioner& pc)
79
uBlasKrylovSolver solver(gmres, pc);
80
return solver.solve(A, x, b);
82
//-----------------------------------------------------------------------------
83
dolfin::uint GMRES::solve(const uBlasKrylovMatrix& A, uBlasVector& x,
84
const uBlasVector& b, uBlasPreconditioner& pc)
86
uBlasKrylovSolver solver(gmres, pc);
87
return solver.solve(A, x, b);
26
89
//-----------------------------------------------------------------------------