Belos
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
BelosStatusTest.hpp
Go to the documentation of this file.
1
2
// @HEADER
3
// *****************************************************************************
4
// Belos: Block Linear Solvers Package
5
//
6
// Copyright 2004-2016 NTESS and the Belos contributors.
7
// SPDX-License-Identifier: BSD-3-Clause
8
// *****************************************************************************
9
// @HEADER
10
//
11
12
#ifndef BELOS_STATUS_TEST_HPP
13
#define BELOS_STATUS_TEST_HPP
14
19
20
#include "
BelosTypes.hpp
"
21
#include "
BelosIteration.hpp
"
22
#include "
BelosConfigDefs.hpp
"
23
#include "Teuchos_Describable.hpp"
24
33
34
namespace
Belos
{
35
37
38
41
class
StatusTestError
:
public
BelosError
42
{
public
:
StatusTestError
(
const
std::string& what_arg) :
BelosError
(what_arg) {}};
43
44
class
StatusTestNaNError
:
public
StatusTestError
45
{
public
:
StatusTestNaNError
(
const
std::string& what_arg) :
StatusTestError
(what_arg) {}};
46
48
49
template
<
class
ScalarType,
class
MV,
class
OP>
50
class
StatusTest
:
public
Teuchos::Describable {
51
52
public
:
54
55
57
StatusTest
() {};
58
60
virtual
~StatusTest
() {};
62
64
65
74
virtual
StatusType
checkStatus
(
Iteration<ScalarType,MV,OP>
* iSolver ) = 0;
75
77
virtual
StatusType
getStatus
()
const
= 0;
79
81
82
88
virtual
void
reset
() = 0;
90
92
93
95
virtual
void
print
(std::ostream& os,
int
indent = 0)
const
= 0;
96
98
virtual
void
printStatus
(std::ostream& os,
StatusType
type)
const
{
99
os << std::left << std::setw(13) << std::setfill(
'.'
);
100
switch
(type) {
101
case
Passed
:
102
os <<
"Passed"
;
103
break
;
104
case
Failed
:
105
os <<
"Failed"
;
106
break
;
107
case
Undefined
:
108
default
:
109
os <<
"**"
;
110
break
;
111
}
112
os << std::left << std::setfill(
' '
);
113
return
;
114
};
115
116
117
};
118
119
}
// end of Belos namespace
120
121
#endif
/* BELOS_STATUS_TEST_HPP */
BelosConfigDefs.hpp
Belos header file which uses auto-configuration information to include necessary C++ headers.
BelosIteration.hpp
Pure virtual base class which describes the basic interface to the linear solver iteration.
BelosTypes.hpp
Collection of types and exceptions used within the Belos solvers.
Belos::BelosError::BelosError
BelosError(const std::string &what_arg)
Definition
BelosTypes.hpp:30
Belos::Iteration
Definition
BelosIteration.hpp:41
Belos::StatusTestError::StatusTestError
StatusTestError(const std::string &what_arg)
Definition
BelosStatusTest.hpp:42
Belos::StatusTest::getStatus
virtual StatusType getStatus() const =0
Return the result of the most recent CheckStatus call.
Belos::StatusTest::~StatusTest
virtual ~StatusTest()
Destructor.
Definition
BelosStatusTest.hpp:60
Belos::StatusTest::print
virtual void print(std::ostream &os, int indent=0) const =0
Output formatted description of stopping test to output stream.
Belos::StatusTest::checkStatus
virtual StatusType checkStatus(Iteration< ScalarType, MV, OP > *iSolver)=0
Check convergence status: Unconverged, Converged, Failed.
Belos::StatusTest::StatusTest
StatusTest()
Constructor.
Definition
BelosStatusTest.hpp:57
Belos::StatusTest::reset
virtual void reset()=0
Informs the convergence test that it should reset its internal configuration to the initialized state...
Belos::StatusTest::printStatus
virtual void printStatus(std::ostream &os, StatusType type) const
Output the result of the most recent CheckStatus call.
Definition
BelosStatusTest.hpp:98
Belos::StatusTestNaNError::StatusTestNaNError
StatusTestNaNError(const std::string &what_arg)
Definition
BelosStatusTest.hpp:45
Belos
Definition
Belos_Details_EBelosSolverType.cpp:13
Belos::StatusType
StatusType
Whether the StatusTest wants iteration to stop.
Definition
BelosTypes.hpp:157
Belos::Failed
@ Failed
Definition
BelosTypes.hpp:158
Belos::Undefined
@ Undefined
Definition
BelosTypes.hpp:159
Belos::Passed
@ Passed
Definition
BelosTypes.hpp:157
Generated for Belos by
1.17.0