Belos Version of the Day
Loading...
Searching...
No Matches
BelosTypes.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Belos: Block Linear Solvers Package
4//
5// Copyright 2004-2016 NTESS and the Belos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef BELOS_TYPES_HPP
11#define BELOS_TYPES_HPP
12
18#include "BelosConfigDefs.hpp"
19#include "Teuchos_Assert.hpp"
20
21namespace Belos {
22
24
25
28 class BelosError : public std::logic_error {
29 public:
30 BelosError (const std::string& what_arg) : std::logic_error(what_arg) {}
31 };
32
34
35
49 enum ETrans { NOTRANS = 0,
50 TRANS = 1,
51 CONJTRANS = 2
52 };
53
70
97 };
98
111 User
112 };
113
136
137 inline constexpr bool compare(int lhs_int, int rhs_int) {
138 if (lhs_int == 1) {
139 return (rhs_int >= 1);
140 }
141 else if (rhs_int == 1) {
142 return (lhs_int >= 1);
143 }
144 else {
145 return (lhs_int == rhs_int);
146 }
147 }
148
150 int lhs_int = static_cast<int>(lhs);
151 int rhs_int = static_cast<int>(rhs);
152 return compare(lhs_int, rhs_int);
153 }
154
155 constexpr bool operator==(ReturnType lhs, int rhs_int) {
156 int lhs_int = static_cast<int>(lhs);
157 return compare(lhs_int, rhs_int);
158 }
159
160 constexpr bool operator==(int lhs_int, ReturnType rhs) {
161 int rhs_int = static_cast<int>(rhs);
162 return compare(lhs_int, rhs_int);
163 }
164
166 int lhs_int = static_cast<int>(lhs);
167 int rhs_int = static_cast<int>(rhs);
168 return !compare(lhs_int, rhs_int);
169 }
170
171 constexpr bool operator!=(ReturnType lhs, int rhs_int) {
172 int lhs_int = static_cast<int>(lhs);
173 return !compare(lhs_int, rhs_int);
174 }
175
176 constexpr bool operator!=(int lhs_int, ReturnType rhs) {
177 int rhs_int = static_cast<int>(rhs);
178 return !compare(lhs_int, rhs_int);
179 }
180
182 std::string
184
210 enum StatusType { Passed = 0x1,
211 Failed = 0x2,
212 Undefined = 0x4
213 };
214
227 enum ResetType { Problem = 0x1,
228 RecycleSubspace = 0x2
229 };
230
232 std::string
234
237 convertStringToStatusType (const std::string& status);
238
241 convertStringToNormType (const std::string& normType);
242
245 convertStringToScaleType (const std::string& scaleType);
246
248 std::string
249 convertScaleTypeToString (const ScaleType scaleType);
250
263
285
296 std::string
297 convertMsgTypeToString (const MsgType msgType);
298
314 static const double convTol;
315
317 static const double polyTol;
318
320 static const double orthoKappa;
321
323 static const double resScaleFactor;
324
326 static const double impTolScale;
327 };
328
329
330} // end Belos namespace
331
332#endif /* BELOS_TYPES_HPP */
Belos header file which uses auto-configuration information to include necessary C++ headers.
Parent class to all Belos exceptions.
BelosError(const std::string &what_arg)
Alternative run-time polymorphic interface for operators.
std::string convertMsgTypeToString(const MsgType msgType)
Show MsgType as a comma-delimited list of names.
ScaleType convertStringToScaleType(const std::string &scaleType)
Convert the given string to its ScaleType enum value.
NormType
The type of vector norm to compute.
@ PreconditionerNorm
MsgType
Available message types recognized by the linear solvers.
@ OrthoDetails
@ StatusTestDetails
@ FinalSummary
@ TimingDetails
@ IterationDetails
ReturnType
Whether the Belos solve converged for all linear systems.
@ NaNDetected
@ Unconverged
@ MaxItersReached
@ NonspecificException
@ MaxRestartsReached
@ LossOfAccuracyDetected
@ InconsistentState
@ BreakdownDetected
@ OrthonormFailure
@ Undetermined
StatusType
Whether the StatusTest wants iteration to stop.
constexpr bool operator==(ReturnType lhs, ReturnType rhs)
NormType convertStringToNormType(const std::string &normType)
Convert the given string to its NormType enum value.
std::string convertScaleTypeToString(const ScaleType scaleType)
Convert the given ScaleType enum value to its corresponding string.
constexpr bool compare(int lhs_int, int rhs_int)
OutputType
Style of output used to display status test information.
ConjType
Whether or not to conjugate the transpose for block inner products.
std::string convertStatusTypeToString(const StatusType status)
The string name corresponding to the given StatusType enum value.
ScaleType
The type of scaling to use on the residual norm value.
@ UserProvided
@ NormOfFullInitRes
@ NormOfFullPrecInitRes
@ NormOfFullScaledPrecInitRes
@ NormOfFullScaledInitRes
@ NormOfPrecInitRes
@ NormOfInitRes
@ NormOfRHS
ETrans
Whether to apply the (conjugate) transpose of an operator.
@ CONJTRANS
ResetType
How to reset the solver.
@ RecycleSubspace
std::string convertReturnTypeToString(const ReturnType result)
Convert the given ReturnType enum value to its corresponding string.
StatusType convertStringToStatusType(const std::string &status)
The StatusType enum value corresponding to the given string name.
constexpr bool operator!=(ReturnType lhs, ReturnType rhs)
Default parameters common to most Belos solvers.
static const double resScaleFactor
User-defined residual scaling factor.
static const double impTolScale
"Implicit Tolerance Scale Factor"
static const double convTol
Default convergence tolerance.
static const double orthoKappa
DGKS orthogonalization constant.
static const double polyTol
Relative residual tolerance for matrix polynomial construction.

Generated for Belos by doxygen 1.9.8