chrono::ChSuspensionTest Class Referenceabstract

Description

Base class for suspension and steering tester This class provides the interface between the systems.

#include <ChSuspensionTest.h>

Inheritance diagram for chrono::ChSuspensionTest:
Collaboration diagram for chrono::ChSuspensionTest:

Public Member Functions

const ChSharedPtr< ChBodyAuxRefGetChassis () const
 Get a handle to the vehicle's chassis body.
 
const ChVectorGetChassisPos () const
 Get the global location of the chassis reference frame origin.
 
const ChQuaternionGetChassisRot () const
 Get the orientation of the chassis reference frame. More...
 
const ChVectorGetChassisPosCOM () const
 Get the global location of the chassis center of mass.
 
const ChQuaternionGetChassisRotCOM () const
 Get the orientation of the chassis centroidal frame. More...
 
ChSharedPtr< ChBodyGetWheelBody (const ChWheelID &wheelID) const
 Get a handle to the specified wheel body.
 
const ChVectorGetWheelPos (const ChWheelID &wheel_id) const
 Get the global location of the specified wheel.
 
const ChQuaternionGetWheelRot (const ChWheelID &wheel_id) const
 Get the global rotation of the specified wheel.
 
const ChVectorGetWheelLinVel (const ChWheelID &wheel_id) const
 global linear velocity of wheel
 
ChVector GetWheelAngVel (const ChWheelID &wheel_id) const
 global angular velocity of wheel
 
ChWheelState GetWheelState (const ChWheelID &wheel_id) const
 Get the complete state for the specified wheel. More...
 
virtual ChCoordsys GetLocalDriverCoordsys () const =0
 Get the local driver position and orientation. More...
 
ChVector GetDriverPos () const
 Get the global location of the driver.
 
virtual void Initialize (const ChCoordsys<> &chassisPos)
 Initialize this chassis at the specified global location and orientation. More...
 
virtual void SetActuator_func_L (const ChSharedPtr< ChFunction > &funcL)
 set the actuator function on the left wheel
 
virtual void SetActuator_func_R (const ChSharedPtr< ChFunction > &funcR)
 
virtual void Update (double time, double steering, double disp_L, double disp_R, const ChTireForces &tire_forces)
 Update the state at the current time. More...
 
virtual void Update (double time, double disp_L, double disp_R, const ChTireForces &tire_forces)
 
virtual void Advance (double step)
 Advance the state of this vehicle by the specified time step.
 
void SetStepsize (double val)
 Set the integration step size for the vehicle subsystem.
 
double GetStepsize () const
 Get the current value of the integration step size for the vehicle subsystem. More...
 
bool Has_steering () const
 
void LogConstraintViolations ()
 Log current constraint violations.
 
- Public Member Functions inherited from chrono::ChSystem
 ChSystem ()
 Create a physical system.
 
 ChSystem (const ChSystem &other)
 Copy constructor.
 
virtual ~ChSystem ()
 Destructor.
 
void SetStep (double m_step)
 Sets the time step used for integration (dynamical simulation). More...
 
double GetStep () const
 Gets the current time step used for the integration (dynamical simulation).
 
void SetEndTime (double m_end_time)
 Sets the end of simulation.
 
double GetEndTime () const
 Gets the end of the simulation.
 
void SetStepMin (double m_step_min)
 Sets the lower limit for time step (only needed if using integration methods which support time step adaption). More...
 
double GetStepMin () const
 Gets the lower limit for time step.
 
void SetStepMax (double m_step_max)
 Sets the upper limit for time step (only needed if using integration methods which support time step adaption). More...
 
double GetStepMax () const
 Gets the upper limit for time step.
 
void SetTimestepperType (ChTimestepper::Type type)
 Set the method for time integration (time stepper type). More...
 
ChTimestepper::Type GetTimestepperType () const
 Get the current method for time integration (time stepper type).
 
void SetTimestepper (std::shared_ptr< ChTimestepper > mstepper)
 Set the timestepper object to be used for time integration.
 
std::shared_ptr< ChTimestepperGetTimestepper () const
 Get the timestepper currently used for time integration.
 
void SetMaxiter (int m_maxiter)
 Sets outer iteration limit for assembly constraints. More...
 
int GetMaxiter () const
 Gets iteration limit for assembly constraints.
 
void SetTol (double m_tol)
 Sets tolerance (in m) for assembly constraints. More...
 
double GetTol () const
 Gets current tolerance for assembly constraints.
 
void SetTolForce (double mtol)
 Sets tolerance for satisfying constraints at the velocity level. More...
 
double GetTolForce () const
 Return the current value of the tolerance used in the speed solver.
 
void SetMinBounceSpeed (double mval)
 For elastic collisions, with objects that have nonzero restitution coefficient: objects will rebounce only if their relative colliding speed is above this threshold. More...
 
double GetMinBounceSpeed () const
 Objects will rebounce only if their relative colliding speed is above this threshold.
 
void SetMaxPenetrationRecoverySpeed (double mval)
 For the default stepper, you can limit the speed of exiting from penetration situations. More...
 
double GetMaxPenetrationRecoverySpeed () const
 Get the limit on the speed for exiting from penetration situations (for Anitescu stepper)
 
virtual void SetSolverType (ChSolver::Type type)
 Choose the solver type, to be used for the simultaneous solution of the constraints in dynamical simulations (as well as in kinematics, statics, etc.) More...
 
ChSolver::Type GetSolverType () const
 Gets the current solver type.
 
