Simbody
3.5
|
Public Member Functions | |
Implementation () | |
Default constructor leaves the operand measure unspecified; no base class cache entries are allocated. More... | |
Implementation (const Measure_< T > &operand, Operation op) | |
Construct a measure that returns the extreme value taken on by the operand measure during a time stepping study. More... | |
void | setOperandMeasure (const Measure_< T > &operand) |
Set the operand measure for this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this. More... | |
void | setOperation (Operation op) |
Set the particular operation to be performed by this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this. More... | |
const Measure_< T > & | getOperandMeasure () const |
Return a reference to the operand measure for this Extreme measure. More... | |
Operation | getOperation () const |
Return the particular operation being performed by this Extreme measure. More... | |
void | setValue (State &s, const T &value) const |
Set the current extreme value stored in this Extreme measure's state variable. More... | |
Real | getTimeOfExtremeValue (const State &s) const |
Return the time at which the extreme was last updated. More... | |
Implementation * | cloneVirtual () const override |
int | getNumTimeDerivativesVirtual () const override |
Extreme(f(t)) has the same number of derivatives as f except that they are all zero unless f(t) is a new extreme. More... | |
Stage | getDependsOnStageVirtual (int order) const override |
The depends-on stage for this measure is the same as for its operand. More... | |
const T & | getUncachedValueVirtual (const State &s, int derivOrder) const override |
We're not using the Measure_<T> base class cache services, but we do have one of our own. More... | |
void | initializeVirtual (State &s) const override |
At start of a time stepping study, this should be called to set the current extreme value to the current value of the operand. More... | |
void | realizeMeasureTopologyVirtual (State &s) const override |
Allocate the auto-updated state variable that holds the extreme seen so far. More... | |
void | realizeMeasureAccelerationVirtual (const State &s) const override |
In case no one has updated the value of this measure yet, we have to make sure it gets updated before the integration moves ahead. More... | |
bool | ensureExtremeHasBeenUpdated (const State &s) const |
Here we make sure that the cache entry is updated if the current value of the operand is more extreme than the previous one, and return a bool indicating whether we have a new extreme. More... | |
Public Member Functions inherited from SimTK::Measure_< T >::Implementation | |
const T & | getValue (const State &s, int derivOrder) const |
void | setDefaultValue (const T &defaultValue) |
Set a new default value for this Measure. More... | |
const T & | getDefaultValue () const |
Return a reference to the value that this Measure will use to initialize its value-level state resource (state variable or cache entry) during the next call to realizeTopology(). More... | |
void | setIsPresumedValidAtDependsOnStage (bool presume) |
bool | getIsPresumedValidAtDependsOnStage () const |
Additional Inherited Members | |
Protected Member Functions inherited from SimTK::Measure_< T >::Implementation | |
Implementation (const T &defaultValue, int numCacheEntries=1) | |
Implementation (int numCacheEntries=1) | |
Argument numCacheEntries should be one greater than the number of derivatives; that is, there is room for the value ("0th" derivative) also. More... | |
Implementation (const Implementation &source) | |
Copy constructor copies the number of cache entries from the source, but not the cache indices themselves as those must be allocated uniquely for the copy. More... | |
int | size () const |
Return the number of elements in the data type of this Measure; for Vector measures this is determined by the size of the default value. More... | |
int | getNumCacheEntries () const |
Return the number of cache entries allocated for the value and derivatives of this Measure. More... | |
const T & | getCacheEntry (const State &s, int derivOrder) const |
Get a const reference to the value stored in one of this Measure's cache entries, indexed by the derivative order (with the value treated as the 0th derivative). More... | |
T & | updCacheEntry (const State &s, int derivOrder) const |
Get a writable reference to the value stored in one of this Measure's cache entries, indexed by the derivative order (with the value treated as the 0th derivative). More... | |
bool | isCacheValueRealized (const State &s, int derivOrder) const |
Determine whether a particular one of this Measure's cache entries has already been realized since the given state was modified. More... | |
void | markCacheValueRealized (const State &s, int derivOrder) const |
Mark one of this Measure's cache entries up to date; call this after you have calculated a value or derivative and stored it in the corresponding cache entry. More... | |
void | markCacheValueNotRealized (const State &s, int derivOrder) const |
Invalidate one of this Measure's cache entries. More... | |
virtual void | calcCachedValueVirtual (const State &, int derivOrder, T &value) const |
Concrete measures must override this if the state cache is used for precalculated values or derivatives. More... | |
const T & | getValueZero () const |
Return a reference to a zero of the same type and size as this Measure's value. More... | |
Protected Member Functions inherited from SimTK::AbstractMeasure::Implementation | |
Implementation () | |
This default constructor is for use by concrete measure implementation classes. More... | |
Implementation (const Implementation &src) | |
Base class copy constructor removes the Subsystem and sets the reference count to zero. More... | |
Implementation & | operator= (const Implementation &src) |
Base class copy assignment operator removes the Subsystem, and sets the reference count to zero. More... | |
int | incrRefCount () const |
int | decrRefCount () const |
int | getRefCount () const |
int | getCopyNumber () const |
Implementation * | clone () const |
This is a deep copy of the concrete Implementation object, except the Subsystem will have been removed. More... | |
void | realizeModel (State &s) const |
void | realizeInstance (const State &s) const |
void | realizeTime (const State &s) const |
void | realizePosition (const State &s) const |
void | realizeVelocity (const State &s) const |
void | realizeDynamics (const State &s) const |
void | realizeAcceleration (const State &s) const |
void | realizeReport (const State &s) const |
void | initialize (State &s) const |
This should be called at the start of a time stepping study to cause this Measure to set its state variables (if any) in the supplied state to their initial conditions. More... | |
int | getNumTimeDerivatives () const |
Stage | getDependsOnStage (int derivOrder) const |
void | setSubsystem (Subsystem &sub, MeasureIndex mx) |
bool | isInSubsystem () const |
const Subsystem & | getSubsystem () const |
Subsystem & | updSubsystem () |
MeasureIndex | getSubsystemMeasureIndex () const |
SubsystemIndex | getSubsystemIndex () const |
void | invalidateTopologyCache () const |
Stage | getStage (const State &s) const |
virtual | ~Implementation () |
virtual void | realizeMeasureModelVirtual (State &) const |
virtual void | realizeMeasureInstanceVirtual (const State &) const |
virtual void | realizeMeasureTimeVirtual (const State &) const |
virtual void | realizeMeasurePositionVirtual (const State &) const |
virtual void | realizeMeasureVelocityVirtual (const State &) const |
virtual void | realizeMeasureDynamicsVirtual (const State &) const |
virtual void | realizeMeasureReportVirtual (const State &) const |
|
inline |
Default constructor leaves the operand measure unspecified; no base class cache entries are allocated.
|
inline |
Construct a measure that returns the extreme value taken on by the operand measure during a time stepping study.
|
inline |
Set the operand measure for this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.
|
inline |
Set the particular operation to be performed by this Extreme measure; this is a Topology stage change so you'll have to call realizeTopology() again if you call this.
|
inline |
Return a reference to the operand measure for this Extreme measure.
|
inline |
Return the particular operation being performed by this Extreme measure.
|
inline |
Set the current extreme value stored in this Extreme measure's state variable.
|
inline |
Return the time at which the extreme was last updated.
This will be the current time if the operand is currently at its most extreme value, otherwise it will be sometime in the past.
|
inlineoverridevirtual |
Implements SimTK::AbstractMeasure::Implementation.
|
inlineoverridevirtual |
Extreme(f(t)) has the same number of derivatives as f except that they are all zero unless f(t) is a new extreme.
Reimplemented from SimTK::AbstractMeasure::Implementation.
|
inlineoverridevirtual |
The depends-on stage for this measure is the same as for its operand.
Implements SimTK::AbstractMeasure::Implementation.
|
inlineoverridevirtual |
We're not using the Measure_<T> base class cache services, but we do have one of our own.
It looks uncached from the base class point of view which is why we're implementing it here.
Reimplemented from SimTK::Measure_< T >::Implementation.
|
inlineoverridevirtual |
At start of a time stepping study, this should be called to set the current extreme value to the current value of the operand.
Reimplemented from SimTK::AbstractMeasure::Implementation.
|
inlineoverridevirtual |
Allocate the auto-updated state variable that holds the extreme seen so far.
We'll assume that changes to this variable invalidate Dynamics (force) stage so that any forces that depend on it will be recomputed if it changes. Also allocate an auxiliary boolean variable that is used to hold whether the current value is a new extreme; that is private to the implementation and not user-accessible since you can instead check the time of last update.
Reimplemented from SimTK::Measure_< T >::Implementation.
|
inlineoverridevirtual |
In case no one has updated the value of this measure yet, we have to make sure it gets updated before the integration moves ahead.
Reimplemented from SimTK::AbstractMeasure::Implementation.
|
inline |
Here we make sure that the cache entry is updated if the current value of the operand is more extreme than the previous one, and return a bool indicating whether we have a new extreme.
We don't want to create an update entry unless the extreme value has changed, because we would like the state variable's last update value to reflect the last actual change.