Rythmos - Transient Integration for Differential Equations
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Rythmos_StepControlInfo.hpp
1
2
#ifndef RYTHMOS_STEP_CONTROL_INFO_HPP
3
#define RYTHMOS_STEP_CONTROL_INFO_HPP
4
5
// disable clang warnings
6
#ifdef __clang__
7
#pragma clang system_header
8
#endif
9
10
#include "Rythmos_StepperSupportTypes.hpp"
11
12
namespace
Rythmos {
13
14
17
template
<
class
Scalar>
18
struct
StepControlInfo
{
20
Scalar
stepSize
;
22
StepSizeType
stepType
;
24
bool
limitedByBreakPoint
;
27
EBreakPointType
breakPointType
;
29
StepControlInfo
()
30
:
stepSize
(-1.0),
stepType
(STEP_TYPE_FIXED),
31
limitedByBreakPoint
(false),
32
breakPointType
(BREAK_POINT_TYPE_SOFT)
33
{}
34
};
35
36
38
template
<
class
Scalar>
39
std::ostream& operator<<(
40
std::ostream &out,
const
StepControlInfo<Scalar> &stepCtrlInfo
41
)
42
{
43
using
std::endl;
44
out
45
<<
"stepType = "
<< toString(stepCtrlInfo.stepType) << endl
46
<<
"stepSize = "
<< stepCtrlInfo.stepSize << endl
47
<<
"limitedByBreakPoint = "
<< stepCtrlInfo.limitedByBreakPoint << endl
48
<<
"breakPointType = "
<< toString(stepCtrlInfo.breakPointType) << endl;
49
return
out;
50
}
51
52
60
template
<
class
Scalar>
61
StepControlInfo<Scalar>
62
stepCtrlInfoTaken
(
63
const
StepControlInfo<Scalar>
&trialStepCtrlInfo,
64
const
Scalar &stepSizeTaken
65
)
66
{
67
typedef
Teuchos::ScalarTraits<Scalar> ST;
68
const
Scalar zero = ST::zero();
69
StepControlInfo<Scalar>
stepCtrlInfo = trialStepCtrlInfo;
70
stepCtrlInfo.
stepSize
= stepSizeTaken;
71
if
( trialStepCtrlInfo.
stepSize
> zero && stepSizeTaken > zero ) {
72
if
(stepSizeTaken < trialStepCtrlInfo.
stepSize
) {
73
stepCtrlInfo.
limitedByBreakPoint
=
false
;
74
}
75
}
76
else
{
77
stepCtrlInfo.
limitedByBreakPoint
=
false
;
78
}
79
return
stepCtrlInfo;
80
}
81
82
83
// 2007/09/14: rabartl: ToDo: Above: Move this function into
84
// Rythmos_IntegratorBaseHelpers.hpp once created!
85
86
87
}
// namespace Rythmos
88
89
90
#endif
// RYTHMOS_STEP_CONTROL_INFO_HPP
Rythmos::StepControlInfo
Simple struct to aggregate integration/stepper control information.
Definition
Rythmos_StepControlInfo.hpp:18
Rythmos::StepControlInfo::limitedByBreakPoint
bool limitedByBreakPoint
True if step size is limited by a breakpoint.
Definition
Rythmos_StepControlInfo.hpp:24
Rythmos::StepControlInfo::stepSize
Scalar stepSize
The size of the time step.
Definition
Rythmos_StepControlInfo.hpp:20
Rythmos::StepControlInfo::breakPointType
EBreakPointType breakPointType
True if the time integrator should restart when passing over the breakpoint.
Definition
Rythmos_StepControlInfo.hpp:27
Rythmos::StepControlInfo::StepControlInfo
StepControlInfo()
Initialize to invalid state.
Definition
Rythmos_StepControlInfo.hpp:29
Rythmos::StepControlInfo::stepCtrlInfoTaken
StepControlInfo< Scalar > stepCtrlInfoTaken(const StepControlInfo< Scalar > &trialStepCtrlInfo, const Scalar &stepSizeTaken)
Return a step control info object for a step actually taken.
Definition
Rythmos_StepControlInfo.hpp:62
Rythmos::StepControlInfo::stepType
StepSizeType stepType
The type of time step.
Definition
Rythmos_StepControlInfo.hpp:22
Generated by
1.17.0