chrono::ChParticle Class Reference

Description

Class for a single particle clone in the ChParticleCloud cluster.

It does not define mass, inertia and shape because those are shared among them.

#include <ChParticleCloud.h>

Inheritance diagram for chrono::ChParticle:
Collaboration diagram for chrono::ChParticle:

Public Member Functions

 ChParticle (const ChParticle &other)
 
ChParticleoperator= (const ChParticle &other)
 
virtual ChVariablesVariables () override
 
ChParticleCloudGetContainer () const
 
void SetContainer (ChParticleCloud *mc)
 
virtual ChContactable::eChContactableType GetContactableType () const override
 This must return the proper eChContactableType enum, for allowing a faster collision dispatcher in ChContactContainer classes (this enum will be used instead of slow dynamic_cast<> to infer the type of ChContactable, if possible)
 
virtual ChVariablesGetVariables1 () override
 Access variables.
 
virtual bool IsContactActive () override
 Tell if the object must be considered in collision detection.
 
virtual int GetContactableNumCoordsPosLevel () override
 Get the number of DOFs affected by this object (position part).
 
virtual int GetContactableNumCoordsVelLevel () override
 Get the number of DOFs affected by this object (speed part).
 
virtual void ContactableGetStateBlockPosLevel (ChState &x) override
 Get all the DOFs packed in a single vector (position part)
 
virtual void ContactableGetStateBlockVelLevel (ChStateDelta &w) override
 Get all the DOFs packed in a single vector (speed part)
 
virtual void ContactableIncrementState (const ChState &x, const ChStateDelta &dw, ChState &x_new) override
 Increment the provided state of this object by the given state-delta increment. More...
 
virtual ChVector3d GetContactPoint (const ChVector3d &loc_point, const ChState &state_x) override
 Express the local point in absolute frame, for the given state position.
 
virtual ChVector3d GetContactPointSpeed (const ChVector3d &loc_point, const ChState &state_x, const ChStateDelta &state_w) override
 Get the absolute speed of a local point attached to the contactable. More...
 
virtual ChVector3d GetContactPointSpeed (const ChVector3d &abs_point) override
 Get the absolute speed of point abs_point if attached to the surface. More...
 
virtual ChFrame GetCollisionModelFrame () override
 Return the coordinate system for the associated collision model. More...
 
virtual void ContactForceLoadResidual_F (const ChVector3d &F, const ChVector3d &T, const ChVector3d &abs_point, ChVectorDynamic<> &R) override
 Apply the force & torque, expressed in absolute reference, applied in pos, to the coordinates of the variables. More...
 
virtual void ContactComputeQ (const ChVector3d &F, const ChVector3d &T, const ChVector3d &point, const ChState &state_x, ChVectorDynamic<> &Q, int offset) override
 Compute a contiguous vector of generalized forces Q from a given force & torque at the given point. More...
 
virtual void ComputeJacobianForContactPart (const ChVector3d &abs_point, ChMatrix33<> &contact_plane, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_N, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_U, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_V, bool second) override
 Compute the jacobian(s) part(s) for this contactable item. More...
 
virtual void ComputeJacobianForRollingContactPart (const ChVector3d &abs_point, ChMatrix33<> &contact_plane, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_N, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_U, ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &jacobian_tuple_V, bool second) override
 Compute the jacobian(s) part(s) for this contactable item, for rolling about N,u,v (used only for rolling friction NSC contacts)
 
virtual double GetContactableMass () override
 used by some SMC code
 
virtual ChPhysicsItemGetPhysicsItem () override
 This is only for backward compatibility.
 
virtual void ArchiveOut (ChArchiveOut &archive_out) override
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in) override
 Method to allow de serialization of transient data from archives.
 
- Public Member Functions inherited from chrono::ChParticleBase
 ChParticleBase (const ChParticleBase &other)
 
ChParticleBaseoperator= (const ChParticleBase &other)
 
- Public Member Functions inherited from chrono::ChFrameMoving< double >
 ChFrameMoving ()
 Default constructor (identity frame).
 
 ChFrameMoving (const ChVector3< double > &v, const ChQuaternion< double > &q=ChQuaternion< double >(1, 0, 0, 0))
 Construct from pos and rot (as a quaternion).
 
 ChFrameMoving (const ChVector3< double > &v, const ChMatrix33< double > &R)
 Construct from pos and rotation (as a 3x3 matrix).
 
 ChFrameMoving (const ChCoordsys< double > &C)
 Construct from a coordsys.
 
 ChFrameMoving (const ChFrame< double > &F)
 Construct from a frame.
 
 ChFrameMoving (const ChFrameMoving< double > &other)
 Copy constructor, build from another moving frame.
 
