Simbody
3.4 (development)
|
The implementation for Integrate measures allocates a continuous state variable or variables from the State's z pool and generates zdot values to be integrated into those z variables. More...
#include <MeasureImplementation.h>
Public Member Functions | |
Implementation () | |
The derivative and initialConditions Measures will be empty handles if this is default constructed. | |
Implementation (const Measure_< T > &deriv, const Measure_< T > &ic, const T &defaultValue) | |
Here we're shallow-copying the Measure handles so we'll be referring to the original Measures. | |
Implementation (const Implementation &source) | |
Copy constructor shallow-copies the referenced measures, but we don't want to share our state variables. | |
void | setValue (State &s, const T &value) const |
Set the value of the state variables(s) that hold the integral. | |
const Measure_< T > & | getDerivativeMeasure () const |
const Measure_< T > & | getInitialConditionMeasure () const |
void | setDerivativeMeasure (const Measure_< T > &d) |
void | setInitialConditionMeasure (const Measure_< T > &ic) |
Implementation * | cloneVirtual () const override |
int | getNumTimeDerivativesVirtual () const override |
This measure has one more time derivative than the integrand. | |
void | calcCachedValueVirtual (const State &s, int derivOrder, T &value) const override |
Concrete measures must override this if the state cache is used for precalculated values or derivatives. | |
const T & | getUncachedValueVirtual (const State &s, int derivOrder) const override |
This is only called when derivOrder >= the number of cache entries we have, but still <= the number of derivatives the Measure says it can deliver. | |
Stage | getDependsOnStageVirtual (int derivOrder) const override |
void | initializeVirtual (State &s) const override |
Initialize the state to the current value of the initial condition measure, if there is one, otherwise to the default value. | |
void | realizeMeasureTopologyVirtual (State &s) const override |
Allocate one Real continuous state variable z per element of this Measure's data type T, using the default value to determine how many are needed (if that's not part of the type T), and initialize them to the corresponding element from the default value. | |
void | realizeMeasureAccelerationVirtual (const State &s) const override |
Set the zdots to the integrand (derivative measure) value. |
The implementation for Integrate measures allocates a continuous state variable or variables from the State's z pool and generates zdot values to be integrated into those z variables.
The z's are then copied into a type T, Time-stage cache entry so that we can return the value as a type T reference. Derivative requests are passed through to the integrand so only one cache entry is required here.
SimTK::Measure_< T >::Integrate::Implementation::Implementation | ( | ) | [inline] |
The derivative and initialConditions Measures will be empty handles if this is default constructed.
Reimplemented from SimTK::AbstractMeasure::Implementation.
SimTK::Measure_< T >::Integrate::Implementation::Implementation | ( | const Measure_< T > & | deriv, |
const Measure_< T > & | ic, | ||
const T & | defaultValue | ||
) | [inline] |
Here we're shallow-copying the Measure handles so we'll be referring to the original Measures.
SimTK::Measure_< T >::Integrate::Implementation::Implementation | ( | const Implementation & | source | ) | [inline] |
Copy constructor shallow-copies the referenced measures, but we don't want to share our state variables.
Reimplemented from SimTK::Measure_< T >::Implementation.
void SimTK::Measure_< T >::Integrate::Implementation::setValue | ( | State & | s, |
const T & | value | ||
) | const [inline] |
Set the value of the state variables(s) that hold the integral.
This cannot be used to change the size if the type T is a Vector; the supplied value must be the same length as the default value of this Measure.
const Measure_<T>& SimTK::Measure_< T >::Integrate::Implementation::getDerivativeMeasure | ( | ) | const [inline] |
const Measure_<T>& SimTK::Measure_< T >::Integrate::Implementation::getInitialConditionMeasure | ( | ) | const [inline] |
void SimTK::Measure_< T >::Integrate::Implementation::setDerivativeMeasure | ( | const Measure_< T > & | d | ) | [inline] |
void SimTK::Measure_< T >::Integrate::Implementation::setInitialConditionMeasure | ( | const Measure_< T > & | ic | ) | [inline] |
Implementation* SimTK::Measure_< T >::Integrate::Implementation::cloneVirtual | ( | ) | const [inline, override, virtual] |
Implements SimTK::AbstractMeasure::Implementation.
int SimTK::Measure_< T >::Integrate::Implementation::getNumTimeDerivativesVirtual | ( | ) | const [inline, override, virtual] |
This measure has one more time derivative than the integrand.
Reimplemented from SimTK::AbstractMeasure::Implementation.
void SimTK::Measure_< T >::Integrate::Implementation::calcCachedValueVirtual | ( | const State & | , |
int | derivOrder, | ||
T & | value | ||
) | const [inline, override, virtual] |
Concrete measures must override this if the state cache is used for precalculated values or derivatives.
Reimplemented from SimTK::Measure_< T >::Implementation.
const T& SimTK::Measure_< T >::Integrate::Implementation::getUncachedValueVirtual | ( | const State & | , |
int | derivOrder | ||
) | const [inline, override, virtual] |
This is only called when derivOrder >= the number of cache entries we have, but still <= the number of derivatives the Measure says it can deliver.
You don't need to override this if that condition can't occur. This is commonly used for functions whose derivatives above a certain order are zero.
Reimplemented from SimTK::Measure_< T >::Implementation.
Stage SimTK::Measure_< T >::Integrate::Implementation::getDependsOnStageVirtual | ( | int | derivOrder | ) | const [inline, override, virtual] |
Implements SimTK::AbstractMeasure::Implementation.
void SimTK::Measure_< T >::Integrate::Implementation::initializeVirtual | ( | State & | s | ) | const [inline, override, virtual] |
Initialize the state to the current value of the initial condition measure, if there is one, otherwise to the default value.
Reimplemented from SimTK::AbstractMeasure::Implementation.
void SimTK::Measure_< T >::Integrate::Implementation::realizeMeasureTopologyVirtual | ( | State & | s | ) | const [inline, override, virtual] |
Allocate one Real continuous state variable z per element of this Measure's data type T, using the default value to determine how many are needed (if that's not part of the type T), and initialize them to the corresponding element from the default value.
Reimplemented from SimTK::Measure_< T >::Implementation.
void SimTK::Measure_< T >::Integrate::Implementation::realizeMeasureAccelerationVirtual | ( | const State & | s | ) | const [inline, override, virtual] |
Set the zdots to the integrand (derivative measure) value.
If no integrand was provided it is treated as though it were zero.
Reimplemented from SimTK::AbstractMeasure::Implementation.