CompliantContactSubsystem Class Reference

This is a force subsystem that implements a compliant contact model to respond to Contact objects as detected by a ContactTrackerSubsystem. More...

#include <CompliantContactSubsystem.h>

Inheritance diagram for CompliantContactSubsystem:
ForceSubsystem Subsystem

List of all members.

Public Member Functions

 CompliantContactSubsystem ()
 Default constructor creates an empty handle.
 CompliantContactSubsystem (MultibodySystem &, const ContactTrackerSubsystem &)
 Add a new CompliantContactSubsystem to the indicated MultibodySystem, specifying the ContactTrackerSubsystem that we will use to obtain the list of ActiveContacts from which we will generate compliant forces.
Real getTransitionVelocity () const
 Get the transition velocity (vt) of the friction model.
void setTransitionVelocity (Real vt)
 Set the transition velocity (vt) of the friction model.
Real getOOTransitionVelocity () const
 Get a precalculated 1/vt to avoid expensive runtime divisions.
int getNumContactForces (const State &state) const
 Determine how many of the reported Contacts are currently generating contact forces.
const ContactForcegetContactForce (const State &state, int n) const
 For each active Contact, get a reference to the most recently calculated force there; the ContactId that produced this force is returned also.
Real getDissipatedEnergy (const State &state) const
 Obtain the total amount of energy dissipated by all the contact responses that were generated by this subsystem since some arbitrary starting point.
void setDissipatedEnergy (State &state, Real energy) const
 Set the accumulated dissipated energy to an arbitrary value.
void calcContactPatchDetails (const State &state, Array_< ContactPatch > &patches) const
 Calculate detailed information about the current set of active contact patches, including deformed geometric information, pressure and friction force distribution, and resultant forces and moments.
void adoptForceGenerator (ContactForceGenerator *generator)
 Attach a new generator to this subsystem as the responder to be used when we see the kind of Contact type for which this generator is defined, replacing the previous generator for this Contact type if there was one.
void adoptDefaultForceGenerator (ContactForceGenerator *generator)
 Attach a new generator to this subsystem as the responder to be used when we see a Contact type for which no suitable generator has been defined, replacing the previous default generator type if there was one.
bool hasForceGenerator (ContactTypeId contact) const
 Return true if this subsystem has a force generator registered that can respond to this kind of Contact.
