1 #ifndef SimTK_SimTKCOMMON_SYSTEM_GUTS_H_
2 #define SimTK_SimTKCOMMON_SYSTEM_GUTS_H_
35 class DecorativeGeometry;
80 const String& version=
"0.0.0");
113 explicit Guts(
class GutsRep* r) : rep(r) { }
115 const GutsRep&
getRep()
const {assert(rep);
return *rep;}
116 GutsRep&
updRep()
const {assert(rep);
return *rep;}
235 bool includeCurrentTime)
const;
238 bool includeCurrentTime)
const;
244 const unsigned nq = (unsigned)s.
getNQ();
246 for (
unsigned i=0; i<nq; ++i)
251 const unsigned nu = (unsigned)s.
getNU();
253 for (
unsigned i=0; i<nu; ++i)
260 class EventTriggerInfoRep;
#define SimTK_SimTKCOMMON_EXPORT
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:224
This is the header which should be included in user programs that would like to make use of all the S...
Declares the user-visible part of a SimTK::State, the implementation is done in a separate internal c...
Includes internal headers providing declarations for the basic SimTK Core classes.
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition: Array.h:1520
void resize(size_type n)
Change the size of this Array, preserving all the elements that will still fit, and default construct...
Definition: Array.h:2091
These are all the possible causes for events.
Definition: Event.h:126
Options for the handleEvent() method.
Definition: Event.h:269
Results returned by the handleEvent() method.
Definition: Event.h:345
Options for the advanced project() methods.
Definition: System.h:950
Results for advanced users of project() methods.
Definition: System.h:1067
ProjectResults & setExitStatus(Status status)
Definition: System.h:1109
@ Succeeded
The project() was successful either because no projection was necessary or projection was able to ach...
Definition: System.h:1076
ProjectResults & clear()
Restore this object to its default-constructed state, with the return status set to Invalid.
Definition: System.h:1089
This class is basically a glorified enumerated type, type-safe and range checked but permitting conve...
Definition: Stage.h:66
@ HighestRuntime
Definition: Stage.h:84
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
int getNQ() const
Get total number of shared q's (generalized coordinates; second order state variables).
int getNU() const
Get total number of shared u's (generalized speeds; mobilities).
SimTK::String is a plug-compatible std::string replacement (plus some additional functionality) inten...
Definition: String.h:65
Provide a unique integer type for identifying Subsystems.
A Subsystem is expected to be part of a larger System and to have interdependencies with other subsys...
Definition: Subsystem.h:55
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 "u-like" arrays, that is, arrays that inherently have...
This is the declaration for the System::Guts class, the abstract object to which a System handle poin...
Definition: SystemGuts.h:71
virtual int calcEventTriggerInfoImpl(const State &state, Array_< EventTriggerInfo > &info) const
virtual bool prescribeQImpl(State &) const
Definition: SystemGuts.h:210
virtual System::Guts * cloneImpl() const =0
virtual void multiplyByNPInvImpl(const State &state, const Vector &dq, Vector &u) const
virtual void multiplyByNTransposeImpl(const State &state, const Vector &fq, Vector &fu) const
const Subsystem & getSubsystem(SubsystemIndex) const
Guts(const String &name="<NONAME>", const String &version="0.0.0")
const State & getDefaultState() const
const String & getVersion() const
Guts(class GutsRep *r)
Definition: SystemGuts.h:113
void multiplyByNPInvTranspose(const State &state, const Vector &fu, Vector &fq) const
void calcDecorativeGeometryAndAppend(const State &, Stage, Array_< DecorativeGeometry > &) const
void projectU(State &, Vector &uErrEst, const ProjectOptions &options, ProjectResults &results) const
void realizeVelocity(const State &s) const
virtual void multiplyByNPInvTransposeImpl(const State &state, const Vector &fu, Vector &fq) const
virtual int realizeInstanceImpl(const State &state) const
Definition: SystemGuts.h:192
const GutsRep & getRep() const
Definition: SystemGuts.h:115
void realizePosition(const State &s) const
GutsRep & updRep() const
Definition: SystemGuts.h:116
virtual void multiplyByNImpl(const State &state, const Vector &u, Vector &dq) const
void realizeDynamics(const State &s) const
virtual void getFreeQIndexImpl(const State &s, Array_< SystemQIndex > &freeQs) const
Definition: SystemGuts.h:243
Subsystem & updSubsystem(SubsystemIndex)
void multiplyByNPInv(const State &state, const Vector &dq, Vector &u) const
bool hasTimeAdvancedEvents() const
void projectQ(State &, Vector &qErrEst, const ProjectOptions &options, ProjectResults &results) const
void realizeAcceleration(const State &s) const
void calcTimeOfNextScheduledReport(const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
void multiplyByN(const State &state, const Vector &u, Vector &dq) const
virtual int realizeModelImpl(State &state) const
Definition: SystemGuts.h:191
const String & getName() const
void realizeModel(State &) const
System::Guts * clone() const
virtual int realizeAccelerationImpl(const State &state) const
Definition: SystemGuts.h:197
virtual int realizeTimeImpl(const State &state) const
Definition: SystemGuts.h:193
void multiplyByNTranspose(const State &state, const Vector &fq, Vector &fu) const
void calcTimeOfNextScheduledEvent(const State &, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
void getFreeUIndex(const State &, Array_< SystemUIndex > &freeUs) const
virtual int realizeDynamicsImpl(const State &state) const
Definition: SystemGuts.h:196
virtual void projectUImpl(State &state, Vector &uErrEst, const ProjectOptions &options, ProjectResults &results) const
Definition: SystemGuts.h:219
State & updDefaultState()
void invalidateSystemTopologyCache() const
virtual int realizePositionImpl(const State &state) const
Definition: SystemGuts.h:194
virtual bool prescribeUImpl(State &) const
Definition: SystemGuts.h:211
bool systemTopologyHasBeenRealized() const
void setHasTimeAdvancedEvents(bool hasEm)
int getNumSubsystems() const
const State & realizeTopology() const
virtual void getFreeUIndexImpl(const State &s, Array_< SystemUIndex > &freeUs) const
Definition: SystemGuts.h:250
virtual void projectQImpl(State &state, Vector &qErrEst, const ProjectOptions &options, ProjectResults &results) const
Definition: SystemGuts.h:216
bool hasRep() const
Definition: SystemGuts.h:114
bool prescribeU(State &) const
virtual int calcTimeOfNextScheduledReportImpl(const State &state, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
void getFreeQIndex(const State &, Array_< SystemQIndex > &freeQs) const
virtual int realizeVelocityImpl(const State &state) const
Definition: SystemGuts.h:195
SubsystemIndex adoptSubsystem(Subsystem &child)
void realizeReport(const State &s) const
virtual void handleEventsImpl(State &state, Event::Cause cause, const Array_< EventId > &eventIds, const HandleEventsOptions &options, HandleEventsResults &results) const
virtual int realizeReportImpl(const State &state) const
Definition: SystemGuts.h:198
void setOwnerHandle(System &)
StageVersion getSystemTopologyCacheVersion() const
virtual int realizeTopologyImpl(State &state) const
Definition: SystemGuts.h:190
virtual int reportEventsImpl(const State &state, Event::Cause cause, const Array_< EventId > &eventIds) const
bool hasOwnerHandle() const
void realizeInstance(const State &s) const
void realizeTime(const State &s) const
void reportEvents(const State &, Event::Cause, const Array_< EventId > &eventIds) const
bool prescribeQ(State &) const
void handleEvents(State &, Event::Cause, const Array_< EventId > &eventIds, const HandleEventsOptions &options, HandleEventsResults &results) const
void calcEventTriggerInfo(const State &, Array_< EventTriggerInfo > &) const
void setSystemTopologyCacheVersion(StageVersion topoVersion) const
const System & getSystem() const
void realize(const State &s, Stage g=Stage::HighestRuntime) const
virtual int calcTimeOfNextScheduledEventImpl(const State &state, Real &tNextEvent, Array_< EventId > &eventIds, bool includeCurrentTime) const
This is the base class that serves as the parent of all SimTK System objects; most commonly Simbody's...
Definition: System.h:97
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
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
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:607