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
25namespace Belos {
26
36template <class ScalarType, class MV, class OP, class DM = DefaultDenseMatrix<int,ScalarType>>
38
39 public:
41
42
51 StatusTestOutputFactory( int outputStyle, Teuchos::RCP<std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP,DM> > > > taggedTests = Teuchos::null )
52 : outputStyle_(outputStyle),
53 taggedTests_(taggedTests)
54 {}
55
59
60
62
63
78 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP,DM> > create(const Teuchos::RCP<OutputManager<ScalarType> > &printer,
80 int mod,
81 int printStates)
82 {
83 Teuchos::RCP<StatusTestOutput<ScalarType,MV,OP,DM> > outputTest;
84
85 switch( outputStyle_ ) {
86
87 case General:
88 if (mod > 0) {
90 }
91 else {
93 }
94 break;
95 case Brief:
96 if (mod > 0) {
98 }
99 else {
101 }
102 break;
103 case User:
104 if (mod > 0) {
105 outputTest = Teuchos::rcp( new StatusTestUserOutput<ScalarType,MV,OP,DM>( printer, test, taggedTests_, mod, printStates ) );
106 }
107 else {
108 outputTest = Teuchos::rcp( new StatusTestUserOutput<ScalarType,MV,OP,DM>( printer, test, taggedTests_, 1 ) );
109 }
110 break;
111 default: //Default to General if invalid outputStyle_ given.
112 if (mod > 0) {
114 }
115 else {
117 }
118 break;
119 }
120
121
122 return outputTest;
123 }
124
126
127 private:
128
129 // Which type of StatusTestOutput class
130 int outputStyle_;
131
132 Teuchos::RCP<std::map<std::string,Teuchos::RCP<StatusTest<ScalarType,MV,OP,DM> > > > taggedTests_;
133
134 // Hide the default constructor and copy constructor
135 StatusTestOutputFactory( void ) {}
136 StatusTestOutputFactory( const StatusTestOutputFactory<ScalarType,MV,OP,DM>& ) {}
137
138};
139
140} // end of Belos namespace
141
142#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.
Teuchos::RCP< StatusTestOutput< ScalarType, MV, OP, DM > > create(const Teuchos::RCP< OutputManager< ScalarType > > &printer, Teuchos::RCP< StatusTest< ScalarType, MV, OP, DM > > test, int mod, int printStates)
Create the StatusTestOutput object specified by the outputStyle.
StatusTestOutputFactory(int outputStyle, Teuchos::RCP< std::map< std::string, Teuchos::RCP< StatusTest< ScalarType, MV, OP, DM > > > > taggedTests=Teuchos::null)
Constructor.

Generated for Belos by doxygen 1.9.8