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
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,
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) {
91 }
92 else {
94 }
95 break;
96 case Brief:
97 if (mod > 0) {
99 }
100 else {
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) {
115 }
116 else {
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 ) {}
137 StatusTestOutputFactory( const StatusTestOutputFactory<ScalarType,MV,OP>& ) {}
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.
Alternative run-time polymorphic interface for operators.
A factory class for generating StatusTestOutput objects.
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.

Generated for Belos by doxygen 1.9.8