Simbody
3.3
|
This class implements an elastic foundation or "bed of springs" contact model. More...
#include <ElasticFoundationForce.h>
Public Member Functions | |
ElasticFoundationForce (GeneralForceSubsystem &forces, GeneralContactSubsystem &contacts, ContactSetIndex contactSet) | |
Create an elastic foundation contact model. More... | |
void | setBodyParameters (ContactSurfaceIndex surfIndex, Real stiffness, Real dissipation, Real staticFriction, Real dynamicFriction, Real viscousFriction) |
Set the material parameters for a surface in the contact set, which must be a ContactGeometry::TriangleMesh. More... | |
Real | getTransitionVelocity () const |
Get the transition velocity (vt) of the friction model. More... | |
void | setTransitionVelocity (Real v) |
Set the transition velocity (vt) of the friction model. More... | |
SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS (ElasticFoundationForce, ElasticFoundationForceImpl, Force) | |
Public Member Functions inherited from SimTK::Force | |
void | disable (State &) const |
Disable this force element, effectively removing it from the System for computational purposes (it is still using its ForceIndex, however). More... | |
void | enable (State &) const |
Enable this force element if it was previously disabled. More... | |
bool | isDisabled (const State &) const |
Test whether this force element is currently disabled in the supplied State. More... | |
void | setDisabledByDefault (bool shouldBeDisabled) |
Normally force elements are enabled when defined and can be disabled later. More... | |
bool | isDisabledByDefault () const |
Test whether this force element is disabled by default in which case it must be explicitly enabled before it will take effect. More... | |
void | calcForceContribution (const State &state, Vector_< SpatialVec > &bodyForces, Vector_< Vec3 > &particleForces, Vector &mobilityForces) const |
Calculate the force that would be applied by this force element if the given state were realized to Dynamics stage. More... | |
Real | calcPotentialEnergyContribution (const State &state) const |
Calculate the potential energy contribution that is made by this force element at the given state. More... | |
Force () | |
Default constructor for Force handle base class does nothing. More... | |
operator ForceIndex () const | |
Implicit conversion to ForceIndex when needed. More... | |
const GeneralForceSubsystem & | getForceSubsystem () const |
Get the GeneralForceSubsystem of which this Force is an element. More... | |
ForceIndex | getForceIndex () const |
Get the index of this force element within its parent force subsystem. More... | |
Public Member Functions inherited from SimTK::PIMPLHandle< Force, ForceImpl, true > | |
bool | isEmptyHandle () const |
Returns true if this handle is empty, that is, does not refer to any implementation object. More... | |
bool | isOwnerHandle () const |
Returns true if this handle is the owner of the implementation object to which it refers. More... | |
bool | isSameHandle (const Force &other) const |
Determine whether the supplied handle is the same object as "this" PIMPLHandle. More... | |
void | disown (Force &newOwner) |
Give up ownership of the implementation to an empty handle. More... | |
PIMPLHandle & | referenceAssign (const Force &source) |
"Copy" assignment but with shallow (pointer) semantics. More... | |
PIMPLHandle & | copyAssign (const Force &source) |
This is real copy assignment, with ordinary C++ object ("value") semantics. More... | |
void | clearHandle () |
Make this an empty handle, deleting the implementation object if this handle is the owner of it. More... | |
const ForceImpl & | getImpl () const |
Get a const reference to the implementation associated with this Handle. More... | |
ForceImpl & | updImpl () |
Get a writable reference to the implementation associated with this Handle. More... | |
int | getImplHandleCount () const |
Return the number of handles the implementation believes are referencing it. More... | |
Additional Inherited Members | |
Public Types inherited from SimTK::PIMPLHandle< Force, ForceImpl, true > | |
typedef PIMPLHandle< Force, ForceImpl, PTR > | HandleBase |
typedef HandleBase | ParentHandle |
Protected Member Functions inherited from SimTK::Force | |
Force (ForceImpl *r) | |
Use this in a derived Force handle class constructor to supply the concrete implementation object to be stored in the handle base. More... | |
Protected Member Functions inherited from SimTK::PIMPLHandle< Force, ForceImpl, true > | |
PIMPLHandle () | |
The default constructor makes this an empty handle. More... | |
PIMPLHandle (ForceImpl *p) | |
This provides consruction of a handle referencing an existing implementation object. More... | |
PIMPLHandle (const PIMPLHandle &source) | |
The copy constructor makes either a deep (value) or shallow (reference) copy of the supplied source PIMPL object, based on whether this is a "pointer
semantics" (PTR=true) or "object (value) semantics" (PTR=false, default) class. More... | |
~PIMPLHandle () | |
Note that the destructor is non-virtual. More... | |
PIMPLHandle & | operator= (const PIMPLHandle &source) |
Copy assignment makes the current handle either a deep (value) or shallow (reference) copy of the supplied source PIMPL object, based on whether this is a "pointer sematics" (PTR=true) or "object (value) semantics" (PTR=false, default) class. More... | |
void | setImpl (ForceImpl *p) |
Set the implementation for this empty handle. More... | |
bool | hasSameImplementation (const Force &other) const |
Determine whether the supplied handle is a reference to the same implementation object as is referenced by "this" PIMPLHandle. More... | |
This class implements an elastic foundation or "bed of springs" contact model.
It places springs over the surface of a triangle mesh, each of which independently interacts with objects in contact with the mesh. The interaction includes components for the normal restoring force, dissipation in the material, and surface friction. This force is only applied to contacts involving a triangle mesh, though the object colliding with the mesh may be of any type. Contacts which do not involve a triangle mesh are ignored.
This class relies on a GeneralContactSubsystem to identify contacts, then applies forces to all contacts in a single contact set. To use it, do the following:
A spring is placed at the center of each face of each triangle mesh. When a mesh collides with any other object, the other object is considered to be rigid and the displacement of each spring is calculated independently. A spring is considered to be displaced if its base location is inside the other object, and the contact point is taken to be the nearest point on that object's surface. When two meshes collide, the springs on each mesh are treated independently: each mesh is assumed to be rigid for purposes of calculating the force exerted by the other mesh's springs.
The force exerted by each spring along its displacement direction is given by
f = k*a*x*(1+c*v)
where k is the spring stiffness, a is the area of the face the spring belongs to, x is the displacement distance, c is the spring's dissipation coefficient, and v=dx/dt. If the springs are assumed to represent a uniform layer of elastic material over a rigid substrate, the stiffness is given by
k = (1-p)*E/((1+p)(1-2p)*h)
where E is the Young's modulus of the elastic layer, p is its Poisson's ratio, and h is its thickness.
The friction force exerted by each spring is based on a model by Michael Hollars:
f = fn*[min(vs/vt,1)*(ud+2(us-ud)/(1+(vs/vt)^2))+uv*vs]
where fn is the normal force at the contact point, vs is the slip (tangential) velocity of the two bodies at the contact point, vt is a transition velocity (see below), and us, ud, and uv are the coefficients of static, dynamic, and viscous friction respectively.
Because the friction force is a continuous function of the slip velocity, this model cannot represent stiction; as long as a tangential force is applied, the two bodies will move relative to each other. There will always be a nonzero drift, no matter how small the force is. The transition velocity vt acts as an upper limit on the drift velocity. By setting vt to a sufficiently small value, the drift velocity can be made arbitrarily small, at the cost of making the equations of motion very stiff. The default value of vt is 0.01.
SimTK::ElasticFoundationForce::ElasticFoundationForce | ( | GeneralForceSubsystem & | forces, |
GeneralContactSubsystem & | contacts, | ||
ContactSetIndex | contactSet | ||
) |
Create an elastic foundation contact model.
forces | the subsystem which will own this ElasticFoundationForce element |
contacts | the subsystem to which this contact model should be applied |
contactSet | the index of the contact set to which this contact model will be applied |
void SimTK::ElasticFoundationForce::setBodyParameters | ( | ContactSurfaceIndex | surfIndex, |
Real | stiffness, | ||
Real | dissipation, | ||
Real | staticFriction, | ||
Real | dynamicFriction, | ||
Real | viscousFriction | ||
) |
Set the material parameters for a surface in the contact set, which must be a ContactGeometry::TriangleMesh.
surfIndex | the index of the surface within the contact set |
stiffness | the stiffness constant (k) for the body |
dissipation | the dissipation coefficient (c) for the body |
staticFriction | the coefficient of static friction (us) for the body |
dynamicFriction | the coefficient of dynamic friction (ud) for the body |
viscousFriction | the coefficient of viscous friction (uv) for the body |
Real SimTK::ElasticFoundationForce::getTransitionVelocity | ( | ) | const |
Get the transition velocity (vt) of the friction model.
void SimTK::ElasticFoundationForce::setTransitionVelocity | ( | Real | v | ) |
Set the transition velocity (vt) of the friction model.
SimTK::ElasticFoundationForce::SimTK_INSERT_DERIVED_HANDLE_DECLARATIONS | ( | ElasticFoundationForce | , |
ElasticFoundationForceImpl | , | ||
Force | |||
) |