Simbody  3.6
SimTK::ContactForce Class Reference

This is a simple class containing the basic force information for a single contact between deformable surfaces S1 and S2 mounted on rigid bodies B1 and B2. More...

Public Member Functions

 ContactForce ()
 Default constructor has invalid contact id, other fields garbage. More...
 
 ContactForce (ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)
 Construct with values for all fields. More...
 
ContactId getContactId () const
 Return the ContactId of the Contact that generated this ContactForce. More...
 
const Vec3getContactPoint () const
 This is the point at which this contact element applies equal and opposite forces to the two bodies, chosen as the center of pressure for composite contact patches. More...
 
const SpatialVecgetForceOnSurface2 () const
 Get the total spatial force applied to body 2 at the contact point (that is, a force and a moment); negate this to find the force applied to body 1 at the same point. More...
 
Real getPotentialEnergy () const
 Get the amount of potential energy currently stored in the deformation of this contact patch. More...
 
Real getPowerDissipation () const
 Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this contact patch (this is a signed value with positive indicating dissipation). More...
 
void setTo (ContactId id, const Vec3 &contactPt, const SpatialVec &forceOnSurface2, Real potentialEnergy, Real powerLoss)
 Replace the current contents of this ContactForce object with the given arguments. More...
 
void setContactId (ContactId id)
 Change the ContactId contained in this ContactForce object. More...
 
void setContactPoint (const Vec3 &contactPt)
 Change the contact point contained in this ContactForce object. More...
 
void setForceOnSurface2 (const SpatialVec &forceOnSurface2)
 Change the value stored in this ContactForce object for the spatial force being applied on surface 2. More...
 
void setPotentialEnergy (Real potentialEnergy)
 Change the value stored for potential energy in this ContactForce object. More...
 
void setPowerDissipation (Real powerLoss)
 Change the value stored for power loss in this ContactForce object. More...
 
void clear ()
 Restore the ContactForce object to its default-constructed state with an invalid contact id and garbage for the other fields. More...
 
bool isValid () const
 Return true if this contact force contains a valid ContactId. More...
 
void changeFrameInPlace (const Transform &X_BA)
 This object is currently in an assumed frame A; given a transform from another frame B to A we'll re-measure and re-express this in B. More...
 

Detailed Description

This is a simple class containing the basic force information for a single contact between deformable surfaces S1 and S2 mounted on rigid bodies B1 and B2.

Every contact interaction between two rigid bodies, however complex, can be expressed as a resultant that can be contained in this class and is sufficient for advancing a simulation. Optionally, you may be able to get more details about the deformed geometry and pressure distribution over the patch but you have to ask for that separately because it can be expensive to calculate or report.

The information stored here is:

  • A point in space at which equal and opposite forces will be applied to corresponding stations of the two interacting rigid bodies. This is called the "contact point".
  • The force vector to be applied there (to each body with opposite sign).
  • A moment vector to be applied to both bodies (with opposite signs).
  • The potential energy currently stored by the elasticity of the contacting materials.
  • The instantaneous power dissipation due to inelastic behavior such as friction and internal material damping.

Points and vectors are measured and expressed in some assumed but unspecified frame A, which might for example be the frame of one of the two surfaces, or one of the two bodies, or Ground. Whenever a method returns a ContactForce object it must document what frame is being used; typically that will be Ground for end user use.

Definition of center of pressure

When the contact patch itself involves many distributed contact points, the center of pressure might not be a particularly meaningful quantity but serves to provide enough information to proceed with a simulation, and to display resultant contact forces, without requiring detailed patch geometry information. We define the location r_c of the center of pressure like this:

           sum_i (r_i * |r_i X Fn_i|) 
     r_c = --------------------------
              sum_i |r_i X Fn_i|

