Simbody  3.6
SimTK::ContactSurface Class Reference

This class combines a piece of ContactGeometry with a ContactMaterial to make an object suitable for attaching to a body which can then engage in contact behavior with other contact surfaces. More...

Public Member Functions

 ContactSurface ()
 Create an empty ContactSurface. More...
 
 ContactSurface (const ContactGeometry &shape, const ContactMaterial &material, Real thickness=0)
 Create a ContactSurface with a given shape and material. More...
 
ContactSurfacesetShape (const ContactGeometry &shape)
 Define a new shape for this ContactSurface. More...
 
ContactSurfacesetMaterial (const ContactMaterial &material, Real thickness=0)
 Define a new material for this ContactSurface, optionally providing the thickness of this elastic material layer over a rigid substrate. More...
 
ContactSurfacesetThickness (Real thickness)
 Set the thickness of the layer of elastic material coating this contact surface. More...
 
const ContactGeometrygetShape () const
 Get read-only access to the shape of this contact surface. More...
 
const ContactMaterialgetMaterial () const
 Get read-only access to the material of this contact surface. More...
 
Real getThickness () const
 Get the thickness of the elastic material layer on this contact surface, with zero indicating that the thickness has not been set. More...
 
ContactGeometryupdShape ()
 Get writable access to the shape of this contact surface. More...
 
ContactMaterialupdMaterial ()
 Get writable access to the material of this contact surface. More...
 
ContactSurfacejoinClique (ContactCliqueId clique)
 Join a contact clique if not already a member. More...
 
void leaveClique (ContactCliqueId clique)
 Remove this surface from a contact clique if it is a member. More...
 
bool isInSameClique (const ContactSurface &other) const
 Determine whether this contact surface is a member of any of the same cliques as some other contact surface, in which case they will be invisible to one another. More...
 
const Array_< ContactCliqueId, short > & getCliques () const
 Return a reference to the list of CliqueIds of the cliques in which this contact surface is a member; the list is always sorted in ascending order. More...
 
ContactSurfacesetIndexOnBody (int index)
 For selection or other purposes, you may want to use this method to store an index that can identify this particular contact surface. More...
 
ContactSurfacesetUserRef (void *userRef)
 Use this method to store an arbitrary reference pointer with this ContactSurface object. More...
 
int getIndexOnBody () const
 Return the index that was supplied to the most recent setIndexOnBody() call for this ContactSurface object, or -1 if that method has not been called. More...
 
void * getUserRef () const
 Return the pointer value that was supplied to the most recent setUserRef() call for this ContactSurface object, or nullptr if that method has not been called. More...
 

Static Public Member Functions

static bool cliquesIntersect (const Array_< ContactCliqueId, short > &a, const Array_< ContactCliqueId, short > &b)
 Return true if there are any common cliques on two clique lists which must each be sorted in ascending order. More...
 
static ContactCliqueId createNewContactClique ()
 Create a new contact clique and return its unique integer id (thread safe). More...
 

Detailed Description

This class combines a piece of ContactGeometry with a ContactMaterial to make an object suitable for attaching to a body which can then engage in contact behavior with other contact surfaces.

The ContactMaterial may be considered as uniform throughout a large solid volume or as a thin layer of uniform material thickness h on top of a rigid substrate. Compliant contact models vary in how they deal with the thickness h: Hertz ignores it, Elastic Foundation uses it to define unit strain.

Typically any contact surface can bump into any other contact surface. However, some groups of surfaces can or should never interact; those groups are called "contact cliques". The set of surfaces that are mounted to the same rigid body always constitues a clique. In addition, other cliques may be defined and arbitrary surfaces made members so that they won't interact. This is commonly used for contact surfaces on adjacent bodies when those surfaces are near the joint between two bodies.

When a ContactSurface is added to a Body it is assigned a small integer index number, which is retained in the ContactSurface object. When the Body is used to create a MobilizedBody, the MobilizedBody gets its own unshared copy of the Body and that includes a copy of that Body's ContactSurface objects, each with its index intact. So the pair (MobilizedBody,index) uniquely identifies a particular ContactSurface. It is also possible to store an arbitary void* pointer with a ContactSurface that can be helpful in mapping back from observed contacts to the model objects that are contacting.

Constructor & Destructor Documentation

◆ ContactSurface() [1/2]

SimTK::ContactSurface::ContactSurface ( )
inline

Create an empty ContactSurface.

◆ ContactSurface() [2/2]

SimTK::ContactSurface::ContactSurface ( const ContactGeometry shape,
const ContactMaterial material,
Real  thickness = 0 
)
inline

Create a ContactSurface with a given shape and material.

Member Function Documentation

◆ setShape()

ContactSurface& SimTK::ContactSurface::setShape ( const ContactGeometry shape)
inline

Define a new shape for this ContactSurface.

◆ setMaterial()

ContactSurface& SimTK::ContactSurface::setMaterial ( const ContactMaterial material,
Real  thickness = 0 
)
inline

Define a new material for this ContactSurface, optionally providing the thickness of this elastic material layer over a rigid substrate.

◆ setThickness()

ContactSurface& SimTK::ContactSurface::setThickness ( Real  thickness)
inline

Set the thickness of the layer of elastic material coating this contact surface.

This is required by the Elastic Foundation Model but is ignored by the Hertz model. Elastic Foundation uses this value to define "unit strain", that is, an element deformed by 0.1*thickness has 10% strain.

◆ getShape()

const ContactGeometry& SimTK::ContactSurface::getShape ( ) const
inline

Get read-only access to the shape of this contact surface.

◆ getMaterial()

const ContactMaterial& SimTK::ContactSurface::getMaterial ( ) const
inline

Get read-only access to the material of this contact surface.

◆ getThickness()

Real SimTK::ContactSurface::getThickness ( ) const
inline

Get the thickness of the elastic material layer on this contact surface, with zero indicating that the thickness has not been set.

◆ updShape()

ContactGeometry& SimTK::ContactSurface::updShape ( )
inline

Get writable access to the shape of this contact surface.

◆ updMaterial()

ContactMaterial& SimTK::ContactSurface::updMaterial ( )
inline

Get writable access to the material of this contact surface.

◆ joinClique()

ContactSurface& SimTK::ContactSurface::joinClique ( ContactCliqueId  clique)
inline

Join a contact clique if not already a member.

It is OK to pass an invalid clique id here, in which case it will be quietly ignored.

◆ leaveClique()

void SimTK::ContactSurface::leaveClique ( ContactCliqueId  clique)
inline

Remove this surface from a contact clique if it is a member.

It is OK to pass an invalid clique id here, in which case it will be quietly ignored.

◆ isInSameClique()

bool SimTK::ContactSurface::isInSameClique ( const ContactSurface other) const
inline

Determine whether this contact surface is a member of any of the same cliques as some other contact surface, in which case they will be invisible to one another.

◆ getCliques()

const Array_<ContactCliqueId,short>& SimTK::ContactSurface::getCliques ( ) const
inline

Return a reference to the list of CliqueIds of the cliques in which this contact surface is a member; the list is always sorted in ascending order.

◆ cliquesIntersect()

static bool SimTK::ContactSurface::cliquesIntersect ( const Array_< ContactCliqueId, short > &  a,
const Array_< ContactCliqueId, short > &  b 
)
inlinestatic

Return true if there are any common cliques on two clique lists which must each be sorted in ascending order.

This takes no longer than O(a+b) where a and b are the sizes of the two clique lists.

◆ createNewContactClique()

static ContactCliqueId SimTK::ContactSurface::createNewContactClique ( )
inlinestatic

Create a new contact clique and return its unique integer id (thread safe).

Every contact surface is automatically a member of a clique containing all the surfaces that reside on the same body.

◆ setIndexOnBody()

ContactSurface& SimTK::ContactSurface::setIndexOnBody ( int  index)
inline

For selection or other purposes, you may want to use this method to store an index that can identify this particular contact surface.

The index is set automatically when you add a contact surface to a body. As an alternative, or addition, see setUserRef(). In any case the index is simply stored with the object and returned if you ask for it. If you don't set it the value is -1. The index is copied if you copy the ContactSurface object. Be sure to change it afterwards if that is not the correct index for the copy, or add it to a Body in which case it will be set automatically.

A reference to this just-modified ContactSurface is returned in the manner of an assignment operator.

◆ setUserRef()

ContactSurface& SimTK::ContactSurface::setUserRef ( void *  userRef)
inline

Use this method to store an arbitrary reference pointer with this ContactSurface object.

This can be useful for mapping a contacting surface back to some meaningful object in your model. If you don't set this pointer the value will be nullptr. This value is stored and returned only; no interpretation is done and the pointed-to object will not be deleted when the ContactSurface object is deleted.

Warning
The value of the userRef pointer is copied if you make a copy of the ContactSurface object. That is likely to be incorrect in many circumstances, depending on how you are using this value. Be sure to clear or change the pointer if necessary after you make a copy.

A reference to this just-modified ContactSurface is returned in the manner of an assignment operator.

◆ getIndexOnBody()

int SimTK::ContactSurface::getIndexOnBody ( ) const
inline

Return the index that was supplied to the most recent setIndexOnBody() call for this ContactSurface object, or -1 if that method has not been called.

Copy construction and copy assignment copy the index. This is set automatically when a ContactSurface is added to a Body.

◆ getUserRef()

void* SimTK::ContactSurface::getUserRef ( ) const
inline

Return the pointer value that was supplied to the most recent setUserRef() call for this ContactSurface object, or nullptr if that method has not been called.

Copy construction and copy assignment copy the pointer. Interpretation of this value is up to the caller.


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