virtual ~ChFrameMoving ()
 Destructor.
 
ChFrameMoving< double > & operator= (const ChFrameMoving< double > &other)
 Assignment operator: copy from another moving frame.
 
ChFrameMoving< double > & operator= (const ChFrame< double > &other)
 Assignment operator: copy from another frame.
 
bool operator== (const ChFrameMoving< double > &other) const
 Returns true for identical frames.
 
bool operator!= (const ChFrameMoving< double > &other) const
 Returns true for different frames.
 
ChFrameMoving< double > operator>> (const ChFrameMoving< double > &F) const
 Transform another frame through this frame. More...
 
ChFrameMoving< double > operator* (const ChFrameMoving< double > &F) const
 Transform another frame through this frame. More...
 
ChFrameMoving< double > & operator>>= (const ChFrameMoving< double > &F)
 Transform this frame by pre-multiplication with another frame. More...
 
ChFrameMoving< double > & operator>>= (const ChVector3< double > &v)
 Transform this frame by pre-multiplication with a given vector (translate frame).
 
ChFrameMoving< double > & operator>>= (const ChQuaternion< double > &q)
 Transform this frame by pre-multiplication with a given quaternion (rotate frame).
 
ChFrameMoving< double > & operator>>= (const ChCoordsys< double > &C)
 Transform this frame by pre-multiplication with a given coordinate system.
 
ChFrameMoving< double > & operator>>= (const ChFrame< double > &F)
 Transform this frame by pre-multiplication with another frame.
 
ChFrameMoving< double > & operator*= (const ChFrameMoving< double > &F)
 Transform this frame by post-multiplication with another frame. More...
 
const ChCoordsys< double > & GetCoordsysDt () const
 Return both rotation and translation velocities as a ChCoordsys object.
 
const ChCoordsys< double > & GetCoordsysDt2 () const
 Return both rotation and translation accelerations as a ChCoordsys object.
 
const ChVector3< double > & GetPosDt () const
 Return the linear velocity.
 
const ChVector3< double > & GetLinVel () const
 Return the linear velocity.
 
const ChVector3< double > & GetPosDt2 () const
 Return the linear acceleration.
 
const ChVector3< double > & GetLinAcc () const
 Return the linear acceleration.
 
const ChQuaternion< double > & GetRotDt () const
 Return the rotation velocity as a quaternion.
 
const ChQuaternion< double > & GetRotDt2 () const
 Return the rotation acceleration as a quaternion.
 
ChVector3< double > GetAngVelLocal () const
 Compute the angular velocity (expressed in local coords).
 
ChVector3< double > GetAngVelParent () const
 Compute the actual angular velocity (expressed in parent coords).
 
ChVector3< double > GetAngAccLocal () const
 Compute the actual angular acceleration (expressed in local coords).
 
ChVector3< double > GetAngAccParent () const
 Compute the actual angular acceleration (expressed in parent coords).
 
virtual void SetCoordsysDt (const ChCoordsys< double > &csys_dt)
 Set both linear and rotation velocities as a single ChCoordsys derivative.
 
virtual void SetPosDt (const ChVector3< double > &vel)
 Set the linear velocity.
 
virtual void SetLinVel (const ChVector3< double > &vel)
 Set the linear velocity.
 
virtual void SetRotDt (const ChQuaternion< double > &q_dt)
 Set the rotation velocity as a quaternion derivative. More...
 
virtual void SetAngVelLocal (const ChVector3< double > &w)
 Set the rotation velocity from the given angular velocity (expressed in local coordinates).
 
virtual void SetAngVelParent (const ChVector3< double > &w)
 Set the rotation velocity from given angular velocity (expressed in parent coordinates).
 
virtual void SetCoordsysDt2 (const ChCoordsys< double > &csys_dtdt)
 Set the linear and rotation accelerations as a single ChCoordsys derivative.
 
virtual void SetPosDt2 (const ChVector3< double > &acc)
 Set the linear acceleration.
 
virtual void SetLinAcc (const ChVector3< double > &acc)
 Set the linear acceleration.
 
virtual void SetRotDt2 (const ChQuaternion< double > &q_dtdt)
 Set the rotation acceleration as a quaternion derivative. More...
 
virtual void SetAngAccLocal (const ChVector3< double > &a)
 Set the rotation acceleration from given angular acceleration (expressed in local coordinates). More...
 
virtual void SetAngAccParent (const ChVector3< double > &a)
 Set the rotation acceleration from given angular acceleration (expressed in parent coordinates).
 
void ComputeRotMatDt (ChMatrix33< double > &R_dt) const
 Compute the time derivative of the rotation matrix.
 
void ComputeRotMatDt2 (ChMatrix33< double > &R_dtdt)
 Compute the second time derivative of the rotation matrix.
 
ChMatrix33< double > GetRotMatDt ()
 Return the time derivative of the rotation matrix.
 
ChMatrix33< double > GetRotMatDt2 ()
 Return the second time derivative of the rotation matrix.
 
void ConcatenatePreTransformation (const ChFrameMoving< double > &F)
 Apply a transformation (rotation and translation) represented by another frame. More...
 
void ConcatenatePostTransformation (const ChFrameMoving< double > &F)
 Apply a transformation (rotation and translation) represented by another frame F in local coordinate. More...
 
ChVector3< double > PointSpeedLocalToParent (const ChVector3< double > &localpos) const
 Return the velocity in the parent frame of a point fixed to this frame and expressed in local coordinates.
 
ChVector3< double > PointSpeedLocalToParent (const ChVector3< double > &localpos, const ChVector3< double > &localspeed) const
 Return the velocity in the parent frame of a moving point, given the point location and velocity expressed in local coordinates.
 
ChVector3< double > PointAccelerationLocalToParent (const ChVector3< double > &localpos) const
 Return the acceleration in the parent frame of a point fixed to this frame and expressed in local coordinates. More...
 
ChVector3< double > PointAccelerationLocalToParent (const ChVector3< double > &localpos, const ChVector3< double > &localspeed, const ChVector3< double > &localacc) const
 Return the acceleration in the parent frame of a moving point, given the point location, velocity, and acceleration expressed in local coordinates.
 
ChVector3< double > PointSpeedParentToLocal (const ChVector3< double > &parentpos, const ChVector3< double > &parentspeed) const
 Return the velocity of a point expressed in this frame, given the point location and velocity in the parent frame.
 
ChVector3< double > PointAccelerationParentToLocal (const ChVector3< double > &parentpos, const ChVector3< double > &parentspeed, const ChVector3< double > &parentacc) const
 Return the acceleration of a point expressed in this frame, given the point location, velocity, and acceleration in the parent frame.
 
ChFrameMoving< double > TransformLocalToParent (const ChFrameMoving< double > &F) const
 Transform a moving frame from 'this' local coordinate system to parent frame coordinate system.
 
ChFrameMoving< double > TransformParentToLocal (const ChFrameMoving< double > &F) const
 Transform a moving frame from the parent coordinate system to 'this' local frame coordinate system.
 
bool Equals (const ChFrameMoving< double > &other) const
 Returns true if this transform is identical to the other transform.
 
bool Equals (const ChFrameMoving< double > &other, double tol) const
 Returns true if this transform is equal to the other transform, within a tolerance 'tol'.
 
virtual void Invert () override
 Invert in place. More...
 
ChFrameMoving< double > GetInverse () const
 Return the inverse transform.
 
- Public Member Functions inherited from chrono::ChFrame< double >
 ChFrame ()
 Default constructor (identity frame).
 
 ChFrame (const ChVector3< double > &v, const ChQuaternion< double > &q=ChQuaternion< double >(1, 0, 0, 0))
 Construct from position and rotation (as quaternion).
 
 ChFrame (const ChVector3< double > &v, const ChMatrix33< double > &R)
 Construct from pos and rotation (as a 3x3 matrix).
 
 ChFrame (const ChVector3< double > &v, const double angle, const ChVector3< double > &u)
 Construct from position mv and rotation of angle alpha around unit vector mu.
 
 ChFrame (const ChCoordsys< double > &C)
 Construct from a coordsys.
 
 ChFrame (const ChFrame< double > &other)
 Copy constructor, build from another frame.
 