void SetMaxItersSolverSpeed (int mval)
 When using an iterative solver (es. More...
 
int GetMaxItersSolverSpeed () const
 Current maximum number of iterations, if using an iterative solver.
 
void SetMaxItersSolverStab (int mval)
 When using an iterative solver (es. More...
 
int GetMaxItersSolverStab () const
 Current maxi. number of iterations, if using an iterative solver for stabilization.
 
void SetSolverWarmStarting (bool usewarm=true)
 If you want to easily turn ON/OFF the warm starting feature of both iterative solvers (the one for speed and the other for pos.stabilization) you can simply use the following instead of accessing them directly with GetSolver() and GetStabSolver()
 
bool GetSolverWarmStarting () const
 Tell if the warm starting is enabled for the speed solver, (if iterative type).
 
void SetSolverOverrelaxationParam (double momega=1.0)
 If you want to easily adjust the omega overrelaxation parameter of both iterative solvers (the one for speed and the other for position stabilization) you can simply use the following instead of accessing them directly with GetSolver() and GetStabSolver(). More...
 
double GetSolverOverrelaxationParam () const
 Tell the omega overrelaxation factor for the speed solver, (if iterative type).
 
void SetSolverSharpnessParam (double momega=1.0)
 If you want to easily adjust the 'sharpness lambda' parameter of both iterative solvers (the one for speed and the other for pos.stabilization) you can simply use the following instead of accessing them directly with GetSolver() and GetStabSolver(). More...
 
double GetSolverSharpnessParam () const
 Tell the 'sharpness lambda' factor for the speed solver, (if iterative type).
 
virtual void SetStabSolver (std::shared_ptr< ChSolver > newsolver)
 Instead of using SetSolverType(), you can create your own custom solver (inherited from ChSolver) and plug it into the system using this function. More...
 
virtual std::shared_ptr< ChSolverGetStabSolver ()
 Access directly the stabilization solver, configured to be used for the stabilization of constraints (solve delta positions). More...
 
virtual void SetSolver (std::shared_ptr< ChSolver > newsolver)
 Instead of using SetSolverType(), you can create your own custom solver (suffice it is inherited from ChSolver) and plug it into the system using this function. More...
 
virtual std::shared_ptr< ChSolverGetSolver ()
 Access directly the solver, configured to be used for the main differential inclusion problem (on speed-impulses). More...
 
void SetSystemDescriptor (std::shared_ptr< ChSystemDescriptor > newdescriptor)
 Instead of using the default 'system descriptor', you can create your own custom descriptor (inherited from ChSystemDescriptor) and plug it into the system using this function. More...
 
std::shared_ptr
< ChSystemDescriptor
GetSystemDescriptor ()
 Access directly the 'system descriptor'.
 
void SetParallelThreadNumber (int mthreads=2)
 Changes the number of parallel threads (by default is n.of cores). More...
 
int GetParallelThreadNumber ()
 Get the number of parallel threads. More...
 
void Set_G_acc (const ChVector<> &m_acc)
 Sets the G (gravity) acceleration vector, affecting all the bodies in the system.
 
const ChVectorGet_G_acc () const
 Gets the G (gravity) acceleration vector affecting all the bodies in the system.
 
void SetupInitial () override
 Initial system setup before analysis. More...
 
void Clear ()
 Removes all bodies/marker/forces/links/contacts, also resets timers and events. More...
 
virtual
ChMaterialSurface::ContactMethod 
GetContactMethod () const =0
 Return the contact method supported by this system. More...
 
virtual ChBodyNewBody ()=0
 Create and return the pointer to a new body. More...
 
virtual ChBodyAuxRefNewBodyAuxRef ()=0
 Create and return the pointer to a new body with auxiliary reference frame. More...
 
void AddProbe (const std::shared_ptr< ChProbe > &newprobe)
 Attach a probe to this system.
 
void AddControls (const std::shared_ptr< ChControls > &newcontrols)
 Attach a control to this system.
 
void RemoveAllProbes ()
 Remove all probes from this system.
 
void RemoveAllControls ()
 Remove all controls from this system.
 
virtual void SetContactContainer (std::shared_ptr< ChContactContainer > container)
 Replace the contact continer.
 
std::shared_ptr
< ChContactContainer
GetContactContainer ()
 Get the contact container.
 
void Reference_LM_byID ()
 Given inserted markers and links, restores the pointers of links to markers given the information about the marker IDs. More...
 
int GetNcontacts ()
 Gets the number of contacts.
 
virtual double GetTimerStep ()
 Return the time (in seconds) spent for computing the time step.
 
virtual double GetTimerSolver ()
 Return the fraction of time (in seconds) for the solver, within the time step. More...
 
virtual double GetTimerSetup ()
 Return the time (in seconds) for the solver Setup phase.
 
virtual double GetTimerCollisionBroad ()
 Return the fraction of time (in seconds) for finding collisions, within the time step.
 
virtual double GetTimerCollisionNarrow ()
 Return the fraction of time (in seconds) for finding collisions, within the time step.
 
virtual double GetTimerUpdate ()
 Return the fraction of time (in seconds) for updating auxiliary data, within the time step.
 
void ResetTimers ()
 Resets the timers.
 
virtual void Setup () override
 Counts the number of bodies and links. More...
 
virtual void Update (bool update_assets=true) override
 Updates all the auxiliary data and children of bodies, forces, links, given their current state. More...
 
virtual void IntStateGather (const unsigned int off_x, ChState &x, const unsigned int off_v, ChStateDelta &v, double &T) override
 From item's state to global state vectors y={x,v} pasting the states at the specified offsets. More...
 
virtual void IntStateScatter (const unsigned int off_x, const ChState &x, const unsigned int off_v, const ChStateDelta &v, const double T) override
 From global state vectors y={x,v} to item's state (and update) fetching the states at the specified offsets. More...
 
virtual void IntStateGatherAcceleration (const unsigned int off_a, ChStateDelta &a) override
 From item's state acceleration to global acceleration vector.
 
virtual void IntStateScatterAcceleration (const unsigned int off_a, const ChStateDelta &a) override
 From state derivative (acceleration) to system, sometimes might be needed.
 
virtual void IntStateGatherReactions (const unsigned int off_L, ChVectorDynamic<> &L) override
 From system to reaction forces (last computed) - some timestepper might need this.
 
virtual void IntStateScatterReactions (const unsigned int off_L, const ChVectorDynamic<> &L) override
 From reaction forces to system, ex. store last computed reactions in ChLink objects for plotting etc.
 
virtual void IntStateIncrement (const unsigned int off_x, ChState &x_new, const ChState &x, const unsigned int off_v, const ChStateDelta &Dv) override
 Computes x_new = x + Dt , using vectors at specified offsets. More...
 
virtual void IntLoadResidual_F (const unsigned int off, ChVectorDynamic<> &R, const double c) override
 Takes the F force term, scale and adds to R at given offset: R += c*F.
 
virtual void IntLoadResidual_Mv (const unsigned int off, ChVectorDynamic<> &R, const ChVectorDynamic<> &w, const double c) override
 Takes the M*v term, multiplying mass by a vector, scale and adds to R at given offset: R += c*M*w.
 
virtual void IntLoadResidual_CqL (const unsigned int off_L, ChVectorDynamic<> &R, const ChVectorDynamic<> &L, const double c) override
 Takes the term Cq'*L, scale and adds to R at given offset: R += c*Cq'*L.
 
virtual void IntLoadConstraint_C (const unsigned int off, ChVectorDynamic<> &Qc, const double c, bool do_clamp, double recovery_clamp) override
 Takes the term C, scale and adds to Qc at given offset: Qc += c*C.
 
virtual void IntLoadConstraint_Ct (const unsigned int off, ChVectorDynamic<> &Qc, const double c) override
 Takes the term Ct, scale and adds to Qc at given offset: Qc += c*Ct.
 
virtual void IntToDescriptor (const unsigned int off_v, const ChStateDelta &v, const ChVectorDynamic<> &R, const unsigned int off_L, const ChVectorDynamic<> &L, const ChVectorDynamic<> &Qc) override
 Prepare variables and constraints for a solution: From a vector R into the F 'force' term of the variables From a vector Qc into the Qb 'constraint' term of the constraints From a vector v into the q 'unknowns' term of the variables (for warm starting) From a vector L into the L 'lagrangian ' term of the constraints (for warm starting)
 
virtual void IntFromDescriptor (const unsigned int off_v, ChStateDelta &v, const unsigned int off_L, ChVectorDynamic<> &L) override
 After a solver solution, fetch values from variables and constraints: To a vector v from the q 'unknowns' term of the variables To a vector L from the L 'lagrangian ' term of the constraints.
 
virtual void InjectVariables (ChSystemDescriptor &mdescriptor) override
 Tell to a system descriptor that there are variables of type ChVariables in this object (for further passing it to a solver) Basically does nothing, but maybe that inherited classes may specialize this. More...
 
virtual void InjectConstraints (ChSystemDescriptor &mdescriptor) override
 Tell to a system descriptor that there are contraints of type ChConstraint in this object (for further passing it to a solver) Basically does nothing, but maybe that inherited classes may specialize this. More...
 
virtual void ConstraintsLoadJacobians () override
 Adds the current jacobians in encapsulated ChConstraints.
 
virtual void InjectKRMmatrices (ChSystemDescriptor &mdescriptor) override
 Tell to a system descriptor that there are items of type ChKblock in this object (for further passing it to a solver) Basically does nothing, but maybe that inherited classes may specialize this. More...
 
virtual void KRMmatricesLoad (double Kfactor, double Rfactor, double Mfactor) override
 Adds the current stiffness K and damping R and mass M matrices in encapsulated ChKblock item(s), if any. More...
 
virtual void VariablesFbReset () override
 Sets the 'fb' part (the known term) of the encapsulated ChVariables to zero.
 
virtual void VariablesFbLoadForces (double factor=1) override
 Adds the current forces (applied to item) into the encapsulated ChVariables, in the 'fb' part: qf+=forces*factor.
 
virtual void VariablesQbLoadSpeed () override
 Initialize the 'qb' part of the ChVariables with the current value of speeds. More...
 
virtual void VariablesFbIncrementMq () override
 Adds M*q (masses multiplied current 'qb') to Fb, ex. More...
 
virtual void VariablesQbSetSpeed (double step=0) override
 Fetches the item speed (ex. More...
 
virtual void VariablesQbIncrementPosition (double step) override
 Increment item positions by the 'qb' part of the ChVariables, multiplied by a 'step' factor. More...
 
virtual void ConstraintsBiReset () override
 Sets to zero the known term (b_i) of encapsulated ChConstraints.
 
virtual void ConstraintsBiLoad_C (double factor=1, double recovery_clamp=0.1, bool do_clamp=false) override
 Adds the current C (constraint violation) to the known term (b_i) of encapsulated ChConstraints.
 
virtual void ConstraintsBiLoad_Ct (double factor=1) override
 Adds the current Ct (partial t-derivative, as in C_dt=0-> [Cq]*q_dt=-Ct) to the known term (b_i) of encapsulated ChConstraints.
 
virtual void ConstraintsBiLoad_Qc (double factor=1) override
 Adds the current Qc (the vector of C_dtdt=0 -> [Cq]*q_dtdt=Qc ) to the known term (b_i) of encapsulated ChConstraints.
 
virtual void ConstraintsFbLoadForces (double factor=1) override
 Adds the current link-forces, if any, (caused by springs, etc.) to the 'fb' vectors of the ChVariables referenced by encapsulated ChConstraints.
 
virtual void ConstraintsFetch_react (double factor=1) override
 Fetches the reactions from the lagrangian multiplier (l_i) of encapsulated ChConstraints. More...
 
virtual int GetNcoords_x () override
 Tells the number of position coordinates x in y = {x, v}.
 
virtual int GetNcoords_v () override
 Tells the number of speed coordinates of v in y = {x, v} and dy/dt={v, a}.
 
virtual int GetNconstr () override
 Tells the number of lagrangian multipliers (constraints)
 
virtual void StateGather (ChState &x, ChStateDelta &v, double &T) override
 From system to state y={x,v}.
 
virtual void StateScatter (const ChState &x, const ChStateDelta &v, const double T) override
 From state Y={x,v} to system.
 
virtual void StateGatherAcceleration (ChStateDelta &a) override
 From system to state derivative (acceleration), some timesteppers might need last computed accel.
 
virtual void StateScatterAcceleration (const ChStateDelta &a) override
 From state derivative (acceleration) to system, sometimes might be needed.
 
virtual void StateGatherReactions (ChVectorDynamic<> &L) override
 From system to reaction forces (last computed) - some timestepper might need this.
 
virtual void StateScatterReactions (const ChVectorDynamic<> &L) override
 From reaction forces to system, ex. store last computed reactions in ChLink objects for plotting etc.
 
virtual void StateIncrementX (ChState &x_new, const ChState &x, const ChStateDelta &Dx) override
 Perform x_new = x + dx for x in Y = {x, dx/dt} It takes care of the fact that x has quaternions, dx has angular vel etc. More...
 
virtual bool StateSolveCorrection (ChStateDelta &Dv, ChVectorDynamic<> &L, const ChVectorDynamic<> &R, const ChVectorDynamic<> &Qc, const double c_a, const double c_v, const double c_x, const ChState &x, const ChStateDelta &v, const double T, bool force_state_scatter=true, bool force_setup=true) override
 Assuming a DAE of the form M*a = F(x,v,t) + Cq'*L C(x,t) = 0 this function computes the solution of the change Du (in a or v or x) for a Newton iteration within an implicit integration scheme. More...
 
virtual void LoadResidual_F (ChVectorDynamic<> &R, const double c) override
 Increment a vector R with the term c*F: R += c*F. More...
 
virtual void LoadResidual_Mv (ChVectorDynamic<> &R, const ChVectorDynamic<> &w, const double c) override
 Increment a vector R with a term that has M multiplied a given vector w: R += c*M*w. More...
 
virtual void LoadResidual_CqL (ChVectorDynamic<> &R, const ChVectorDynamic<> &L, const double c) override
 Increment a vectorR with the term Cq'*L: R += c*Cq'*L. More...
 
virtual void LoadConstraint_C (ChVectorDynamic<> &Qc, const double c, const bool do_clamp=false, const double mclam=1e30) override
 Increment a vector Qc with the term C: Qc += c*C. More...
 
virtual void LoadConstraint_Ct (ChVectorDynamic<> &Qc, const double c) override
 Increment a vector Qc with the term Ct = partial derivative dC/dt: Qc += c*Ct. More...
 
int RecordAllProbes ()
 If ChProbe() objects are added to this system, using this command you force the ChProbe::Record() on all them, at once. More...
 
int ResetAllProbes ()
 If ChProbe() objects are added to this system, using this command you force the ChProbe::Reset() on all them, at once. More...
 
virtual void CustomEndOfStep ()
 Executes custom processing at the end of step. More...
 
bool ExecuteControlsForUpdate ()
 If ChControl() objects are added to this system, using the following commands you call the execution of their scripts. More...
 
bool ExecuteControlsForStep ()
 
void SynchronizeLastCollPositions ()
 All bodies with collision detection data are requested to store the current position as "last position collision-checked".
 
double ComputeCollisions ()
 Perform the collision detection. More...
 
void RegisterCustomCollisionCallback (CustomCollisionCallback *mcallb)
 Specify a callback object to be invoked at each collision detection step. More...
 
void SetCollisionSystem (std::shared_ptr< collision::ChCollisionSystem > newcollsystem)
 For higher performance (ex. More...
 
std::shared_ptr
< collision::ChCollisionSystem
GetCollisionSystem () const
 Access the collision system, the engine which computes the contact points (usually you don't need to access it, since it is automatically handled by the client ChSystem object). More...
 
void SetUseSleeping (bool ms)
 Turn on this feature to let the system put to sleep the bodies whose motion has almost come to a rest. More...
 
bool GetUseSleeping () const
 Tell if the system will put to sleep the bodies whose motion has almost come to a rest.
 
int DoStepDynamics (double m_step)
 Advances the dynamical simulation for a single step, of length m_step. More...
 
bool DoFrameDynamics (double m_endtime)
 Performs integration until the m_endtime is exactly reached, but current time step may be automatically "retouched" to meet exactly the m_endtime after n steps. More...
 
bool DoEntireDynamics ()
 Given the current state, the sw simulates the dynamical behaviour of the system, until the end time is reached, repeating many steps (maybe the step size will be automatically changed if the integrator method supports step size adaption). More...
 
bool DoEntireUniformDynamics (double frame_step)
 Like "DoEntireDynamics", but results are provided at uniform steps "frame_step", using the DoFrameDynamics() many times. More...
 
size_t GetStepcount () const
 Return the total number of time steps taken so far.
 
void ResetStepcount ()
 Reset to 0 the total number of time steps.
 
int GetSolverCallsCount () const
 Return the number of calls to the solver's Solve() function. More...
 
int GetSolverSetupCount () const
 Return the number of calls to the solver's Setup() function. More...
 
void SetDumpSolverMatrices (bool md)
 Set this to "true" to enable automatic saving of solver matrices at each time step, for debugging purposes. More...
 
bool GetDumpSolverMatrices () const
 
void DumpSystemMatrices (bool save_M, bool save_K, bool save_R, bool save_Cq, const char *path)
 Dump the current M mass matrix, K damping matrix, R damping matrix, Cq constraint jacobian matrix (at the current configuration). More...
 
void GetMassMatrix (ChSparseMatrix *M)
 Compute the system-level mass matrix. More...
 
void GetStiffnessMatrix (ChSparseMatrix *K)
 Compute the system-level stiffness matrix, i.e. More...
 
void GetDampingMatrix (ChSparseMatrix *R)
 Compute the system-level damping matrix, i.e. More...
 
void GetConstraintJacobianMatrix (ChSparseMatrix *Cq)
 Compute the system-level constraint jacobian matrix, i.e. More...
 
bool DoStepKinematics (double m_step)
 Advances the kinematic simulation for a single step, of length m_step. More...
 
bool DoFrameKinematics (double m_endtime)
 Performs kinematics until the m_endtime is exactly reached, but current time step may be automatically "retouched" to meet exactly the m_endtime after n steps. More...
 
bool DoEntireKinematics ()
 Given the current state, this kinematic simulation satisfies all the costraints with the "DoStepKinematics" procedure for each time step, from the current time to the end time. More...
 
bool DoAssembly (int action)
 Given the current time and state, attempt to satisfy all constraints, using a Newton-Raphson iteration loop. More...
 
bool DoFullAssembly ()
 Shortcut for full position/velocity/acceleration assembly.
 
bool DoStaticLinear ()
 Solve the position of static equilibrium (and the reactions). More...
 
bool DoStaticNonlinear (int nsteps=10)
 Solve the position of static equilibrium (and the reactions). More...
 
bool DoStaticRelaxing (int nsteps=10)
 Finds the position of static equilibrium (and the reactions) starting from the current position. More...
 
virtual void ArchiveOUT (ChArchiveOut &marchive) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIN (ChArchiveIn &marchive) override
 Method to allow deserialization of transient data from archives.
 
int FileProcessChR (ChStreamInBinary &m_file)
 Process a ".chr" binary file containing the full system object hierarchy as exported -for example- by the R3D modeler, with chrono plugin version, or by using the FileWriteChR() function. More...
 
int FileWriteChR (ChStreamOutBinary &m_file)
 Write a ".chr" binary file containing the full system object hierarchy (bodies, forces, links, etc.) (deprecated function - obsolete)
 
- Public Member Functions inherited from chrono::ChAssembly
 ChAssembly (const ChAssembly &other)
 
virtual ChAssemblyClone () const override
 "Virtual" copy constructor (covariant return type).
 
void Clear ()
 Removes all inserted items: bodies, links, etc.
 
virtual void AddBody (std::shared_ptr< ChBody > newbody)
 Attach a body to this system. Must be an object of exactly ChBody class.
 
virtual void AddLink (std::shared_ptr< ChLink > newlink)
 Attach a link to this system. Must be an object of ChLink or derived classes.
 
virtual void AddOtherPhysicsItem (std::shared_ptr< ChPhysicsItem > newitem)
 Attach a ChPhysicsItem object that is not a body or link.
 
void Add (std::shared_ptr< ChPhysicsItem > newitem)
 Attach whatever type of ChPhysicsItem (ex a ChBody, or a ChParticles, or a ChLink, etc.) to the system. More...
 
void AddBatch (std::shared_ptr< ChPhysicsItem > newitem)
 Items added in this way are added like in the Add() method, but not instantly, they are simply queued in a batch of 'to add' items, that are added automatically at the first Setup() call. More...
 
void FlushBatch ()
 If some items are queued for addition in system, using AddBatch(), this will effectively add them and clean the batch. More...
 
virtual void RemoveBody (std::shared_ptr< ChBody > mbody)
 Remove a body from this system.
 
virtual void RemoveLink (std::shared_ptr< ChLink > mlink)
 Remove a link from this system.
 
virtual void RemoveOtherPhysicsItem (std::shared_ptr< ChPhysicsItem > mitem)
 Remove a ChPhysicsItem object that is not a body or a link.
 
void Remove (std::shared_ptr< ChPhysicsItem > newitem)
 Remove whatever type of ChPhysicsItem that was added to the system. More...
 
void RemoveAllBodies ()
 Remove all bodies from this system.
 
void RemoveAllLinks ()
 Remove all links from this system.
 
void RemoveAllOtherPhysicsItems ()
 Remove all physics items that were not added to body or link lists.
 
IteratorBodies IterBeginBodies ()
 Get a ChBody iterator, initialized at the beginning of body list.
 
IteratorBodies IterEndBodies ()
 
IteratorLinks IterBeginLinks ()
 Get a ChLink iterator, initialized at the beginning of link list.
 
IteratorLinks IterEndLinks ()
 
IteratorOtherPhysicsItems IterBeginOtherPhysicsItems ()
 Get a ChPhysics iterator, initialized at the beginning of additional ChPhysicsItems.
 
IteratorOtherPhysicsItems IterEndOtherPhysicsItems ()
 
IteratorPhysicsItems IterBeginPhysicsItems ()
 Get a ChPhysics iterator.
 
IteratorPhysicsItems IterEndPhysicsItems ()
 
std::vector< std::shared_ptr
< ChBody > > * 
Get_bodylist ()
 Gets the list of children bodies -low level function-. More...
 
std::vector< std::shared_ptr
< ChLink > > * 
Get_linklist ()
 Gets the list of children links -low level function-. More...
 
std::vector< std::shared_ptr
< ChPhysicsItem > > * 
Get_otherphysicslist ()
 Gets the list of children physics items that are not in the body or link lists. More...
 
std::shared_ptr< ChBodySearchBody (const char *m_name)
 Searches a body from its ChObject name.
 
std::shared_ptr< ChLinkSearchLink (const char *m_name)
 Searches a link from its ChObject name.
 
std::shared_ptr< ChPhysicsItemSearchOtherPhysicsItem (const char *m_name)
 Searches from other ChPhysics items (not bodies or links) from name.
 
std::shared_ptr< ChPhysicsItemSearch (const char *m_name)
 Searches whatever item (body, link or other ChPhysics items)
 
std::shared_ptr< ChMarkerSearchMarker (const char *m_name)
 Searches a marker from its ChObject name.
 
std::shared_ptr< ChMarkerSearchMarker (int markID)
 Searches a marker from its unique ID.
 
int GetNbodies () const
 Gets the number of active bodies (so, excluding those that are sleeping or are fixed to ground)
 
int GetNbodiesSleeping () const
 Gets the number of bodies that are in sleeping mode (excluding fixed bodies).
 
int GetNbodiesFixed () const
 Gets the number of bodies that are fixed to ground.
 
int GetNbodiesTotal () const
 Gets the total number of bodies added to the system, including the grounded and sleeping bodies.
 
int GetNlinks () const
 Gets the number of links .
 
int GetNphysicsItems () const
 Gets the number of other physics items (not ChLinks or ChBodies).
 
int GetNcoords () const
 Gets the number of coordinates (considering 7 coords for rigid bodies because of the 4 dof of quaternions)
 
int GetNdof () const
 Gets the number of degrees of freedom of the system.
 
int GetNdoc () const
 Gets the number of scalar constraints added to the system, including constraints on quaternion norms.
 
int GetNsysvars () const
 Gets the number of system variables (coordinates plus the constraint multipliers, in case of quaternions)
 
int GetNcoords_w () const
 Gets the number of coordinates (considering 6 coords for rigid bodies, 3 transl.+3rot.)
 
int GetNdoc_w () const
 Gets the number of scalar constraints added to the system.
 
int GetNdoc_w_C () const
 Gets the number of scalar constraints added to the system (only bilaterals)
 
int GetNdoc_w_D () const
 Gets the number of scalar constraints added to the system (only unilaterals)
 
int GetNsysvars_w () const
 Gets the number of system variables (coordinates plus the constraint multipliers)
 
virtual void SetSystem (ChSystem *m_system) override
 Set the pointer to the parent ChSystem() and also add to new collision system / remove from old coll.system.
 
virtual void SyncCollisionModels () override
 If this physical item contains one or more collision models, sinchronize their coordinates and bounding boxes to the state of the item. More...
 
virtual void Update (double mytime, bool update_assets=true) override
 Updates all the auxiliary data and children of bodies, forces, links, given their current state. More...
 
virtual void SetNoSpeedNoAcceleration () override
 Set zero speed (and zero accelerations) in state, without changing the position.
 
virtual int GetDOF () override
 Get the number of scalar coordinates (ex. dim of position vector)
 
virtual int GetDOF_w () override
 Get the number of scalar coordinates of variables derivatives (ex. dim of speed vector)
 
virtual int GetDOC () override
 Get the number of scalar constraints, if any, in this item.
 
virtual int GetDOC_c () override
 Get the number of scalar constraints, if any, in this item (only bilateral constr.)
 
virtual int GetDOC_d () override
 Get the number of scalar constraints, if any, in this item (only unilateral constr.)
 
void ShowHierarchy (ChStreamOutAscii &m_file, int level=0)
 Writes the hierarchy of contained bodies, markers, etc. More...
 
- Public Member Functions inherited from chrono::ChPhysicsItem
 ChPhysicsItem (const ChPhysicsItem &other)
 
ChSystemGetSystem () const
 Get the pointer to the parent ChSystem()
 
void AddAsset (std::shared_ptr< ChAsset > masset)
 Add an optional asset (it can be used to define visualization shapes, es ChSphereShape, or textures, or custom attached properties that the user can define by creating his class inherited from ChAsset)
 
std::vector< std::shared_ptr
< ChAsset > > & 
GetAssets ()
 Access to the list of optional assets.
 
std::shared_ptr< ChAssetGetAssetN (unsigned int num)
 Access the Nth asset in the list of optional assets.
 
virtual ChFrame GetAssetsFrame (unsigned int nclone=0)
 Get the master coordinate system for assets that have some geometric meaning. More...
 
virtual unsigned int GetAssetsFrameNclones ()
 Optionally, a ChPhysicsItem can return multiple asset coordinate systems; this can be helpful if, for example, when a ChPhysicsItem contains 'clones' with the same assets (ex. More...
 
virtual bool GetCollide () const
 Tell if the object is subject to collision. More...
 
virtual void AddCollisionModelsToSystem ()
 If this physical item contains one or more collision models, add them to the system's collision engine. More...
 
virtual void RemoveCollisionModelsFromSystem ()
 If this physical item contains one or more collision models, remove them from the system's collision engine. More...
 
virtual void GetTotalAABB (ChVector<> &bbmin, ChVector<> &bbmax)
 Get the entire AABB axis-aligned bounding box of the object. More...
 
virtual void GetCenter (ChVector<> &mcenter)
 Get a symbolic 'center' of the object. More...
 
virtual void StreamINstate (ChStreamInBinary &mstream)
 Method to deserialize only the state (position, speed) Must be implemented by child classes. More...
 
virtual void StreamOUTstate (ChStreamOutBinary &mstream)
 Method to serialize only the state (position, speed) Must be implemented by child classes. More...
 
unsigned int GetOffset_x ()
 Get offset in the state vector (position part)
 
unsigned int GetOffset_w ()
 Get offset in the state vector (speed part)
 
unsigned int GetOffset_L ()
 Get offset in the lagrangian multipliers.
 
void SetOffset_x (const unsigned int moff)
 Set offset in the state vector (position part) Note: only the ChSystem::Setup function should use this.
 
void SetOffset_w (const unsigned int moff)
 Set offset in the state vector (speed part) Note: only the ChSystem::Setup function should use this.
 
void SetOffset_L (const unsigned int moff)
 Set offset in the lagrangian multipliers Note: only the ChSystem::Setup function should use this.
 
- Public Member Functions inherited from chrono::ChObj
 ChObj (const ChObj &other)
 
int GetIdentifier () const
 Gets the numerical identifier of the object.
 
void SetIdentifier (int id)
 Sets the numerical identifier of the object.
 
double GetChTime () const
 Gets the simulation time of this object.
 
void SetChTime (double m_time)
 Sets the simulation time of this object.
 
const char * GetName () const
 Gets the name of the object as C Ascii null-terminated string -for reading only!
 
void SetName (const char myname[])
 Sets the name of this object, as ascii string.
 
std::string GetNameString () const
 Gets the name of the object as C Ascii null-terminated string.
 
void SetNameString (const std::string &myname)
 Sets the name of this object, as std::string.
 
void MFlagsSetAllOFF (int &mflag)
 
void MFlagsSetAllON (int &mflag)
 
void MFlagSetON (int &mflag, int mask)
 
void MFlagSetOFF (int &mflag, int mask)
 
int MFlagGet (int &mflag, int mask)
 
- Public Member Functions inherited from chrono::ChIntegrableIIorder
virtual int GetNcoords_a ()
 Return the number of acceleration coordinates of a in dy/dt={v, a} This is a default implementation that works in almost all cases, as dim(a) = dim(v),.
 
virtual void StateSetup (ChState &x, ChStateDelta &v, ChStateDelta &a)
 Set up the system state with separate II order components x, v, a for y = {x, v} and dy/dt={v, a}.
 
virtual bool StateSolveA (ChStateDelta &Dvdt, ChVectorDynamic<> &L, const ChState &x, const ChStateDelta &v, const double T, const double dt, bool force_state_scatter=true)
 Solve for accelerations: a = f(x,v,t) Given current state y={x,v} , computes acceleration a in the state derivative dy/dt={v,a} and lagrangian multipliers L (if any). More...
 
virtual int GetNcoords_y () override
 Return the number of coordinates in the state Y. More...
 
virtual int GetNcoords_dy () override
 Return the number of coordinates in the state increment. More...
 
virtual void StateGather (ChState &y, double &T) override
 Gather system state in specified array. More...
 
virtual void StateScatter (const ChState &y, const double T) override
 Scatter the states from the provided array to the system. More...
 
virtual void StateGatherDerivative (ChStateDelta &Dydt) override
 Gather from the system the state derivatives in specified array. More...
 
virtual void StateScatterDerivative (const ChStateDelta &Dydt) override
 Scatter the state derivatives from the provided array to the system. More...
 
virtual void StateIncrement (ChState &y_new, const ChState &y, const ChStateDelta &Dy) override
 Increment state array: y_new = y + Dy. More...
 
virtual bool StateSolve (ChStateDelta &dydt, ChVectorDynamic<> &L, const ChState &y, const double T, const double dt, bool force_state_scatter=true) override
 Solve for state derivatives: dy/dt = f(y,t). More...
 
virtual bool StateSolveCorrection (ChStateDelta &Dy, ChVectorDynamic<> &L, const ChVectorDynamic<> &R, const ChVectorDynamic<> &Qc, const double a, const double b, const ChState &y, const double T, const double dt, bool force_state_scatter=true, bool force_setup=true) override
 This was for Ist order implicit integrators, but here we disable it.
 
- Public Member Functions inherited from chrono::ChIntegrable
virtual void StateSetup (ChState &y, ChStateDelta &dy)
 Set up the system state.
 
virtual void LoadResidual_Hv (ChVectorDynamic<> &R, const ChVectorDynamic<> &v, const double c)
 Increment a vector R (usually the residual in a Newton Raphson iteration for solving an implicit integration step) with a term that has H multiplied a given vector w: R += c*H*w. More...
 

Protected Attributes

ChSharedPtr< ChBodyAuxRefm_ground
 handle to the fixed ground body
 
ChSharedPtr< ChSuspension > m_suspension
 list of handles to suspension subsystems, only 1 in this case.
 
ChSharedPtr< ChBodym_post_L
 left shaker post
 
ChSharedPtr< ChBodym_post_R
 right shaker post
 
ChSharedPtr< ChLinkLockPrismaticm_post_L_prismatic
 left post prismatic joint
 
ChSharedPtr< ChLinkLinActuatorm_post_L_linact
 actuate left post
 
ChSharedPtr< ChLinkLockPointPlanem_post_L_ptPlane
 actuate L suspension to a specified height
 
ChSharedPtr< ChLinkLockPrismaticm_post_R_prismatic
 right post prismatic joint
 
ChSharedPtr< ChLinkLinActuatorm_post_R_linact
 actuate right post
 
ChSharedPtr< ChLinkLockPointPlanem_post_R_ptPlane
 actuate R suspension to a specified height
 
bool m_has_steering
 include steering?
 
ChSharedPtr< ChSteering > m_steering
 handle to the steering subsystem.
 
ChWheelList m_wheels
 list of handles to wheel subsystems, 2 in this case.
 
double m_stepsize
 integration step-size for the vehicle system
 
ChSharedPtr< ChFunctionm_actuator_L
 actuator function applied to left wheel
 
ChSharedPtr< ChFunctionm_actuator_R
 actuator function applied to right wheel
 
- Protected Attributes inherited from chrono::ChSystem
std::vector< std::shared_ptr
< ChProbe > > 
probelist
 list of 'probes' (variable-recording objects)
 
std::vector< std::shared_ptr
< ChControls > > 
controlslist
 list of 'controls' script objects
 
std::shared_ptr
< ChContactContainer
contact_container
 the container of contacts
 
ChVector G_acc
 gravitational acceleration
 
double end_time
 end of simulation
 
double step
 time step
 
double step_min
 min time step
 
double step_max
 max time step
 
double tol
 tolerance
 
double tol_force
 tolerance for forces (used to obtain a tolerance for impulses)
 
int maxiter
 max iterations for nonlinear convergence in DoAssembly()
 
bool use_sleeping
 if true, put to sleep objects that come to rest
 
std::shared_ptr
< ChSystemDescriptor
descriptor
 the system descriptor
 
std::shared_ptr< ChSolversolver_speed
 the solver for speed problem
 
std::shared_ptr< ChSolversolver_stab
 the solver for position (stabilization) problem, if any
 
int max_iter_solver_speed
 maximum num iterations for the iterative solver
 
int max_iter_solver_stab
 maximum num iterations for the iterative solver for constraint stabilization
 
int max_steps_simplex
 maximum number of steps for the simplex solver.
 
double min_bounce_speed
 minimum speed for rebounce after impacts. Lower speeds are clamped to 0
 
double max_penetration_recovery_speed
 limit for the speed of penetration recovery (positive, speed of exiting)
 
int parallel_thread_number
 used for multithreaded solver
 
size_t stepcount
 internal counter for steps
 
int setupcount
 number of calls to the solver's Setup()
 
int solvecount
 number of StateSolveCorrection (reset to 0 at each timestep of static analysis)
 
bool dump_matrices
 for debugging
 
int ncontacts
 total number of contacts
 
std::shared_ptr
< collision::ChCollisionSystem
collision_system
 collision engine
 
std::vector
< CustomCollisionCallback * > 
collision_callbacks
 
ChTimer< double > timer_step
 timer for integration step
 
ChTimer< double > timer_solver
 timer for solver (excluding setup phase)
 
ChTimer< double > timer_setup
 timer for solver setup
 
ChTimer< double > timer_collision_broad
 timer for collision broad phase
 
ChTimer< double > timer_collision_narrow
 timer for collision narrow phase
 
ChTimer< double > timer_update
 timer for system update
 
std::shared_ptr< ChTimesteppertimestepper
 time-stepper object
 
bool last_err
 indicates error over the last kinematic/dynamics/statics
 
- Protected Attributes inherited from chrono::ChAssembly
std::vector< std::shared_ptr
< ChBody > > 
bodylist
 list of rigid bodies
 
std::vector< std::shared_ptr
< ChLink > > 
linklist
 list of joints (links)
 
std::vector< std::shared_ptr
< ChPhysicsItem > > 
otherphysicslist
 list of other physic objects that are not bodies or links
 
std::vector< std::shared_ptr
< ChPhysicsItem > > 
batch_to_insert
 list of items to insert when doing Setup() or Flush.
 
int nbodies
 number of bodies (currently active)
 
int nlinks
 number of links
 
int nphysicsitems
 number of other physics items
 
int ncoords
 number of scalar coordinates (including 4th dimension of quaternions) for all active bodies
 
int ndoc
 number of scalar costraints (including constr. on quaternions)
 
int nsysvars
 number of variables (coords+lagrangian mult.), i.e. = ncoords+ndoc for all active bodies
 
int ncoords_w
 number of scalar coordinates when using 3 rot. dof. per body; for all active bodies
 
int ndoc_w
 number of scalar costraints when using 3 rot. dof. per body; for all active bodies
 
int nsysvars_w
 number of variables when using 3 rot. dof. per body; i.e. = ncoords_w+ndoc_w
 
int ndof
 number of degrees of freedom, = ncoords-ndoc = ncoords_w-ndoc_w ,
 
int ndoc_w_C
 number of scalar costraints C, when using 3 rot. dof. per body (excluding unilaterals)
 
int ndoc_w_D
 number of scalar costraints D, when using 3 rot. dof. per body (only unilaterals)
 
int nbodies_sleep
 number of bodies that are sleeping
 
int nbodies_fixed
 number of bodies that are fixed
 
- Protected Attributes inherited from chrono::ChPhysicsItem
ChSystemsystem
 parent system
 
std::vector< std::shared_ptr
< ChAsset > > 
assets
 set of assets
 
unsigned int offset_x
 offset in vector of state (position part)
 
unsigned int offset_w
 offset in vector of state (speed part)
 
unsigned int offset_L
 offset in vector of lagrangian multipliers
 
- Protected Attributes inherited from chrono::ChObj
double ChTime
 the time of simulation for the object
 

Additional Inherited Members

- Protected Member Functions inherited from chrono::ChSystem
virtual void DescriptorPrepareInject (ChSystemDescriptor &mdescriptor)
 Pushes all ChConstraints and ChVariables contained in links, bodies, etc. More...
 

Member Function Documentation

const ChQuaternion& chrono::ChSuspensionTest::GetChassisRot ( ) const

Get the orientation of the chassis reference frame.

The chassis orientation is returned as a quaternion representing a rotation with respect to the global reference frame.

const ChQuaternion& chrono::ChSuspensionTest::GetChassisRotCOM ( ) const

Get the orientation of the chassis centroidal frame.

The chassis orientation is returned as a quaternion representing a rotation with respect to the global reference frame.

virtual ChCoordsys chrono::ChSuspensionTest::GetLocalDriverCoordsys ( ) const
pure virtual

Get the local driver position and orientation.

This is a coordinate system relative to the chassis reference frame.

double chrono::ChSuspensionTest::GetStepsize ( ) const

Get the current value of the integration step size for the vehicle subsystem.

ChWheelState chrono::ChSuspensionTest::GetWheelState ( const ChWheelID &  wheel_id) const

Get the complete state for the specified wheel.

In this case, no wheel spin (omega) is given, since the wheels are locked.

virtual void chrono::ChSuspensionTest::Initialize ( const ChCoordsys<> &  chassisPos)
virtual

Initialize this chassis at the specified global location and orientation.

Parameters
[in]chassisPosinitial global position and orientation
virtual void chrono::ChSuspensionTest::Update ( double  time,
double  steering,
double  disp_L,
double  disp_R,
const ChTireForces &  tire_forces 
)
virtual

Update the state at the current time.

steering between -1 and +1, and no force need be applied if using external actuation

Parameters
[in]timecurrent time
[in]steeringcurrent steering input [-1,+1]
[in]disp_Lleft post displacement
[in]disp_Rright post displacement
[in]tire_forcestires force to apply to wheel
virtual void chrono::ChSuspensionTest::Update ( double  time,
double  disp_L,
double  disp_R,
const ChTireForces &  tire_forces 
)
virtual
Parameters
[in]timecurrent time
[in]disp_Lleft post displacement
[in]disp_Rright post displacement
[in]tire_forcestires force to apply to wheel