1 #ifndef SimTK_SimTKCOMMON_STATE_H_ 2 #define SimTK_SimTKCOMMON_STATE_H_ 159 class PerSubsystemInfo;
160 class DiscreteVarInfo;
161 class CacheEntryInfo;
162 class ListOfDependents;
337 bool isConsistent(
const SimTK::State& otherState)
const;
342 inline void setNumSubsystems(
int i);
358 inline int getNumSubsystems()
const;
364 inline const Stage& getSystemStage()
const;
372 inline void invalidateAll(
Stage);
381 inline void invalidateAllCacheAtOrAbove(
Stage)
const;
394 inline void advanceSystemToStage(
Stage)
const;
400 inline StageVersion getSystemTopologyStageVersion()
const;
707 {
return allocateCacheEntry(sx, stage, stage, value); }
728 allocateCacheEntryWithPrerequisites
730 bool q,
bool u,
bool z,
810 inline int getNY()
const;
815 inline int getNQ()
const;
821 inline int getNU()
const;
827 inline int getNZ()
const;
833 inline int getNYErr()
const;
836 inline int getNQErr()
const;
842 inline int getNUErr()
const;
849 inline int getNUDotErr()
const;
854 inline int getNMultipliers()
const;
857 inline int getNEventTriggers()
const;
860 inline int getNEventTriggersByStage(
Stage)
const;
870 inline std::mutex& getStateLock()
const;
910 inline const Vector& getEventTriggers()
const;
911 inline const Vector& getEventTriggersByStage(
Stage)
const;
914 inline Vector& updEventTriggers()
const;
915 inline Vector& updEventTriggersByStage(
Stage)
const;
961 inline const Real& getTime()
const;
962 inline const Vector& getY()
const;
965 inline const Vector& getQ()
const;
966 inline const Vector& getU()
const;
967 inline const Vector& getZ()
const;
1004 inline const Vector& getUWeights()
const;
1012 inline const Vector& getZWeights()
const;
1017 inline Vector& updUWeights();
1022 inline Vector& updZWeights();
1026 inline Real& updTime();
1030 inline void setTime(
Real t);
1031 inline void setY(
const Vector& y);
1039 inline void setQ(
const Vector& q);
1040 inline void setU(
const Vector& u);
1041 inline void setZ(
const Vector& z);
1043 inline const Vector& getYDot()
const;
1046 inline const Vector& getQDot()
const;
1047 inline const Vector& getZDot()
const;
1048 inline const Vector& getUDot()
const;
1051 inline const Vector& getQDotDot()
const;
1054 inline Vector& updYDot()
const;
1055 inline Vector& updQDot()
const;
1056 inline Vector& updZDot()
const;
1057 inline Vector& updUDot()
const;
1062 inline Vector& updQDotDot()
const;
1066 inline const Vector& getYErr()
const;
1069 inline const Vector& getQErr()
const;
1070 inline const Vector& getUErr()
const;
1073 inline const Vector& getUDotErr()
const;
1074 inline const Vector& getMultipliers()
const;
1078 inline const Vector& getQErrWeights()
const;
1090 inline const Vector& getUErrWeights()
const;
1096 inline Vector& updQErrWeights();
1102 inline Vector& updUErrWeights();
1105 inline Vector& updYErr()
const;
1106 inline Vector& updQErr()
const;
1107 inline Vector& updUErr()
const;
1109 inline Vector& updUDotErr()
const;
1110 inline Vector& updMultipliers()
const;
1134 inline Stage getLowestSystemStageDifference
1143 inline void setSystemTopologyStageVersion(
StageVersion topoVersion);
1164 inline const ListOfDependents& getQDependents()
const;
1168 inline const ListOfDependents& getUDependents()
const;
1172 inline const ListOfDependents& getZDependents()
const;
1175 inline bool hasCacheEntry(
const CacheEntryKey& cacheEntry)
const;
1189 inline bool hasDiscreteVar(
const DiscreteVarKey& discreteVar)
const;
1204 inline void autoUpdateDiscreteVariables();
1207 inline String toString()
const;
1209 inline String cacheToString()
const;
1218 const StateImpl& getImpl()
const {assert(impl);
return *impl;}
1219 StateImpl& updImpl() {assert(impl);
return *impl;}
1231 #endif // SimTK_SimTKCOMMON_STATE_H_ #define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
SimTK_DEFINE_UNIQUE_INDEX_TYPE(AssemblyConditionIndex)
Unique integer type for Subsystem-local uDotErr indexing.
This unique integer type is for identifying a triggered event in the full System-level view of the St...
CacheEntryIndex allocateCacheEntry(SubsystemIndex sx, Stage stage, AbstractValue *value) const
This is an abbreviation for allocation of a cache entry whose earliest and latest Stages are the same...
Definition: State.h:705
This unique integer type is for indexing the global, System-level "y-like" arrays, that is, the arrays in which all of the various Subsystems' continuous state variables q, u, and z have been collected into contiguous memory.
Unique integer type for Subsystem-local u indexing.
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
Unique integer type for Subsystem-local uErr indexing.
Unique integer type for Subsystem-local qErr indexing.
This class is basically a glorified enumerated type, type-safe and range checked but permitting conve...
Definition: Stage.h:66
This is part of the internal implementation of SimTK::State and does not contain any user-visible obj...
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:606
long long StageVersion
This is the type to use for Stage version numbers that get incremented whenever a state variable chan...
Definition: Stage.h:44
This unique integer type is for indexing global "multiplier-like" arrays, that is, arrays that inherently have the same dimension as the total number of Lagrange multipliers in the full System-level view of the State.
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
long long ValueVersion
This is the type to use for state variable version numbers that get incremented whenever a state valu...
Definition: Stage.h:52
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition: Array.h:53
CacheEntryIndex allocateLazyCacheEntry(SubsystemIndex sx, Stage earliest, AbstractValue *value) const
This is an abbreviation for allocation of a lazy cache entry.
Definition: State.h:718
This unique integer type is for indexing global "q-like" arrays, that is, arrays that inherently have...
This unique integer type is for indexing global "qErr-like" arrays, that is, arrays that inherently h...
Unique integer type for Subsystem-local z indexing.
This unique integer type is for indexing the global, System-level "yErr-like" arrays, that is, the arrays in which all of the various Subsystems' qErr and uErr constraint equation slots have been collected together.
This unique integer type is for indexing global "uErr-like" arrays, that is, arrays that inherently h...
Unique integer type for Subsystem-local q indexing.
std::pair< SubsystemIndex, DiscreteVariableIndex > DiscreteVarKey
Definition: State.h:165
Higher than any legitimate Stage.
Definition: Stage.h:79
#define SimTK_FORCE_INLINE
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:269
std::ostream & operator<<(std::ostream &o, const ContactForce &f)
Definition: CompliantContactSubsystem.h:387
This unique integer type is for identifying a triggered event within a particular Stage of the full S...
SimTK::String is a plug-compatible std::string replacement (plus some additional functionality) inten...
Definition: String.h:62
Abstract base class representing an arbitrary value of unknown type.
Definition: Value.h:49
This unique integer type is for indexing global "uDotErr-like" arrays, that is, arrays that inherentl...
This file declares the types needed for Simbody's support for Events.
This unique integer type is for selecting discrete variables.
This unique integer type is for indexing global "z-like" arrays, that is, arrays that inherently have...
Provide a unique integer type for identifying Subsystems.
std::pair< SubsystemIndex, CacheEntryIndex > CacheEntryKey
Definition: State.h:164
This unique integer type is for selecting non-shared cache entries.
This is the header which should be included in user programs that would like to make use of all the S...
Unique integer type for Subsystem-local, per-stage event indexing.
This unique integer type is for indexing global "u-like" arrays, that is, arrays that inherently have...
Includes internal headers providing declarations for the basic SimTK Core classes.