bool hasDefaultForceGenerator () const
 Return true if this subsystem has a force generator registered that can be used for response to an unrecognized type of Contact (typically this will be a "do nothing" or "throw an error" generator.
const ContactForceGeneratorgetContactForceGenerator (ContactTypeId contact) const
 Return the force generator to be used for a Contact of the indicated type.
const ContactForceGeneratorgetDefaultForceGenerator () const
 Return the force generator to be used for a Contact type for which no suitable force generator has been registered.
const ContactTrackerSubsystemgetContactTrackerSubsystem () const
 Get a read-only reference to the ContactTrackerSubsystem associated with this CompliantContactSubsystem.
const MultibodySystemgetMultibodySystem () const
 Every Subsystem is owned by a System; a CompliantContactSubsystem expects to be owned by a MultibodySystem.

Detailed Description

This is a force subsystem that implements a compliant contact model to respond to Contact objects as detected by a ContactTrackerSubsystem.

The subsystem contains an extendable collection of ContactForceGenerator objects, one per type of Contact. For example, a point contact would be handled by a different force generator than would a mesh contact.


Constructor & Destructor Documentation

CompliantContactSubsystem (  )  [inline]

Default constructor creates an empty handle.

Add a new CompliantContactSubsystem to the indicated MultibodySystem, specifying the ContactTrackerSubsystem that we will use to obtain the list of ActiveContacts from which we will generate compliant forces.

The MultibodySystem takes over ownership of the new subsystem object, but the handle we construct here retains a reference to it.


Member Function Documentation

void adoptDefaultForceGenerator ( ContactForceGenerator generator  ) 

Attach a new generator to this subsystem as the responder to be used when we see a Contact type for which no suitable generator has been defined, replacing the previous default generator type if there was one.

The subsystem takes over ownership of the generator; don't delete it yourself.

void adoptForceGenerator ( ContactForceGenerator generator  ) 

Attach a new generator to this subsystem as the responder to be used when we see the kind of Contact type for which this generator is defined, replacing the previous generator for this Contact type if there was one.

The subsystem takes over ownership of the generator; don't delete it yourself.

void calcContactPatchDetails ( const State state,
Array_< ContactPatch > &  patches 
) const

Calculate detailed information about the current set of active contact patches, including deformed geometric information, pressure and friction force distribution, and resultant forces and moments.

This detailed information is only calculated when requested because it may be expensive for some ContactForceGenerators; for simulation purposes only the resultants are needed. The input to this calculation is the current set of ActiveContacts as obtained for this State from the associated ContactTrackerSubsystem. You can call this at Velocity stage or higher. Each contact patch is the result of a single Contact, but not all active Contacts will produce patches.

const ContactForce& getContactForce ( const State state,
int  n 
) const

For each active Contact, get a reference to the most recently calculated force there; the ContactId that produced this force is returned also.

You can call this at Velocity stage or later; the contact forces will be realized first if necessary.

const ContactForceGenerator& getContactForceGenerator ( ContactTypeId  contact  )  const

Return the force generator to be used for a Contact of the indicated type.

If no generator was registered for this type of contact, this will be the default generator.

const ContactTrackerSubsystem& getContactTrackerSubsystem (  )  const

Get a read-only reference to the ContactTrackerSubsystem associated with this CompliantContactSubsystem.

This is the contact tracker that is maintaining the list of contacts for which this subsystem will be providing the response forces.

const ContactForceGenerator& getDefaultForceGenerator (  )  const

Return the force generator to be used for a Contact type for which no suitable force generator has been registered.

Real getDissipatedEnergy ( const State state  )  const

Obtain the total amount of energy dissipated by all the contact responses that were generated by this subsystem since some arbitrary starting point.

This is the time integral of all the power dissipated during any of the contacts by material dissipative and friction forces. For a system whose only non-conservative forces are contacts, the sum of potential, kinetic, and dissipated energies should be conserved with an exception noted below. This is particularly useful for debugging new ContactForceGenerators. This is a State variable so you can obtain its value any time after it is allocated.

Precondition:
state realized to Stage::Model
Parameters:
[in] state The State from which to obtain the current value of the dissipated energy.
Returns:
The total dissipated energy (a nonnegative scalar).
Note:
The Hunt and Crossley dissipation model used by many contact force generators can occasionally detect that a body is being "yanked" out of a contact (this is more likely with very large dissipation coefficients). To track all the energy in that case we would have to allow the surfaces to stick together, which is unreasonable. Instead, some of the energy will be lost to unmodeled effects because the surface is unable to transfer energy back to the bodies and will instead vibrate or ring until the energy is dissipated.
const MultibodySystem& getMultibodySystem (  )  const

Every Subsystem is owned by a System; a CompliantContactSubsystem expects to be owned by a MultibodySystem.

This method returns a const reference to the containing MultibodySystem and will throw an exception if there is no containing System or it is not a MultibodySystem.

int getNumContactForces ( const State state  )  const

Determine how many of the reported Contacts are currently generating contact forces.

You can call this at Velocity stage or later; the contact forces will be realized first if necessary before we report how many there are.

Real getOOTransitionVelocity (  )  const

Get a precalculated 1/vt to avoid expensive runtime divisions.

Real getTransitionVelocity (  )  const

Get the transition velocity (vt) of the friction model.

bool hasDefaultForceGenerator (  )  const

Return true if this subsystem has a force generator registered that can be used for response to an unrecognized type of Contact (typically this will be a "do nothing" or "throw an error" generator.

bool hasForceGenerator ( ContactTypeId  contact  )  const

Return true if this subsystem has a force generator registered that can respond to this kind of Contact.

void setDissipatedEnergy ( State state,
Real  energy 
) const

Set the accumulated dissipated energy to an arbitrary value.

Typically this is used only to reset the dissipated energy to zero, but non-zero values can be useful if you are trying to match some existing data or continuing a simulation. This is a State variable so you can set its value any time after it is allocated.

Precondition:
state realized to Stage::Model
Parameters:
[in,out] state The State whose dissipated energy variable for this subsystem is to be modified.
[in] energy The new value for the accumulated dissipated energy (must be a nonnegative scalar).
void setTransitionVelocity ( Real  vt  ) 

Set the transition velocity (vt) of the friction model.


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

Generated on Thu Aug 12 16:37:58 2010 for SimTKcore by  doxygen 1.6.1