Description
Interface for objects that generate contacts.
A derived class must add all its variable sets (of ChVariable type) to the list managed by this class.
#include <ChContactable.h>

Public Types | |
enum | Type { Type::UNKNOWN, Type::ONE_1, Type::ONE_2, Type::ONE_3, Type::ONE_4, Type::ONE_5, Type::ONE_6, Type::TWO_33, Type::TWO_66, Type::THREE_333, Type::THREE_666 } |
Contactable type (based on number of variables objects and their DOFs). More... | |
Public Member Functions | |
virtual Type | GetContactableType () const =0 |
Return the proper contactable Type. More... | |
void | AddCollisionModel (std::shared_ptr< ChCollisionModel > model) |
Add the collision model. | |
void | AddCollisionShape (std::shared_ptr< ChCollisionShape > shape, const ChFrame<> &frame=ChFrame<>()) |
Add a collision shape. More... | |
std::shared_ptr< ChCollisionModel > | GetCollisionModel () const |
Access the collision model. | |
virtual bool | IsContactActive ()=0 |
Indicate whether or not the object must be considered in collision detection. | |
virtual ChConstraintTuple * | CreateConstraintTuple ()=0 |
Create a constraint tuple with the appropriate number of variables for this contactable object. More... | |
virtual int | GetContactableNumCoordsPosLevel ()=0 |
Get the number of DOFs affected by this object (position part). | |
virtual int | GetContactableNumCoordsVelLevel ()=0 |
Get the number of DOFs affected by this object (speed part). | |
virtual void | ContactableGetStateBlockPosLevel (ChState &x)=0 |
Get all the DOFs packed in a single vector (position part). | |
virtual void | ContactableGetStateBlockVelLevel (ChStateDelta &w)=0 |
Get all the DOFs packed in a single vector (speed part). | |
virtual void | ContactableIncrementState (const ChState &x, const ChStateDelta &dw, ChState &x_new)=0 |
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)=0 |
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)=0 |
Get the absolute speed of a local point attached to the contactable. More... | |
virtual ChVector3d | GetContactPointSpeed (const ChVector3d &abs_point)=0 |
Get the absolute speed of point abs_point if attached to the surface. | |
virtual ChFrame | GetCollisionModelFrame ()=0 |
Return the frame of the associated collision model relative to the contactable object. More... | |
virtual void | ContactForceLoadResidual_F (const ChVector3d &F, const ChVector3d &T, const ChVector3d &abs_point, ChVectorDynamic<> &R)=0 |
Apply the given force & torque at the given location and load into the global generalized force vector. More... | |
virtual void | ContactComputeQ (const ChVector3d &F, const ChVector3d &T, const ChVector3d &point, const ChState &state_x, ChVectorDynamic<> &Q, int offset)=0 |
Compute a contiguous vector of generalized forces Q from a given force & torque at the given point. More... | |
virtual double | GetContactableMass ()=0 |
Return the mass of the contactable object. More... | |
virtual ChPhysicsItem * | GetPhysicsItem ()=0 |
Return the contactable object as a ChPhysicsItem. More... | |
void | SetUserData (const std::shared_ptr< void > &data) |
Set user-data associated with this contactable. | |
bool | HasData () const |
Check if this contactable has associated user-data. | |
template<typename T > | |
std::shared_ptr< T > | GetUserData () const |
Get the user-data using static cast to a known type. | |
virtual void | ComputeJacobianForContactPart (const ChVector3d &abs_point, ChMatrix33<> &contact_plane, ChConstraintTuple *jacobian_tuple_N, ChConstraintTuple *jacobian_tuple_U, ChConstraintTuple *jacobian_tuple_V, bool second)=0 |
Compute the Jacobian part(s) for this contactable item. More... | |
virtual void | ComputeJacobianForRollingContactPart (const ChVector3d &abs_point, ChMatrix33<> &contact_plane, ChConstraintTuple *jacobian_tuple_N, ChConstraintTuple *jacobian_tuple_U, ChConstraintTuple *jacobian_tuple_V, bool second) |
Compute the rolling Jacobian part(s) for this contactable item. More... | |
void | ArchiveOut (ChArchiveOut &archive_out) |
Method to allow serialization of transient data to archives. | |
void | ArchiveIn (ChArchiveIn &archive_in) |
Method to allow deserialization of transient data from archives. | |
Protected Attributes | |
std::shared_ptr< ChCollisionModel > | collision_model |
collision model for the contactable object | |
std::vector< ChVariables * > | m_contactable_variables |
variables associated with the contactable object | |
std::shared_ptr< void > | m_data |
arbitrary user-data | |
Friends | |
class | ChContactSMC |
Member Enumeration Documentation
◆ Type
|
strong |
Contactable type (based on number of variables objects and their DOFs).
Enumerator | |
---|---|
UNKNOWN | unknown contactable type |
ONE_1 | 1 variable with 1 DOF |
ONE_2 | 1 variable with 2 DOFs |
ONE_3 | 1 variable with 3 DOFs (e.g., ChNodeFEAxyz) |
ONE_4 | 1 variable with 4 DOFs |
ONE_5 | 1 variable with 5 DOFs |
ONE_6 | 1 variable with 6 DOFs (e.g., ChBody, ChParticle, ChNodeFEAxyzrot) |
TWO_33 | 2 variables, each with 3 DOFs (e.g., segments between 2 ChNodeFEAxyz nodes) |
TWO_66 | 2 variables, each with 6 DOFs (e.g., triangle between 2 ChNodeFEAxyzrot nodes) |
THREE_333 | 3 variables, each with 3 DOFs (e.g., triangle between 3 ChNodeFEAxyz nodes) |
THREE_666 | 3 variables, each with 6 DOFs (e.g., triangle between 3 ChNodeFEAxyzrot nodes) |
Member Function Documentation
◆ AddCollisionShape()
void chrono::ChContactable::AddCollisionShape | ( | std::shared_ptr< ChCollisionShape > | shape, |
const ChFrame<> & | frame = ChFrame<>() |
||
) |
Add a collision shape.
If this item does not have a collision model, one is created.
◆ ComputeJacobianForContactPart()
|
pure virtual |
Compute the Jacobian part(s) for this contactable item.
For example, if the contactable is a ChBody, this should update the corresponding 1x6 Jacobian. Required for NSC contact formulation.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ ComputeJacobianForRollingContactPart()
|
inlinevirtual |
Compute the rolling Jacobian part(s) for this contactable item.
Required for NSC contact formulation.
Reimplemented in chrono::ChParticle.
◆ ContactableIncrementState()
|
pure virtual |
Increment the provided state of this object by the given state-delta increment.
Compute: x_new = x + dw.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ ContactComputeQ()
|
pure virtual |
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 F and its application point are specified in the global frame, while the torque T is specified in the global frame too. 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. Required for SMC contact formulation.
- Parameters
-
F force T torque point application point state_x global state vector Q generalized force vector offset index offset
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ ContactForceLoadResidual_F()
|
pure virtual |
Apply the given force & torque at the given location and load into the global generalized force vector.
The force F and its application point are specified in the absolute reference frame, while the torque T is specified in the global frame too. Each object must update the entries in R corresponding to its variables. Required for SMC contact formulation.
- Parameters
-
F force T torque abs_point application point R global generalized force vector
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ CreateConstraintTuple()
|
pure virtual |
Create a constraint tuple with the appropriate number of variables for this contactable object.
Required for NSC contact formulation.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ GetCollisionModelFrame()
|
pure virtual |
Return the frame of the associated collision model relative to the contactable object.
ChCollisionModel might call this to get the position of the contact model (when rigid) and sync it.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactNodeXYZ, chrono::fea::ChContactSegmentXYZ, and chrono::ChParticle.
◆ GetContactableMass()
|
pure virtual |
Return the mass of the contactable object.
Required for SMC contact formulation.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::ChParticle, and chrono::fea::ChContactNodeXYZ.
◆ GetContactableType()
|
pure virtual |
Return the proper contactable Type.
Used for the collision dispatcher in ChContactContainer classes.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ GetContactPointSpeed()
|
pure virtual |
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.
Implemented in chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
◆ GetPhysicsItem()
|
pure virtual |
Return the contactable object as a ChPhysicsItem.
Provided only for backward compatibility. In newer code, the reference to a ChPhysicsItem should not be usedr.
Implemented in chrono::ChBody, chrono::fea::ChContactTriangleXYZRot, chrono::fea::ChContactSegmentXYZRot, chrono::fea::ChContactNodeXYZRot, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChContactSegmentXYZ, chrono::fea::ChContactNodeXYZ, and chrono::ChParticle.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono/physics/ChContactable.h
- /builds/uwsbel/chrono/src/chrono/physics/ChContactable.cpp