Simbody  3.5
SimTK::Subsystem::Guts Class Reference

The abstract parent of all Subsystem implementation classes. More...

+ Inheritance diagram for SimTK::Subsystem::Guts:

List of all members.

Public Member Functions

 Guts (const String &name="<NONAME>", const String &version="0.0.0")
 This constructor is for use in the constructors of derived Subsystems.
virtual ~Guts ()
 Destructor is virtual to permit cleanup of derived classes.
 Guts (const Guts &)
 Copy constructor results in a default-constructed object though with the name and version string copied.
const StringgetName () const
 Report back the name supplied on construction; this is not interpreted in any way by Simbody.
const StringgetVersion () const
 Report back the version string supplied on construction; this i not interpreted in any way by Simbody.
MeasureIndex adoptMeasure (AbstractMeasure &m)
 Add a new Measure to this Subsystem.
template<class T >
Measure_< T > getMeasure_ (MeasureIndex mx) const
 Return the Measure whose index within this Subsystem is given.
AbstractMeasure getMeasure (MeasureIndex mx) const
 Return the Measure whose index within this Subsystem is given, as an AbstractMeasure (that is, its value type is not specified).
bool isInSystem () const
bool isInSameSystem (const Subsystem &otherSubsystem) const
const SystemgetSystem () const
SystemupdSystem ()
void setSystem (System &sys, SubsystemIndex id)
SubsystemIndex getMySubsystemIndex () const
bool subsystemTopologyHasBeenRealized () const
 Returns true if this subsystem's realizeTopology() method has been called since the last topological change or call to invalidateSubsystemTopologyCache().
void invalidateSubsystemTopologyCache () const
 Always call this method when a topological change is made to this Subsystem to indicate that any Stage::Topology cache values may need recomputation.
