Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_LinearOpWithSolveTester_decl.hpp
1// @HEADER
2// *****************************************************************************
3// Thyra: Interfaces and Support for Abstract Numerical Algorithms
4//
5// Copyright 2004 NTESS and the Thyra contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
11#define THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
12
13
14#include "Thyra_LinearOpWithSolveBase.hpp"
15#include "Teuchos_StandardMemberCompositionMacros.hpp"
16#include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
17#include "Teuchos_FancyOStream.hpp"
18
19
20namespace Thyra {
21
22
59template<class Scalar>
62{
63public:
64
67
70
72
75
78
80 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_default );
83 forward_default_residual_warning_tol );
86 forward_default_residual_error_tol );
89 forward_default_solution_error_warning_tol );
92 forward_default_solution_error_error_tol );
93
95 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_residual );
99 forward_residual_solve_tol );
102 forward_residual_slack_warning_tol );
105 forward_residual_slack_error_tol );
106
108 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_default );
111 adjoint_default_residual_warning_tol );
114 adjoint_default_residual_error_tol );
117 adjoint_default_solution_error_warning_tol );
120 adjoint_default_solution_error_error_tol );
121
124 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_residual );
128 adjoint_residual_solve_tol );
131 adjoint_residual_slack_warning_tol );
134 adjoint_residual_slack_error_tol );
135
138 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
139
142 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
143
148
152
159 void turn_off_all_tests();
160
167 void set_all_solve_tol( const ScalarMag solve_tol );
168
175 void set_all_slack_warning_tol( const ScalarMag slack_warning_tol );
176
183 void set_all_slack_error_tol( const ScalarMag slack_error_tol );
184
186
189
191 void setParameterList(const RCP<ParameterList>& paramList);
192
195
197
200
205 bool check(
208 ) const;
209
211
212private:
213
214 static const bool check_forward_default_default_;
215 static const bool check_forward_residual_default_;
216 static const bool check_adjoint_default_default_;
217 static const bool check_adjoint_residual_default_;
218
219 static const ScalarMag warning_tol_default_;
220 static const ScalarMag error_tol_default_;
221 static const ScalarMag solve_tol_default_;
222 static const ScalarMag slack_warning_tol_default_;
223 static const ScalarMag slack_error_tol_default_;
224
225 static const int num_random_vectors_default_;
226 static const bool show_all_tests_default_;
227 static const bool dump_all_default_;
228 static const int num_rhs_default_;
229
230 static const std::string AllSolveTol_name_;
231 static const std::string AllSlackWarningTol_name_;
232 static const std::string AllSlackErrorTol_name_;
233 static const std::string ShowAllTests_name_;
234 static const std::string DumpAll_name_;
235
236}; // class LinearOpWithSolveTester
237
238
239} // namespace Thyra
240
241
242#endif // THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
Base class for all linear operators that can support a high-level solve operation.
Testing class for LinearOpWithSolveBase.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_residual_slack_error_tol)
void setParameterList(const RCP< ParameterList > &paramList)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_default_residual_error_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_residual_slack_error_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_adjoint_default)
Set if a default forward solve will be performed on not.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, show_all_tests)
Set if all tests are shown or just summaries.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_residual_slack_warning_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_default_solution_error_warning_tol)
void set_all_slack_warning_tol(const ScalarMag slack_warning_tol)
Set all the warning tolerances to the same value.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_default_solution_error_error_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_rhs)
Set the number of right-hand-sides in the multivectors.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_residual_slack_warning_tol)
void set_all_solve_tol(const ScalarMag solve_tol)
Set all the solve tolerances to the same value.
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_random_vectors)
Set the number random vectors that is generated during each test.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_default_solution_error_warning_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_residual_solve_tol)
Set the relative tolerance that will be requested in the residual in the adjoint solve .
bool check(const LinearOpWithSolveBase< Scalar > &op, Teuchos::FancyOStream *out) const
Check a LinearOpWithSolveBase object.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_default_residual_error_tol)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_default_solution_error_error_tol)
void turn_off_all_tests()
Turn off all tests so that individual tests can be set.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_forward_residual)
Set if a tolerance on the residual of the forward solve should checked or not.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, dump_all)
Set if all of the vectors are dumped or not (only relevant if show_all_tests()==true).
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_forward_default)
Set if a default forward solve will be performed on not.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_default_residual_warning_tol)
void set_all_slack_error_tol(const ScalarMag slack_error_tol)
Set all the error tolerances to the same value.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_residual_solve_tol)
Set the relative tolerance that will be requested in the residual for the forward solve .
RCP< const ParameterList > getValidParameters() const
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_adjoint_residual)
Set if a tolerance on the residual of the adjoint solve should checked or not.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, forward_default_residual_warning_tol)