GEOS
LinearSolverResult.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERRESULT_HPP_
21 #define GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERRESULT_HPP_
22 
23 #include "common/DataTypes.hpp"
24 
25 #include <vector>
26 
27 namespace geos
28 {
29 
37 {
41  enum class Status
42  {
43  InProgress,
44  Success,
45  NotConverged,
46  Breakdown
47  };
48 
50  Status status = Status::InProgress;
51 
54 
57 
60 
63 
68  bool success() const
69  {
70  return status == Status::Success;
71  }
72 
77  bool breakdown() const
78  {
79  return status == Status::Breakdown;
80  }
81 };
82 
85  "InProgress",
86  "Success",
87  "NotConverged",
88  "Breakdown" );
89 
90 }
91 
92 #endif //GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERRESULT_HPP_
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Results/stats of a linear solve.
bool success() const
Check whether the last solve was successful.
real64 residualReduction
Final relative residual norm.
real64 setupTime
Setup time (in seconds) for preconditioners and/or direct factorizations.
Status status
convergence flag
bool breakdown() const
Check whether the last solve brokedown.
real64 solveTime
Solve time (in seconds) exclusive of setup costs.
Status
Status of the linear solve.
integer numIterations
Number of solver iterations performed.