MULTIBODY SIMULATION SOFTWARE - API documentation

chrono::ChSystem Class Reference

#include <CHsystem.h>

Inheritance diagram for chrono::ChSystem:

Inheritance graph
[legend]
Collaboration diagram for chrono::ChSystem:

Collaboration graph
[legend]

List of all members.

Public Types

enum  eCh_integrationType { INT_ANITESCU = 0, INT_TASORA = 6 }
enum  eCh_lcpSolver {
  LCP_ITERATIVE_SOR = 0, LCP_ITERATIVE_SYMMSOR, LCP_SIMPLEX, LCP_ITERATIVE_JACOBI,
  LCP_ITERATIVE_SOR_MULTITHREAD, LCP_ITERATIVE_GPU
}
enum  eCh_frictionProjection { FRI_CONEORTHO = 0, FRI_CONEAPPROXIMATE = 1 }

Public Member Functions

 ChSystem (unsigned int max_objects=16000, double scene_size=500)
 ~ChSystem ()
void Copy (ChSystem *source)
void SetStep (double m_step)
double GetStep ()
void SetEndTime (double m_end_time)
double GetEndTime ()
void SetStepMin (double m_step_min)
double GetStepMin ()
void SetStepMax (double m_step_max)
double GetStepMax ()
void SetIntegrationType (eCh_integrationType m_integration_type)
eCh_integrationType GetIntegrationType ()
void SetOrder (int m_order)
int GetOrder ()
void SetMultisteps (int m_multisteps)
int GetMultisteps ()
void SetMaxiter (int m_maxiter)
int GetMaxiter ()
void SetTol (double m_tol)
double GetTol ()
void SetTolSpeeds (double m_tol)
double GetTolSpeeds ()
void SetNormType (int m_normtype)
int GetNormType ()
void SetAdaption (int m_adapt)
int GetAdaption ()
void SetBaumgarteStabilize (int m_stab)
int GetBaumgarteStabilize ()
double GetBaumgarte ()
void SetDynaclose (int m_close)
int GetDynaclose ()
void SetNsClosePos (int mn)
int GetNsClosePos ()
void SetNsCloseSpeed (int mn)
int GetNsCloseSpeed ()
void SetDynatol (double m_tol)
double GetDynatol ()
void SetMonolattol (double m_tol)
double GetMonolattol ()
void SetIntegrtol (double m_tol)
double GetIntegrtol ()
void SetPredict (int m_pr)
int GetPredict ()
void SetPredorder (int m_pr)
int GetPredorder ()
void SetStifftol (double m_tol)
double GetStifftol ()
void SetXYmode (int m_mode)
int GetXYmode ()
void SetAutoAssembly (int aas)
int GetAutoAssembly ()
void SetMaxStepsCollide (int mval)
int GetMaxStepsCollide ()
void SetMinBounceSpeed (double mval)
double GetMinBounceSpeed ()
void SetMaxPenetrationRecoverySpeed (double mval)
double GetMaxPenetrationRecoverySpeed ()
double GetErrIntegration ()
double GetErrConstraints ()
void SetLcpSolverType (eCh_lcpSolver mval)
eCh_lcpSolver GetLcpSolverType ()
void SetIterLCPmaxItersSpeed (int mval)
int GetIterLCPmaxItersSpeed ()
int GetIterLCPmaxItersStab ()
void SetIterLCPmaxItersStab (int mval)
void SetSimplexLCPmaxSteps (int mval)
int GetSimplexLCPmaxSteps ()
void SetIterLCPwarmStarting (bool usewarm=true)
bool GetIterLCPwarmStarting ()
void SetIterLCPomega (double momega=1.0)
double GetIterLCPomega ()
ChLcpSolverGetLcpSolverSpeed ()
ChLcpSolverGetLcpSolverStab ()
void SetParallelThreadNumber (int mthreads=2)
int GetParallelThreadNumber ()
void SetFrictionProjection (eCh_frictionProjection mval)
eCh_frictionProjection GetFrictionProjection ()
bool GetUseGPU ()
void Set_G_acc (ChVector<> m_acc=ChVector<>(0.0,-9.8, 0.0))
ChVector Get_G_acc ()
void AddBody (ChSharedPtr< ChBody > newbody)
void AddLink (ChSharedPtr< ChLink > newlink)
void AddLink (ChLink *newlink)
void AddOtherPhysicsItem (ChSharedPtr< ChPhysicsItem > newitem)
void AddProbe (ChSharedPtr< ChProbe > &newprobe)
void AddControls (ChSharedPtr< ChControls > &newcontrols)
void Add (ChSharedPtr< ChPhysicsItem > newitem)
void RemoveBody (ChSharedPtr< ChBody > mbody)
void RemoveLink (ChSharedPtr< ChLink > mlink)
std::list< ChLink * >
::iterator 
RemoveLinkIter (std::list< ChLink * >::iterator &mlinkiter)
void RemoveOtherPhysicsItem (ChSharedPtr< ChPhysicsItem > mitem)
void Remove (ChSharedPtr< ChPhysicsItem > newitem)
void RemoveAllBodies ()
void RemoveAllLinks ()
void RemoveAllOtherPhysicsItems ()
void RemoveAllProbes ()
void RemoveAllControls ()
IteratorLinks IterBeginLinks ()
IteratorLinks IterEndLinks ()
std::vector< ChBody * > * Get_bodylist ()
std::list< ChLink * > * Get_linklist ()
std::list
< ChPhysicsItem * > * 
Get_otherphysicslist ()
ChContactContainerBaseGetContactContainer ()
ChBodySearchBody (char *m_name)
ChLinkSearchLink (char *m_name)
ChMarkerSearchMarker (char *m_name)
ChMarkerSearchMarker (int markID)
void Clear ()
void Reference_LM_byID ()
int GetNbodies ()
int GetNbodiesSleeping ()
int GetNbodiesFixed ()
int GetNbodiesTotal ()
int GetNlinks ()
int GetNcoords ()
int GetNdof ()
int GetNdoc ()
int GetNsysvars ()
int GetNredundancy ()
int GetNcoords_w ()
int GetNdoc_w ()
int GetNdoc_w_C ()
int GetNdoc_w_D ()
int GetNsysvars_w ()
int GetNcontacts ()
double GetTimerStep ()
double GetTimerLcp ()
double GetTimerCollisionBroad ()
double GetTimerCollisionNarrow ()
double GetTimerUpdate ()
void ResetTimers ()
char * GetErrMessage ()
int GetLastErr ()
void ResetErrors ()
ChEventsGet_events ()
int Setup ()
void Update ()
void UpdateExternalGeometry ()
int RecordAllProbes ()
int ResetAllProbes ()
int ExecuteControlsJsForStart ()
int ExecuteControlsJsForUpdate ()
int ExecuteControlsJsForStep ()
int ExecuteControlsJsFor3DStep ()
char * GetJsForStartFile ()
char * GetJsForUpdateFile ()
char * GetJsForStepFile ()
char * GetJsFor3DStepFile ()
int SetJsForStartFile (char *mfile)
int SetJsForUpdateFile (char *mfile)
int SetJsForStepFile (char *mfile)
int SetJsFor3DStepFile (char *mfile)
int ExecuteJsForStart ()
int ExecuteJsForUpdate ()
int ExecuteJsForStep ()
int ExecuteJsFor3DStep ()
int OffRedundantCostraints (int *pivarray, int numredund)
int OnRedundantCostraints ()
void SynchronizeLastCollPositions ()
void SynchronizeLastCollSpeeds ()
double ComputeCollisions ()
void SetCustomComputeCollisionCallback (ChCustomComputeCollisionCallback *mcallb)
void SetCustomCollisionPointCallback (ChCustomCollisionPointCallback *mcallb)
void CollisionLinkListRemove ()
ChCollisionSystemGetCollisionSystem ()
void SetUseSleeping (bool ms)
bool GetUseSleeping ()
int DoStepDynamics (double m_step)
int DoFrameDynamics (double m_endtime)
int DoEntireDynamics ()
int DoEntireUniformDynamics (double frame_step)
int DoStepKinematics (double m_step)
int DoFrameKinematics (double m_endtime)
int DoEntireKinematics ()
int DoAssembly (int action, int mflags=0)
int DoFullAssembly ()
int DoStaticRelaxing ()
int DoRemoveRedundancy ()
void StreamIN (ChStreamInBinary &mstream)
void StreamOUT (ChStreamOutBinary &mstream)
void StreamOUT (ChStreamOutAscii &mstream)
int StreamOUTall (ChStreamOutBinary &m_file)
int StreamINall (ChStreamInBinary &m_file)
void ShowHierarchy (ChStreamOutAscii &m_file)
int FileProcessCHR (ChStreamInBinary &m_file)
int FileWriteCHR (ChStreamOutBinary &m_file)
int FileProcessJS (char *m_file)

