Rythmos - Transient Integration for Differential Equations Version of the Day
|
Implementation of Rythmos::Stepper for explicit Taylor polynomial time integration of ODEs. More...
#include <Rythmos_ExplicitTaylorPolynomialStepper.hpp>
Public Types | |
typedef Teuchos::ScalarTraits< Scalar >::magnitudeType | ScalarMag |
Typename of magnitude of scalars. | |
![]() | |
typedef Teuchos::ScalarTraits< Scalar >::magnitudeType | ScalarMag |
Public Member Functions | |
ExplicitTaylorPolynomialStepper () | |
Constructor. | |
~ExplicitTaylorPolynomialStepper () | |
Destructor. | |
RCP< const Thyra::VectorSpaceBase< Scalar > > | get_x_space () const |
Return the space for x and x_dot | |
void | setModel (const RCP< const Thyra::ModelEvaluator< Scalar > > &model) |
Set model. | |
void | setNonconstModel (const RCP< Thyra::ModelEvaluator< Scalar > > &model) |
Set model. | |
RCP< const Thyra::ModelEvaluator< Scalar > > | getModel () const |
RCP< Thyra::ModelEvaluator< Scalar > > | getNonconstModel () |
void | setInitialCondition (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition) |
Thyra::ModelEvaluatorBase::InArgs< Scalar > | getInitialCondition () const |
Scalar | takeStep (Scalar dt, StepSizeType flag) |
Take a time step of magnitude dt . | |
const StepStatus< Scalar > | getStepStatus () const |
void | setParameterList (RCP< Teuchos::ParameterList > const ¶mList) |
Redefined from Teuchos::ParameterListAcceptor. | |
RCP< Teuchos::ParameterList > | getNonconstParameterList () |
RCP< Teuchos::ParameterList > | unsetParameterList () |
RCP< const Teuchos::ParameterList > | getValidParameters () const |
std::string | description () const |
void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const |
void | addPoints (const Array< Scalar > &time_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &x_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &xdot_vec) |
void | getPoints (const Array< Scalar > &time_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *x_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *xdot_vec, Array< ScalarMag > *accuracy_vec) const |
Get values from buffer. | |
void | setRange (const TimeRange< Scalar > &range, const InterpolationBufferBase< Scalar > &IB) |
Fill data in from another interpolation buffer. | |
TimeRange< Scalar > | getTimeRange () const |
void | getNodes (Array< Scalar > *time_vec) const |
Get interpolation nodes. | |
void | removeNodes (Array< Scalar > &time_vec) |
Remove interpolation nodes. | |
int | getOrder () const |
Get order of interpolation. | |
![]() | |
virtual bool | supportsCloning () const |
Return if this stepper supports cloning or not. | |
virtual RCP< StepperBase< Scalar > > | cloneStepperAlgorithm () const |
Clone the stepper object if supported. | |
virtual bool | isImplicit () const |
Return if this stepper is an implicit stepper. | |
virtual bool | acceptsModel () const |
Return if this stepper accepts a model. | |
virtual void | setModel (const RCP< const Thyra::ModelEvaluator< Scalar > > &model)=0 |
Specify the model problem to integrate. | |
virtual void | setNonconstModel (const RCP< Thyra::ModelEvaluator< Scalar > > &model)=0 |
Accept a nonconst model. | |
virtual bool | modelIsConst () const |
Return of the model is only const or can be returned as a non-const object. | |
virtual RCP< const Thyra::ModelEvaluator< Scalar > > | getModel () const =0 |
Get the model. | |
virtual RCP< Thyra::ModelEvaluator< Scalar > > | getNonconstModel ()=0 |
Get the model nonconst. | |
virtual void | setInitialCondition (const Thyra::ModelEvaluatorBase::InArgs< Scalar > &initialCondition)=0 |
Specify initial condition and re-initialize. | |
virtual Thyra::ModelEvaluatorBase::InArgs< Scalar > | getInitialCondition () const =0 |
Get the currently set initial condtion. | |
virtual Scalar | takeStep (Scalar dt, StepSizeType stepType)=0 |
Take a step. | |
virtual const StepStatus< Scalar > | getStepStatus () const =0 |
Get current stepper status after a step has been taken. | |
virtual void | setStepControlData (const StepperBase &stepper) |
Set step control data from another stepper. | |
virtual RCP< const Thyra::VectorSpaceBase< Scalar > > | get_x_space () const =0 |
Return the space for x and x_dot . | |
virtual void | addPoints (const Array< Scalar > &time_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &x_vec, const Array< RCP< const Thyra::VectorBase< Scalar > > > &xdot_vec)=0 |
Add points to the buffer. | |
virtual TimeRange< Scalar > | getTimeRange () const =0 |
Return the range of time values where interpolation calls can be performed. | |
virtual void | getPoints (const Array< Scalar > &time_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *x_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *xdot_vec, Array< ScalarMag > *accuracy_vec) const =0 |
Get values from the buffer at different time points. | |
virtual void | getNodes (Array< Scalar > *time_vec) const =0 |
Get interpolation nodes. | |
virtual void | removeNodes (Array< Scalar > &time_vec)=0 |
Remove nodes from the interpolation buffer. | |
virtual int | getOrder () const =0 |
Get order of interpolation. | |
Additional Inherited Members | |
![]() | |
template<class Scalar > | |
bool | isInitialized (const StepperBase< Scalar > &stepper) |
template<class Scalar > | |
bool | isInitialized (const StepperBase< Scalar > &stepper) |
![]() | |
template<class Scalar > | |
RCP< const Thyra::VectorBase< Scalar > > | get_x (const InterpolationBufferBase< Scalar > &interpBuffer, const Scalar &t) |
Get a single point x(t) from an interpolation buffer. | |
template<class Scalar > | |
RCP< const Thyra::VectorBase< Scalar > > | get_xdot (const InterpolationBufferBase< Scalar > &interpBuffer, const Scalar &t) |
Get a single point xdot(t) from an interpolation buffer. | |
template<class Scalar > | |
void | get_x_and_x_dot (const InterpolationBufferBase< Scalar > &interpBuffer, const Scalar t, const Ptr< RCP< const Thyra::VectorBase< Scalar > > > &x, const Ptr< RCP< const Thyra::VectorBase< Scalar > > > &x_dot) |
Nonmember helper function to get x and x_dot at t. | |
template<class Scalar > | |
void | assertTimePointsAreSorted (const Array< Scalar > &time_vec) |
Assert that a time point vector is sorted. | |
template<class Scalar > | |
void | assertNoTimePointsBeforeCurrentTimeRange (const InterpolationBufferBase< Scalar > &interpBuffer, const Array< Scalar > &time_vec, const int &startingTimePointIndex=0) |
Assert that none of the time points fall before the current time range for an interpolation buffer object. | |
template<class Scalar > | |
void | assertNoTimePointsInsideCurrentTimeRange (const InterpolationBufferBase< Scalar > &interpBuffer, const Array< Scalar > &time_vec) |
Assert that none of the time points fall inside the current time range for an interpolation buffer object. | |
template<class TimeType > | |
void | selectPointsInTimeRange (const Array< TimeType > &points_in, const TimeRange< TimeType > &range, const Ptr< Array< TimeType > > &points_out) |
Select points from an Array that sit in a TimeRange. | |
template<class TimeType > | |
void | removePointsInTimeRange (Array< TimeType > *points_in, const TimeRange< TimeType > &range) |
Remove points from an Array that sit in a TimeRange. | |
template<class Scalar > | |
bool | getCurrentPoints (const InterpolationBufferBase< Scalar > &interpBuffer, const Array< Scalar > &time_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *x_vec, Array< RCP< const Thyra::VectorBase< Scalar > > > *xdot_vec, int *nextTimePointIndex) |
Get time points in the current range of an interpolation buffer object. | |
Implementation of Rythmos::Stepper for explicit Taylor polynomial time integration of ODEs.
Let
be an ODE initial-value problem. This class implements a single time step of an explicit Taylor polynomial time integration method for computing numerical solutions to the IVP. The method consists of computing a local truncated Taylor series solution to the ODE (section Computing the Taylor Polynomial), estimating a step size within the radius of convergence of the Taylor series (section Computing a Step Size) and then summing the polynomial at that step to compute the next point in the numerical integration (section Summing the Polynomial). The algorithmic parameters to the method are controlled through the params
argument to the constructor which are described in section Parameters.
Let
be a power series solution to the IVP above. Then
where
By differentiating the power series for
where each coefficient
With the truncated Taylor polynomial solution
so
A step size
for some error tolerance
With a step size
is used as the next integration point where a new Taylor series is calculated. Local error per step can also be controlled by computing
This method recognizes the following algorithmic parameters that can be set in the params
argument to the constructor:
Definition at line 163 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::ScalarMag |
Typename of magnitude of scalars.
Definition at line 168 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::ExplicitTaylorPolynomialStepper |
Constructor.
Definition at line 364 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::~ExplicitTaylorPolynomialStepper |
Destructor.
Definition at line 372 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Return the space for x
and x_dot
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 863 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Set model.
Implements Rythmos::StepperBase< Scalar >.
Definition at line 406 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Set model.
Implements Rythmos::StepperBase< Scalar >.
Definition at line 419 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Implements Rythmos::StepperBase< Scalar >.
Definition at line 429 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Implements Rythmos::StepperBase< Scalar >.
Definition at line 437 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Implements Rythmos::StepperBase< Scalar >.
Definition at line 444 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Implements Rythmos::StepperBase< Scalar >.
Definition at line 467 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Take a time step of magnitude dt
.
Implements Rythmos::StepperBase< Scalar >.
Definition at line 475 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Implements Rythmos::StepperBase< Scalar >.
Definition at line 593 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
void Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::setParameterList | ( | RCP< Teuchos::ParameterList > const & | paramList | ) |
Redefined from Teuchos::ParameterListAcceptor.
Definition at line 626 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
RCP< Teuchos::ParameterList > Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::getNonconstParameterList |
Definition at line 661 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
RCP< Teuchos::ParameterList > Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::unsetParameterList |
Definition at line 669 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
RCP< const Teuchos::ParameterList > Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::getValidParameters |
Definition at line 679 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
std::string Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::description |
Definition at line 701 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
void Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::describe | ( | Teuchos::FancyOStream & | out, |
const Teuchos::EVerbosityLevel | verbLevel = Teuchos::Describable::verbLevel_default |
||
) | const |
Definition at line 709 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Redefined from InterpolationBufferBase Add points to buffer
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 741 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Get values from buffer.
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 752 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
void Rythmos::ExplicitTaylorPolynomialStepper< Scalar >::setRange | ( | const TimeRange< Scalar > & | range, |
const InterpolationBufferBase< Scalar > & | IB | ||
) |
Fill data in from another interpolation buffer.
|
virtual |
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 771 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Get interpolation nodes.
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 782 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Remove interpolation nodes.
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 798 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.
|
virtual |
Get order of interpolation.
Implements Rythmos::InterpolationBufferBase< Scalar >.
Definition at line 805 of file Rythmos_ExplicitTaylorPolynomialStepper.hpp.