Go to the documentation of this file. 1 #ifndef SimTK_SIMMATH_INTEGRATOR_H_
2 #define SimTK_SIMMATH_INTEGRATOR_H_
123 class InitializationFailed;
124 class StepSizeTooSmall;
126 class TriedToAdvancePastFinalTime;
127 class CantAskForEventInfoWhenNoEventTriggered;
204 ReachedReportTime =1,
206 ReachedEventTrigger =2,
208 ReachedScheduledEvent=3,
217 StartOfContinuousInterval=7,
218 InvalidSuccessfulStepStatus = -1
252 ReachedFinalTime = 1,
254 AnUnrecoverableErrorOccurred = 2,
256 EventHandlerRequestedTermination = 3,
258 InvalidTerminationReason = -1
406 {
return getSuccessfulStepStatusString(stat); }
409 const IntegratorRep&
getRep()
const {assert(rep);
return *rep;}
410 IntegratorRep&
updRep() {assert(rep);
return *rep;}
414 friend class IntegratorRep;
419 #endif // SimTK_SIMMATH_INTEGRATOR_H_
This object is intended to contain all state information for a SimTK::System, except topological info...
Definition: State.h:280
IntegratorRep * rep
Definition: Integrator.h:413
int getNumRealizations() const
Get the total number of state realizations that have been performed since the last call to resetAllSt...
void resetAllStatistics()
Reset all statistics to zero.
void setMaximumStepSize(Real hmax)
Set the maximum step size that should ever be used.
TerminationReason getTerminationReason() const
Get the reason the simulation terminated.
int getNumUProjections() const
Get the total number of times a state velocities U have been projected since the last call to resetAl...
int getNumErrorTestFailures() const
Get the number of attempted steps that have failed due to the error being unacceptably high since the...
void setProjectInterpolatedStates(bool shouldProject)
Set whether interpolated states should be projected back to the constraint manifold after interpolati...
An Integrator is an object that can advance the State of a System through time.
Definition: Integrator.h:116
int getMethodMaxOrder() const
Get the maximum order this Integrator may use.
int getNumIterations() const
For iterative methods, this is the total number of internal step iterations taken regardless of wheth...
static String getSuccessfulStepStatusString(SuccessfulStepStatus)
Get a human readable description of the reason a step returned.
int getNumQProjections() const
Get the total number of times a state positions Q have been projected since the last call to resetAll...
const Array_< EventId > & getTriggeredEvents() const
Get the IDs of all events which have been localized within the event window.
#define SimTK_SIMMATH_EXPORT
Definition: SimTKmath/include/simmath/internal/common.h:64
const Array_< Event::Trigger > & getEventTransitionsSeen() const
Get EventTriggers describing the events which have been localized within the event window.
int getNumProjectionFailures() const
Get the number of attempted steps that have failed due to an error when projecting the state (either ...
void setReturnEveryInternalStep(bool shouldReturn)
Set whether the Integrator should return from stepTo() or stepBy() after every internal step,...
void setUseInfinityNorm(bool useInfinityNorm)
(Advanced) Use infinity norm (maximum absolute value) instead of default RMS norm to evaluate whether...
Real getPreviousStepSizeTaken() const
Get the size of the most recent successful step.
int getMethodMinOrder() const
Get the minimum order this Integrator may use.
This is a System that represents the dynamics of a particle moving along a smooth surface.
Definition: Assembler.h:37
Real getTime() const
Get the time of the current State. This is equivalent to calling getState().getTime().
Definition: Integrator.h:162
const IntegratorRep & getRep() const
Definition: Integrator.h:409
void setAllowInterpolation(bool shouldInterpolate)
Set whether the Integrator is permitted to return interpolated states for reporting purposes which ma...
const State & getState() const
Return a State corresponding to the "current" time at the end of the last call to stepTo() or stepBy(...
int getNumConvergentIterations() const
For iterative methods, get the number of internal step iterations in steps that led to convergence (n...
static String getTerminationReasonString(TerminationReason)
Get a human readable description of the termination reason.
SuccessfulStepStatus
When a step is successful, it will return an indication of what caused it to stop where it did.
Definition: Integrator.h:202
Integrator()
Definition: Integrator.h:118
SuccessfulStepStatus stepBy(Real interval, Real scheduledEventTime=Infinity)
Integrate the System until something happens which requires outside processing, and return a status c...
static String successfulStepStatusString(SuccessfulStepStatus stat)
OBSOLETE: use getSuccessfulStepStatusString().
Definition: Integrator.h:405
const char * getMethodName() const
Get the name of this integration method.
const State & getAdvancedState() const
Return the state representing the trajectory point to which the integrator has irreversibly advanced.
void initialize(const State &state)
Supply the integrator with a starting state.
int getNumDivergentIterations() const
For iterative methods, get the number of internal step iterations in steps that did not lead to conve...
int getNumProjections() const
Get the total number of times a state has been projected (counting both Q and U projections) since th...
void reinitialize(Stage stage, bool shouldTerminate)
After an event handler has made a discontinuous change to the Integrator's "advanced state",...
void setFinalTime(Real tFinal)
Set the time at which the simulation should end.
This class is basically a glorified enumerated type, type-safe and range checked but permitting conve...
Definition: Stage.h:66
int getNumStepsAttempted() const
Get the total number of steps that have been attempted (successfully or unsuccessfully) since the las...
bool methodHasErrorControl() const
Get whether this Integrator provides error control.
void setMinimumStepSize(Real hmin)
Set the minimum step size that should ever be used.
const Array_< Real > & getEstimatedEventTimes() const
Get the estimated times of all events which have been localized within the event window.
Real getConstraintToleranceInUse() const
Get the constraint tolerance which is being used for error control.
Real getAdvancedTime() const
Get the time of the advanced State. This is equivalent to calling getAdvancedState()....
Definition: Integrator.h:173
int getNumRealizationFailures() const
Get the number of attempted steps that have failed due to an error when realizing the state since the...
Real getPredictedNextStepSize() const
Get the step size that will be attempted first on the next call to stepTo() or stepBy().
Real getActualInitialStepSizeTaken() const
Get the size of the first successful step after the last initialize() call.
void setConstraintTolerance(Real consTol)
Set the tolerance within which constraints must be satisfied.
IntegratorRep & updRep()
Definition: Integrator.h:410
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition: Array.h:53
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
const Real Infinity
This is the IEEE positive infinity constant for this implementation of the default-precision Real typ...
int getNumStepsTaken() const
Get the total number of steps that have been successfully taken since the last call to resetAllStatis...
void setForceFullNewton(bool forceFullNewton)
(Advanced) Constraint projection may use an out-of-date iteration matrix for efficiency.
Vec2 getEventWindow() const
Get the window (tLow, tHigh] within which one or more events have been localized.
void setInternalStepLimit(int nSteps)
Set the maximum number of steps that may be taken within a single call to stepTo() or stepBy().
void setProjectEveryStep(bool forceProject)
Set whether the system should be projected back to the constraint manifold after every step.
bool isSimulationOver() const
Get whether the simulation has terminated.
SimTK::String is a plug-compatible std::string replacement (plus some additional functionality) inten...
Definition: String.h:62
int getNumConvergenceTestFailures() const
Get the number of attempted steps that failed due to non-convergence of internal step iterations.
bool isInfinityNormInUse() const
(Advanced) Are we currently using the infinity norm?
Real getAccuracyInUse() const
Get the accuracy which is being used for error control.
void setAccuracy(Real accuracy)
Set the overall accuracy that should be used for integration.
TerminationReason
Once the simulation has ended, getTerminationReason() may be called to find out what caused it to end...
Definition: Integrator.h:250
void setFixedStepSize(Real stepSize)
Set the integrator to use a single fixed step size for all steps.
int getNumUProjectionFailures() const
Get the number of attempted steps that have failed due to an error when projecting the state velociti...
State & updAdvancedState()
Get a non-const reference to the advanced state.
void setInitialStepSize(Real hinit)
Set the initial step size that should be attempted.
int getNumQProjectionFailures() const
Get the number of attempted steps that have failed due to an error when projecting the state position...
SuccessfulStepStatus stepTo(Real reportTime, Real scheduledEventTime=Infinity)
Integrate the System until something happens which requires outside processing, and return a status c...
bool isStateInterpolated() const
Get whether getState() will return an interpolated state or just the same thing as getAdvancedState()...