Subsystem::Gutsclone () const
void realizeSubsystemTopology (State &) const
void realizeSubsystemModel (State &) const
void realizeSubsystemInstance (const State &) const
void realizeSubsystemTime (const State &) const
void realizeSubsystemPosition (const State &) const
void realizeSubsystemVelocity (const State &) const
void realizeSubsystemDynamics (const State &) const
void realizeSubsystemAcceleration (const State &) const
void realizeSubsystemReport (const State &) const
void calcDecorativeGeometryAndAppend (const State &, Stage, Array_< DecorativeGeometry > &) const
void createScheduledEvent (const State &state, EventId &eventId) const
void createTriggeredEvent (const State &state, EventId &eventId, EventTriggerByStageIndex &triggerFunctionIndex, Stage stage) const
void calcEventTriggerInfo (const State &, Array_< EventTriggerInfo > &) const
void calcTimeOfNextScheduledEvent (const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
void calcTimeOfNextScheduledReport (const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
void handleEvents (State &, Event::Cause, const Array_< EventId > &eventIds, const HandleEventsOptions &options, HandleEventsResults &results) const
void reportEvents (const State &, Event::Cause, const Array_< EventId > &eventIds) const
const SubsystemgetOwnerSubsystemHandle () const
 Return a const reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.
SubsystemupdOwnerSubsystemHandle ()
 Return a writable reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.
void setOwnerSubsystemHandle (Subsystem &subsys)
 Provide a reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.
bool hasOwnerSubsystemHandle () const
 Check whether this Subsystem::Guts object is currently owned by some Subsystem handle object.
State access methods

These convenience methods are inline pass-throughs to the State methods of the same name but insert this Subsystem's SubsystemIndex as the first argument.

That is the value returned by the getMySubsystemIndex() method. An exception will be thrown if this Subsystem is not contained in a System.

See the SimTK::State documentation for the meaning of these methods; the behavior is identical here. An identical set of methods is present in the Subsystem handle class; in both cases they were added because it got annoying to have to dig up the subsystem index for every call to a State method.

QIndex allocateQ (State &s, const Vector &qInit) const
UIndex allocateU (State &s, const Vector &uInit) const
ZIndex allocateZ (State &s, const Vector &zInit) const
DiscreteVariableIndex allocateDiscreteVariable (State &s, Stage g, AbstractValue *v) const
DiscreteVariableIndex allocateAutoUpdateDiscreteVariable (State &s, Stage invalidates, AbstractValue *v, Stage updateDependsOn) const
CacheEntryIndex allocateCacheEntry (const State &s, Stage dependsOn, Stage computedBy, AbstractValue *v) const
CacheEntryIndex allocateCacheEntry (const State &state, Stage g, AbstractValue *v) const
CacheEntryIndex allocateLazyCacheEntry (const State &state, Stage earliest, AbstractValue *v) const
QErrIndex allocateQErr (const State &s, int nqerr) const
UErrIndex allocateUErr (const State &s, int nuerr) const
UDotErrIndex allocateUDotErr (const State &s, int nudoterr) const
EventTriggerByStageIndex allocateEventTriggersByStage (const State &s, Stage g, int ntriggers) const
const VectorgetQ (const State &s) const
const VectorgetU (const State &s) const
const VectorgetZ (const State &s) const
const VectorgetUWeights (const State &s) const
const VectorgetZWeights (const State &s) const
VectorupdQ (State &s) const
VectorupdU (State &s) const
VectorupdZ (State &s) const
const VectorgetQDot (const State &s) const
const VectorgetUDot (const State &s) const
const VectorgetZDot (const State &s) const
const VectorgetQDotDot (const State &s) const
VectorupdQDot (const State &s) const
VectorupdUDot (const State &s) const
VectorupdZDot (const State &s) const
VectorupdQDotDot (const State &s) const
const VectorgetQErr (const State &s) const
const VectorgetUErr (const State &s) const
const VectorgetQErrWeights (const State &s) const
const VectorgetUErrWeights (const State &s) const
const VectorgetUDotErr (const State &s) const
const VectorgetMultipliers (const State &s) const
const VectorgetEventTriggersByStage (const State &s, Stage g) const
VectorupdQErr (const State &s) const
VectorupdUErr (const State &s) const
VectorupdUDotErr (const State &s) const
VectorupdMultipliers (const State &s) const
VectorupdEventTriggersByStage (const State &s, Stage g) const
SystemQIndex getQStart (const State &s) const
int getNQ (const State &s) const
SystemUIndex getUStart (const State &s) const
int getNU (const State &s) const
SystemZIndex getZStart (const State &s) const
int getNZ (const State &s) const
SystemQErrIndex getQErrStart (const State &s) const
int getNQErr (const State &s) const
SystemUErrIndex getUErrStart (const State &s) const
int getNUErr (const State &s) const
SystemUDotErrIndex getUDotErrStart (const State &s) const
int getNUDotErr (const State &s) const
SystemMultiplierIndex getMultipliersStart (const State &s) const
int getNMultipliers (const State &s) const
SystemEventTriggerByStageIndex getEventTriggerStartByStage (const State &s, Stage g) const
int getNEventTriggersByStage (const State &s, Stage g) const
void setQ (State &s, const Vector &q) const
void setU (State &s, const Vector &u) const
void setZ (State &s, const Vector &z) const
Stage getStage (const State &s) const
void advanceToStage (const State &s, Stage g) const
const AbstractValuegetDiscreteVariable (const State &s, DiscreteVariableIndex index) const
AbstractValueupdDiscreteVariable (State &s, DiscreteVariableIndex index) const
const AbstractValuegetCacheEntry (const State &s, CacheEntryIndex index) const
AbstractValueupdCacheEntry (const State &s, CacheEntryIndex index) const
Real getDiscreteVarLastUpdateTime (const State &s, DiscreteVariableIndex dx) const
CacheEntryIndex getDiscreteVarUpdateIndex (const State &s, DiscreteVariableIndex dx) const
const AbstractValuegetDiscreteVarUpdateValue (const State &s, DiscreteVariableIndex dx) const
AbstractValueupdDiscreteVarUpdateValue (const State &s, DiscreteVariableIndex dx) const
bool isDiscreteVarUpdateValueRealized (const State &s, DiscreteVariableIndex dx) const
void markDiscreteVarUpdateValueRealized (const State &s, DiscreteVariableIndex dx) const
bool isCacheValueRealized (const State &s, CacheEntryIndex cx) const
void markCacheValueRealized (const State &s, CacheEntryIndex cx) const
void markCacheValueNotRealized (const State &s, CacheEntryIndex cx) const

Protected Member Functions

virtual Subsystem::GutscloneImpl () const =0
virtual int realizeSubsystemTopologyImpl (State &s) const
virtual int realizeSubsystemModelImpl (State &s) const
virtual int realizeSubsystemInstanceImpl (const State &s) const
virtual int realizeSubsystemTimeImpl (const State &s) const
virtual int realizeSubsystemPositionImpl (const State &s) const
virtual int realizeSubsystemVelocityImpl (const State &s) const
virtual int realizeSubsystemDynamicsImpl (const State &s) const
virtual int realizeSubsystemAccelerationImpl (const State &s) const
virtual int realizeSubsystemReportImpl (const State &s) const
virtual int calcDecorativeGeometryAndAppendImpl (const State &, Stage, Array_< DecorativeGeometry > &) const
virtual void calcEventTriggerInfoImpl (const State &, Array_< EventTriggerInfo > &) const
virtual void calcTimeOfNextScheduledEventImpl (const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
virtual void calcTimeOfNextScheduledReportImpl (const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
virtual void handleEventsImpl (State &, Event::Cause, const Array_< EventId > &eventIds, const HandleEventsOptions &options, HandleEventsResults &results) const
virtual void reportEventsImpl (const State &, Event::Cause, const Array_< EventId > &eventIds) const

Friends

class Subsystem

Detailed Description

The abstract parent of all Subsystem implementation classes.

You must extend this class if you implement a new concrete Subsystem class. The Simbody user's API for Subsystems is defined exclusively in the Subsystem handle class declaration; the API declared here is for use by Subsystem implementors.


Constructor & Destructor Documentation

SimTK::Subsystem::Guts::Guts ( const String name = "<NONAME>",
const String version = "0.0.0" 
) [explicit]

This constructor is for use in the constructors of derived Subsystems.

This serves as a default constructor since both arguments have defaults. The name and version strings are not interpreted by Simbody in any way; they are simply stored and returned as given.

Reimplemented in SimTK::ForceSubsystem::Guts.

virtual SimTK::Subsystem::Guts::~Guts ( ) [virtual]

Destructor is virtual to permit cleanup of derived classes.

Reimplemented in SimTK::ForceSubsystem::Guts.

Copy constructor results in a default-constructed object though with the name and version string copied.

Copy assignment is suppressed.


Member Function Documentation

const String& SimTK::Subsystem::Guts::getName ( ) const [inline]

Report back the name supplied on construction; this is not interpreted in any way by Simbody.

const String& SimTK::Subsystem::Guts::getVersion ( ) const [inline]

Report back the version string supplied on construction; this i not interpreted in any way by Simbody.

QIndex SimTK::Subsystem::Guts::allocateQ ( State s,
const Vector qInit 
) const [inline]
UIndex SimTK::Subsystem::Guts::allocateU ( State s,
const Vector uInit 
) const [inline]
ZIndex SimTK::Subsystem::Guts::allocateZ ( State s,
const Vector zInit 
) const [inline]
DiscreteVariableIndex SimTK::Subsystem::Guts::allocateAutoUpdateDiscreteVariable ( State s,
Stage  invalidates,
AbstractValue v,
Stage  updateDependsOn 
) const [inline]
CacheEntryIndex SimTK::Subsystem::Guts::allocateCacheEntry ( const State s,
Stage  dependsOn,
Stage  computedBy,
AbstractValue v 
) const [inline]
CacheEntryIndex SimTK::Subsystem::Guts::allocateCacheEntry ( const State state,
Stage  g,
AbstractValue v 
) const [inline]
CacheEntryIndex SimTK::Subsystem::Guts::allocateLazyCacheEntry ( const State state,
Stage  earliest,
AbstractValue v 
) const [inline]
QErrIndex SimTK::Subsystem::Guts::allocateQErr ( const State s,
int  nqerr 
) const [inline]
UErrIndex SimTK::Subsystem::Guts::allocateUErr ( const State s,
int  nuerr 
) const [inline]
UDotErrIndex SimTK::Subsystem::Guts::allocateUDotErr ( const State s,
int  nudoterr 
) const [inline]
EventTriggerByStageIndex SimTK::Subsystem::Guts::allocateEventTriggersByStage ( const State s,
Stage  g,
int  ntriggers 
) const [inline]
const Vector& SimTK::Subsystem::Guts::getQ ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getU ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getZ ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getUWeights ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getZWeights ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updQ ( State s) const [inline]
Vector& SimTK::Subsystem::Guts::updU ( State s) const [inline]
Vector& SimTK::Subsystem::Guts::updZ ( State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getQDot ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getUDot ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getZDot ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getQDotDot ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updQDot ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updUDot ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updZDot ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updQDotDot ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getQErr ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getUErr ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getQErrWeights ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getUErrWeights ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getUDotErr ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getMultipliers ( const State s) const [inline]
const Vector& SimTK::Subsystem::Guts::getEventTriggersByStage ( const State s,
Stage  g 
) const [inline]
Vector& SimTK::Subsystem::Guts::updQErr ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updUErr ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updUDotErr ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updMultipliers ( const State s) const [inline]
Vector& SimTK::Subsystem::Guts::updEventTriggersByStage ( const State s,
Stage  g 
) const [inline]
SystemQIndex SimTK::Subsystem::Guts::getQStart ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNQ ( const State s) const [inline]
SystemUIndex SimTK::Subsystem::Guts::getUStart ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNU ( const State s) const [inline]
SystemZIndex SimTK::Subsystem::Guts::getZStart ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNZ ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNQErr ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNUErr ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNUDotErr ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNMultipliers ( const State s) const [inline]
int SimTK::Subsystem::Guts::getNEventTriggersByStage ( const State s,
Stage  g 
) const [inline]
void SimTK::Subsystem::Guts::setQ ( State s,
const Vector q 
) const [inline]
void SimTK::Subsystem::Guts::setU ( State s,
const Vector u 
) const [inline]
void SimTK::Subsystem::Guts::setZ ( State s,
const Vector z 
) const [inline]
Stage SimTK::Subsystem::Guts::getStage ( const State s) const [inline]
void SimTK::Subsystem::Guts::advanceToStage ( const State s,
Stage  g 
) const [inline]
const AbstractValue& SimTK::Subsystem::Guts::getCacheEntry ( const State s,
CacheEntryIndex  index 
) const [inline]
AbstractValue& SimTK::Subsystem::Guts::updCacheEntry ( const State s,
CacheEntryIndex  index 
) const [inline]
bool SimTK::Subsystem::Guts::isCacheValueRealized ( const State s,
CacheEntryIndex  cx 
) const [inline]
void SimTK::Subsystem::Guts::markCacheValueRealized ( const State s,
CacheEntryIndex  cx 
) const [inline]
void SimTK::Subsystem::Guts::markCacheValueNotRealized ( const State s,
CacheEntryIndex  cx 
) const [inline]

Add a new Measure to this Subsystem.

The returned MeasureIndex is local to this Subsystem and can be used to access the Measure later.

template<class T >
Measure_<T> SimTK::Subsystem::Guts::getMeasure_ ( MeasureIndex  mx) const [inline]

Return the Measure whose index within this Subsystem is given.

The index should be as it was returned by adoptMeasure(). This is templatized for use when you know the value type of the Measure; if you don't then you should call getMeasure() which will return the Measure as an AbstractMeasure instead.

See also:
getMeasure()
AbstractMeasure SimTK::Subsystem::Guts::getMeasure ( MeasureIndex  mx) const [inline]

Return the Measure whose index within this Subsystem is given, as an AbstractMeasure (that is, its value type is not specified).

The index should be as it was returned by adoptMeasure().

See also:
getMeasure_
bool SimTK::Subsystem::Guts::isInSystem ( ) const [inline]
bool SimTK::Subsystem::Guts::isInSameSystem ( const Subsystem otherSubsystem) const
const System& SimTK::Subsystem::Guts::getSystem ( ) const [inline]
void SimTK::Subsystem::Guts::setSystem ( System sys,
SubsystemIndex  id 
) [inline]

Returns true if this subsystem's realizeTopology() method has been called since the last topological change or call to invalidateSubsystemTopologyCache().

Always call this method when a topological change is made to this Subsystem to indicate that any Stage::Topology cache values may need recomputation.

If the Subsystem belongs to a System, the System's overall topology will also be invalidated, since its Stage::Topology cannot be valid if any of its Subsystem topology stages are not valid. However, the stages of other Subsystems in the same System are not affected. A subsequent call to realizeTopology() is required before any computed values may be obtained.

void SimTK::Subsystem::Guts::createScheduledEvent ( const State state,
EventId eventId 
) const
void SimTK::Subsystem::Guts::createTriggeredEvent ( const State state,
EventId eventId,
EventTriggerByStageIndex triggerFunctionIndex,
Stage  stage 
) const
void SimTK::Subsystem::Guts::calcTimeOfNextScheduledEvent ( const State ,
Real tNextEvent,
Array_< EventId > &  eventIds,
bool  includeCurrentTime 
) const
void SimTK::Subsystem::Guts::calcTimeOfNextScheduledReport ( const State ,
Real tNextEvent,
Array_< EventId > &  eventIds,
bool  includeCurrentTime 
) const
void SimTK::Subsystem::Guts::handleEvents ( State ,
Event::Cause  ,
const Array_< EventId > &  eventIds,
const HandleEventsOptions options,
HandleEventsResults results 
) const
void SimTK::Subsystem::Guts::reportEvents ( const State ,
Event::Cause  ,
const Array_< EventId > &  eventIds 
) const
virtual Subsystem::Guts* SimTK::Subsystem::Guts::cloneImpl ( ) const [protected, pure virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemTopologyImpl ( State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemModelImpl ( State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemInstanceImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemTimeImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemPositionImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemVelocityImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemDynamicsImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemAccelerationImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::realizeSubsystemReportImpl ( const State s) const [inline, protected, virtual]
virtual int SimTK::Subsystem::Guts::calcDecorativeGeometryAndAppendImpl ( const State ,
Stage  ,
Array_< DecorativeGeometry > &   
) const [inline, protected, virtual]
virtual void SimTK::Subsystem::Guts::calcEventTriggerInfoImpl ( const State ,
Array_< EventTriggerInfo > &   
) const [inline, protected, virtual]
virtual void SimTK::Subsystem::Guts::calcTimeOfNextScheduledEventImpl ( const State ,
Real tNextEvent,
Array_< EventId > &  eventIds,
bool  includeCurrentTime 
) const [inline, protected, virtual]
virtual void SimTK::Subsystem::Guts::calcTimeOfNextScheduledReportImpl ( const State ,
Real tNextEvent,
Array_< EventId > &  eventIds,
bool  includeCurrentTime 
) const [inline, protected, virtual]
virtual void SimTK::Subsystem::Guts::handleEventsImpl ( State ,
Event::Cause  ,
const Array_< EventId > &  eventIds,
const HandleEventsOptions options,
HandleEventsResults results 
) const [inline, protected, virtual]
virtual void SimTK::Subsystem::Guts::reportEventsImpl ( const State ,
Event::Cause  ,
const Array_< EventId > &  eventIds 
) const [inline, protected, virtual]

Return a const reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.

Return a writable reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.

Provide a reference to the Subsystem handle object that is the unique owner of this Subsystem::Guts object.

The owner Subsystem is responsible for deleting this object at destruction. Subsystem::Guts objects are not reference counted.

Check whether this Subsystem::Guts object is currently owned by some Subsystem handle object.


Friends And Related Function Documentation

friend class Subsystem [friend]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines