MULTIBODY SIMULATION SOFTWARE - API documentation
Public Member Functions | Protected Attributes
chrono::ChPhysicsItem Class Reference

#include <CHphysicsItem.h>

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

List of all members.

Public Member Functions

virtual void Copy (ChPhysicsItem *source)
ChSystemGetSystem ()
virtual void SetSystem (ChSystem *m_system)
std::vector< ChSharedPtr
< ChAsset > > & 
GetAssets ()
ChSharedPtr< ChAssetGetAssetN (unsigned int num)
virtual bool GetCollide ()
virtual void SyncCollisionModels ()
virtual void AddCollisionModelsToSystem ()
virtual void RemoveCollisionModelsFromSystem ()
virtual void GetTotalAABB (ChVector<> &bbmin, ChVector<> &bbmax)
virtual void GetCenter (ChVector<> &mcenter)
virtual void StreamINstate (ChStreamInBinary &mstream)
virtual void StreamOUTstate (ChStreamOutBinary &mstream)
virtual void Update (double mytime)
virtual void Update ()
void SetNoSpeedNoAcceleration ()
virtual int GetDOF ()
virtual int GetDOC ()
virtual int GetDOC_c ()
virtual int GetDOC_d ()
virtual void VariablesFbReset ()
virtual void VariablesFbLoadForces (double factor=1.)
virtual void VariablesQbLoadSpeed ()
virtual void VariablesQbSetSpeed (double step=0.)
virtual void VariablesQbIncrementPosition (double step)
virtual void InjectVariables (ChLcpSystemDescriptor &mdescriptor)
virtual void InjectConstraints (ChLcpSystemDescriptor &mdescriptor)
virtual void ConstraintsBiReset ()
virtual void ConstraintsBiLoad_C (double factor=1., double recovery_clamp=0.1, bool do_clamp=false)
virtual void ConstraintsBiLoad_Ct (double factor=1.)
virtual void ConstraintsBiLoad_Qc (double factor=1.)
virtual void ConstraintsFbLoadForces (double factor=1.)
virtual void ConstraintsLoadJacobians ()
virtual void ConstraintsLiLoadSuggestedSpeedSolution ()
virtual void ConstraintsLiLoadSuggestedPositionSolution ()
virtual void ConstraintsLiFetchSuggestedSpeedSolution ()
virtual void ConstraintsLiFetchSuggestedPositionSolution ()
virtual void ConstraintsFetch_react (double factor=1.)
virtual void StreamIN (ChStreamInBinary &mstream)
virtual void StreamOUT (ChStreamOutBinary &mstream)

Protected Attributes

ChSystemsystem
std::vector< ChSharedPtr
< ChAsset > > 
assets

Detailed Description

Base class for items that can contain objects of ChLcpVariables or ChLcpConstraints, such as rigid bodies, mechanical joints, etc.


Member Function Documentation

virtual void chrono::ChPhysicsItem::AddCollisionModelsToSystem ( ) [virtual]

If this physical item contains one or more collision models, add them to the system's collision engine.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChAssembly, chrono::ChParticlesClones, chrono::ChMatterMeshless, and chrono::ChConveyor.

virtual void chrono::ChPhysicsItem::ConstraintsBiLoad_C ( double  factor = 1.,
double  recovery_clamp = 0.1,
bool  do_clamp = false 
) [virtual]
virtual void chrono::ChPhysicsItem::ConstraintsBiLoad_Ct ( double  factor = 1.) [virtual]
virtual void chrono::ChPhysicsItem::ConstraintsBiLoad_Qc ( double  factor = 1.) [virtual]

Adds the current Qc (the vector of C_dtdt=0 -> [Cq]*q_dtdt=Qc ) to the known term (b_i) of encapsulated ChLcpConstraints

Reimplemented in chrono::ChLinkLock, chrono::ChAssembly, chrono::ChLinkMasked, and chrono::ChConveyor.

