Rythmos - Transient Integration for Differential Equations
Version of the Day
|
Base strategy class for interpolation functionality. More...
#include <Rythmos_InterpolatorBase.hpp>
Public Member Functions | |
virtual bool | supportsCloning () const |
Return if this interpolator supports cloning or not. More... | |
virtual Teuchos::RCP < InterpolatorBase< Scalar > > | cloneInterpolator () const |
Clone the interpolator object if supported. More... | |
virtual void | setNodes (const RCP< const typename DataStore< Scalar >::DataStoreVector_t > &nodes)=0 |
Store pointer to interpolation nodes. More... | |
virtual void | interpolate (const Array< Scalar > &t_values, typename DataStore< Scalar >::DataStoreVector_t *data_out) const =0 |
Perform an interpolation. More... | |
virtual int | order () const =0 |
Return the order of the interpolation. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Scalar > | |
void | assertBaseInterpolatePreconditions (const typename DataStore< Scalar >::DataStoreVector_t &data_in, const Array< Scalar > &t_values, typename DataStore< Scalar >::DataStoreVector_t *data_out) |
Base strategy class for interpolation functionality.
ToDo: Finish documentation!
Definition at line 44 of file Rythmos_InterpolatorBase.hpp.
|
virtual |
Return if this interpolator supports cloning or not.
If returnVal==true
, then cloneInterpolator()
will clone *this
object and return an non-null RCP.
The default implementation of this function simply returns false.
Reimplemented in Rythmos::CubicSplineInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.
Definition at line 137 of file Rythmos_InterpolatorBase.hpp.
|
virtual |
Clone the interpolator object if supported.
Postconditions:
[
supportsCloning()==true
] returnVal != Teuchos::null
[
supportsCloning()==false
] returnVal == Teuchos::null
The default implementation returns
Teuchos::null
which is consistent with the default implementation of supportsCloning()
. If this function is overridden in a base class to support cloning, then supportsCloning()
must be overridden to return true
.
Reimplemented in Rythmos::CubicSplineInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.
Definition at line 145 of file Rythmos_InterpolatorBase.hpp.
|
pure virtual |
Store pointer to interpolation nodes.
This function represent a persisting relationship between the interpolation nodes and the interpolator. For simple interpolators like linear and Hermite, this is not needed, but for interpolators like cubic splines where there is some computational work in assembling the interpolant, this is important.
Preconditions:
nodes
must have unique time values and be sorted in ascending time order Postconditions:
nodes
is a different pointer than was previously called, then it is possible that the interpolant will be recomputed when interpolate
is next called. Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.
|
pure virtual |
Perform an interpolation.
This function must support passing node values back out directly, handling when only one node value is passed in, and dealing with xdot==Teuchos::null
.
Preconditions:
nodes->size()==1
then t_values[0] == (*nodes)[0].time
t_values
must have unique and sorted values in ascending order nodes->front().time <= t_values[i] <= nodes->back().time
for all t=0..time_values.size()-1
(*nodes)[i].x != Teuchos::null
for all i=0..nodes->size()-1
Postconditions:
data_out
will come out sorted in ascending time order (*nodes)[i].xdot == Teuchos::null
then all t_values in the interval (*nodes)[i-1]..(*nodes)[i+1]
will have xdot = Tuechos::null
. Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.
|
pure virtual |
Return the order of the interpolation.
2007/05/18: rabartl: ToDo: Define what "order" means.
Implemented in Rythmos::CubicSplineInterpolator< Scalar >, Rythmos::HermiteInterpolator< Scalar >, and Rythmos::LinearInterpolator< Scalar >.
|
related |
Definition at line 53 of file Rythmos_InterpolatorBaseHelpers.hpp.