/usr/include/trilinos/Rythmos_IntegrationControlStrategyBase.hpp is in libtrilinos-rythmos-dev 12.10.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | #ifndef RYTHMOS_INTEGRATION_CONTROL_STRATEGY_BASE_HPP
#define RYTHMOS_INTEGRATION_CONTROL_STRATEGY_BASE_HPP
#include "Rythmos_Types.hpp"
#include "Teuchos_Describable.hpp"
#include "Teuchos_VerboseObject.hpp"
#include "Teuchos_ParameterListAcceptor.hpp"
namespace Rythmos {
// Forwards
template<class Scalar> class StepControlInfo;
template<class Scalar> class TimeRange;
template<class Scalar> class StepperBase;
/** \brief Base class for strategy objects that control integration by
* selecting step sizes for a stepper.
*
* ToDo: Finish Implementation!
*/
template<class Scalar>
class IntegrationControlStrategyBase
: virtual public Teuchos::Describable,
virtual public Teuchos::VerboseObject<IntegrationControlStrategyBase<Scalar> >,
virtual public Teuchos::ParameterListAcceptor
{
public:
/** \brief Return if this object can handle and repond to failed time steps.
*
* Default implementation returns false.
*/
virtual bool handlesFailedTimeSteps() const { return false; }
/** \brief Clone this integration control object if supported .
*
* Here, the cloned object just has to have the control information copied,
* not the complete state of the object mid way through an integration.
*/
virtual RCP<IntegrationControlStrategyBase<Scalar> >
cloneIntegrationControlStrategy() const = 0;
/** \brief Reset the control algorithm to the beginning to start a new
* integration.
*
* \param integrationTimeDomain [in] The time domain over which the
* integration will be defined.
*
* <b>Preconditions:</b><ul>
* <li> <tt>integrationTimeDomain.length() > 0.0</tt>
* </ul>
*/
virtual void resetIntegrationControlStrategy(
const TimeRange<Scalar> &integrationTimeDomain
) = 0;
/** \brief Select the next time step control info.
*
* \param stepper [in] The stepper object that is being stepped forward in
* time to integrate the transient ODE/DAE equations. On the very first
* call, this stepper should just have the initial condition.
*
* \param stepCtrlInfoLast [in] The actual time step that was taken on the
* last time step.
*
* \param timeStepIter [in] The (zero-based) time step iteration counter.
* In the first call to this function, this should be passed as
* <tt>timeStepIter==0</tt> and it should be incremented on each call only
* once. While the concrete implementation if <tt>*this</tt> could keep
* track of the this counter, putting it in the argument list helps to
* simplify logic and helps to validate correct usage.
*
* \returns Returns the control information about the next step, including
* if <tt>returnVal.stepSize</tt> is limited by a breakpoint and if that
* breakpoint requires a restart of the stepper. If no more steps are to be
* taken then a step size of <tt>returnVal.stepSize < 0.0</tt> will be
* returned and the time integrator client should halt the integration
* immediately!
*
* Warning! This function is *NOT* stateless. It should be called once and
* only once per time step iteration.
*
* NOTE: The function <tt>resetIntegrationControlStrategy()</tt> must be
* called prior to even the first call to function.
*/
virtual StepControlInfo<Scalar>
getNextStepControlInfo(
const StepperBase<Scalar> &stepper,
const StepControlInfo<Scalar> &stepCtrlInfoLast,
const int timeStepIter
) = 0;
/** \brief Inform of a failed time step.
*
* \param stepper [in] The stepper object after the failed time step.
*
* \param stepCtrlInfoLast [in] Same as passed into last call to
* getNextStepControlInfo().
*
* \param timeStepIter [in] Same as passed into last call to
* getNextStepControlInfo().
*
* \param stepControlInfo [in] Value returned from last call to
* getNextStepControlInfo().
*
* \returns true if a new timestep can be suggested, false if not.
*
* \precondition this->handlesFailedTimeSteps()==true
*
* Default implementation is to ignore this.
*/
virtual bool resetForFailedTimeStep(
const StepperBase<Scalar> &stepper,
const StepControlInfo<Scalar> &stepCtrlInfoLast,
const int timeStepIter,
const StepControlInfo<Scalar> &stepCtrlInfo
)
{ return false; }
};
} // namespace Rythmos
#endif // RYTHMOS_INTEGRATION_CONTROL_STRATEGY_BASE_HPP
|