Contact regularization is a technique in which contact constraints are made “soft” by adding compliance and damping. This means that they no longer remove DOFs from the system, and so overconstraining cannot occur, but contact penetration is no longer strictly enforced and there may be an increase in the computation time required for the simulation.
Compliant contact is a simple form of regularization that is analogous
to that used for joints and connectors, discussed in Section
3.4.9. Compliance and damping parameters
and
can be specified between any two collidables, with
being the
inverse of a corresponding contact stiffness
, such the
contact forces
acting along each contact normal are given by
| (8.1) |
where
is the contact penetration distance and is negative
when penetration occurs. Contact forces act to push the contacting
bodies apart, so if body A is penetrating body B and the contact
normal
is directed toward A, the forces acting on A and B
at the contact point will be
and
, respectively.
Since
is the inverse of the contact stiffness
, a value of
(the default) implies “infinitely” stiff contact
constraints. Compliance is enabled whenever the compliance is set
to a value greater than 0, with stiffness decreasing as compliance
increases.
Compliance can offer a couple of advantages over and above solving the problem of contact redundancy:
smoother contact behaviour. The inherent “springiness” created by compliance can reduce contact bouncing and noise (although this may require some parameter tuning).
faster computation. Compliance incorporates position correction directly into its behavior, which removes the need for the extra solve required by a position stabilization step (Section 4.1.3).
One consequence of compliant contact is that it results in persistent penetration over the contact area, with a depth that is (roughly) inversely proportional to the stiffness . With a high enough stiffness, this penetration can usually be made acceptable. (The persistent penetration is also what helps stabilize the contact.)
There are several ways to set up compliant contact. One is to use a contact force behavior, such as area compliant contact (Section 8.7.3) or elastic foundation contact (Section 8.7.4), both of which compute the compliance and damping terms on the fly in service of specified material properties. The other way is to set the compliance and damping terms directly, as discussed in the remainder of this section.
For many applications, particularly those involving FE contact, we recommend using area compliant contact (Section 8.7.3), as it exhibits good performance and usually requires specifying only one parameter (stiffness per unit area
), with the damping parameter being determined automatically.
Compliance can be enabled directly by setting the compliance and damping properties of either the collision manager or the
CollisionBehavior for a specific
collision pair; these properties correspond to
and
in
(8.1). While it is not required to set the damping property,
it is usually desirable to set it to a value that approximates critical damping
in order to prevent “bouncing” contact behavior. Compliance and damping can
be set in the GUI by editing the properties of either the collision manager or
a specific collision behavior, or set in code using the accessor methods
as is illustrated by the following code fragments:
An important question is what values to choose for compliance and
damping. At present, there is no automatic way to determine these, and
so some experimental parameter tuning is often necessary. With regard
to the contact stiffness
, appropriate values will depend on the
desired maximum penetration depth and other loadings acting on the
body. The mass of the collidable bodies may also be relevant if one
wants to control how fast the contact stabilizes. (The mass of every
CollidableBody can be
determined by its getMass() method.) Since
acts on a
per-contact basis, the resulting total force will increase with the
number of contacts. Once
is determined, the compliance value
is simply the inverse:
.
Given
, the damping
can then be estimated based on the desired
damping ratio
, using the formula
| (8.2) |
where
is the combined mass of the collidable bodies (or the mass
of one body if the other is non-dynamic). Typically, the desired
damping will be close to critical damping, for which
.
An example that allows a user to play with contact regularization is given in Section 8.5.1.
When regularizing contact through compliance, as described in
Section 8.6, the forces
at each
contact are explicitly determined as per (8.1). As
a broader alternative to this, ArtiSynth allows applications to
specify a contact force behavior,
which allows
to be computed as a more generalized function of
:
| (8.3) |
where
and
are functions returning the elastic force and
the damping coefficient. The corresponding compliance is then a local
function of
given by
(which is the inverse of the
local stiffness).
Because
is negative during contact,
should also be negative.
, on the other hand, should be positive, so that the damping acts to reduce
.
Contact force behaviors are implemented as subclasses of the abstract class ContactForceBehavior. To enable them, the application sets the forceBehavior property of the CollisionBehavior controlling the contact interaction, using the method
A ContactForceBehavior must implement the method computeResponse() to compute the contact force, compliance, damping and (optionally) step damping at each contact:
The arguments to this method supply specific information about the contact (see Figure 8.17):
An array of length four that returns the contact force, compliance,
damping and step damping in its first, second, third and fourth
entries. Entries that are not set default to 0. The contact force is
the
shown in (8.3), the compliance
is
, and the damping is
. The step damping is an
optional dimensionless factor
that sets a minimum damping
proportional to the simulation step size
, so that the damping
actually applied is
| (8.4) |
This allows the damping time constant (the damping divided by the
stiffness) to be kept at or above
, which is required for stable
compliant contact (Section 8.7.3.2),
without the behavior needing to know
.
The penetration distance
(the value of which is negative).
ContactPoint objects containing information about the two points associated with the contact (Figure 8.17), including each point’s position (returned by getPoint()) and associated vertices and weights (returned by numVertices(), getVertices(), and getWeights()).
The contact normal
.
Area associated with the contact. For vertex penetration contact (Section 8.4.1.2), this is 1/3 of the area of each face surrounding the penetrating vertex, projected onto the plane perpendicular to the contact normal. For edge-edge contacts, it is likewise 1/3 of the area of each face adjacent to the penetrating edge. For contour region contact, it is the area of the contact region divided by the number of contact points. For two-way vertex penetration contact (Section 8.4.1.2), in which penetrations are computed for both colliding surfaces, the area of each vertex contact is halved, since the vertices of both surfaces then cover the same contact region.
Not currently used.
A collision force behavior may use its computeResponse() method
to calculate the force, compliance and damping in any desired way. As
per equation (8.3), these quantities are
functions of the penetration distance
, supplied by the argument
dist.
A very simple instance of ContactForceBehavior that just recreates the contact compliance of (8.1) is shown below:
This example uses only the penetration distance information supplied by dist, dividing it by the compliance to determine the contact force. Since dist is negative when the collidables are interpenetrating, the returned contact force will also be negative.
Often, such as when implementing elastic foundation contact
(Section 8.7.4), the contact force
behavior is expressed in terms of pressure, given as a
function of
:
| (8.5) |
In that case, the contact force
is determined by multiplying
by the local area
associated with the contact:
| (8.6) |
Since
and
are both assumed to be negative during contact, we will assume here that
is negative as well.
Within the computeResponse() method, the area
is given by the
contactArea argument. If the above example of computeResponse() is modified so that the stiffness parameter
controls pressure instead of force, then we obtain the following:
Because contactArea is halved for two-way vertex penetration contact, forces computed this way do not need further adjustment when penetrations are computed for both colliding surfaces.
ArtiSynth supplies a built-in contact force behavior, AreaCompliantContact, that implements linear compliant contact in which the stiffness and damping of each contact are proportional to the area associated with it. AreaCompliantContact is intended to provide a fast and easy way to regularize and smooth contact behavior, particularly for the vertex-based contact associated with FE models,
The contact force is given by
| (8.7) |
where
is the (negative) penetration distance,
is the area
associated with the contact (as supplied by the contactArea
argument of computeResponse(); see Section
8.7.2),
is a stiffness per unit area
(with units of force/length
),
is the simulation step size,
is a dimensionless step damping factor, and
is
a stiffness damping time constant. Because the stiffness is specified per unit area rather than per
contact, the contact pressure produced by a given penetration does not
depend on the resolution of the colliding meshes.
Like elastic foundation contact (Section 8.7.4), area compliant contact is intended for use with vertex penetration contact (Section 8.4.1). For deformable bodies, it is particularly useful for regularizing contact (Section 8.7): rigid vertex contact with finely meshed FEM models is often overconstrained, which can result in noisy and unevenly distributed contact pressures, and making the contact compliant removes this problem.
AreaCompliantContact exports the following properties:
The following code fragment shows how area compliant contact might be
set up between an FEM model fem representing a thin layer and a
rigid body body, with
chosen as described below and the
damping properties left at their default values:
Adding contact compliance is roughly equivalent to placing a layer of
springs between the contacting surfaces. With AreaCompliantContact,
the resulting penetration
at each contact point is
where
is the contact pressure. If the maximum contact pressure
and a maximum allowable penetration
are known, one can simply choose
| (8.8) |
More often, these quantities are not known in advance, and it is easier to
choose
so that the contact is much stiffer than the deformable
bodies themselves. This can be done in three steps:
Estimate an effective thickness
for each deformable body.
This is the depth over which the
contact stress stays concentrated over the contact patch, such that
(assuming linear elasticity with Poisson’s ratio
) the deformation
along the contact direction under a contact pressure
is
approximately
may equal the true thickness
of the body along the contact
direction, but is often smaller, as described below.
Compute the stiffness per unit area of each body,
, where
is its Young’s modulus. If there are two deformable bodies, with Young’s
moduli
and
and effective thicknesses
and
,
combine them like springs in series to obtain a single body stiffness
For a single deformable body in contact with a rigid one,
.
Set
| (8.9) |
where
is a dimensionless stiffness ratio, with values between
10 and 50 usually being a good choice.
The ratio
is approximately the ratio of the deformation of the
bodies to the penetration
. It should be large enough that
is small relative to the body deformation, but not so large that
the possible noise associated with non-compliant contact (Section
8.7) is introduced. Since
can vary
over a fairly wide range,
only needs to be estimated roughly. In
particular, when two bodies are in contact,
is dominated by the
softer (or thicker) body, and it is usually sufficient to use
, which overestimates
by at most a
factor of 2. Also, as the body becomes more incompressible (i.e., as
approaches 0.5), its effective stiffness along the contact
direction increases (e.g., by about 3.8 for a thin layer with
), in which
case a smaller value of
(or lower value of
) can be used.
Estimating the effective thickness
typically lies between the true thickness
of the body along
the contact direction and the minimal width
of the contact
patch. Let
be the area of the patch, and
the cross-sectional area of the body in the contact plane. The
contact stress is concentrated within a depth of about
below the
patch. Below that it continues to spread out and decrease, until it is
limited by the sides of the body, after which it remains roughly
uniform at
(Figure 8.18, panel
(d)). If the body is much wider than the patch, this uniform stress is
negligible. This leads to the approximation
which gives the cases shown in Figure 8.18 and summarized here:
| body type | condition | |
|---|---|---|
| (a) thin layer | ||
| (b) large body |
|
|
| (c) tall body | ||
| (d) intermediate | other cases |
These estimates assume that the body is supported on the side opposite the contact (by a rigid base, or by other bodies).
Note that when two bodies are in contact,
and
are the same for both.
Example
For a cartilage-like layer with
and a thickness of 2 mm
(in SI units) pressed against a rigid body,
, and
gives
. If the layer
instead contacts a second, identical layer, then
, giving
. The FEM-FEM case might
then be set up as follows:
The default value of
corresponds to the first case above:
for a cartilage-like layer with
and a thickness of 2 mm, pressed against a rigid body. It should usually be adjusted for other materials, geometries and units.
stiffnessDamping and stepDamping have default values of 0.0 and 1.0, which should be fine for most applications. They are described in detail below just in case an application wishes to adjust them.
Compliant contact forces are integrated using the penetration
estimated at the middle of the time step. As a result, the damping
time constant
must be at least
. If it is smaller, stiff
contacts oscillate from one step to the next, with contacts possibly
switching on and off at every step, and the oscillation becomes more
persistent as
increases. The stepDamping property
provides this minimum damping automatically, by setting
to
, where
is the current step size. This does not depend
on the masses or units of the model, and adjusts automatically if the
step size is changed. A value of 0.5 damps the oscillation within a
single step, while larger values give a smoother but more sluggish
response. The default value of 1 is suitable for most models. Values
less than 0.5 should be avoided unless
is set to at least
.
Step damping is a numerical device and does not model physical
damping. In particular, when a light rigid body strikes a stiff
compliant contact, it rebounds with a coefficient of restitution of
roughly
(or about 1/3 for the default value),
regardless of the step size; increasing
reduces this
rebound. The stiffnessDamping property
provides damping
that is independent of the step size, and is needed only when such
damping is required; for example, when the oscillation of a rigid body
of mass
on a soft contact, with frequency
(where
is the total
stiffness of all its contacts), is resolved by the step size (i.e.,
is less than about 1). A damping ratio of about
can then be obtained by
setting
. For contact involving FE models, stiffnessDamping rarely needs to be set.
ArtiSynth implements elastic foundation contact (EFC), based on a linear material law as described in [3], using the built-in contact force behavior LinearElasticContact.
By default, this material computes contact pressures from
![]() |
(8.10) |
where
is Young’s modulus,
is Poisson’s ratio,
is the
contact penetration distance, and
is the foundation layer
thickness. (Note that both
and
are negated relative to the
formulation in [3] because we assume
during
contact.) The use of the
function helps ensure that contact
does not penetrate the foundation layer. However, to ensure robustness
in case contact does penetrate the layer (or comes close to
doing so), the pressure relationship is linearized (with a steep
slope) whenever
, where
is the minimum thickness
ratio controlled by the LinearElasticContact property minThicknessRatio.
Alternatively, if a strictly linear pressure relationship is desired, this can be achieved by setting the property useLogDistance to false. The pressure relationship then becomes
![]() |
(8.11) |
where again
will be negative when
.
Damping forces
can be computed in one of two ways: either
with
set to a constant
such that
| (8.12) |
or with
set to a multiple of
and the magnitude of the
elastic contact force
, such that
| (8.13) |
The latter is compatible with the EFC damping used by OpenSim (equation 24 in [22]).
Elastic foundation contact assumes the use of vertex penetration contact (Section 8.4.1) to achieve correct results.
LinearElasticContact exports several properties to control the force response described above:
value such that (8.10) is linearized if
.
The default value is 0.01.
An enum of type ElasticContactBase.DampingMethod, for which DIRECT and FORCE cause damping to be implemented using (8.12) and (8.13), respectively. The default value is DIRECT.
A simple example of elastic foundation contact is defined by the model
artisynth.demos.tutorial.ElasticFoundationContact
This implements EFC between a spherical ball and a bowl into which it is dropped. Pressure rendering is enabled (Section 8.5.3), and the bowl is made transparent, allowing the contact pressure to be viewed as the ball moves about.
The source code for the build method is shown below:
The demo first creates the ball and the bowl as rigid bodies (lines 6-26), with the bowl defined by a mesh read from the file data/bowl.obj relative to the demo source directory, and the ball defined as an icosahedral sphere. The bowl is fixed in place (bowl.setDynamic(false)), and the ball is positioned at a suitable location for dropping into the bowl when simulation begins.
Next, a collision behavior is created, with its collision method
property set to VERTEX_PENETRATION (as required for EFC), and a
friction coefficient of 0.1 (to ensure that the ball will actually
roll) (lines 28-31). A LinearElasticContact is then constructed,
with
,
, damping factor
, and thickness
,
and added to the collision behavior using setForceBehavior()
(lines 32-26). The behavior is then used to enable contact between the
ball and bowl (line 39).
Lines 41-49 set up rendering properties: the collision manager is made visible, with color map rendering set to CONTACT_PRESSURE, and the ball and bowl are set to be rendered in pale blue and green, with the bowl rendered using only mesh edges so as to make it transparent.
Finally, a control panel is created allowing the user to adjust properties of the contact force behavior and the pressure rendering range (lines 51-57).
To run this example in ArtiSynth, select All demos > tutorial > ElasticFoundationContact from the Models menu. Running the model will cause the ball to drop into the bowl, with the resulting contact pressures rendered as in Figure 8.19.
It is possible to bind certain EFC material properties to a field, for situations where these properties vary over the surface of the contacting meshes. Properties of LinearElasticContact that can be bound to (scalar) fields include YoungsModulus and thickness, using the methods
Most typically, the properties will be bound to a mesh field (Section 7.3) defined with respect to one of the colliding meshes.
When determining the value of either youngsModulus or thickness within its computeResponse() method, LinearElasticContact checks to see if the property is bound to a field. If it is, the method first checks if the field is a mesh field associated with the meshes of either cpnt0 or cpnt1, and if so, extracts the value using the vertex information of the associated contact point. Otherwise, the value is extracted from the field using the position of cpnt0.
A simple example of binding the thickness property to a field is given by
artisynth.demos.tutorial.VariableElasticContact
This implements EFC between a beveled cylinder and a plate on which it is resting. The plate is made transparent, allowing the contact pressure to be viewed from below.
|
The model’s code is similar to that for ElasticFoundationContact (Section 8.7.5), except that the collidables are different and the EFC thickness property is bound to a field. The source code for the first part of the build method is shown below:
First, the cylinder and the plate are created as rigid bodies (lines 6-23), with the cylinder defined by a mesh read from the file data/beveledCylinder.obj relative to the demo source directory. The plate is fixed in place and positioned so that it is directly under the cylinder.
Next, the contact method is set to VERTEX_PENETRATION (as
required for EFC), this time by setting it for all collisions in the
collision manager, and a LinearElasticContact is constructed,
with
,
, damping factor
, and thickness
(lines 25-32). Then in lines 34-43, a ScalarMeshField is created
for the cylinder surface mesh, with vertex values set so that the
field defines a thickness value
that increases with the radial
distance
from the cylinder axis according to:
This field is then added to the fields list of the MechModel and the EFC thickness property is bound to it (lines 44-46).
Lastly, a collision behavior is created, with the EFC added to it as a force behavior, and used to enable cylinder/plate collisions (lines 48-53).
It is important that EFC properties are bound to fields before the behavior method setForceBehavior() is called, because that method copies the force behavior and so subsequent field bindings would not be noticed. If for some reason the bindings must be made after the call, they should be applied to the copied force behavior, which can be obtained using getForceBehavior().
To run this example in ArtiSynth, select All demos > tutorial > VariableElasticContact from the Models menu. Running the model will result in contact pressures seen in the left of Figure 8.20, with the pressures decreasing radially in response to the increasing thickness. With no field binding, the pressures are constant across the cylinder bottom (Figure 8.20, right).