LinearSolverIstl.hpp
Go to the documentation of this file.
1/*
2 Copyright 2012 SINTEF ICT, Applied Mathematics.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_LINEARSOLVERISTL_HEADER_INCLUDED
21#define OPM_LINEARSOLVERISTL_HEADER_INCLUDED
22
23
25#include <opm/core/utility/parameters/ParameterGroup.hpp>
26#include <string>
27#include <boost/any.hpp>
28
29namespace Opm
30{
31
34 {
35 public:
51
55 LinearSolverIstl(const ParameterGroup& param);
56
59
61
71 virtual LinearSolverReport solve(const int size,
72 const int nonzeros,
73 const int* ia,
74 const int* ja,
75 const double* sa,
76 const double* rhs,
77 double* solution,
78 const boost::any& comm=boost::any()) const;
79
82 virtual void setTolerance(const double tol);
83
86 virtual double getTolerance() const;
87
88 private:
96 template<class O, class S, class C>
97 LinearSolverReport solveSystem(O& opA, double* solution, const double *rhs,
98 S& sp, const C& comm, int maxit) const;
99
100 double linsolver_residual_tolerance_;
101 int linsolver_verbosity_;
102 enum LinsolverType { CG_ILU0 = 0, CG_AMG = 1, BiCGStab_ILU0 = 2, FastAMG=3, KAMG=4 };
103 LinsolverType linsolver_type_;
104 bool linsolver_save_system_;
105 std::string linsolver_save_filename_;
106 int linsolver_max_iterations_;
108 int linsolver_smooth_steps_;
110 double linsolver_prolongate_factor_;
111
112 };
113
114
115} // namespace Opm
116
117
118
119#endif // OPM_LINEARSOLVERISTL_HEADER_INCLUDED
Abstract interface for linear solvers.
Definition: LinearSolverInterface.hpp:33
LinearSolverReport solve(const CSRMatrix *A, const double *rhs, double *solution) const
Concrete class encapsulating some dune-istl linear solvers.
Definition: LinearSolverIstl.hpp:34
virtual double getTolerance() const
LinearSolverIstl(const ParameterGroup &param)
virtual LinearSolverReport solve(const int size, const int nonzeros, const int *ia, const int *ja, const double *sa, const double *rhs, double *solution, const boost::any &comm=boost::any()) const
virtual void setTolerance(const double tol)
virtual ~LinearSolverIstl()
Destructor.
Definition: AnisotropicEikonal.hpp:44
Definition: LinearSolverInterface.hpp:42