LinearSolverPetsc.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2014 SINTEF ICT, Applied Mathematics.
3  Copyright 2014 STATOIL ASA.
4 
5  This file is part of the Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
22 #define OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
25 #include <string>
26 
27 namespace Opm
28 {
29 
30 
33  {
34  public:
41 
46 
48  virtual ~LinearSolverPetsc();
49 
51 
61  virtual LinearSolverReport solve(const int size,
62  const int nonzeros,
63  const int* ia,
64  const int* ja,
65  const double* sa,
66  const double* rhs,
67  double* solution,
68  const boost::any&) const;
69 
72  virtual void setTolerance(const double tol);
73 
76  virtual double getTolerance() const;
77  private:
78  std::string ksp_type_;
79  std::string pc_type_;
80  int ksp_view_;
81  double rtol_;
82  double atol_;
83  double dtol_;
84  int maxits_;
85  };
86 
87 
88 } // namespace Opm
89 
90 
91 
92 #endif // OPM_LINEARSOLVERPETSC_HEADER_INCLUDED
Concrete class encapsulating some Petsc linear solvers.
Definition: LinearSolverPetsc.hpp:32
Definition: AnisotropicEikonal.hpp:43
Definition: ParameterGroup.hpp:109
virtual double getTolerance() const
virtual void setTolerance(const double tol)
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 &) const
LinearSolverReport solve(const CSRMatrix *A, const double *rhs, double *solution) const
Definition: LinearSolverInterface.hpp:41
Abstract interface for linear solvers.
Definition: LinearSolverInterface.hpp:32
virtual ~LinearSolverPetsc()
Destructor.