ChFrame< double > & operator= (const ChFrame< double > &other)
 Assignment operator: copy from another frame.
 
bool operator== (const ChFrame< double > &other) const
 Returns true for identical frames.
 
bool operator!= (const ChFrame< double > &other) const
 Returns true for different frames.
 
ChFrame< double > operator* (const ChFrame< double > &F) const
 Transform another frame through this frame. More...
 
ChVector3< double > operator* (const ChVector3< double > &v) const
 Transform a vector through this frame (express in parent frame). More...
 
ChFrame< double > operator>> (const ChFrame< double > &F) const
 Transform another frame through this frame. More...
 
ChVector3< double > operator/ (const ChVector3< double > &v) const
 Transform a vector through this frame (express from parent frame). More...
 
ChFrame< double > & operator>>= (const ChFrame< double > &F)
 Transform this frame by pre-multiplication with another frame. More...
 
ChFrame< double > & operator>>= (const ChVector3< double > &v)
 Transform this frame by pre-multiplication with a given vector (translate frame).
 
ChFrame< double > & operator>>= (const ChQuaternion< double > &q)
 Transform this frame by pre-multiplication with a given quaternion (rotate frame).
 
ChFrame< double > & operator>>= (const ChCoordsys< double > &C)
 Transform this frame by pre-multiplication with a given coordinate system.
 
ChFrame< double > & operator*= (const ChFrame< double > &F)
 Transform this frame by post-multiplication with another frame. More...
 
const ChCoordsys< double > & GetCoordsys () const
 Return both current rotation and translation as a ChCoordsys object.
 
const ChVector3< double > & GetPos () const
 Return the current translation vector.
 
const ChQuaternion< double > & GetRot () const
 Return the current rotation quaternion.
 
const ChMatrix33< double > & GetRotMat () const
 Return the current 3x3 rotation matrix.
 
ChVector3< double > GetRotAxis () const
 Get axis of finite rotation, in parent space.
 
double GetRotAngle () const
 Get angle of rotation about axis of finite rotation.
 
void SetCoordsys (const ChCoordsys< double > &C)
 Impose both translation and rotation as a single ChCoordsys. More...
 
void SetCoordsys (const ChVector3< double > &v, const ChQuaternion< double > &q)
 Impose both translation and rotation. More...
 
void SetRot (const ChQuaternion< double > &q)
 Impose the rotation as a quaternion. More...
 
void SetRot (const ChMatrix33< double > &R)
 Impose the rotation as a 3x3 matrix. More...
 
void SetPos (const ChVector3< double > &pos)
 Impose the translation vector.
 
void ConcatenatePreTransformation (const ChFrame< double > &F)
 Apply a transformation (rotation and translation) represented by another frame. More...
 
void ConcatenatePostTransformation (const ChFrame< double > &F)
 Apply a transformation (rotation and translation) represented by another frame F in local coordinate. More...
 
void Move (const ChVector3< double > &v)
 An easy way to move the frame by the amount specified by vector v, (assuming v expressed in parent coordinates)
 
void Move (const ChCoordsys< double > &C)
 Apply both translation and rotation, assuming both expressed in parent coordinates, as a vector for translation and quaternion for rotation,.
 
ChVector3< double > TransformPointLocalToParent (const ChVector3< double > &v) const
 Transform a point from the local frame coordinate system to the parent coordinate system.
 
ChVector3< double > TransformPointParentToLocal (const ChVector3< double > &v) const
 Transforms a point from the parent coordinate system to local frame coordinate system.
 
ChVector3< double > TransformDirectionLocalToParent (const ChVector3< double > &d) const
 Transform a direction from the parent frame coordinate system to 'this' local coordinate system.
 
ChVector3< double > TransformDirectionParentToLocal (const ChVector3< double > &d) const
 Transforms a direction from 'this' local coordinate system to parent frame coordinate system.
 
ChWrench< double > TransformWrenchLocalToParent (const ChWrench< double > &w) const
 Transform a wrench from the local coordinate system to the parent coordinate system.
 
ChWrench< double > TransformWrenchParentToLocal (const ChWrench< double > &w) const
 Transform a wrench from the parent coordinate system to the local coordinate system.
 
ChFrame< double > TransformLocalToParent (const ChFrame< double > &F) const
 Transform a frame from 'this' local coordinate system to parent frame coordinate system.
 