where r_i is the vector locating contact point i, F_i=Fn_i+Ft_i is the contact force at point i resolved into locally-normal and locally-tangential components, and M_i is a pure moment if any generated by the contact force model as a result of the i'th contact point. Note that the locally- tangent contact force Ft_i (presumably from friction) and pure moment M_i do not contribute to the center of pressure calculation; we're choosing the point that minimizes the net moment generated by normal ("pressure") forces only. Note that the normal force Fn_i includes both stiffness and dissipation contributions, so the center of pressure can be velocity-dependent.

Constructor & Destructor Documentation

◆ ContactForce() [1/2]

SimTK::ContactForce::ContactForce ( )
inline

Default constructor has invalid contact id, other fields garbage.

◆ ContactForce() [2/2]

SimTK::ContactForce::ContactForce ( ContactId  id,
const Vec3 contactPt,
const SpatialVec forceOnSurface2,
Real  potentialEnergy,
Real  powerLoss 
)
inline

Construct with values for all fields.

Contact point and force must be in the same but unspecified frame (typically Ground), and force and moment must be as applied at the contact point; we can't check so don't mess up.

Member Function Documentation

◆ getContactId()

ContactId SimTK::ContactForce::getContactId ( ) const
inline

Return the ContactId of the Contact that generated this ContactForce.

◆ getContactPoint()

const Vec3& SimTK::ContactForce::getContactPoint ( ) const
inline

This is the point at which this contact element applies equal and opposite forces to the two bodies, chosen as the center of pressure for composite contact patches.

◆ getForceOnSurface2()

const SpatialVec& SimTK::ContactForce::getForceOnSurface2 ( ) const
inline

Get the total spatial force applied to body 2 at the contact point (that is, a force and a moment); negate this to find the force applied to body 1 at the same point.

◆ getPotentialEnergy()

Real SimTK::ContactForce::getPotentialEnergy ( ) const
inline

Get the amount of potential energy currently stored in the deformation of this contact patch.

◆ getPowerDissipation()

Real SimTK::ContactForce::getPowerDissipation ( ) const
inline

Get the energy dissipation rate (power loss) due to the deformation rate and friction losses for this contact patch (this is a signed value with positive indicating dissipation).

◆ setTo()

void SimTK::ContactForce::setTo ( ContactId  id,
const Vec3 contactPt,
const SpatialVec forceOnSurface2,
Real  potentialEnergy,
Real  powerLoss 
)
inline

Replace the current contents of this ContactForce object with the given arguments.

This provides values for all fields. Contact point and force must be in the same but unspecified frame (typically Ground), and force and moment must be as applied at the contact point; we can't check so don't mess up.

◆ setContactId()

void SimTK::ContactForce::setContactId ( ContactId  id)
inline

Change the ContactId contained in this ContactForce object.

◆ setContactPoint()

void SimTK::ContactForce::setContactPoint ( const Vec3 contactPt)
inline

Change the contact point contained in this ContactForce object.

◆ setForceOnSurface2()

void SimTK::ContactForce::setForceOnSurface2 ( const SpatialVec forceOnSurface2)
inline

Change the value stored in this ContactForce object for the spatial force being applied on surface 2.

◆ setPotentialEnergy()

void SimTK::ContactForce::setPotentialEnergy ( Real  potentialEnergy)
inline

Change the value stored for potential energy in this ContactForce object.

◆ setPowerDissipation()

void SimTK::ContactForce::setPowerDissipation ( Real  powerLoss)
inline

Change the value stored for power loss in this ContactForce object.

◆ clear()

void SimTK::ContactForce::clear ( )
inline

Restore the ContactForce object to its default-constructed state with an invalid contact id and garbage for the other fields.

◆ isValid()

bool SimTK::ContactForce::isValid ( ) const
inline

Return true if this contact force contains a valid ContactId.

◆ changeFrameInPlace()

void SimTK::ContactForce::changeFrameInPlace ( const Transform X_BA)
inline

This object is currently in an assumed frame A; given a transform from another frame B to A we'll re-measure and re-express this in B.

Cost is 48 flops. Note that this doesn't change the moment because we're not moving the force application point physically; just remeasuring it from B.


The documentation for this class was generated from the following file: