GEOSX
LinearSolverBase.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2019 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2019 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2019 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All right reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
18 #ifndef GEOS_LINEARSOLVERBASE_HPP
19 #define GEOS_LINEARSOLVERBASE_HPP
20 
21 #include "PreconditionerBase.hpp"
24 #include "common/Stopwatch.hpp"
25 
26 namespace geos
27 {
28 
33 template< typename LAI >
34 class LinearSolverBase : public PreconditionerBase< LAI >
35 {
36 public:
37 
40 
42  using Vector = typename Base::Vector;
43 
45  using Matrix = typename Base::Matrix;
46 
52  : m_params( std::move( params ) )
53  {}
54 
60  virtual void solve( Vector const & rhs, Vector & sol ) const = 0;
61 
66  {
67  return m_params;
68  }
69 
73  LinearSolverResult const & result() const
74  {
75  return m_result;
76  }
77 
78 protected:
79 
82 
85 };
86 
87 }
88 
89 #endif //GEOS_LINEARSOLVERBASE_HPP
Simple interface for linear solvers that allows to extract solution results.
typename Base::Vector Vector
Alias for vector type.
LinearSolverResult m_result
Result of most recent solve (status, timings)
virtual void solve(Vector const &rhs, Vector &sol) const =0
Solve preconditioned system.
LinearSolverParameters m_params
Parameters for the solver.
typename Base::Matrix Matrix
Alias for matrix type.
LinearSolverResult const & result() const
LinearSolverParameters const & parameters() const
LinearSolverBase(LinearSolverParameters params)
Constructor.
Common interface for preconditioning operators.
typename Base::Vector Vector
Alias for vector type.
typename LAI::ParallelMatrix Matrix
Alias for matrix type.
Set of parameters for a linear solver or preconditioner.
Results/stats of a linear solve.