Belos Version of the Day
Loading...
Searching...
No Matches
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
20#include "BelosTypes.hpp"
21#include "BelosIteration.hpp"
22#include "BelosConfigDefs.hpp"
23#include "Teuchos_Describable.hpp"
24
34namespace Belos {
35
37
38
42 {public: StatusTestError(const std::string& what_arg) : BelosError(what_arg) {}};
43
45 {public: StatusTestNaNError(const std::string& what_arg) : StatusTestError(what_arg) {}};
46
48
49template <class ScalarType, class MV, class OP>
50class StatusTest : public Teuchos::Describable {
51
52 public:
54
55
58
60 virtual ~StatusTest() {};
62
64
65
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 };
116
117};
118
119} // end of Belos namespace
120
121#endif /* BELOS_STATUS_TEST_HPP */
Belos header file which uses auto-configuration information to include necessary C++ headers.
Pure virtual base class which describes the basic interface to the linear solver iteration.
Collection of types and exceptions used within the Belos solvers.
Parent class to all Belos exceptions.
Alternative run-time polymorphic interface for operators.
Exception thrown to signal error in a status test during Belos::StatusTest::checkStatus().
StatusTestError(const std::string &what_arg)
StatusTestNaNError(const std::string &what_arg)
A pure virtual class for defining the status tests for the Belos iterative solvers.
virtual StatusType getStatus() const =0
Return the result of the most recent CheckStatus call.
virtual ~StatusTest()
Destructor.
virtual void print(std::ostream &os, int indent=0) const =0
Output formatted description of stopping test to output stream.
virtual StatusType checkStatus(Iteration< ScalarType, MV, OP > *iSolver)=0
Check convergence status: Unconverged, Converged, Failed.
StatusTest()
Constructor.
virtual void reset()=0
Informs the convergence test that it should reset its internal configuration to the initialized state...
virtual void printStatus(std::ostream &os, StatusType type) const
Output the result of the most recent CheckStatus call.
StatusType
Whether the StatusTest wants iteration to stop.

Generated for Belos by doxygen 1.9.8