virtual void chrono::ChPhysicsItem::ConstraintsFbLoadForces ( double  factor = 1.) [virtual]

Adds the current link-forces, if any, (caused by springs, etc.) to the 'fb' vectors of the ChLcpVariables referenced by encapsulated ChLcpConstraints

Reimplemented in chrono::ChAssembly, chrono::ChLinkMarkers, chrono::ChContactContainerDEM, chrono::ChShaftsClutch, chrono::ChShaftsMotor, and chrono::ChContactContainerDEMMPI.

virtual void chrono::ChPhysicsItem::ConstraintsFetch_react ( double  factor = 1.) [virtual]

Fetches the reactions from the lagrangian multiplier (l_i) of encapsulated ChLcpConstraints. Mostly used after the LCP provided the solution in ChLcpConstraints. Also, should convert the reactions obtained from dynamical simulation, from link space to intuitive react_force and react_torque.

Reimplemented in chrono::ChAssembly, chrono::ChLinkMateGeneric, chrono::ChLinkLock, chrono::ChLinkEngine, chrono::ChLinkMasked, chrono::ChLinkDistance, chrono::ChLinkFastContact, chrono::ChContactContainer, chrono::ChContactContainerNodes, chrono::ChShaftsPlanetary, chrono::ChShaftsBody, chrono::ChConveyor, chrono::ChNodeBody, chrono::ChShaftsClutch, chrono::ChShaftsMotor, and chrono::ChShaftsGear.

virtual void chrono::ChPhysicsItem::ConstraintsLiFetchSuggestedSpeedSolution ( ) [virtual]

After the LCP solver has found the l_i lagangian multipliers for the SPEED problem, this function will be called to store the solutions in a cache (to be implemented in ChLink sub classes) so that it can be later retrieved with ConstraintsLiLoadSuggestedSpeedSolution(). If you do not plan to implement a l_i cache, just do not override this function in child classes and do nothing.

Reimplemented in chrono::ChLinkMateGeneric, chrono::ChAssembly, chrono::ChLinkEngine, chrono::ChLinkMasked, chrono::ChLinkDistance, chrono::ChLinkFastContact, chrono::ChContactContainer, chrono::ChContactContainerNodes, chrono::ChShaftsPlanetary, chrono::ChShaftsBody, chrono::ChConveyor, chrono::ChNodeBody, chrono::ChShaftsClutch, chrono::ChShaftsMotor, and chrono::ChShaftsGear.

virtual void chrono::ChPhysicsItem::ConstraintsLiLoadSuggestedSpeedSolution ( ) [virtual]

Fills the solution of the constraint (the lagrangian multiplier l_i) with an initial guess, if any. This can be used for warm-starting the LCP solver before starting the solution of the SPEED problem, if some approximate solution of constraint impulese l_i already exist (ex. cached from a previous LCP execution) When implementing this in sub classes, if no guess is available, set l_i as 0.

Reimplemented in chrono::ChLinkMateGeneric, chrono::ChAssembly, chrono::ChLinkEngine, chrono::ChLinkMasked, chrono::ChLinkDistance, chrono::ChLinkFastContact, chrono::ChContactContainer, chrono::ChContactContainerNodes, chrono::ChShaftsPlanetary, chrono::ChShaftsBody, chrono::ChConveyor, chrono::ChNodeBody, chrono::ChShaftsClutch, chrono::ChShaftsMotor, and chrono::ChShaftsGear.

void chrono::ChPhysicsItem::GetCenter ( ChVector<> &  mcenter) [virtual]

Get a symbolic 'center' of the object. By default this function returns the center of the AABB. It could be overridden by child classes, anyway it must always get a point that must be inside AABB.

virtual bool chrono::ChPhysicsItem::GetCollide ( ) [virtual]

Tell if the object is subject to collision. Only for interface; child classes may override this, using internal flags.

