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
23
24#if !HAVE_PETSC
25#error "LinearSolverPetsc.hpp included, but the PETSc libraries are not available!"
26#endif
27
29#include <opm/core/utility/parameters/ParameterGroup.hpp>
30#include <string>
31
32namespace Opm
33{
34
35
38 {
39 public:
46
50 LinearSolverPetsc(const ParameterGroup& param);
51
54
56
66 virtual LinearSolverReport solve(const int size,
67 const int nonzeros,
68 const int* ia,
69 const int* ja,
70 const double* sa,
71 const double* rhs,
72 double* solution,
73 const boost::any&) const;
74
77 virtual void setTolerance(const double tol);
78
81 virtual double getTolerance() const;
82 private:
83 std::string ksp_type_;
84 std::string pc_type_;
85 int ksp_view_;
86 double rtol_;
87 double atol_;
88 double dtol_;
89 int maxits_;
90 };
91
92
93} // namespace Opm
94
95
96
97#endif // OPM_LINEARSOLVERPETSC_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 Petsc linear solvers.
Definition: LinearSolverPetsc.hpp:38
virtual double getTolerance() const
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
LinearSolverPetsc(const ParameterGroup &param)
virtual void setTolerance(const double tol)
virtual ~LinearSolverPetsc()
Destructor.
Definition: AnisotropicEikonal.hpp:44
Definition: LinearSolverInterface.hpp:42