Belos Version of the Day
Loading...
Searching...
No Matches
BelosStatusTestOutputFactory.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
11#ifndef BELOS_STATUS_TEST_OUTPUT_FACTORY_HPP
12#define BELOS_STATUS_TEST_OUTPUT_FACTORY_HPP
13
18
19#include "BelosConfigDefs.hpp"
20#include "BelosTypes.hpp"
24
25
26namespace Belos {
27
37template <class ScalarType, class MV, class OP>
39
40 public:
42
43
52 StatusTestOutputFactory( int outputStyle, Teuchos::RCP<std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > > taggedTests = Teuchos::null )
53 : outputStyle_(outputStyle),
54 taggedTests_(taggedTests)
55 {}
56
60
61
63
64
79 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > create(const Teuchos::RCP<OutputManager<ScalarType> > &printer,
80 Teuchos::RCP<StatusTest<ScalarType,MV,OP> > test,
81 int mod,
82 int printStates)
83 {
84 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP> > outputTest;
85
86 switch( outputStyle_ ) {
87
88 case General:
89 if (mod > 0) {
90 outputTest = Teuchos::rcp( new StatusTestGeneralOutput<ScalarType,MV,OP>( printer, test, mod, printStates ) );
91 }
92 else {
93 outputTest = Teuchos::rcp( new StatusTestGeneralOutput<ScalarType,MV,OP>( printer, test, 1 ) );
94 }
95 break;
96 case Brief:
97 if (mod > 0) {
98 outputTest = Teuchos::rcp( new StatusTestResNormOutput<ScalarType,MV,OP>( printer, test, mod, printStates ) );
99 }
100 else {
101 outputTest = Teuchos::rcp( new StatusTestResNormOutput<ScalarType,MV,OP>( printer, test, 1 ) );
102 }
103 break;
104 case User:
105 if (mod > 0) {
106 outputTest = Teuchos::rcp( new StatusTestUserOutput<ScalarType,MV,OP>( printer, test, taggedTests_, mod, printStates ) );
107 }
108 else {
109 outputTest = Teuchos::rcp( new StatusTestUserOutput<ScalarType,MV,OP>( printer, test, taggedTests_, 1 ) );
110 }
111 break;
112 default: //Default to General if invalid outputStyle_ given.
113 if (mod > 0) {
114 outputTest = Teuchos::rcp( new StatusTestGeneralOutput<ScalarType,MV,OP>( printer, test, mod, printStates ) );
115 }
116 else {
117 outputTest = Teuchos::rcp( new StatusTestGeneralOutput<ScalarType,MV,OP>( printer, test, 1 ) );
118 }
119 break;
120 }
121
122
123 return outputTest;
124 }
125
127
128 private:
129
130 // Which type of StatusTestOutput class
131 int outputStyle_;
132
133 Teuchos::RCP<std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP> > > > taggedTests_;
134
135 // Hide the default constructor and copy constructor
136 StatusTestOutputFactory( void ) {}
138
139};
140
141} // end of Belos namespace
142
143#endif /* BELOS_STATUS_TEST_OUTPUT_FACTORY_HPP */
Belos header file which uses auto-configuration information to include necessary C++ headers.
Special StatusTest for printing any kind of status test.
Special StatusTest for printing status tests in simple format for residuals.
Special StatusTest for printing status tests in simple format for residuals.
Collection of types and exceptions used within the Belos solvers.
Belos's basic output manager for sending information of select verbosity levels to the appropriate ou...
A special StatusTest for printing other status tests.
StatusTestOutputFactory(int outputStyle, Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > > > taggedTests=Teuchos::null)
Constructor.
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP > > create(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP > > test, int mod, int printStates)
Create the StatusTestOutput object specified by the outputStyle.
A special StatusTest for printing other status tests in a simple format.
A special StatusTest for printing other status tests in a simple format.
A pure virtual class for defining the status tests for the Belos iterative solvers.

Generated on for Belos by doxygen 1.15.0