GEOS
RichardsonSolver.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_LINEARALGEBRA_SOLVERS_RICHARDSONSOLVER_HPP_
20 #define GEOS_LINEARALGEBRA_SOLVERS_RICHARDSONSOLVER_HPP_
21 
23 
24 namespace geos
25 {
26 
34 template< typename VECTOR >
35 class RichardsonSolver final : public KrylovSolver< VECTOR >
36 {
37 public:
38 
41 
43  using Vector = typename Base::Vector;
44 
49 
57  LinearOperator< Vector > const & matrix,
58  LinearOperator< Vector > const & precond );
59 
61 
66 
72  virtual void solve( Vector const & b, Vector & x ) const override;
73 
74  virtual string methodName() const override
75  {
76  return "Richardson";
77  };
78 
80 
81 protected:
82 
85 
86  using Base::m_params;
87  using Base::m_operator;
88  using Base::m_precond;
90  using Base::m_result;
92  using Base::logProgress;
93  using Base::logResult;
94 
95 private:
96 
97  real64 m_omega;
98 };
99 
100 } // geosx
101 
102 #endif //GEOS_LINEARALGEBRA_SOLVERS_RICHARDSONSOLVER_HPP_
Base class for Krylov solvers.
LinearSolverResult m_result
results of a solve
LinearOperator< Vector > const & m_operator
reference to the operator to be solved
static VectorTemp createTempVector(Vector const &src)
Helper function to create temporary vectors based on a source vector.
void logResult() const
Output convergence result (called by implementations).
typename Base::Vector Vector
Alias for template parameter.
typename VectorStorageHelper< VECTOR >::type VectorTemp
Alias for vector type that can be used for temporaries.
LinearOperator< Vector > const & m_precond
reference to the preconditioning operator
void logProgress() const
Output iteration progress (called by implementations).
array1d< real64 > m_residualNorms
Absolute residual norms at each iteration (if available)
LinearSolverParameters m_params
parameters of the solver
Abstract base class for linear operators.
VECTOR Vector
Alias for template parameter.
Implements preconditioned modified Richardson iteration.
RichardsonSolver(LinearSolverParameters params, LinearOperator< Vector > const &matrix, LinearOperator< Vector > const &precond)
Solver object constructor.
virtual string methodName() const override
Get name of the Krylov subspace method.
virtual void solve(Vector const &b, Vector &x) const override
Solve preconditioned system.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
Set of parameters for a linear solver or preconditioner.