MULTIBODY SIMULATION SOFTWARE - API documentation

chrono::ChParticles Class Reference

#include <CHparticles.h>

Inheritance diagram for chrono::ChParticles:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ChParticles ()
 ~ChParticles ()
void Copy (ChParticles *source)
void SetCollide (bool mcoll)
bool GetCollide ()
void SetLimitSpeed (bool mlimit)
bool GetLimitSpeed ()
unsigned int GetNparticles ()
ChAparticleGetParticle (unsigned int n)
void ResizeNparticles (int newsize)
void AddParticle (ChCoordsys< double > initial_state=CSYSNORM)
virtual int GetDOF ()
void VariablesFbReset ()
void VariablesFbLoadForces (double factor=1.)
void VariablesQbLoadSpeed ()
void VariablesQbSetSpeed (double step=0.)
void VariablesQbIncrementPosition (double step)
virtual void InjectVariables (ChLcpSystemDescriptor &mdescriptor)
void SetNoSpeedNoAcceleration ()
ChCollisionModelGetCollisionModel ()
virtual void SyncCollisionModels ()
virtual void AddCollisionModelsToSystem ()
virtual void RemoveCollisionModelsFromSystem ()
void UpdateParticleCollisionModels ()
float GetImpactC ()
void SetImpactC (float mval)
float GetImpactCt ()
void SetImpactCt (float mval)
float GetKfriction ()
void SetKfriction (float mval)
float GetSfriction ()
void SetSfriction (float mval)
void SetFriction (float mval)
void SetMass (double newmass)
double GetMass ()
void SetInertia (ChMatrix33<> *newXInertia)
void SetInertiaXX (Vector iner)
Vector GetInertiaXX ()
void SetInertiaXY (Vector iner)
Vector GetInertiaXY ()
void SetMaxSpeed (float m_max_speed)
float GetMaxSpeed ()
void SetMaxWvel (float m_max_wvel)
float GetMaxWvel ()
void ClampSpeed ()
void SetSleepTime (float m_t)
float GetSleepTime ()
void SetSleepMinSpeed (float m_t)
float GetSleepMinSpeed ()
void SetSleepMinWvel (float m_t)
float GetSleepMinWvel ()
virtual void Update (double mytime)
virtual void Update ()
void UpdateExternalGeometry ()
void StreamIN (ChStreamInBinary &mstream)
void StreamOUT (ChStreamOutBinary &mstream)


Detailed Description

Class for clusters of particles, that is many rigid objects with the same shape and mass. This can be used to make granular flows, where you have thousands of objects with the same shape. In fact, a single ChParticles object can be more memory-efficient than many ChBody objects, because they share many features, such as mass and collision shape. If you have N different families of shapes in your granular simulations (ex. 50% of particles are large spheres, 25% are small spheres and 25% are polihedrons) you can simply add three ChParticles objects to the ChSystem. This would be more efficient anyway than creating all shapes as ChBody.

Constructor & Destructor Documentation

chrono::ChParticles::ChParticles (  ) 

CLASS FOR PARTICLE CLUSTER.

Build a cluster of particles. By default the cluster will contain 0 particles.

chrono::ChParticles::~ChParticles (  ) 

Destructor.


Member Function Documentation

void chrono::ChParticles::Copy ( ChParticles source  ) 

Copy from another ChParticles.

void chrono::ChParticles::SetCollide ( bool  mcoll  ) 

Enable/disable the collision for this cluster of particles. After setting ON, remember RecomputeCollisionModel() before anim starts (it is not automatically recomputed here because of performance issues.)

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

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

Reimplemented from chrono::ChPhysicsItem.

void chrono::ChParticles::SetLimitSpeed ( bool  mlimit  ) 

Trick. Set the maximum linear speed (beyond this limit it will be clamped). This is useful in virtual reality and real-time simulations, because it reduces the risk of bad collision detection. The realism is limited, but the simulation is more stable.

unsigned int chrono::ChParticles::GetNparticles (  ) 

Get the number of particles.

ChAparticle& chrono::ChParticles::GetParticle ( unsigned int  n  ) 

Access the N-th particle.

void chrono::ChParticles::ResizeNparticles ( int  newsize  ) 

Resize the particle cluster. Also clear the state of previously created particles, if any. NOTE! Define the sample collision shape using GetCollisionModel()->... before adding particles!

void chrono::ChParticles::AddParticle ( ChCoordsys< double >  initial_state = CSYSNORM  ) 

Add a new particle to the particle cluster, passing a coordinate system as initial state. NOTE! Define the sample collision shape using GetCollisionModel()->... before adding particles!

virtual int chrono::ChParticles::GetDOF (  )  [virtual]

Number of coordinates of the particle cluster.

Reimplemented from chrono::ChPhysicsItem.

void chrono::ChParticles::VariablesFbReset (  )  [virtual]

Sets the 'fb' part of the encapsulated ChLcpVariablesBody to zero.

Reimplemented from chrono::ChPhysicsItem.

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

Adds the current forces applied to body (including gyroscopic torque) in encapsulated ChLcpVariablesBody, in the 'fb' part: qf+=forces*factor

