29 #ifndef Rythmos_STEPPER_SUPPORT_TYPES_H
30 #define Rythmos_STEPPER_SUPPORT_TYPES_H
32 #include "Rythmos_Types.hpp"
33 #include "Thyra_VectorBase.hpp"
40 enum StepSizeType { STEP_TYPE_FIXED, STEP_TYPE_VARIABLE };
45 const char* toString(
const StepSizeType stepSizeType )
47 switch(stepSizeType) {
49 return "STEP_TYPE_FIXED";
50 case STEP_TYPE_VARIABLE:
51 return "STEP_TYPE_VARIABLE";
52 #ifdef HAVE_RYTHMOS_DEBUG
54 TEUCHOS_TEST_FOR_EXCEPT(
"Invalid enum value!");
63 STEP_STATUS_UNINITIALIZED
64 ,STEP_STATUS_CONVERGED
71 const char* toString(
const EStepStatus stepStatus)
74 case STEP_STATUS_UNINITIALIZED:
return "STEP_STATUS_UNINITIALIZED";
75 case STEP_STATUS_CONVERGED:
return "STEP_STATUS_CONVERGED";
76 case STEP_STATUS_UNKNOWN:
return "STEP_STATUS_UNKNOWN";
77 #ifdef HAVE_RYTHMOS_DEBUG
78 default: TEUCHOS_TEST_FOR_EXCEPT(
true);
87 STEP_LET_STATUS_PASSED
88 ,STEP_LET_STATUS_FAILED
89 ,STEP_LET_STATUS_UNKNOWN
95 const char* toString(
const EStepLETStatus stepLETStatus)
97 switch(stepLETStatus) {
98 case STEP_LET_STATUS_PASSED:
return "STEP_LET_STATUS_PASSED";
99 case STEP_LET_STATUS_FAILED:
return "STEP_LET_STATUS_FAILED";
100 case STEP_LET_STATUS_UNKNOWN:
return "STEP_LET_STATUS_UNKNOWN";
101 #ifdef HAVE_RYTHMOS_DEBUG
102 default: TEUCHOS_TEST_FOR_EXCEPT(
true);
110 enum EBreakPointType {
111 BREAK_POINT_TYPE_HARD,
112 BREAK_POINT_TYPE_SOFT
118 const char* toString(
const EBreakPointType breakPointType)
120 switch(breakPointType) {
121 case BREAK_POINT_TYPE_HARD:
return "BREAK_POINT_TYPE_HARD";
122 case BREAK_POINT_TYPE_SOFT:
return "BREAK_POINT_TYPE_SOFT";
123 #ifdef HAVE_RYTHMOS_DEBUG
124 default: TEUCHOS_TEST_FOR_EXCEPT(
true);
132 template<
class Scalar>
161 :stepStatus(STEP_STATUS_UNKNOWN)
162 ,stepLETStatus(STEP_LET_STATUS_UNKNOWN)
163 ,
stepLETValue(Scalar(-Teuchos::ScalarTraits<Scalar>::one()))
169 template<
class Scalar>
170 std::ostream& operator<<( std::ostream& out_arg, const StepStatus<Scalar> &stepStatus )
173 RCP<Teuchos::FancyOStream>
174 out = Teuchos::getFancyOStream(Teuchos::rcp(&out_arg,
false));
175 Teuchos::OSTab tab(out);
177 <<
"message: \"" << stepStatus.message <<
"\"" << endl
178 <<
"stepStatus = " << toString(stepStatus.stepStatus) << endl
179 <<
"stepLETStatus = " << toString(stepStatus.stepLETStatus) << endl
180 <<
"stepSize = " << stepStatus.stepSize << endl
181 <<
"order = " << stepStatus.order << endl
182 <<
"time = " << stepStatus.time << endl
183 <<
"stepLETValue = " << stepStatus.stepLETValue << endl;
184 if (stepStatus.solution == Teuchos::null) {
185 *out <<
"solution = NULL" << endl;
188 *out <<
"solution = " << stepStatus.solution->description() << endl;
190 if (stepStatus.solutionDot == Teuchos::null) {
191 *out <<
"solutionDot = NULL" << endl;
194 *out <<
"solutionDot = " << stepStatus.solutionDot->description() << endl;
196 if (stepStatus.residual == Teuchos::null) {
197 *out <<
"residual = NULL" << endl;
200 *out <<
"residual = " << stepStatus.residual->description() << endl;
202 *out <<
"extraParameters: ";
203 if(stepStatus.extraParameters.get()) {
205 stepStatus.extraParameters->print(Teuchos::OSTab(out).o(),1000,
true);
208 *out <<
"NONE" << endl;
215 #endif // Rythmos_STEPPER_SUPPORT_TYPES_H
RCP< const Teuchos::ParameterList > extraParameters
RCP< const Thyra::VectorBase< Scalar > > residual
RCP< const Thyra::VectorBase< Scalar > > solutionDot
EStepLETStatus stepLETStatus
RCP< const Thyra::VectorBase< Scalar > > solution