LinearSolverFactory.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_LINEARSOLVERFACTORY_HEADER_INCLUDED
21#define OPM_LINEARSOLVERFACTORY_HEADER_INCLUDED
22
23
25#include <memory>
26
27namespace Opm
28{
29
30 class ParameterGroup;
31
32
38 {
39 public:
42
58 LinearSolverFactory(const ParameterGroup& param);
59
62
64
74 virtual LinearSolverReport solve(const int size,
75 const int nonzeros,
76 const int* ia,
77 const int* ja,
78 const double* sa,
79 const double* rhs,
80 double* solution,
81 const boost::any& add=boost::any()) const;
82
86 virtual void setTolerance(const double tol);
87
91 virtual double getTolerance() const;
92
93 private:
94 std::shared_ptr<LinearSolverInterface> solver_;
95 };
96
97
98} // namespace Opm
99
100
101#endif // OPM_LINEARSOLVERFACTORY_HEADER_INCLUDED
Definition: LinearSolverFactory.hpp:38
LinearSolverFactory(const ParameterGroup &param)
virtual void setTolerance(const double tol)
virtual ~LinearSolverFactory()
Destructor.
virtual double getTolerance() const
LinearSolverFactory()
Default constructor.
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 &add=boost::any()) const
Abstract interface for linear solvers.
Definition: LinearSolverInterface.hpp:33
LinearSolverReport solve(const CSRMatrix *A, const double *rhs, double *solution) const
Definition: AnisotropicEikonal.hpp:44
Definition: LinearSolverInterface.hpp:42