Reimplemented in chrono::ChMatterSPH, chrono::ChBody, chrono::ChMatterMeshless, chrono::ChParticlesClones, chrono::ChConveyor, and chrono::ChAssembly.

void chrono::ChPhysicsItem::GetTotalAABB ( ChVector<> &  bbmin,
ChVector<> &  bbmax 
) [virtual]

Get the entire AABB axis-aligned bounding box of the object. The AABB must enclose the collision models, if any. By default is infinite AABB. Should be overridden by child classes.

Reimplemented in chrono::ChBody, and chrono::ChAssembly.

virtual void chrono::ChPhysicsItem::InjectConstraints ( ChLcpSystemDescriptor mdescriptor) [virtual]

Tell to a system descriptor that there are contraints of type ChLcpConstraint in this object (for further passing it to a LCP solver) Basically does nothing, but maybe that inherited classes may specialize this.

Reimplemented in chrono::ChLinkLock, chrono::ChLinkMateGeneric, chrono::ChAssembly, chrono::ChLinkEngine, chrono::ChLinkMasked, chrono::ChLinkDistance, chrono::ChLinkFastContact, chrono::ChContactContainer, chrono::ChContactContainerNodes, chrono::ChShaftsPlanetary, chrono::ChShaftsBody, chrono::ChConveyor, chrono::ChNodeBody, chrono::ChShaftsClutch, chrono::ChShaftsMotor, and chrono::ChShaftsGear.

virtual void chrono::ChPhysicsItem::InjectVariables ( ChLcpSystemDescriptor mdescriptor) [virtual]

Tell to a system descriptor that there are variables of type ChLcpVariables in this object (for further passing it to a LCP solver) Basically does nothing, but maybe that inherited classes may specialize this.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChParticlesClones, chrono::ChMatterMeshless, chrono::ChLinkEngine, chrono::ChAssembly, chrono::ChShaft, chrono::ChConveyor, chrono::ChBodyDEMMPI, and chrono::ChBodyMPI.

virtual void chrono::ChPhysicsItem::RemoveCollisionModelsFromSystem ( ) [virtual]

If this physical item contains one or more collision models, remove them from the system's collision engine.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChAssembly, chrono::ChParticlesClones, chrono::ChMatterMeshless, and chrono::ChConveyor.

void chrono::ChPhysicsItem::SetNoSpeedNoAcceleration ( )

Set zero speed (and zero accelerations) in state, without changing the position. Child classes should impement this function if GetDOF() > 0. It is used by owner ChSystem for some static analysis.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChAssembly, chrono::ChParticlesClones, chrono::ChMatterMeshless, and chrono::ChShaft.

void chrono::ChPhysicsItem::StreamIN ( ChStreamInBinary mstream) [virtual]
virtual void chrono::ChPhysicsItem::StreamINstate ( ChStreamInBinary mstream) [virtual]

Method to deserialize only the state (position, speed) Must be implemented by child classes.

Reimplemented in chrono::ChAssembly, and chrono::ChBody.

void chrono::ChPhysicsItem::StreamOUT ( ChStreamOutBinary mstream) [virtual]
virtual void chrono::ChPhysicsItem::StreamOUTstate ( ChStreamOutBinary mstream) [virtual]

Method to serialize only the state (position, speed) Must be implemented by child classes.

Reimplemented in chrono::ChAssembly, and chrono::ChBody.

virtual void chrono::ChPhysicsItem::SyncCollisionModels ( ) [virtual]

If this physical item contains one or more collision models, sinchronize their coordinates and bounding boxes to the state of the item.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChAssembly, chrono::ChParticlesClones, chrono::ChMatterMeshless, and chrono::ChConveyor.

virtual void chrono::ChPhysicsItem::Update ( double  mytime) [virtual]

This is an important function, which is called by the owner ChSystem at least once per integration step. It may update all auxiliary data of the item, such as matrices if any, etc., depending on the current coordinates. The inherited classes, for example the ChLinkMask, often implement specialized versions of this Update(time) function, because they might need to update inner states, forces, springs, etc. This base version, by default, simply updates the item's time.