Public Attributes

ChCustomCollisionPointCallbackcollisionpoint_callback

Protected Member Functions

void LCPprepare_reset ()
void LCPprepare_load (bool load_jacobians, bool load_v, double F_factor, double Ct_factor, double C_factor, double recovery_clamp, bool do_clamp)
void LCPprepare_inject (ChLcpSystemDescriptor &mdescriptor)
void LCPprepare_Li_from_speed_cache ()
void LCPprepare_Li_from_position_cache ()
void LCPresult_Li_into_speed_cache ()
void LCPresult_Li_into_position_cache ()
void LCPresult_Li_into_reactions (double mfactor)

Classes

class  ChCustomCollisionPointCallback
 Class to be inherited by user and to use in SetCustomCollisionPointCallback(). More...
class  ChCustomComputeCollisionCallback
 Class to be inherited by user and to use in SetCustomComputeCollisionCallback(). More...


Detailed Description

This class is used to represent a multibody physical system, so it acts also as a database for most items involved in simulations, most noticeably objects of ChBody and ChLink classes, which are used to represent mechanisms.

Moreover, it also owns some global settings and features, like the gravity acceleration, the global time and so on.

This object will be responsible of performing the entire physical simulation (dynamics, kinematics, statics, etc.), so you need at least one ChSystem object in your program, in order to perform simulations (you'll insert rigid bodies and links into it..)


Member Enumeration Documentation

enum chrono::ChSystem::eCh_integrationType

Available methods for time integration (time steppers). Only fixed-step Anitescu and Tasora types are currently supported.

enum chrono::ChSystem::eCh_lcpSolver

Available types of solvers for the LCP problem. Note: compared to iterative methods, the simplex solver is so slow that it's mostly for experiments. Also, Jacobi is slower than SOR - hence it's here for benchmarks & tests.

enum chrono::ChSystem::eCh_frictionProjection

Available types of friction cone projection for the LCP solution (only in case of iterative LCP solvers).


Constructor & Destructor Documentation

chrono::ChSystem::ChSystem ( unsigned int  max_objects = 16000,
double  scene_size = 500 
)

Create a physical system. Note, in case you will use collision detection, the values of 'max_objects' and 'scene_size' can be used to initialize the broadphase collision algorithm in an optimal way. Scene size should be approximately the radius of the expected area where colliding objects will move.

***TOBY*** change this line if you want to plug-in your custom GPU contact container

***TOBY*** change this line if you want to plug-in your custom GPU collision engine

chrono::ChSystem::~ChSystem (  ) 

Destructor.


Member Function Documentation

void chrono::ChSystem::Copy ( ChSystem source  ) 

Copy from another ChSystem. Note! All settings are copied, but the hierarchy of children bodies, links, probes etc. are NOT copied.

void chrono::ChSystem::SetStep ( double  m_step  ) 

Sets the time step used for integration (dynamical simulation). The lower this value, the more precise the simulation. Usually, values about 0.01 s are enough for simple simulations. It may be modified automatically by integration methods, if they support automatic time adaption.

double chrono::ChSystem::GetStep (  ) 

Gets the current time step used for the integration (dynamical simulation).

void chrono::ChSystem::SetEndTime ( double  m_end_time  ) 

Sets the end of simulation.

double chrono::ChSystem::GetEndTime (  ) 

Gets the end of the simulation.

void chrono::ChSystem::SetStepMin ( double  m_step_min  ) 

Sets the lower limit for time step (only needed if using integration methods which support time step adaption).

double chrono::ChSystem::GetStepMin (  ) 

Gets the lower limit for time step.

void chrono::ChSystem::SetStepMax ( double  m_step_max  ) 

Sets the upper limit for time step (only needed if using integration methods which support time step adaption).

double chrono::ChSystem::GetStepMax (  ) 

Gets the upper limit for time step.

void chrono::ChSystem::SetIntegrationType ( eCh_integrationType  m_integration_type  ) 

Sets the method for time integration (time stepper). Some steppers are faster but can run into some troubles when dealing with large interpenetrations in contacts/impacts (es: INT_ANITESCU), while others are more precise but at an expense of a lower performance (es. INT_TASORA).

eCh_integrationType chrono::ChSystem::GetIntegrationType (  ) 

Gets the current method for time integration (time stepper).

void chrono::ChSystem::SetOrder ( int  m_order  ) 

Integration order (ONLY if current integration method supports multi-order integration.).

int chrono::ChSystem::GetOrder (  ) 

Integration order (ONLY if current integration method supports multi-order integration.).

void chrono::ChSystem::SetMultisteps ( int  m_multisteps  ) 

Integration substeps (ONLY if current integration method supports multi-step integration.).

int chrono::ChSystem::GetMultisteps (  ) 

Integration substeps (ONLY if current integration method supports multi-step integration.).

void chrono::ChSystem::SetMaxiter ( int  m_maxiter  ) 

Sets iteration limit for assembly constraints. When trying to keep constraints together, the iterative process is stopped if this max.number of iterations (or tolerance) is reached.

int chrono::ChSystem::GetMaxiter (  ) 

Gets iteration limit for assembly constraints.

void chrono::ChSystem::SetTol ( double  m_tol  ) 

Sets tolerance (in m) for assembly constraints. When trying to keep constraints together, the iterative process is stopped if this tolerance (or max.number of iterations ) is reached

double chrono::ChSystem::GetTol (  ) 

Gets current tolerance for assembly constraints.

void chrono::ChSystem::SetTolSpeeds ( double  m_tol  ) 

Sets tolerance for satisfying speeds in constraints. Speeds in constraints must be made compatible: the iterative process is stopped if this tolerance (or max.number of iterations ) is reached.

double chrono::ChSystem::GetTolSpeeds (  ) 

Gets current tolerance (in m/s) for satisfying constraints at the speed level.

void chrono::ChSystem::SetNormType ( int  m_normtype  ) 

Sets the method used to compute the norm of constraint violation (NORM_INF, NORM_TWO).

void chrono::ChSystem::SetAdaption ( int  m_adapt  ) 

Activate timestep adaption (ONLY if supported by integration method).

void chrono::ChSystem::SetBaumgarteStabilize ( int  m_stab  ) 

Activates the Baumgarte method for constraint stabilization (only for backward compatibility, since it'sconsidered an old and imprecise approach to constraint stabilization)

double chrono::ChSystem::GetBaumgarte (  ) 

Gets a suggested value for the Baumgarte stabilization coefficient.

void chrono::ChSystem::SetDynaclose ( int  m_close  ) 

Activates the stabilization in constraints as a LCP on position level, for acceleration/force integration methods where this is optional. (Not yet used).

void chrono::ChSystem::SetNsClosePos ( int  mn  ) 

Stabilization in constraints as a LCP on position level happens each Ns steps. For acceleration/force integration methods where this is optional. (Not yet used).

void chrono::ChSystem::SetNsCloseSpeed ( int  mn  ) 

Stabilization in constraints as a LCP on speed level happens each Ns steps. For acceleration/force integration methods where this is optional. (Not yet used).

void chrono::ChSystem::SetDynatol ( double  m_tol  ) 

Obsolete.

void chrono::ChSystem::SetMonolattol ( double  m_tol  ) 

Obsolete.

void chrono::ChSystem::SetIntegrtol ( double  m_tol  ) 

Tolerance for integration methods with adaptive time step. For example, some Runge Kutta methods will halve the step if the local integration precision is below the tolerance.

void chrono::ChSystem::SetPredict ( int  m_pr  ) 

Obsolete.

void chrono::ChSystem::SetPredorder ( int  m_pr  ) 

Obsolete.

void chrono::ChSystem::SetStifftol ( double  m_tol  ) 

Obsolete.

void chrono::ChSystem::SetXYmode ( int  m_mode  ) 

Impose the 2D mode. Only for very simple systems. Note that, given the speed and efficiency of current LCP solvers and integrators, there's no need to force the 2D mode - just use the 3D.

void chrono::ChSystem::SetMaxPenetrationRecoverySpeed ( double  mval  ) 

For the Anitescu stepper, you can limit the speed of exiting from penetration situations. Usually set a positive value, about 0.1 .. 2 . (as exiting speed, in m/s)

double chrono::ChSystem::GetMaxPenetrationRecoverySpeed (  ) 

Get the limit on the speed for exiting from penetration situations (for Anitescu stepper).

void chrono::ChSystem::SetLcpSolverType ( eCh_lcpSolver  mval  ) 

Choose the LCP solver type, to be used for the simultaneous solution of the constraints in dynamical simulations (as well as in kinematics, statics, etc.) You can choose between the eCh_lcpSolver types, for example LCP_ITERATIVE_SOR for fast (not 100precise) approach to problems with contacts, or LCP_SIMPLEX (slow,precise), etc.

eCh_lcpSolver chrono::ChSystem::GetLcpSolverType (  ) 

Gets the current LCP solver type.

void chrono::ChSystem::SetIterLCPmaxItersSpeed ( int  mval  ) 

In case you are using an iterative LCP solver (es. LCP_ITERATIVE_SOR) you can set the maximum number of iterations. The higher the iteration number, the more precise the simulation (but more CPU time)

int chrono::ChSystem::GetIterLCPmaxItersSpeed (  ) 

Current maximum number of iterations, if using an iterative LCP solver.

int chrono::ChSystem::GetIterLCPmaxItersStab (  ) 

In case you are using an iterative LCP solver (es. LCP_ITERATIVE_SOR) and an integration method requiring post-stabilization (es. INT_TASORA) you can set the maximum number of stabilization iterations. The higher the iteration number, the more precise the simulation (but more CPU time)

void chrono::ChSystem::SetIterLCPmaxItersStab ( int  mval  ) 

Current maxi. number of iterations, if using an iterative LCP solver for stabilization.

void chrono::ChSystem::SetSimplexLCPmaxSteps ( int  mval  ) 

If you use the LCP_SIMPLEX lcp solver (usually not suggested), here you can set a limit on the number of simplex steps (n. of pivots). Note: premature truncation of the simplex solver may cause big errors!. Set as 0 for no limits on the number of iterations (but it may run forever!)

int chrono::ChSystem::GetSimplexLCPmaxSteps (  ) 

Limit on the number of simplex steps, if using LCP_SIMPLEX as LCP solver.

void chrono::ChSystem::SetIterLCPwarmStarting ( bool  usewarm = true  ) 

If you want to easily turn ON/OFF the warm starting feature of both LCP iterative solvers (the one for speed and the other for pos.stabilization) you can simply use the following instead of accessing them directly with GetLcpSolverSpeed() and GetLcpSolverStab()

bool chrono::ChSystem::GetIterLCPwarmStarting (  ) 

Tell if the warm starting is enabled for the speed solver, (if iterative type).

void chrono::ChSystem::SetIterLCPomega ( double  momega = 1.0  ) 

If you want to easily adjust the omega overrelaxation parameter of both LCP iterative solvers (the one for speed and the other for pos.stabilization) you can simply use the following instead of accessing them directly with GetLcpSolverSpeed() and GetLcpSolverStab(). Note, usually a good omega for Jacobi or GPU solver is 0.2; for other iter.solvers can be up to 1.0

double chrono::ChSystem::GetIterLCPomega (  ) 

Tell the omega overrelaxation factor for the speed solver, (if iterative type).

ChLcpSolver * chrono::ChSystem::GetLcpSolverSpeed (  ) 

Access directly the LCP solver, configured to be used for the main differential inclusion problem (LCP on speed-impulses). Use mostly for diagnostics.

ChLcpSolver * chrono::ChSystem::GetLcpSolverStab (  ) 

Access directly the LCP solver, configured to be used for the stabilization of constraints (solve delta positions). Use mostly for diagnostics.

void chrono::ChSystem::SetParallelThreadNumber ( int  mthreads = 2  ) 

Changes the number of parallel threads (by default=2). Note that this value is meaningless if you do not use parallel solvers like, for example, the LCP_ITERATIVE_SOR_MULTITHREAD complemementarity solver (other solvers will use a single thread anyway). If you have a N-core processor, this should be set at least =N for maximum performance.

int chrono::ChSystem::GetParallelThreadNumber (  ) 

Get the number of parallel threads. Note that this value is meaningless if you are not using a parallel solver (other solvers will use a single thread anyway).

void chrono::ChSystem::SetFrictionProjection ( eCh_frictionProjection  mval  ) 

Set the method used to compute the projection of friction forces (only in case an iterative LCP solver is used). The FRI_CONEORTHO is the correct non-expansive mapping, changing all three contact forces at once, while FRI_CONEAPPROXIMATE is sequential (and approximate)

eCh_frictionProjection chrono::ChSystem::GetFrictionProjection (  ) 

Set the method used to compute the projection of friction forces (only in case an iterative LCP solver is used).

bool chrono::ChSystem::GetUseGPU (  ) 

Returns true if the GPU is used for the LCP problem (ex. because the LCP_ITERATIVE_GPU solver is used)

void chrono::ChSystem::Set_G_acc ( ChVector<>  m_acc = ChVector<>(0.0, -9.8, 0.0)  ) 

Sets the G (gravity) acceleration vector, affecting all the bodies in the system.

ChVector chrono::ChSystem::Get_G_acc (  ) 

Gets the G (gravity) acceleration vector affecting all the bodies in the system.

void chrono::ChSystem::AddBody ( ChSharedPtr< ChBody newbody  ) 

Attach a body to this system.

void chrono::ChSystem::AddLink ( ChSharedPtr< ChLink newlink  ) 

Attach a link to this system.

void chrono::ChSystem::AddOtherPhysicsItem ( ChSharedPtr< ChPhysicsItem newitem  ) 

Attach a ChPhysicsItem object that is not a body or link.

void chrono::ChSystem::AddProbe ( ChSharedPtr< ChProbe > &  newprobe  ) 

Attach a probe to this system.

void chrono::ChSystem::AddControls ( ChSharedPtr< ChControls > &  newcontrols  ) 

Attach a control to this system.

void chrono::ChSystem::Add ( ChSharedPtr< ChPhysicsItem newitem  ) 

Attach whatever type of ChPhysicsItem (ex a ChBody, or a ChParticles, or a ChLink, etc.) to the system. It will take care of adding it to the proper list: of bodies, oof links, or of other generic physic item. (i.e. it calls AddBody(), AddLink() or AddOtherPhysicsItem() ).

void chrono::ChSystem::RemoveBody ( ChSharedPtr< ChBody mbody  ) 

Remove a body from this system.

void chrono::ChSystem::RemoveLink ( ChSharedPtr< ChLink mlink  ) 

Remove a link from this system.

std::list< ChLink * >::iterator chrono::ChSystem::RemoveLinkIter ( std::list< ChLink * >::iterator &  mlinkiter  ) 

Remove a link from this system (faster version, mostly internal use).

void chrono::ChSystem::RemoveOtherPhysicsItem ( ChSharedPtr< ChPhysicsItem mitem  ) 

Remove a ChPhysicsItem object that is not a body or a link.

void chrono::ChSystem::Remove ( ChSharedPtr< ChPhysicsItem newitem  ) 

Attach whatever type of ChPhysicsItem (ex a ChBody, or a ChParticles, or a ChLink, etc.) that was added to the system with Add(). Use this instead of old RemoveBody(), RemoveLink, etc.

void chrono::ChSystem::RemoveAllBodies (  ) 

Remove all bodies from this system.

void chrono::ChSystem::RemoveAllLinks (  ) 

Remove all links from this system.

void chrono::ChSystem::RemoveAllOtherPhysicsItems (  ) 

Remove all physics items that were not added to body or link lists.

void chrono::ChSystem::RemoveAllProbes (  ) 

Remove all probes from this system.

void chrono::ChSystem::RemoveAllControls (  ) 

Remove all controls from this system.

std::vector<ChBody*>* chrono::ChSystem::Get_bodylist (  ) 

Gets the list of children bodies. NOTE! use this list only to enumerate etc., but NOT to remove or add items (use the appropriate Remove.. and Add.. functions instead!)

std::list<ChLink*>* chrono::ChSystem::Get_linklist (  ) 

Gets the list of children links. NOTE! use this list only to enumerate etc., but NOT to remove or add items (use the appropriate Remove.. and Add.. functions instead!)

std::list<ChPhysicsItem*>* chrono::ChSystem::Get_otherphysicslist (  ) 

Gets the list of children physics items that are not in the body or link lists. NOTE! use this list only to enumerate etc., but NOT to remove or add items (use the appropriate Remove.. and Add.. functions instead!)

ChContactContainerBase* chrono::ChSystem::GetContactContainer (  ) 

Get the container of the contacts.

ChBody * chrono::ChSystem::SearchBody ( char *  m_name  ) 

Searches a body from its ChObject name.

ChLink * chrono::ChSystem::SearchLink ( char *  m_name  ) 

Searches a link from its ChObject name.

ChMarker * chrono::ChSystem::SearchMarker ( char *  m_name  ) 

Searches a marker from its ChObject name.

ChMarker * chrono::ChSystem::SearchMarker ( int  markID  ) 

Searches a marker from its unique ID.

void chrono::ChSystem::Clear (  ) 

Removes all bodies/marker/forces/links/contacts, also resets timers and events.

void chrono::ChSystem::Reference_LM_byID (  ) 

Given inserted markers and links, restores the pointers of links to markers given the information about the marker IDs.

int chrono::ChSystem::GetNbodies (  ) 

Gets the number of active bodies (so, excluding those that are sleeping or are fixed to ground).

int chrono::ChSystem::GetNbodiesSleeping (  ) 

Gets the number of bodies that are in sleeping mode (excluding fixed bodies).

int chrono::ChSystem::GetNbodiesFixed (  ) 

Gets the number of bodies that are fixed to ground.

int chrono::ChSystem::GetNbodiesTotal (  ) 

Gets the total number of bodies added to the system, including the grounded and sleeping bodies.

int chrono::ChSystem::GetNlinks (  ) 

Gets the number of links .

int chrono::ChSystem::GetNcoords (  ) 

Gets the number of coordinates (considering 7 coords for rigid bodies because of the 4 dof of quaternions).

int chrono::ChSystem::GetNdof (  ) 

Gets the number of degrees of freedom of the system.

int chrono::ChSystem::GetNdoc (  ) 

Gets the number of scalar constraints added to the system, including constraints on quaternion norms.

int chrono::ChSystem::GetNsysvars (  ) 

Gets the number of system variables (coordinates plus the constraint multipliers, in case of quaternions).

int chrono::ChSystem::GetNredundancy (  ) 

Gets the number of redundant scalar constraints - Note: feature currently disabled.

int chrono::ChSystem::GetNcoords_w (  ) 

Gets the number of coordinates (considering 6 coords for rigid bodies, 3 transl.+3rot.).

int chrono::ChSystem::GetNdoc_w (  ) 

Gets the number of scalar constraints added to the system.

int chrono::ChSystem::GetNdoc_w_C (  ) 

Gets the number of scalar constraints added to the system (only bilaterals).

int chrono::ChSystem::GetNdoc_w_D (  ) 

Gets the number of scalar constraints added to the system (only unilaterals).

int chrono::ChSystem::GetNsysvars_w (  ) 

Gets the number of system variables (coordinates plus the constraint multipliers).

int chrono::ChSystem::GetNcontacts (  ) 

Gets the number of contacts.

double chrono::ChSystem::GetTimerStep (  ) 

Gets the time (in seconds) spent for computing the time step.

double chrono::ChSystem::GetTimerLcp (  ) 

Gets the fraction of time (in seconds) for the solution of the LCPs, within the time step.

double chrono::ChSystem::GetTimerCollisionBroad (  ) 

Gets the fraction of time (in seconds) for finding collisions, within the time step.

double chrono::ChSystem::GetTimerCollisionNarrow (  ) 

Gets the fraction of time (in seconds) for finding collisions, within the time step.

double chrono::ChSystem::GetTimerUpdate (  ) 

Gets the fraction of time (in seconds) for updating auxiliary data, within the time step.

void chrono::ChSystem::ResetTimers (  ) 

Resets the timers.

char* chrono::ChSystem::GetErrMessage (  ) 

Current warning/error (soon this function will be deprecated and obsolete).

int chrono::ChSystem::GetLastErr (  ) 

Current warning/error code (soon this function will be deprecated and obsolete).

ChEvents* chrono::ChSystem::Get_events (  ) 

Gets the cyclic event buffer of this system (it can be used for debugging/profiling etc.)

int chrono::ChSystem::Setup (  ) 

Counts the number of bodies and links.

void chrono::ChSystem::Update (  ) 

Updates all the auxiliary data and children of bodies, forces, links, given their current state.

void chrono::ChSystem::UpdateExternalGeometry (  ) 

Tells to the associated external object of class ChExternalObject() , if any, that all 3D shapes of the system must be updated in order to syncronize to the current system's state.

void chrono::ChSystem::LCPprepare_reset (  )  [protected]

Sets to zero all the known terms bi & fb of the sparse LCP (that is, resets all the bi terms in ChConstraints (for example constraints defined in ChLinks, and resets all the fb vectors of ChVariables contained, for example, in ChBodies)

void chrono::ChSystem::LCPprepare_load ( bool  load_jacobians,
bool  load_v,
double  F_factor,
double  Ct_factor,
double  C_factor,
double  recovery_clamp,
bool  do_clamp 
) [protected]

Fills the all the known terms of the sparse LCP (that is, fills all the bi terms in ChConstraints (for example constraints defined in ChLinks, and fills all the fb vectors of ChVariables contained, for example, in ChBodies). The parameters of this function specify which data must be loaded in the known terms.

Parameters:
load_jacobians  load jacobians into ChConstraints
load_v  load v_old (current speeds) in q (to use LCP solver with option 'add_Mq_to_f')
F_factor  load F (forces) in fb: fb+=F*F_factor
Ct_factor  load Ct into bi: bi+= Ct*Ct_factor
C_factor  load C into bi: bi+= C*C_factor, otherwise..
recovery_clamp  if do_clamp=true, bi+= min(C*C_factor, recovery_clamp);
do_clamp  if true, limit the recovery of constraint drifting

void chrono::ChSystem::LCPprepare_inject ( ChLcpSystemDescriptor mdescriptor  )  [protected]

Pushes back all ChConstraints and ChVariables contained in links,bodies,etc. into the LCP descriptor.

void chrono::ChSystem::LCPprepare_Li_from_speed_cache (  )  [protected]

The following constraints<->system functions are used before and after the solution of a LCP, because iterative LCP solvers may converge faster to the Li lagrangian multiplier solutions if 'guessed' values provided (exploit the fact that CHlink classes implement caches with 'last computed multipliers').

int chrono::ChSystem::RecordAllProbes (  ) 

If ChProbe() objects are added to this system, using this command you force the ChProbe::Record() on all them, at once.

int chrono::ChSystem::ResetAllProbes (  ) 

If ChProbe() objects are added to this system, using this command you force the ChProbe::Reset() on all them, at once.

int chrono::ChSystem::ExecuteControlsJsForStart (  ) 

If ChControl() objects are added to this system, using the following commands you call the execution of their scripts. You seldom call these functions directly, since the ChSystem() methods already call them automatically, at each step, update, etc.

int chrono::ChSystem::OffRedundantCostraints ( int *  pivarray,
int  numredund 
)

Getting the array of pivots and the number of redundant costraints as provided by the Gauss solution routine, it sets the "redundant" flags for the unuseful costraints in links. Returns TRUE. NOTE - function deactivated in latest versions!

REDUNDANCY HANDLING

int chrono::ChSystem::OnRedundantCostraints (  ) 

Restore the costraints which has been temporarily disabled because redundant. Returns number oc modified constr. states (on/off) NOTE - function deactivated in latest versions!

void chrono::ChSystem::SynchronizeLastCollPositions (  ) 

All bodies with collision detection data are requested to store the current position as "last position collision-checked"

double chrono::ChSystem::ComputeCollisions (  ) 

Perform the collision detection. For each contact, a ChLink object is created and inserted into the linklist. Previous contacts, if existing in the linklist, are deleted or replaced by the new ones. This is mostly called automatically by time integration.

void chrono::ChSystem::SetCustomComputeCollisionCallback ( ChCustomComputeCollisionCallback mcallb  ) 

Use this if you want that some specific callback function is executed at each collision detection step (ex. all the times that ComputeCollisions() is automatically called by the integration method). For example some other collision engine could add further contacts using this callback.

void chrono::ChSystem::SetCustomCollisionPointCallback ( ChCustomCollisionPointCallback mcallb  ) 

Use this if you want that some specific callback function is executed soon after each contact point is created. The callback will be called many times, once for each contact. Example: it can be used to modify the friction coefficients for each created contact (otherwise, by default, would be the average of the two frict.coeff.)

void chrono::ChSystem::CollisionLinkListRemove (  ) 

Removes contact constraints, if any, from the linklist of this system. Usually, contact constraints are kept updated by ComputeCollisions(), which automatically take care of renewing the list, and deleting the old contacts, but maybe you want to force deletion of contacts in some special cases, so you can use this. OBSOLETE***

ChCollisionSystem* chrono::ChSystem::GetCollisionSystem (  ) 

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).

void chrono::ChSystem::SetUseSleeping ( bool  ms  ) 

Turn on this feature to let the system put to sleep the bodies whose motion has almost come to a rest. This feature will allow faster simulation of large scenarios for real-time purposes, but it will affect the precision! This functionality can be turned off selectively for specific ChBodies.

bool chrono::ChSystem::GetUseSleeping (  ) 

Tell if the system will put to sleep the bodies whose motion has almost come to a rest.

int chrono::ChSystem::DoStepDynamics ( double  m_step  ) 

Advances the dynamical simulation for a single step, of length m_step. You can call this function many times in order to simulate up to a desired end time. This is the most important function for analysis, you can use it, for example, once per screen refresh in VR and interactive realtime applications, etc.

int chrono::ChSystem::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. Useful when you want to advance the simulation in a simulations (3d modeling software etc.) wihch needs updates of the screen at a fixed rate (ex.30th of second) while the integration must use more steps.

int chrono::ChSystem::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).

int chrono::ChSystem::DoEntireUniformDynamics ( double  frame_step  ) 

Like "DoEntireDynamics", but results are provided at uniform steps "frame_step", using the DoFrameDynamics() many times.

int chrono::ChSystem::DoStepKinematics ( double  m_step  ) 

Advances the kinematic simulation for a single step, of length m_step. You can call this function many times in order to simulate up to a desired end time.

int chrono::ChSystem::DoFrameKinematics ( double  m_endtime  ) 

meet exactly the m_endtime after n steps.

Performs kinematics until the m_endtime is exactly reached, but current time step may be automatically "retouched" to

int chrono::ChSystem::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.

int chrono::ChSystem::DoAssembly ( int  action,
int  mflags = 0 
)

Given the current time and state, the sw tries to satisfy all costraints, with the Newton-Raphson iteration. Used iteratively in inverse kinematics. Different tolerance checking allowable (norm 1/2/inf) mode = [action flags, see above], ASS_POSITION , ASS_SPEED , ASS_ACCEL (also together) flags = [see above] ASF_COLLISION , perform also collision detection Returns 0 if no errors, returns TRUE if error happened (impossible assemblation?)

int chrono::ChSystem::DoFullAssembly (  ) 

Shortcut for full pos/speed/acc assembly, also computes forces.

int chrono::ChSystem::DoStaticRelaxing (  ) 

Finds the position of static equilibrium (and the reactions) starting from the current position. Since a truncated iterative metod is used, you may need to call this method multiple times in case of large nonlienarities before coming to the precise static solution.

int chrono::ChSystem::DoRemoveRedundancy (  ) 

Tries to identify the ill-placed constraints and switch off their active flags Returns tot number of bad constraint equations removed.

void chrono::ChSystem::StreamIN ( ChStreamInBinary mstream  )  [virtual]

Method to allow deserializing a persistent binary archive (ex: a file) into transient data.

Reimplemented from chrono::ChObj.

void chrono::ChSystem::StreamOUT ( ChStreamOutBinary mstream  )  [virtual]

Method to allow serializing transient data into a persistent binary archive (ex: a file).

Reimplemented from chrono::ChObj.

void chrono::ChSystem::StreamOUT ( ChStreamOutAscii mstream  )  [virtual]

Method to allow serialization of transient data in ascii, as a readable item, for example "chrono::GetLog() << myobject;"

Reimplemented from chrono::ChObj.

int chrono::ChSystem::StreamOUTall ( ChStreamOutBinary m_file  ) 

Binary save data, for this object and subobjects (bodies, links, etc.).

int chrono::ChSystem::StreamINall ( ChStreamInBinary m_file  ) 

Binary read data, for this object and subobjects (bodies, links, etc.), also rebuilding hierarchy.

void chrono::ChSystem::ShowHierarchy ( ChStreamOutAscii m_file  ) 

Writes the hierarchy of contained bodies, markers, etc. in ASCII readable form, mostly for debugging purposes.

int chrono::ChSystem::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.

int chrono::ChSystem::FileWriteCHR ( ChStreamOutBinary m_file  ) 

Write a ".chr" binary file containing the full system object hierarchy (bodies, forces, links, etc.) (deprecated function - obsolete)

int chrono::ChSystem::FileProcessJS ( char *  m_file  ) 

Process a ".js" file containing Chrono Javascript program (it may build a system and perform simulations, and write to files) Such javascript file can contain generic javascript commands.


CHRONO::ENGINE
C++ library for multibody simulation, (C) Alessandro Tasora
This API documentation has been generated on 17 Jul 2009 by Doxygen