GEOS
coreComponents
linearAlgebra
utilities
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
36
struct
LinearSolverResult
37
{
41
enum class
Status
42
{
43
InProgress,
44
Success,
45
NotConverged,
46
Breakdown
47
};
48
50
Status
status
= Status::InProgress;
51
53
integer
numIterations
= 0;
54
56
real64
residualReduction
= 0.0;
57
59
real64
setupTime
= 0.0;
60
62
real64
solveTime
= 0.0;
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
84
ENUM_STRINGS
(
LinearSolverResult::Status
,
85
"InProgress"
,
86
"Success"
,
87
"NotConverged"
,
88
"Breakdown"
);
89
90
}
91
92
#endif
//GEOS_LINEARALGEBRA_UTILITIES_LINEARSOLVERRESULT_HPP_
DataTypes.hpp
geos
Definition:
DataLayouts.hpp:29
geos::ENUM_STRINGS
ENUM_STRINGS(LinearSolverParameters::SolverType, "direct", "cg", "gmres", "fgmres", "bicgstab", "preconditioner")
Declare strings associated with enumeration values.
geos::real64
double real64
64-bit floating point type.
Definition:
DataTypes.hpp:99
geos::integer
std::int32_t integer
Signed integer type.
Definition:
DataTypes.hpp:82
geos::LinearSolverResult
Results/stats of a linear solve.
Definition:
LinearSolverResult.hpp:37
geos::LinearSolverResult::success
bool success() const
Check whether the last solve was successful.
Definition:
LinearSolverResult.hpp:68
geos::LinearSolverResult::residualReduction
real64 residualReduction
Final relative residual norm.
Definition:
LinearSolverResult.hpp:56
geos::LinearSolverResult::setupTime
real64 setupTime
Setup time (in seconds) for preconditioners and/or direct factorizations.
Definition:
LinearSolverResult.hpp:59
geos::LinearSolverResult::status
Status status
convergence flag
Definition:
LinearSolverResult.hpp:50
geos::LinearSolverResult::breakdown
bool breakdown() const
Check whether the last solve brokedown.
Definition:
LinearSolverResult.hpp:77
geos::LinearSolverResult::solveTime
real64 solveTime
Solve time (in seconds) exclusive of setup costs.
Definition:
LinearSolverResult.hpp:62
geos::LinearSolverResult::Status
Status
Status of the linear solve.
Definition:
LinearSolverResult.hpp:42
geos::LinearSolverResult::numIterations
integer numIterations
Number of solver iterations performed.
Definition:
LinearSolverResult.hpp:53
Generated by
1.9.1