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 
27 namespace Opm
28 {
29 
30  namespace parameter { class ParameterGroup; }
31 
32 
38  {
39  public:
42 
59 
61  virtual ~LinearSolverFactory();
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
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
virtual ~LinearSolverFactory()
Destructor.
Definition: AnisotropicEikonal.hpp:43
virtual double getTolerance() const
virtual void setTolerance(const double tol)
Definition: ParameterGroup.hpp:109
LinearSolverFactory()
Default constructor.
Definition: LinearSolverFactory.hpp:37
LinearSolverReport solve(const CSRMatrix *A, const double *rhs, double *solution) const
Definition: LinearSolverInterface.hpp:41
Abstract interface for linear solvers.
Definition: LinearSolverInterface.hpp:32