ChFrame< double > TransformParentToLocal (const ChFrame< double > &F) const
 Transform a frame from the parent coordinate system to 'this' local frame coordinate system.
 
bool Equals (const ChFrame< double > &other) const
 Returns true if this transform is identical to the other transform.
 
bool Equals (const ChFrame< double > &other, double tol) const
 Returns true if this transform is equal to the other transform, within a tolerance 'tol'.
 
void Normalize ()
 Normalize the rotation, so that quaternion has unit length.
 
virtual void SetIdentity ()
 Sets to no translation and no rotation.
 
ChFrame< double > GetInverse () const
 Return the inverse transform.
 

Public Attributes

ChParticleCloudcontainer
 
ChVariablesBodySharedMass variables
 
ChVector3d UserForce
 
ChVector3d UserTorque
 

Additional Inherited Members

- Protected Attributes inherited from chrono::ChFrameMoving< double >
ChCoordsys< double > m_csys_dt
 rotation and position velocity, as vector + quaternion
 
ChCoordsys< double > m_csys_dtdt
 rotation and position acceleration, as vector + quaternion
 
- Protected Attributes inherited from chrono::ChFrame< double >
ChCoordsys< double > m_csys
 position and rotation, as vector + quaternion
 
ChMatrix33< double > m_rmat
 3x3 orthogonal rotation matrix
 

Member Function Documentation

◆ ComputeJacobianForContactPart()

void chrono::ChParticle::ComputeJacobianForContactPart ( const ChVector3d abs_point,
ChMatrix33<> &  contact_plane,
ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &  jacobian_tuple_N,
ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &  jacobian_tuple_U,
ChVariableTupleCarrier_1vars< 6 >::type_constraint_tuple &  jacobian_tuple_V,
bool  second 
)
overridevirtual

Compute the jacobian(s) part(s) for this contactable item.

For example, if the contactable is a ChBody, this should update the corresponding 1x6 jacobian.

◆ ContactableIncrementState()

void chrono::ChParticle::ContactableIncrementState ( const ChState x,
const ChStateDelta dw,
ChState x_new 
)
overridevirtual

Increment the provided state of this object by the given state-delta increment.

Compute: x_new = x + dw.

Implements chrono::ChContactable.

◆ ContactComputeQ()

void chrono::ChParticle::ContactComputeQ ( const ChVector3d F,
const ChVector3d T,
const ChVector3d point,
const ChState state_x,
ChVectorDynamic<> &  Q,
int  offset 
)
overridevirtual

Compute a contiguous vector of generalized forces Q from a given force & torque at the given point.

Used for computing stiffness matrix (square force jacobian) by backward differentiation. The force and its application point are specified in the global frame. Each object must set the entries in Q corresponding to its variables, starting at the specified offset. If needed, the object states must be extracted from the provided state position.

Implements chrono::ChContactable.

◆ ContactForceLoadResidual_F()

void chrono::ChParticle::ContactForceLoadResidual_F ( const ChVector3d F,
const ChVector3d T,
const ChVector3d abs_point,
ChVectorDynamic<> &  R 
)
overridevirtual

Apply the force & torque, expressed in absolute reference, applied in pos, to the coordinates of the variables.

Force for example could come from a penalty model.

Implements chrono::ChContactable.

◆ GetCollisionModelFrame()

virtual ChFrame chrono::ChParticle::GetCollisionModelFrame ( )
inlineoverridevirtual

Return the coordinate system for the associated collision model.

ChCollisionModel might call this to get the position of the contact model (when rigid) and sync it.

Implements chrono::ChContactable.

◆ GetContactPointSpeed() [1/2]

ChVector3d chrono::ChParticle::GetContactPointSpeed ( const ChVector3d abs_point)
overridevirtual

Get the absolute speed of point abs_point if attached to the surface.

Easy in this case because there are no rotations..

Implements chrono::ChContactable.

◆ GetContactPointSpeed() [2/2]

ChVector3d chrono::ChParticle::GetContactPointSpeed ( const ChVector3d loc_point,
const ChState state_x,
const ChStateDelta state_w 
)
overridevirtual

Get the absolute speed of a local point attached to the contactable.

The given point is assumed to be expressed in the local frame of this object. This function must use the provided states.

Implements chrono::ChContactable.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/physics/ChParticleCloud.h
  • /builds/uwsbel/chrono/src/chrono/physics/ChParticleCloud.cpp