Reimplemented from chrono::ChPhysicsItem.

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

Initialize the 'qb' part of the ChLcpVariablesBody with the current value of body 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 from chrono::ChPhysicsItem.

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

Fetches the body speed (both linear and angular) from the 'qb' part of the ChLcpVariablesBody (does not updates the full body&markers state) and sets it as the current body speed. If 'step' is not 0, also computes the approximate acceleration of the body using backward differences, that is accel=(new_speed-old_speed)/step. Mostly used after the LCP provided the solution in ChLcpVariablesBody .

Reimplemented from chrono::ChPhysicsItem.

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

Increment body position by the 'qb' part of the ChLcpVariablesBody, 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). Does not automatically update markers & forces.

Reimplemented from chrono::ChPhysicsItem.

void chrono::ChParticles::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 from chrono::ChPhysicsItem.

void chrono::ChParticles::SetNoSpeedNoAcceleration (  ) 

Set no speed and no accelerations (but does not change the position).

Reimplemented from chrono::ChPhysicsItem.

ChCollisionModel* chrono::ChParticles::GetCollisionModel (  ) 

Acess the collision model for the collision engine: this is the 'sample' collision model that is used by all particles. To get a non-null pointer, remember to SetCollide(true), before.

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

Synchronize coll.models coordinates and bounding boxes to the positions of the particles.

Reimplemented from chrono::ChPhysicsItem.

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

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

Reimplemented from chrono::ChPhysicsItem.

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

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

Reimplemented from chrono::ChPhysicsItem.

void chrono::ChParticles::UpdateParticleCollisionModels (  ) 

After you added collision shapes to the sample coll.model (the one that you access with GetCollisionModel() ) you need to call this function so that all collision models of particles will reference the sample coll.model.

float chrono::ChParticles::GetImpactC (  ) 

The normal restitution coefficient, for collisions. Should be in 0..1 range.

float chrono::ChParticles::GetImpactCt (  ) 

The tangential restitution coefficient, for collisions.

float chrono::ChParticles::GetKfriction (  ) 

The kinetic friction coefficient. Usually in 0..1 range, rarely above.

float chrono::ChParticles::GetSfriction (  ) 

The static friction coefficient. Usually a bit higher than kinetic coeff.

void chrono::ChParticles::SetFriction ( float  mval  ) 

Set both static friction and kinetic friction at once, with same value.

void chrono::ChParticles::SetMass ( double  newmass  ) 

Mass of each particle. Must be positive.

void chrono::ChParticles::SetInertia ( ChMatrix33<> *  newXInertia  ) 

Set the inertia tensor of each particle.

void chrono::ChParticles::SetInertiaXX ( Vector  iner  ) 

Set the diagonal part of the inertia tensor of each particle.

Vector chrono::ChParticles::GetInertiaXX (  ) 

Get the diagonal part of the inertia tensor of each particle.

void chrono::ChParticles::SetInertiaXY ( Vector  iner  ) 

Set the extradiagonal part of the inertia tensor of each particle (xy, yz, zx values, the rest is symmetric)

Vector chrono::ChParticles::GetInertiaXY (  ) 

Get the extradiagonal part of the inertia tensor of each particle (xy, yz, zx values, the rest is symmetric)

void chrono::ChParticles::SetMaxSpeed ( float  m_max_speed  ) 

Trick. Set the maximum linear speed (beyond this limit it will be clamped). This is useful in virtual reality and real-time simulations, because it reduces the risk of bad collision detection. This speed limit is active only if you set SetLimitSpeed(true);

void chrono::ChParticles::SetMaxWvel ( float  m_max_wvel  ) 

Trick. Set the maximum angualar speed (beyond this limit it will be clamped). This is useful in virtual reality and real-time simulations, because it reduces the risk of bad collision detection. This speed limit is active only if you set SetLimitSpeed(true);

void chrono::ChParticles::ClampSpeed (  ) 

When this function is called, the speed of particles is clamped into limits posed by max_speed and max_wvel - but remember to put the body in the SetLimitSpeed(true) mode.

void chrono::ChParticles::SetSleepTime ( float  m_t  ) 

Set the amount of time which must pass before going automatically in sleep mode when the body has very small movements.

void chrono::ChParticles::SetSleepMinSpeed ( float  m_t  ) 

Set the max linear speed to be kept for 'sleep_time' before freezing.

void chrono::ChParticles::SetSleepMinWvel ( float  m_t  ) 

Set the max linear speed to be kept for 'sleep_time' before freezing.

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

Update all auxiliary data of the particles.

Reimplemented from chrono::ChPhysicsItem.

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

Update all auxiliary data of the particles.

Reimplemented from chrono::ChPhysicsItem.

void chrono::ChParticles::UpdateExternalGeometry (  ) 

Tells to the associated external object ChExternalObject() ,if any, that its 3D shape must be updated in order to syncronize to ChBody coordinates

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

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

Reimplemented from chrono::ChPhysicsItem.

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

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

Reimplemented from chrono::ChPhysicsItem.


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