chrono::ChContactable Class Referenceabstract

Description

Interface for objects that generate contacts One should inherit from ChContactable_1vars, ChContactable_2vars etc.

depending on the number of ChVariable objects contained in the object (i.e. the variable chunks to whom the contact point position depends, also the variables affected by contact force).

#include <ChContactable.h>

Inherited by chrono::ChContactable_1vars< 3 >, chrono::ChContactable_1vars< 6 >, chrono::ChContactable_3vars< 3, 3, 3 >, chrono::ChContactable_3vars< 6, 6, 6 >, chrono::ChContactable_1vars< T1 >, chrono::ChContactable_2vars< T1, T2 >, and chrono::ChContactable_3vars< T1, T2, T3 >.

Public Types

enum  eChContactableType {
  CONTACTABLE_UNKNOWN = 0, CONTACTABLE_6, CONTACTABLE_3, CONTACTABLE_333,
  CONTACTABLE_666
}
 Enum used for dispatcher optimization instead than rtti. More...
 

Public Member Functions

virtual bool IsContactActive ()=0
 Indicate whether or not the object must be considered in collision detection.
 
virtual int ContactableGet_ndof_x ()=0
 Get the number of DOFs affected by this object (position part).
 
virtual int ContactableGet_ndof_w ()=0
 Get the number of DOFs affected by this object (speed part).
 
virtual void ContactableGetStateBlock_x (ChState &x)=0
 Get all the DOFs packed in a single vector (position part).
 
virtual void ContactableGetStateBlock_w (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 ChVector GetContactPoint (const ChVector<> &loc_point, const ChState &state_x)=0
 Express the local point in absolute frame, for the given state position.
 
virtual ChVector GetContactPointSpeed (const ChVector<> &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 ChVector GetContactPointSpeed (const ChVector<> &abs_point)=0
 Get the absolute speed of point abs_point if attached to the surface.
 
virtual ChCoordsys GetCsysForCollisionModel ()=0
 Return the coordinate system for the associated collision model. More...
 
virtual void ContactForceLoadResidual_F (const ChVector<> &F, const ChVector<> &abs_point, ChVectorDynamic<> &R)=0
 Apply the given force at the given location and load into the global generalized force array. More...
 
virtual void ContactForceLoadQ (const ChVector<> &F, const ChVector<> &point, const ChState &state_x, ChVectorDynamic<> &Q, int offset)=0
 Apply the given force at the given point and load the generalized force array. More...
 
virtual double GetContactableMass ()=0
 This can be useful in some SMC code:
 
virtual ChPhysicsItemGetPhysicsItem ()=0
 This is only for backward compatibility. More...
 
virtual eChContactableType GetContactableType () const =0
 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)
 

Member Enumeration Documentation

◆ eChContactableType

Enum used for dispatcher optimization instead than rtti.

Enumerator
CONTACTABLE_UNKNOWN 

unknown contactable type

CONTACTABLE_6 

1 variable with 6 DOFs (e.g., ChBody, ChNodeFEAxyzrot)

CONTACTABLE_3 

1 variable with 3 DOFS (e.g., ChNodeFEAxyz, ChAparticle)

CONTACTABLE_333 

3 variables, each with 3 DOFs (e.g., triangle between 3 ChNodeFEAxyz nodes)

CONTACTABLE_666 

3 variables, each with 6 DOFs (e.g., triangle between 3 ChNodeFEAxyzrot nodes)

Member Function Documentation

◆ ContactableIncrementState()

virtual void chrono::ChContactable::ContactableIncrementState ( const ChState x,
const ChStateDelta dw,
ChState x_new 
)
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::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

◆ ContactForceLoadQ()

virtual void chrono::ChContactable::ContactForceLoadQ ( const ChVector<> &  F,
const ChVector<> &  point,
const ChState state_x,
ChVectorDynamic<> &  Q,
int  offset 
)
pure virtual

Apply the given force at the given point and load the generalized force array.

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.

Implemented in chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

◆ ContactForceLoadResidual_F()

virtual void chrono::ChContactable::ContactForceLoadResidual_F ( const ChVector<> &  F,
const ChVector<> &  abs_point,
ChVectorDynamic<> &  R 
)
pure virtual

Apply the given force at the given location and load into the global generalized force array.

The force and its application point are given in the absolute reference frame. Each object must update the entries in R corresponding to its variables. Force for example could come from a penalty model.

Implemented in chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

◆ GetContactPointSpeed()

virtual ChVector chrono::ChContactable::GetContactPointSpeed ( const ChVector<> &  loc_point,
const ChState state_x,
const ChStateDelta state_w 
)
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::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

◆ GetCsysForCollisionModel()

virtual ChCoordsys chrono::ChContactable::GetCsysForCollisionModel ( )
pure virtual

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.

Implemented in chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

◆ GetPhysicsItem()

virtual ChPhysicsItem* chrono::ChContactable::GetPhysicsItem ( )
pure virtual

This is only for backward compatibility.

Note that in recent code the reference to the ChPhysicsItem should disappear. The ChPhysicsItem could be the ChContactable itself (ex. see the ChBody) or a container (ex. the ChMEsh, for ChContactTriangle)

Implemented in chrono::fea::ChContactTriangleXYZROT, chrono::ChBody, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.


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