Reimplemented in chrono::ChLinkMateOrthogonal, chrono::ChBody, chrono::ChLinkMateXdistance, chrono::ChParticlesClones, chrono::ChAssembly, chrono::ChLinkMatePlane, chrono::ChMatterSPH, chrono::ChMatterMeshless, chrono::ChShaft, chrono::ChLink, chrono::ChLinkMasked, chrono::ChLinkMateGeneric, chrono::ChShaftsPlanetary, chrono::ChLinkMarkers, chrono::ChShaftsMotor, chrono::ChShaftsClutch, chrono::ChShaftsBody, chrono::ChNodeBody, chrono::ChLinkDistance, chrono::ChShaftsGear, chrono::ChConveyor, chrono::ChShaftsTorsionSpring, chrono::ChLinkFastContact, chrono::ChContactContainer, chrono::ChContactContainerDEM, chrono::ChContactContainerNodes, chrono::ChAssemblyMPI, and chrono::ChBodyDEMMPI.

virtual void chrono::ChPhysicsItem::Update ( ) [virtual]

As above, but does not require updating of time-dependent data. By default, calls Update(mytime) using item's current time.

Reimplemented in chrono::ChBody, chrono::ChParticlesClones, chrono::ChAssembly, chrono::ChMatterSPH, chrono::ChMatterMeshless, chrono::ChLink, chrono::ChBodyAuxRef, chrono::ChAssemblyMPI, and chrono::ChBodyDEMMPI.

virtual void chrono::ChPhysicsItem::VariablesFbLoadForces ( double  factor = 1.) [virtual]

Adds the current forces (applied to item) into the encapsulated ChLcpVariables, in the 'fb' part: qf+=forces*factor

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChLinkEngine, chrono::ChMatterMeshless, chrono::ChParticlesClones, chrono::ChAssembly, chrono::ChShaft, chrono::ChConveyor, and chrono::ChShaftsTorsionSpring.

virtual void chrono::ChPhysicsItem::VariablesQbIncrementPosition ( double  step) [virtual]

Increment item positions by the 'qb' part of the ChLcpVariables, multiplied by a 'step' factor. pos+=qb*step If qb is a speed, this behaves like a single step of 1-st order numerical integration (Eulero integration).

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChParticlesClones, chrono::ChLinkEngine, chrono::ChMatterMeshless, chrono::ChAssembly, chrono::ChShaft, and chrono::ChConveyor.

virtual void chrono::ChPhysicsItem::VariablesQbLoadSpeed ( ) [virtual]

Initialize the 'qb' part of the ChLcpVariables with the current value of speeds. Note: since 'qb' is the unknown of the LCP, this function sems unuseful, however the LCP solver has an option 'add_Mq_to_f', that takes [M]*qb and add to the 'fb' term before starting (this is often needed in the Anitescu time stepping method, for instance); this explains the need of this method..

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChLinkEngine, chrono::ChMatterMeshless, chrono::ChParticlesClones, chrono::ChAssembly, chrono::ChShaft, and chrono::ChConveyor.

virtual void chrono::ChPhysicsItem::VariablesQbSetSpeed ( double  step = 0.) [virtual]

Fetches the item speed (ex. linear and angular vel.in rigid bodies) from the 'qb' part of the ChLcpVariables and sets it as the current item speed. If 'step' is not 0, also should compute the approximate acceleration of the item using backward differences, that is accel=(new_speed-old_speed)/step. Mostly used after the LCP provided the solution in ChLcpVariables.

Reimplemented in chrono::ChBody, chrono::ChMatterSPH, chrono::ChLinkEngine, chrono::ChParticlesClones, chrono::ChMatterMeshless, chrono::ChAssembly, chrono::ChShaft, and chrono::ChConveyor.


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