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 chuncks 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 Member Functions

virtual bool IsContactActive ()=0
 Tell if 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 std::shared_ptr
< ChMaterialSurface > & 
GetMaterialSurfaceBase ()=0
 Return the pointer to the surface material. 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...
 

Member Function Documentation

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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

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 gloabl 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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.

virtual std::shared_ptr<ChMaterialSurface>& chrono::ChContactable::GetMaterialSurfaceBase ( )
pure virtual

Return the pointer to the surface material.

Use dynamic cast to understand if this is a ChMaterialSurfaceSMC, ChMaterialSurfaceNSC or others. This function returns a reference to the shared pointer member variable and is therefore THREAD SAFE.

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

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::ChBody, chrono::fea::ChContactTriangleXYZROT, chrono::fea::ChContactNodeXYZROT, chrono::fea::ChContactTriangleXYZ, chrono::fea::ChNodeMeshless, chrono::ChNodeSPH, chrono::fea::ChContactNodeXYZ, and chrono::ChAparticle.