Content uploaded by Mickeal Verschoor

Author content

All content in this area was uploaded by Mickeal Verschoor on Mar 24, 2019

Content may be subject to copyright.

17

Eicient and Accurate Collision Response for Elastically

Deformable Models

MICKEAL VERSCHOOR, Eindhoven University of Technology and Universidad Rey Juan Carlos

ANDREI C. JALBA, Eindhoven University of Technology

Fig. 1. A hyper-elastic Armadillo pulled through a set of (transparent) rotating cylinders at timesteps 5,000,7,500,10,000,and12,500. The timing results

of this experiment for various methods are shown later in Figure 10.

Simulating (elastically) deformable models that can collide with each other

and with the environment remains a challenging task. The resulting con-

tact problems can be elegantly approached using Lagrange multipliers to

represent the unknown magnitude of the response forces. Typical methods

construct and solve a Linear Complementarity Problem (LCP) to obtain the

response forces. This requires the inverse of the generalized mass matrix,

which is generally hard to obtain for deformable-body problems. In this

article, we tackle such contact problems by directly solving the Mixed Lin-

ear Complementarity Problem (MLCP) and omitting the construction of

an LCP matrix. Since a convex quadratic program with linear constraints is

equivalent to an MLCP, we propose to use a Conjugate Residual (CR) solver

as the backbone of our collision response system. By dynamically updat-

ing the set of active constraints, the MLCP with inequality constraints can

be solved eciently. We also propose a simple yet ecient preconditioner

that ensures faster convergence. Finally, our approach is faster than exist-

ing methods (at the same accuracy), and it allows accurate treatment of

friction.

CCS Concepts: • Computing methodologies →Physical simulation;

Additional Key Words and Phrases: Collision response, conjugate residual

Authors’ addresses: M. Verschoor, Department of Mathematics and Computer Sci-

ence, Eindoven University of Technology, Eindhoven, P.O. Box 513, 5600 MB, The

Netherlands, and Department of Computer Science, Universidad Rey Juan Car-

los, Móstoles, Calle Tulipán s/n, 28933, Spain, Spain; email: mickeal.verschoor@

gmail.com; A. C. Jalba, Department of Mathematics and Computer Science, Eindhoven

University of Technology, Eindhoven, P.O. Box513, 5600 MB, The Netherlands; email:

a.c.jalba@tue.nl.

Permission to make digital or hard copies of all or part of this work for personal or

classroom use is granted without fee provided that copies are not made or distributed

for prot or commercial advantage and that copies bear this notice and the full cita-

tion on the rst page. Copyrights for components of this work owned by others than

ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or re-

publish, to post on servers or to redistribute to lists, requires prior specic permission

and/or a fee. Request permissions from permissions@acm.org.

© 2019 Association for Computing Machinery.

0730-0301/2019/03-ART17 $15.00

https://doi.org/10.1145/3209887

ACM Reference format:

Mickeal Verschoor and Andrei C. Jalba. 2019. Ecient and Accurate Col-

lision Response for Elastically Deformable Models. ACMTrans.Graph.38,

2, Article 17 (March 2019), 20 pages.

https://doi.org/10.1145/3209887

1 INTRODUCTION

Physically based models are now widely used in many computer

graphics applications, such as animated movies and video games.

Typical animations consist of many (complex) objects that can in-

teract with each other and the environment. The behavior of such

objects is based on their internal dynamics, modeled through some

material simulation (e.g., rigid-body, cloth, or uid simulation).

However, the very motion of each object can also inuence the mo-

tion of other objects in the scene. Therefore, accurate treatment of

collision events dramatically improves the realism of the simula-

tion, delivering rich and visually pleasing animations. In addition

to translational and rotational motion, the motion of a deformable

object is also aected by shape changes (deformations). Since the

deformation is generally unknown, no exact collision time and

location can be directly computed. Furthermore, the collision re-

sponse inuences the dynamics of the objects and thus their mo-

tion, and ideally, it should also account for accurate friction.

Typical approaches for handling contact problems reformulate

them as velocity constraints and use Lagrange multipliers to

represent the unknown magnitudes of the contact forces. Then,

the resulting Mixed Linear Complementarity Problem (MLCP) has

to be solved, which yields a solution that agrees with both the

collision response problem and the model dynamics. The con-

strained problem is usually tackled by reformulating it as a Linear

Complementarity Problem (LCP), which typically is solved using

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:2 • M. Verschoor and A. C. Jalba

(Projected) Gauss-Seidel methods. The construction of the LCP

matrix requires the inverse of the generalized mass matrix, which

can be directly computed for rigid-body simulations. However,

for deformable bodies, this inverse is not directly available and

has to be approximated (e.g., see Otaduy et al. (2009)). Therefore,

one often seeks an approximation or solves a system of coupled

problems. Alternatively, directly solving the original MLCP

constitutes a viable approach for deformable models. Ramage and

Wathen (1994) compared the performance of the Conjugate

Residual (CR) method for solving coupled indenite problems,

stemming from nite-element discretizations of the Stokes

equations, to that of a two-level approach in which two nested

Conjugate Gradient (CG) solvers were used. Their results show

that the CR method outperforms the coupled CG approach for

such equality-constrained problems. Inspired by their results, we

shall investigate here how the CR method can be extended for e-

ciently solving contact problems involving inequality constraints.

For stable simulations of coupled rigid and deformable bodies, it

is important that all collisions are resolved completely at the end

of each timestep. However, when a collision is resolved, the result-

ing deformation may lead to new collisions or changes in contact

forces elsewhere. This often results in a state in which contacts do

not agree with the actual geometry. If such errors are not corrected,

these contacts will eventually introduce energy to the system, re-

sulting in oscillations and instabilities. Additionally, the larger the

deformation is, the more likely that such mismatches appear. Such

mismatches can occur even for rigid bodies. To minimize these er-

rors, one needs to solve non-linear contact problems.

In this article, we present a method that focuses on solving the

contact problem for deformable bodies, without the need to com-

pute the Delassus operator. Due to this, contacts can be eciently

linearized, which allows us to solve the non-linear contact prob-

lem, resulting in a guaranteed collision-free state at convergence.

The method is based on the CR method, which simultaneously

provides estimates for both deformation and contact forces. By al-

lowing constraints to change status (switch among active or in-

active states), inequality (non-penetration) constraints can be han-

dled directly. Furthermore, friction is modeled similarly, such as

by switching between static and kinetic friction constraints. By

continuously updating the sliding directions of the kinetic friction

constraints, Coulomb’s friction model is approximated. Addition-

ally, we propose a simple yet eective preconditioner that signif-

icantly reduces the number of iterations and computation time.

The method allows for large deformations and contact forces, sta-

ble stacking of (almost) rigid objects, and an accurate approxima-

tion of Coulomb’s friction cone (see Figures 1and 2, and, later,

Figure 8). Finally, our approach is faster compared to other meth-

ods, with the speedup typically increasing with the complexity of

the simulation.

1.1 Previous and Related Work

A tremendous amount of work has been done addressing physical

simulations for computer animation, including rigid-body, cloth,

deformable-object, and uid simulations. Here, we shall only give

a very brief overview of highly related methods. For background

material on contact mechanics, we refer to the work of Wriggers

(2002) and references therein.

Rigid bodies. Although penalty methods for collision response

(Barbič and James 2007; Moore and Wilhelms 1988) are relatively

fast and easy to implement, the computed penalty forces have

to compete with all other forces acting on the simulated bodies.

Therefore, the forces may fail to avoid inter-penetration. Impulse-

based methods (Bara 1989) model the response of a collision

event through the application of contact impulses. These methods

apply impulses on objects to resolve collisions but can trigger

new ones. This problem can be solved by using shock propagation

techniques (Guendelman et al. 2003). Other approaches used

in rigid-body simulations often model collision response as a

constrained optimization problem (Bara 1994; Erleben 2007;

Müller et al. 2007; Redon et al. 2002). This class of methods also in-

cludes approaches based on LCP formulations (Cottle et al. 1992),

typically used in rigid-body simulations (Bara 1996), interactive

applications (Catto 2005; Tonge et al. 2012), and cloth simulations

(Bridson et al. 2002). LCPs are frequently used in combination with

implicit time-integration schemes such that a collision-free state

is guaranteed for the next timestep (Stewart and Trinkle 1996). It

is this last property that makes such approaches very appealing

for solving the contact problem for deformable models as well.

Anitescu and Hart (2004) develop xed-point iteration algorithms

that solve convex sub-problems that are guaranteed, for small

friction coecients, to obtain the unique velocity solution of the

non-convex friction LCP. Their method converges at a linear rate.

A non-smooth non-linear CG method is presented by Silcowitz-

Hansen et al. (2010b), which combines Projected Gauss-Seidel

(PGS) with a Fletcher-Reeves CG method. Bertails-Descoubes

et al. (2011) present a method for simulating contacts between

small rods or bers. The method models exact Coulomb friction

and uses a non-smooth Newton solver, which relies on an easy

construction of the Delassus operator. Xu et al. (2014) present a

method for rigid bodies, which solves a Quadratic-Programming

(QP) problem based on contact constraints. A Singular-Value-

Decomposition (SVD) solver is used to form the (singular) Schur

complement matrix, which is then used in combination with

Cholesky decomposition and back-substitution. Friction is mod-

eled using friction anchors. Although a penalty-based method,

due to the implicit-integration scheme used, this approach can

also be interpreted as a method that solves constraints. Mazhar

et al. (2015) introduce the so-called Accelerated Projected Gradient

Descent approach to accelerate the simulation of large systems of

rigid bodies interacting through normal and frictional contact. The

method can easily be parallelized, resulting in speedups of one to

two orders of magnitude. Silcowitz-Hansen et al. (2010a)propose

a PGS method working on a subspace of the problem. At each

iteration, the method rst performs an approximation using PGS,

followed by a more accurate solve concerning a subset of active

constraints having non-clamped multipliers. A detailed overview

of numerical methods for solving LCPs is given by Erleben (2013).

Finally, an extensive overview of rigid-body simulations is given

by Bender et al. (2014). Other related projected Krylov methods,

used in rigid many-body/granular-material simulations, are found

in Heyn et al. (2012) and Renouf and Alart (2005).

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:3

Fig. 2. Example simulations by our method. (a) Diicult case with many deformable objects in a moving wedge. (b) Large deformations and elastic forces

appear when the shown elastic strings are tangled; by releasing external forces, the strings are untangled. (c) Stable stacking of rigid objects, illustrating

accurate friction treatment.

Deformable models. Early work on collision handling for de-

formable models includes the method of Bara and Witkin (1992),

which models the collision response through constraints yielding

contact forces. By solving a QP problem, an optimal solution is

obtained. Although not directly used for deformable objects, Con-

straint Anticipation (Bara 1996) is a technique that transforms an

MLCP into an LCP. After solving the LCP for the unknown La-

grange multipliers, collision response impulses are applied on the

colliding models. When applied to rigid bodies, this technique is

very ecient. Otaduy et al. (2009) extend this approach for de-

formable models as Iterative Constraint Anticipation (ICA). ICA

computes the multipliers and the collision response using two

nested (Projected) Gauss-Seidel solvers that approximate both the

multipliers and velocities. Raghupathi and Faure (2006)useanAc-

tive Set approach for solving the contact response problem: Given

a set of active and inactive constraints, a QP problem is solved

using the CG method. On convergence, constraints can change

state between active and inactive. The Staggered Projections (SP)

method (Kaufman et al. 2008) computes an unconstrained velocity

that is corrected using two coupled projection steps (each solved

using a QP solver). This iterative process continues until the resid-

ual is minimized. The method of Allard et al. (2010)constructs

volume-based constraints that ensure a zero intersection volume

of two colliding objects. The resulting MLCP is solved using the

Gauss-Seidel–like method of Duriez et al. (2006). The latter ap-

proximates exact Coulomb friction and explicitly constructs the

Delassus operator (an LCP matrix), for which some approxima-

tions were made. Daviet et al. (2011) present a scalable and robust

solver for capturing Coulomb friction in large assemblies of tightly

packed bers, such as hair. The method can handle a few thousand

bers subject to tens of thousands frictional contacts at a reason-

able computational cost. Li et al. (2015) present an ecient Gra-

dient Projection method for computing contact responses by de-

coupling constraints. Unfortunately, their method cannot handle

coupled frictional constraints eciently. Works on collision detec-

tion (Teschner et al. 2004), coupling of rigid and deformable bodies

(Shinar et al. 2008), deformable bodies (Galoppo et al. 2006; Irving

et al. 2007; Pauly et al. 2004; Spillmann et al. 2007), and penalty

forces (Tang et al. 2012) are all closely related to the contact prob-

lem for deformable models.

Comparison to our method. We build on methods that involve

velocity-level constraints and compute Lagrange multipliers in

combination with implicit time integration. As seen earlier, many

methods found in rigid-body applications require the construc-

tion of an LCP, Schur complement matrix, or Delassus operator,

which relies on the availability of the inverted generalized mass

matrix. For rigid-body problems, this inverse can be obtained rel-

atively easily, whereas for Finite Element Method (FEM)-based

deformable-body problems, this is generally not immediately pos-

sible. Therefore, many of these methods are not ecient for sim-

ulating deformable bodies with a large number of degrees of free-

dom (see Section 6.2.4). Indeed, for deformable-body problems,

often coupled solvers (Kaufman et al. 2008;Otaduyetal.2009)

and/or PGS methods are used (Allard et al. 2010; Duriez et al.

2006). Otaduy et al. (2009) iteratively approximate interleaved nor-

mal and friction responses, but their method does not satisfy the

Maximum Dissipation Principle (MDP). In Kaufman et al. (2008),

this principle is guaranteed. This method iteratively solves two

coupled QP problems and has been demonstrated for rigid and

reduced-order exible multibody systems. The method of Duriez

et al. (2006) models exact Coulomb friction (satisfying the MDP)

and solves the problem using a PGS approach.

All methods just mentioned rst solve an unconstrained prob-

lem, which is corrected later, or rst compute collision impulses,

which are applied as external forces to objects. Our approach dif-

fers from all of these works in that no coupled solvers are used,

neither is an LCP, Delassus, or Schur complement matrix con-

structed or used. We approximate the Coulomb friction model us-

ing an additional kinetic friction force, aligned with the sliding ve-

locity, thus satisfying the MDP. The corresponding QP problem

(containing the generalized mass matrix of the simulation and its

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:4 • M. Verschoor and A. C. Jalba

constraints) is solved using the CR method. By changing the state

of the constraints, projections are performed that directly apply to

the global problem such that friction and normal responses aect

the internal (elastic) energy of the objects. In addition, constraints

can be added or re-linearized at convergence to guarantee that a

global, collision-free state is obtained, satisfying all constraints. To

accelerate the convergence of the method, we derive a precondi-

tioner that signicantly reduces the amount of iterations. Finally,

in this work, we create constraints per contact point, although we

could also use constraints based on a volumetric description of a

collision, similar to Allard et al. (2010).

2 BACKGROUND

2.1 Linear and Hyper-Elasticity

The deformation of a body can be described by a mapping ϕfrom

material coordinates Xto world coordinates x(i.e., x=ϕ(X)). The

stress Pat a point Xdepends solely on the deformation gradi-

ent F=∂ϕ

∂Xand is obtained through some energy density function

Ψ(F)via P(F)=∂Ψ

∂F. Since the stress is invariant under rotations,

P(UF)=UP(F)holds for any rotation U. Furthermore, if the ma-

terial is isotropic, P(FVT)=P(F)VTholds for any rotation V.By

diagonalizing Fusing SVD, Fbecomes Uˆ

FVT, so the stress can be

obtained through

P(F)=UP(ˆ

F)VT,(1)

with ˆ

Fa diagonal matrix containing the singular values of the

deformation gradient. Given the (isotropic) constitutional model

used in Ψ, a wide range of materials can be simulated. If Ψis a

quadratic function, a linear elastic model is obtained, for which

the unrotated force gradient is constant; this coincides with co-

rotational FEM (Müller and Gross 2004). Once the stress Pis ob-

tained, the nodal force fiis obtained by

fi=−P(F)bi,(2)

with bithe area-weighted normals of the faces connected to node

ifor a particular volume and stress P(see Irving et al. (2004)). By

assembling the nodal forces for all volumes, net force fis obtained.

To obtain the force gradient, ∂f

∂x=i∂f

∂Fi

∂Fi

∂x, the gradients of the

SVD in Equation (1)withrespecttoFare required (see Sin et al.

(2011) for its derivation). When dealing with hyper-elastic mate-

rials, the computed force responses can become very large (due

to the non-linear nature of the energy model) when the compres-

sion becomes large. To robustly simulate such materials, we use

the method of Stomakhin et al. (2012), which linearly extrapolates

the energy density function after a certain amount of compression

is reached.

2.2 Dynamics and Numerical Integration

Given Newton’s second law of motion Ma =f, a rst-order Taylor

expansion of the net force fis performed, yielding

Ma =f+Δt∂f

∂x

∂x

∂t+Δt∂f

∂v

∂v

∂t=f+Δt∂f

∂xv+Δt∂f

∂va.(3)

Using a rst-order forward dierence approximation of the accel-

eration a, the following semi-implicit system is obtained,

M+ΔtCd+Δt2Kvi+1=(M+ΔtCd)vi+Δtf,(4)

Fig. 3. Vertex-face contact pair. Vertex xi

m(green) at iteration ipenetrates

a face at i+1(red). xjis the collision point on the face, wa,wb,wcits

barycentric weights, nkthe contact normal, and t1,2the tangent vectors;

dk,nrepresents the normal distance at the beginning of the timestep and

dk,tthe tangential distance.

with Mthe mass matrix of the system, vthe velocity, damping

matrix Cd=−∂f

∂v, and stiness matrix K=−∂f

∂x(see Bara and

Witkin (1998)). Positions xare updated using

xi+1=xi+Δtvi+1.(5)

We discretize Equation (4) in space using the FEM. Accordingly,

for each element (tetrahedron), a per-element equivalent of Equa-

tion (4) is generated, given mapping x=ϕ(X). By assembling all

of these local instances into a global one, the global version of

Equation (4) is obtained, now with M,Cd,and Kthe global mass-,

damping-, and stiness matrix, and x,v,fnow vectors represent-

ing positions, velocities, and all internal (Equation (2)) and exter-

nal forces (e.g., gravitational forces) of all nodes in the discretized

model. This system is stored using a large yet sparse matrix in the

form Avi+1=b, with A∈R3Nv×3Nvthe generalized mass matrix

(M+ΔtCd+Δt2K), bthe right-hand side, and Nvthe total num-

ber of vertices. Such systems are typically solved using the CG

method for the unknown velocities vi+1. Given the new velocities,

the positions are updated using Equation (5).

2.3 Non-Penetration Constraints

Two deformable bodies have collided if the signed distance be-

tween any two points on their surfaces Γ1and Γ2is negative. Such

collision events are detected by considering vertex-face and edge-

edge contact pairs. For the vertex-face case, let xi

m∈Γ1be a (dis-

crete) vertex on the surface of the rst object, which penetrates Γ2

in the next timestep, resulting in a collision point xjon a triangu-

lar face of Γ2(see Figure 3). The (signed) distance dk,nbetween xi

j

and xi

mis computed using

Ck(xi)=xi

m−xi

j·ni

k=dk,n,(6)

with ni

kthe contact normal,kthe constraint identier, and xi

a vector containing all vertex positions at timestep i.Toavoid

penetration, Ck(xi)≥0 must hold for any xjand xmpair.

Clearly, this should also hold after the semi-implicit update (i.e.,

Ck(xi+Δtvi+1)≥0). Since Equation (4) solves for vi+1,Equa-

tion (6) is transformed into a velocity constraint using a rst-order

approximation—that is,

Δt∂Ck

∂xjΔt∂Ck

∂xm·

vi+1

j

vi+1

m

≥−dk,n=ck,n,(7)

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:5

with vi+1

jand vi+1

mthe new vertex velocities, and ck,nthe con-

straint constant. After collecting all resulting non-penetration con-

straints and assembling all instances of Equation (7), one obtains

Jvi+1≥cn,(8)

with J∈RNc×3Nvthe Jacobian matrix containing the derivatives

of all positional constraints, Ncthe number of non-penetration

constraints, Nvthe number of vertices, va vector representing

all vertex velocities, and cthe right-hand side of Equation (7),

for all constraints. Since xj=waxa+wbxb+wcxcand we con-

sider vertex-face and edge-edge pairs, Jcontains per contact point

asparserow-vectorjk∈R1×3Nv,e.g.,jk=[−waΔtnT

k,−wbΔtnT

k,

−wcΔtnT

k,ΔtnT

k] for a vertex-face constraint Ck, with nkthe con-

tact normal (see Figure 3). At this point, we consider nkto be

constant within one timestep. In Section 3.3, an extension is pro-

posed that takes the change of the constraints into account. Fur-

thermore, self-collisions in which Γ1=Γ2and degenerate colli-

sions (vertex-vertex/vertex-edge) are treated similarly. However,

the latter will produce duplicate contacts that need special care (see

Section 3.4.1).

2.4 Constrained Velocity as a Complementarity Problem

We model collision response using Lagrange multipliers so that

normal contact forces are given by fn=JTλ, with λthe vector

of Lagrange multipliers representing the unknown magnitudes

of all contact forces. According to Signorini’s contact model (see

also Duriez et al. (2006)), a complementarity condition is fur-

ther imposed—to prevent penetration, the contact forces should

push the bodies apart, and hence λ≥0. Furthermore, if the non-

penetration constraint is not violated (Ck(x)>0 for some con-

straint), its corresponding multiplier should be λk=0. Hence,

(Jv −cn)Tλ=(vTJT−cT

n)λ=vTfn−cT

nλ=0, which gives the

complementarity condition.

Contact forces are simply included in the motion equations of

the model (see Section 2.2), resulting in

0≤AJ

T

J0

v

λ−b

cn⊥1

λ≥0(9)

(see Cottle et al. (1992)), which is an MLCP for which the Karush-

Kuhn-Tucker (KKT) optimality conditions (Kuhn and Tucker 1950)

apply.

3 COLLISION RESPONSE THROUGH

THE CR METHOD

MLCPs can be solved by transforming them into LCPs (Bara

1996), provided that matrix Acan be easily inverted. They can also

be solved by any algorithm for strictly convex QP problems with

linear constraints. Given the MLCP from Equation (9), the corre-

sponding QP problem is

min f(v)=1

2vTAv −vTb(10)

subject to Jv ≥cn.

A sucient condition to guarantee strict convexity is for matrix

Ato be positive denite. In this case, f(v)is a strictly convex

function, and if the constraints also are linear, it has a unique

global minimizer (Boyd and Vandenberghe 2004). Since according

to Equation (4), Ais given by the linear combination of the

(positive-denite) mass and (positive semi-denite) stiness and

damping matrices, Ais positive denite. If the material simula-

tion does not produce a positive semi-denite matrix, this property

must be enforced, for example, by removing the negative eigenval-

ues from the element stiness matrices.

The quadratic function in Equation (10), but subject to Jv =cn,

is equivalent to

AJ

T

J0

B

v

λ

y

=b

cn

d

,(11)

or By =din short. Since matrix B∈R(3Nv+Nc)×(3Nv+Nc)is not

positive denite, the system in Equation (11) cannot be solved by

the CG method. The CR method (Luenberger 1970)isaKrylov

subspace method, similar to the (more popular) CG method, and

minimizes By −d2and thus solves Equation (11). In the follow-

ing sections, we describe how the CR method is used to solve the

contact problem, including friction. Additionally, we describe how

constraints are re-linearized to obtain a collision-free state.

3.1 CR Method With Non-Penetration Constraints

Luenberger (1973) proposed a method for solving constrained non-

linear programming problems by treating inequality constraints as

equality ones that can regularly change states. The method uses a

descent step to improve the current approximation. When the prob-

lem is a QP with linear constraints, the CR method can be used to

perform these descent steps. In the following, we describe how

the method in Luenberger (1973)isappliedincaseofcontactand

friction and how it is used in combination with the CR method in

Algorithm 1.

For now, let jdenote the loop index inside the CR method. Fur-

thermore, recall that each constraint Ckis represented by a sparse

row-vector jkin Jacobian J, its corresponding Lagrange multi-

plier λk,and some constant ck,n(see Section 2.3). The comple-

mentarity condition in Equation (9) states that if λk>0istrue,

then jkv=ck,nalso holds for some constraint Ck, with vthe

global velocity. Conversely, if λk=0istrue,thenjkv≥ck,nand

(jkv−ck,n)Tλk=0also hold. Therefore, constraint Ckdoes not

contribute to the computation of vand can be deactivated in line 13

or line 23. Due to this mechanism, summarized in Algorithms 2

and 3, the CR method can solve the problem in Equation (10). In

other words, each constraint is active or inactive throughout the

solver iterations, and its state is regularly updated. The method

converges when rj+1<ϵ1and Urj+1∞<ϵ2, with ϵ1and ϵ2a

relative and absolute tolerance, respectively, and Ua matrix that

selects the entries from rthat involve active constraints. This en-

sures a maximum constraint error less than ϵ2. The second con-

vergence criterion is used to detect local minima (see Section 4.3).

Furthermore, when the CR method converges, new constraints

can be added and inactive constraints are removed. However, the

main dierence with active set methods is that constraints’ state

changes are allowed before the solver converges. Therefore, the

problem is to decide when to activate or deactivate constraints prior

to convergence. Note that when a constraint is inactive, multipli-

cations Bpjand Byj+1are performed such that the corresponding

entries in Jare neglected. This also applies for the correspond-

ing terms of the preconditioner C(see Section 3.4 for details about

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:6 • M. Verschoor and A. C. Jalba

ALGORITHM 1: Pseudo-code of our collision handling system.

1Discretize computational domain;

2Initialize BVH and additional data structures;

3while Simulating do

4Update matrix Ausing FEM (see Equation (4));

5Find all potential collision candidates (Section 5.1);

6Linearize and check all active constraints;

7r0=d−By0;p0=C−1r0,j=0;

8while Not converged do

9α=

rT

jC−1BC−1rj

pT

jBC−1Bpj

;

10 yj+1=yj+αpj;

11 rj+1=rj−αBpj;

12 if α>0then

13 EvaluateConstraints(rj+1,j,ϵ1,ϵ2);

14 if No constraints changed then

15 β=−rT

j+1C−1BC−1rj+1

rT

jC−1BC−1rj;

16 pj+1=C−1rj+1−βpj;

17 Bpj+1=BC−1rj+1−βBpj;

18 else

19 rj+1=d−Byj+1;

20 pj+1=C−1rj+1;

21 Bpj+1=BC−1rj+1;

22 if rj+1<ϵ1∧Urj+1∞<ϵ2∨BC−1rj+1<ϵ1

then

23 EvaluateConstraints(rj+1,0,ϵ1,ϵ2);

24 if No constraint states have changed then

25 Check all candidates for new collisions

(Section 5.2);

26 if No new constraints are added then

27 Re-linearize constraints (Section 3.3 and

Equation (21));

28 if No constraints are updated then

29 Advance simulation;

30 break;

31 Recompute residual (see lines 19–21);

32 j=j+1;

preconditioning). Furthermore, when the residual is recomputed

for inactive constraints, the values in dcorresponding to inactive

constraints are also neglected.

Constraint activation. The activation of a constraint Ckdepends

on ck,n,jkand vat solver iteration j. Distance dk,nis computed

using Equation (6) and stored in ck,nwhen the constraint is added

to the system (when a collision is detected), or when the constraint

is re-linearized. At the same moment, jkis computed and included

in J(see Section 5for more details). To determine when a constraint

should be activated (assuming it is inactive), the penetration depth

is evaluated regularly. If

jkv−ck,n≤0 (12)

ALGORITHM 2: Pseudo-code for constraint evaluations.

1Function EvaluateConstraints(r,i,ϵ1,ϵ2):

2interval = max(1,log2(r/ϵ1)

3);

3if imod interval == 0∨i== 0then

4foreach contact kdo

5if Non-penetration constraint active then

6if jkv−ck,n≥0and λk≤0then

7Deactivate constraint, λk=0;

8else if jkv−ck,n≤0then

9Activate constraint, set friction to kinetic friction;

10 if Non-penetration constraint active then

11 if Friction constraint in static friction mode then

12 if γk>μλkand (jk,tv−ck,t)Tγk>0

then

13 Switch to kinetic friction;

14 ˆ

δk=ˆ

γk,λ

k=γk/μ,γk=0;

15 else if (jk,tv−ck,t)Tˆ

δk≤0then

16 Switch to static friction;

17 γk=γ

k,γ

k=0;

18 UpdateKineticFriction();

19 if Z−1Sd[Δλk,ΔγT

k+ΔγT

k]T>ϵ2then

20 Use updated constraint kand report change to

solver;

21 else

22 Discard changes for constraint k;

23 d=[(b−Jtγ)T,cT

n,cT

t]T/*Update RHS*/;

holds, the constraint is activated and the corresponding Lagrange

multiplier will be computed, which would eventually resolve the

collision (see line 8 of Algorithm 2).

Constraint deactivation. Since our solver allows for activation

and deactivation of constraints at any time, a criterion is needed to

decide when to deactivate them. It may seem logical to deactivate

a constraint Ckif jkv−ck,n≥0. However, since vdoes not reect

the nal velocity, this criterion cannot solely be used. When both

jkvand λkare used instead, the criterion can be formulated as

follows: if

jkv−ck,n≥0andλk≤0 (13)

hold, then there is no collision and the constraint is attracting the

objects—that is, it tries to enforce the equality jkv=ck,n. There-

fore, the constraint is deactivated (see line 6 of Algorithm 2). This

is thus the only state that allows deactivation of a non-penetration

constraint. For all other combinations, the constraint is kept active

since there is still a collision (jkv−ck,n<0) or objects are repelled

(λk>0).

Unlike Luenberger (1973), our CR-based solver for contact prob-

lems updates only the active set at dynamic intervals determined

by the residual norm (see line 2 of Algorithm 2). When the residual

is small, constraints are evaluated more frequently. Conversely, for

a larger residual norm, constraints are evaluated less frequently,

which reduces the number of residual evaluations (each requiring

a multiplication By). This makes our method more ecient than

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:7

Fig. 4. A representation of the friction cone in which sliding velocity

jk,tv−ck,tis misaligned by angle θ(blue segment) with the friction vec-

tor δk. To address this, we compute the new friction direction δ

kthat is

more aligned with the sliding velocity (see Algorithm 3). If the magnitude

of the sliding velocity is below the solver tolerance (red area), no update

of δkis performed.

the CR solver in Luenberger (1973). Additionally, our method sup-

ports a left preconditioner (matrix C−1in Algorithm 1).

3.2 Incorporating Friction Constraints

Friction is also treated as a constraint on the velocity. According to

Coulomb’s friction model, friction can be described by a cone that

bounds the friction force ffin all directions, given the magnitude

of the normal force fnand a friction coecient μ(see Figure 4).

When ff<μfn, the friction force is not bounded and the

sliding velocity is zero. When ff=μfn, the friction force

is bounded and is not large enough to keep the sliding velocity

at zero. Equation (9) can therefore be extended with additional

complementarity conditions, resulting in the following problem:

0≤

AJ

TJT

t0

J00 0

Jt00−eT

0μ−e0

v

λ

γ

β

−

b

cn

ct

0

⊥

1

λ

γ

β

≥0,(14)

with JT

tγ=ffthe applied friction force, Jt∈RNpNc×3Nvamatrix

containing tangent vectors for all friction constraints, γavectorof

unknown multipliers representing the magnitude of these vectors,

and ctcontaining all tangential distances for all constraints.

Per constraint, the tangential distances ck,t(see Figure 3)are

computed similar to Equation (6), albeit the normal vector is

replaced by a tangent one. Please note that ck,trepresents the

distance from conguration xi

mto the rst moment of impact at

xj. For persistent contacts, ck,t=0since xi

mis already in contact.

Matrix Jtusually contains, per contact point, a number Npof

scaled instances of tangent vectors, each corresponding to one

facet of the discretized friction cone. Furthermore, eand μare

matrices used to couple all multipliers in λ,γand β. The latter

representing the unknown sliding velocities. If βkis positive for

some friction constraint Ck, a positive sliding velocity exists and

the friction force is bounded, resulting in dissipation of energy. If

βkis zero, the friction force is not bounded and no sliding occurs.

Unfortunately, Equation (14) is not symmetric and non-convex,

and is therefore not equivalent to a QP problem. In the next

section, a modication is proposed that restores this relation.

ALGORITHM 3: Pseudo-code for kinetic friction update.

1Function UpdateKineticFriction():

2if Constraint kin kinetic friction mode then

3if γ

kμλkthen

4Compute Simple Moving Average λk,a;

5λ

k=λk,a;

6if 0<δT

k(jk,tv−ck,t)<cos(ϵθ)/*If angle θ>ϵθ*/ then

7Δδk=(jk,tv−ck,t)−δk/*Compute dierence*/;

8δk=δk+αθΔδk/*Decreases θ*/;

9γ

k=μλ

kδk/*Update friction force*/;

3.2.1 Modified Friction Model. Given the model described in

Equation (14), we now proceed by adapting this model. Instead of

using a discretized friction cone, a continuous and bounded kinetic

friction force is modeled. This approach is summarized in Algo-

rithms 2and 3, and discussed here. Per constraint Ck, the friction

force is decomposed using only two perpendicular tangent vectors

tk,1and tk,2, which appear in jk,t∈R2×3Nvas part of Jt(see Fig-

ure 4). Due to this, γcontains, per constraint Ck, two Lagrange

multipliers (γk,1,γk,2)T=γk, which can be both positive and neg-

ative. For clarity of exposure, we assume for now that all friction

constraints in the system are either in the static or kinetic state. To

also keep the presentation brief, we may not make a clear distinc-

tion between model and method.

Static friction. For static friction, the sliding velocity is zero (β=

0), so Equation (14) can be written as

0≤

AJ

TJT

t

J00

Jt00

v

λ

γ

−

b

cn

ct

⊥

1

λ

|γ|

≥0,(15)

with |γ|the componentwise absolute values of γ,andthead-

ditional condition that 0≤eγ ≤μλ, which for a constraint Ck

means that 0 ≤γk≤μλk. The second inequality should hold

for the static case, because the friction force is not bounded by the

friction cone, and the solver computes a friction force that satises

jk,tv=ck,t.Conversely,ifboth

γk>μλkand (jk,tv−ck,t)Tγk>0 (16)

hold, the applied friction force is too large and acts in the direc-

tion of the sliding velocity; thus, the conditions for static friction

are violated and the constraint is switched to kinetic friction (see

line 12 of Algorithm 2).

Kinetic friction. For kinetic friction, the sliding velocity is pos-

itive (β>0), which makes Equation (14) non-symmetric. Such a

system can be solved as described in Bender et al. (2014). Alterna-

tively, this system can be symmetrized by removing slack vector

βfrom the equation. This has the advantage that solutions always

exist and can be found by Lemke’s algorithm (Stewart and Trinkle

1996). Unfortunately, dropping βresults in a violation of the MDP,

as βselects a discrete vector in Jtthat ensures this principle. In

our method, the MDP is enforced dierently.

Our approach for handling kinetic friction could be interpreted

as a Bounded Linear Complementarity Problem (BLCP) (Judice and

Pires 1994) reformulation of Equation (14), where the alignment

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:8 • M. Verschoor and A. C. Jalba

of the discretized friction cone depends on the state of the sys-

tem. The relation in the last row of Equation (14) is enforced sepa-

rately. This means that the kinetic friction force will never be over-

estimated, as it could happen in the BLCP model.

For kinetic friction, β>0, thus μλ =eγ, which for a particular

constraintCkmeans that μλk=γk. The sliding velocity is given

by jk,tv−ck,t=eTβ>0. The basic idea is now to estimate both

the magnitude and direction of γk.

Let γ

k=(μλ

kδk,1,μλ

kδk,2)Tbe such an estimate, with λ

kan

approximation of λk,andδk=δk,1tk,1+δk,2tk,2a unit vector,

representing the direction of the kinetic friction force in the tan-

gent plane, for example, at xj(see Figure 4). Next, we eliminate

from Equation (14) all rows and columns corresponding to βand

move JT

tγto the right-hand side so that our approximation can

beexpressedinmatrixformas

0≤AJ

T

J0

v

λ−b−JT

tγ

cn⊥1

λ≥0,(17)

supplemented per constraint by the condition (jk,tv−ck,t)Tδk>

0. This condition is violated when the sliding velocity changes di-

rection due to a too large friction force—that is, when

(jk,tv−ck,t)Tδk≤0.(18)

By then, switching the constraint to static friction, the solver will

estimate γk, which eventually satises jk,tv−ck,t=0(see line 15

of Algorithm 2).

Kinetic friction update. Earlier, a correct approximation of γ

k

was assumed to be available; here, we show how this vector is

updated such that the friction force and the sliding velocity are

aligned, and that the magnitude of the friction force is bounded.

Given the preceding conditions, a violation occurs if

μλkγ

k=μλ

kδk,1,μλ

kδk,2T.(19)

If this happens, Simple Moving Average (SMA) λk,ais updated by

adding the current λkto its histor y of nvalues (n=2 in our imple-

mentation; see line 4 of Algorithm 3). Next, λ

kis set to the SMA

of λk,aat line 5. To impose the MDP, the kinetic friction direction

δkand the sliding velocity have to be kept aligned. When the an-

gle θ(see Figure 4) between δkand the current sliding velocity

is larger than a given threshold (ϵθ=1.2 degrees in our imple-

mentation), the dierence Δδkbetween both vectors is computed

(line 7). Next, δkis updated using δk+αθΔδkand then normal-

ized, with αθa small step size (0.01 in our implementation; see

line 8 of Algorithm 3). Thus, δkis gradually updated to realign

it with the current sliding velocity. Finally, γ

kis approximated

(see line 9 of Algorithm 3). Using this strategy, eventually all ki-

netic friction vectors approach their nal conguration and satisfy

the conditions specied in Equation (17). By using this strategy, a

stabilization mechanism is introduced that suppresses undesired

oscillations while solving the contact problem. Finally, in a real

simulation, the system contains both static and kinetic friction

constraints, so the problem can be described in matrix form as

0≤

AJ

TJT

t

J00

Jt00

v

λ

γ

−

b−JT

tγ

cn

ct

⊥

1

λ

γ

≥0,(20)

where, for static constraints, entries in γare set to zero, whereas

for kinetic constraints, all entries in γ,ctand those of matrix B

corresponding to Jt,JT

tare similarly set to zero.

3.3 The Non-Linear Contact Problem

The problem solved in Equation (20) assumes that Jand Jtare

constant during the timestep, which generally is not true. Hence,

C(xi+1)⊥λmay not hold at the end of the timestep. To minimize

such errors, the complementarity conditions must also hold after

updating the geometry. To solve this non-linear problem, C(x)is

re-linearized using an interpolated approximation of xbased on

its previous and current approximations, followed by a solve of

Equation (20). Instead of interpolating C(x)globally, one can re-

linearize each individual Ck(x)—that is,

Cl+1

k(xi+1)=wCl+1

k(xi+1)+(1−w)Cl

k(xi),(21)

with 0 <w<1 a weight such that the change in the contact nor-

mal is less than, say, 15 degrees, andCl

kindicates the last, Cl+1

kthe

current, and Cl+1

kthe new interpolated conguration of the con-

straining geometry. The re-linearization of the constraints results

in an updated J,Jt,and c(line 27 of Algorithm 1). Then, the method

recomputes the preconditioner and the residual vector, and contin-

ues until it converges again for the linearized problem. This pro-

cedure continues until, for each active constraint, 0 <Ck(x)<ϵ2

holds. When w=0, this procedure is exactly Newton’s method in

which the constraints are re-linearized followed by a solve of the

updated Equation (20). Since line 25 of Algorithm 1updates the set

of potential collisions, a collision-free state is eventually obtained.

Additionally, when a contact point slides o a face or edge, the

corresponding constraint must be removed from the system. The

main advantage of Algorithm 1is that updating J,Jt,and cdoes

not require an update of the LCP matrix or Delassus operator. This

allows us to eciently solve the non-linear contact problem for

large systems.

3.4 Preconditioning

In this section, we derive a preconditioner that is easy to compute,

yet it signicantly reduces the amount of iterations compared to a

simple diagonal preconditioner. A common approach for improv-

ing the convergence rate of Krylov-subspace methods is to use a

preconditioner matrix C−1. Many methods exist for approximat-

ing preconditioner matrices, such as LU and Cholesky factoriza-

tions (Golub and Van Loan 1996). Unfortunately, these methods

assume that the matrix is positive denite, and therefore these

preconditioners are not useful for our indenite problem from

Equation (20).

Algorithm 1shows the pseudo-code of our preconditioned CR

solver with inequality constraints. Matrix Bin the solver repre-

sents the matrix from Equation (20)andC−1the preconditioner

matrix such that C−1≈B−1. The blockwise inverse of Bis

B−1=A−1−A−1LTS−1LA−1(S−1LA−1)T

S−1LA−1−S−1,(22)

with LT=(JTJT

t)∈R3Nv×3Ncthe combined constraint matrix

and S=LA−1LT. Next, we approximate matrices Aand Sby

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:9

Ad=diag(A)and Sd=diag(ZLA−1

dLT),respectively, with diag(·)

extracting the diagonal part of its matrix argument and Zadiag-

onal scaling matrix (see the following). Thus, the computations of

A−1

dand S−1

dbecome trivial. Additionally, S−1

dLA−1

dis easy to eval-

uate and yields the same sparsity structure as that of L.Basedon

this, we construct the following preconditioners:

Full:C−1is obtained from Equation (22) by replacing Aand Sby

Adand Sd, respectively;

Diag:C−1=A−1

d0

0S−1

d.

When the preconditioner is applied, only those parts correspond-

ing to active non-penetration and static friction constraints are

considered. To construct the Full preconditioner, we rst compute

the quantities S−1

d,S−1

dLA−1

d,A−1

dLTfor each constraint and use

them when evaluating the blocks of the preconditioner (see Equa-

tion (22)). Furthermore, when constraints are added, removed, or

re-linearized, these precomputed quantities are also updated.

If a positive-denite preconditioner is used, like our Diag pre-

conditioner, then the norm of the preconditioned residual will de-

crease monotonically when the states of the constraints are not

updated. As we will discuss in Section 4.2, updating constraint

states does not always result in a decrease of r(see Algorithm 1),

but the approximation will always be closer to the new optimum.

When an indenite preconditioner is used, the evolution of ris

more chaotic. More importantly, αcan also be negative, which in-

dicates that the current optimum for the preconditioned problem

lies in the opposite direction of p. Such an update does improve the

preconditioned problem (rTC−1r), although generally not the

unpreconditioned problem (rTr). Since the constraint updates

are based on the unpreconditioned values xand λ,anupdateis

only performed if a step toward the unpreconditioned optimum is

taken (i.e., when α>0).

3.4.1 Preconditioner Scaling. The Full preconditioner approx-

imated by Equation (22) signicantly improves the convergence

rate of the method. Unfortunately, this preconditioner will have

large deviations in the upper-left block when Bbecomes singular

or ill conditioned due to (nearly) duplicate constraints in L. When

Lis full rank, both the inverse and pseudo-inverse of Bare equal.

By adding duplicate rows to L,Band thus Sbecome singular. In

our approximation, Sddoes not become singular. Computing then

the approximated block inverse for our preconditioner using Sd

yields a change in the upper-left block of the preconditioner com-

pared to the non-singular case. If this error becomes too large, the

CR method converges signicantly slower. In contrast, the pseudo-

inverse of Bdoes not introduce such a change.

To keep the upper-left block invariant for duplicates in L,itis

sucient to see that duplicate rows and columns can be added

together. As a result, the diagonal values in Sdwould have been

scaled up by the number of duplicates for their corresponding con-

straint. Since we do not add duplicates together, the same scaling

must be introduced to Sdusing Z, which contains, per constraint

in L,the number of similar or duplicate instances. When comput-

ing the upper-left block, duplicate constraints are added implicitly

through the multiplication LTS−1

dL. Since this multiplication also

involves S−1

dand thus Z−1, the dierence introduced by the dupli-

cates is compensated by Z−1.

Similar or identical constraints occur, for example, when an edge

intersects other edges close to one of their shared vertices. The

barycentric coordinate for the shared vertex is relatively large for

all constraints. The other involved vertices have a small contribu-

tion, which makes the constraints almost identical to each other.

For constraints involving deformable bodies, it is sucient to com-

pute, for each pair of constraints aand b, a weight based on the

dierences between their barycentric coordinates (i.e., (1−|wa,i−

wb,i|), with ia vertex id). The similarity of a pair is the product of

these factors for each vertex that aand bhave in common. Even-

tually, the total scaling factor for one constraint is the sum of all

of these products. For contacts between rigid bodies (Figure 2(c)),

many constraints can act on the same degrees of freedom of the

rigid objects. Here the amount of duplicates, and thus the error in

the preconditioner, can be potentially large. In this case, it is suf-

cient to scale all constraints working on the same two bodies by

the total number of constraints between those bodies. This is in

some way similar to the method of Tonge et al. (2012).

3.5 Optimizations

The convergence rate of the method described in Algorithm 1is

improved by allowing constraints to update their status at dynamic

intervals. In other words, the closer the method is to convergence,

the smaller the intervals are between successive constraint evalua-

tions (see line 2 of Algorithm 2). Eventually, constraints are evalu-

ated every iteration when the residual is small. If we always allow

constraints to update their status every iteration, in the worst case,

the solver would need to recompute the residual vector as in line 19

every iteration, instead of using the recurrence from line 15. The

performance would then be comparable to that of a Gradient De-

scent method, which can converge slowly due to zigzagging.Con-

versely, when constraints are only allowed to update their status at

convergence, one has an Active Set method. In this case, the num-

ber of iterations between successive constraint evaluations can be

relatively large. Due to this, the solver can enter a loop in which

constraints continuously change their status. This constraint cy-

cling drastically aects solver convergence and should be avoided.

By evaluating constraints at dynamic intervals, the solver re-

sponds fast enough to situations in which constraints should

change states, although also slow enough for the solver to exploit

the conjugacy of the residual vectors. A positive side eect of this

strategy is that the number of residual re-evaluations (see line 19) is

signicantly reduced. We have run a large number of experiments

while tuning the relation between the computed interval and the

residual norm. We have found that this strategy works very well

for eciently solving contact-response problems. This approach

gave good results in all test cases but are not optimal for all cases.

Within our method, the possibility still exists that constraints

change their status a large number of times, decreasing the con-

vergence rate. To prevent this, one approach is to keep (at some

point) constraints in a xed state, as mentioned in Raghupathi and

Faure (2006). Unfortunately this results in a violation of the condi-

tions specied in Sections 3.1 and 3.2, which could introduce ad-

ditional energy to the system. However, even in such cases, the

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:10 • M. Verschoor and A. C. Jalba

current approximation is able to move toward the optimum, mean-

ing that the method is still able to converge (see Luenberger

(1973)).

When a constraint is about to change (see line 19 of Algo-

rithm 2), the change is postponed if the change in distance is less

than ϵ2. In this case, the eect of performing the update is negli-

gible. This strategy also eliminates undesired oscillations of con-

straint states (constraint cycling) that have no eect on the nal

result. This usually occurs when the solution for a particular con-

straint is located close to a discontinuity in the derivatives (i.e.,

when a vertex is about to slide or when two entities are barely

touching).

Each time constraints change states, vectors r,p,and Bp must be

recomputed to restore the conjugacy of the residual vector. Since

the computation of the residual requires a full multiplication with

matrix B, this is not very ecient. However, since each residual

vector can be decomposed as r=ru+rc, with ru=b−Av the un-

constrained residual and rcthe remaining constraint residual, a

multiplication with matrix Acan therefore be completely omitted

since ruis not aected by a state change. Indeed, only rcneeds to

be recomputed, which signicantly improves performance. Please

note that this decomposition requires that other intermediate vec-

tors and computations are decomposed similarly.

4 CONVERGENCE

In this section, we discuss the convergence behavior of our

method, given the criteria described in Section 3for switching

constraints. First, we show that a minimal residual, in combina-

tion with all constraints satised, implies that a global solution is

found. Next, we show that successive updates of constraints lead to

a state in which all constraints are satised. Finally, we show that

when all constraints are satised but the residual does not reach

the minimum, its gradient will reach the minimum instead.

4.1 Global Convergence

The Delassus operator (LA−1LT), where LT=(JTJT

t),de-

scribes, for each pair of constraints that share the same object in

the inverted generalized mass matrix A−1, their inuence on each

other. The inverted Delassus operator can therefore be seen as the

“solution” to the contact problem and describes the inuence of

each pair of constraints onto each other, no matter how many ob-

jects and constraints are present in the chain between the two con-

straints. Hence, this solution is a global one. In our method, the De-

lassus operator is not used. However, the CR method minimizes

By −d, with y=B−1dits minimum. Given the blockwise in-

verse of B(see Equation (22)), minimizing By −dalso implicitly

applies the Delassus operator. This is equivalent to solving both λ

and γthrough the Delassus operator, and applying these forces to

the bodies to obtain the unknown velocity v.

Within our method, the states of the constraints are actively

switched when they do not agree with the currently computed

v,γ,and λ. When some constraints change states, the method must

reset vectors r,p,and thus Bp (i.e., a state change inuences the

residual energy of the system). This reset allows the method to

search in a direction that minimizes the energy according to the

new state. Since all constraints and the deformation problem in

Fig. 5. Activation and deactivation of a constraint.

sub-matrix Acontribute to the residual, a suciently small resid-

ual should imply that the problem is solved. However, the solution

can only be the global minimizer if all constraints are in their nal

state at convergence . If not, then constraint states are changed, the

residual will be inuenced, and thus the current solution cannot

be a global minimizer for the problem. The method then continues

until all constraints are satised.

Assuming that the constraint states are known and only active

constraints are considered, a global minimum exists if the con-

straints are convex and Aand the second derivatives of the con-

straints (which vanish for linear constraints) are symmetric and

positive denite (see Luenberger (1973)). At this global minimum,

all multipliers of all active constraints are strictly positive (or not

clamped in case of friction constraints) and their distances are zero.

When inactive constraints are considered as well, their multipliers

are zero and their distances are strictly positive. Hence, the com-

plementarity conditions are satised, and the complementarity er-

ror vanishes (see Section 6.3). Let us dene such a residual that,

once minimized, solves Equation (20)—that is,

rд=

Av −b+JT

A(λ)++JT

t,S(γ)μλ +JT

t,K(γ)μλ

(JAv−cn)+(JIv−cn)−

γT(Jt,Sv−ct)+δT(Jt,Kv−ct)−

,(23)

with JAand JIcorresponding to all active and inactive non-

penetration constraints; similarly, Jt,Sand Jt,Kcorrespond to

all static and kinetic friction constraints, respectively. Further-

more, the multipliers and distances are clamped by operators

(·)−,(·)+,(·)μλ between (−∞,0),(0,∞),and (−μλ,μλ),respec-

tively. At the global minimum, rд=0⇒r=0. Conversely,

r=0⇒rд=0 if and only if no constraints are violated. Un-

fortunately, the nal constraint states for which this relation holds

are not known apriori.

4.2 Constraint Updates

In the following, we reason about the implications of updating con-

straint states, as illustrated by Figure 5. We consider only non-

penetration and kinetic friction constraints, as static friction can

be treated similar to non-penetration constraints.

Activation of non-penetration constraints. Figure 5(a) shows

the activation of an inactive constraint Ckat iteration j.Its

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:11

distance jkvj−ck,nis positive, thus not contributing to rдnor

to r. By minimizing rin the direction of pj,anewapproxima-

tion vj+1is obtained, which is closer to the current minimum v∗

(Luenberger 1970). If distance jkvj+1−ck,nbecomes negative, the

constraint is activated. Due to this active constraint, the new min-

imum v∗∗ along pjnow lies on the (green) plane dened by the

constraint, which intersects the path between vjand vj+1. Since

vj+1is now closer to the new optimum v∗∗ along pjthan vj

was to the previous optimum, this constraint switch results in

an improvement of the approximation. However, the distance be-

tween vj+1and v∗∗ appears as an additional residual term via

jkvj+1−ck,n=jk(vj+1−v∗∗), through the rst term in the sec-

ond row of Equation (23). Depending on the used preconditioner,

rmight or might not decrease. However, since approximation

vj+1will now be closer to the new optimum, this step including

the constraint activation is an improvement.

Deactivation of non-penetration constraints. Figure 5(b) shows

the deactivation of a constraint Ck. At iteration j,distance jkvj−

ck,nis negative. Next, a new step in direction pjis performed,

with vj+1the new approximation. When both λk<0andjkvj+1−

ck,n>0 hold, the constraint must be deactivated. The negative

multiplier in combination with a positive distance indicates that

the minimum lies on the positive side of the constraint and not on

its plane, and hence the constraint is working in the wrong direc-

tion and can be deactivated. Since jkv−ck,nis zero somewhere

between vjand vj+1, and the new minimum v∗lies on the posi-

tive side of the constraint, vj+1is closer to v∗than vjwas. Hence,

the state is improved. Since the positive distance jkvj+1−ck,nand

negative multiplier are clamped in Equation (23), rдdecreases.

The actual ragain might or might not decrease, because it is

based on active constraints and possible negative multipliers.

Delayed evaluation. When constraints are evaluated and

switched at xed intervals, noptimization steps are performed

that move the current approximation closer to the current opti-

mum. This can also be considered as a single optimization step.

If constraints do change their state after nsteps, a new opti-

mum is obtained and the method proceeds in that direction. This

only demonstrates that the method eventually converges to an

optimum. The choice of nlargely aects the performance of the

method. In general, the larger nis, the larger is the possibility

that the method overshoots, which results in a smaller overall im-

provement per noptimization steps. Therefore, we keep nlarge for

large residuals and decrease nwith the residual norm (see line 2 of

Algorithm 2).

Kinetic friction constraint update. The update of a kinetic fric-

tion constraint changes the magnitude λ

kand direction δkof the

kinetic friction force. Since the kinetic friction force is placed on

the right-hand side of Equation (20), any update of δkand λ

k

results in a change of r. When directions jk,tv−ck,tand δk

are misaligned, δkis updated as described in Section 3.2. Since

each updated δkis somewhere between the previous δkand

jk,tv−ck,tdue to moving average δk,a, the angle between these

vectors becomes smaller (see Figure 4). Due to this, also the change

in jT

k,tδkμλ(the kinetic friction force; see the right-hand side of

Fig. 6. Plots of several residual norms for preconditioners Diag and Full

of the simulation timestep shown in Figure 7. The non-linear updates of

the constraints are indicated by circles. The preconditioned residual norm

is computed as C−1/2r, the constraint residual norm as Ur ∞,and

the preconditioned constraint residual norm as UC−1/2r∞. Due to the

infinity norm, the shown (preconditioned) constraint residuals represent

an upper bound of the actual constraint residual.

Equation (20)) becomes smaller. Therefore, successive increases of

rdue to these updates (through the last term in the rst row of

Equation (23)) become smaller and eventually vanish when δkand

jk,tv−ck,tare parallel.

Convergence plots. Figure 6depicts the convergence behavior of

our method for both preconditioners for the simulation timestep

shown in Figure 7. Figure 6(a) shows the residual norms obtained

with the Diag preconditioner. The residual shows a similar behav-

ior compared to the preconditioned residual and (preconditioned)

constraint residuals. Although the residual does not provide much

information about the convergence, the preconditioned residual

C−1/2rshows a decreasing behavior on the lower bound. A state

change of a constraint results in an increase of the residuals. Af-

ter continuing for a few iterations, the preconditioned residual is

(in most cases) smaller compared to its norm before the state up-

date. Additionally, the (preconditioned) constraint residual shows

an overall decreasing trend on the upper bound of the error, indi-

cating that, in general, the update of the constraint states eventu-

ally results in a better approximation. This behavior also explains

the eect of the optimization discussed in Section 3.5 in which the

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:12 • M. Verschoor and A. C. Jalba

Fig. 7. Test case in which nine deformable spheres roll between a (trans-

parent) rigid torus and a rotating spherical object. Figure 6depicts the

residual norms at a certain simulation iteration.

constraints are evaluated at a certain rate depending on the resid-

ual norm. This allows the method proceed toward the new opti-

mum for a few iterations until constraints are re-evaluated. The

large peaks in the plots correspond to the non-linear updates of the

constraints. The intervals between successive non-linear updates

become smaller as the approximation approaches the nal solution

(see Section 3.3). Figure 6(b) shows the (preconditioned) residu-

als obtained with the Full preconditioner, which shows less cor-

respondence with the (preconditioned) constraint residuals. How-

ever, the constraint residuals show the same behavior compared to

the Diag preconditioned case, albeit the Full preconditioned case

results in a much faster convergence. The constraint tolerance for

both experiments were ϵ2=10−6and a relative tolerance for the

residual of ϵ1=10−5.

4.3 Local Minima

Whenever the problem is over-constrained, no unique solution ex-

ists. Hence, the problem has local minima. At such a local min-

imum, the gradient vanishes. Since the CR method minimizes

C−1/2r2=|rTC−1r|, the gradient of the minimized function

(2BC−1r) becomes zero at a local minimum. When this happens, α

becomes zero in line 9 of Algorithm 1, so the approximation can-

not be further improved. Next, the computation of βwill result

in a division by zero, causing the method to break down. To pre-

vent this, the norm of the gradient function (second test in line 22

of Algorithm 1) is also inspected, as proposed by Hayami (2002).

If this norm drops below ϵ1, the method has computed a least-

square approximation for the current local minimum. This allows

the method to perform the checks in lines 23 through 25 and to

update the problem.

5 SYSTEM OVERVIEW

Non-penetration and friction constraints act on subsets of vertices

of the colliding models. To constrain the movement globally, all

vertex-face and edge-edge collision pairs should be detected, col-

lected, and assembled in (global) matrices Jand Jt. Since the solu-

tion of Equation (20) is collision free, a standard collision detection

system would not nd any collisions in the beginning of each sim-

ulation timestep. This suggests that all collisions would have to be

detected inside the internal loop of the CR method. However, doing

so would be prohibitively expensive in terms of computations.

Algorithm 1gives the overall pseudo-code of our collision han-

dling system, which is further described in the following sections.

Within our approach, we search once for all possible candidate col-

lision pairs at the beginning of each simulation timestep (see line 5

of Algorithm 1). Then, all existing constraints are updated. When

the solver converges, a collision check is performed (see line 25). If

no new collisions are found, then all active constraints are checked

if their conguration and state agree with the actual geometry

and velocity; if necessary, constraints are re-linearized or removed

from the system (see line 27). Finally, if the system is not updated,

the state of the simulation is guaranteed to be collision free, and

the error made by each constraint is guaranteed to be less than the

desired tolerance.

5.1 Collision Detection

When the simulation is initialized, a Bounding Volume Hierar-

chy (BVH) is constructed, containing axis-aligned bounding vol-

umes enclosing all surface faces (triangles) of the simulated bodies

(which coincides with the simulation meshes; see line 2 of Algo-

rithm 1); our hierarchical data structure is a binary tree. The BVH

is used to quickly nd potential face-face collisions by testing for

intersection of their bounding volumes. Since deformable objects

can have self-collisions, all faces of an object must also be tested for

collisions with all other faces of the same object. Since bounding

volumes of adjacent faces will intersect, one approach to discard

false positives is to terminate the tree traversal when both faces

belong to the same (self-collision free) surface patch (see Volino

and Thalmann (1994)). When there is a possibility that both faces

can collide at the end of the timestep, both faces must be included

in further collision checks to guarantee a collision-free state at the

end of the timestep.

To detect nearby faces of a given face, we extend each bounding

box by 3Δtvin the directions of its vertex velocities. For each face

represented in the BVH, a set is created that stores all nearby and

potentially colliding faces. All faces whose extended bounding vol-

umes intersect the one of the current face are selected by travers-

ing the tree. These face-face pairs are then used to create so-called

candidate lists. The candidate lists contain, for each vertex/edge, a

list of all nearby faces/edges (the candidates) that can potentially

collide; duplicate edge-edge pairs are discarded.

5.2 Raw Collision Detection

At convergence, all candidate pairs (vertex-face and edge-edge) are

checked for collisions given the current velocity (see line 25). First,

each collision pair is updated (time integrated) using the current

velocity. If the pair has intersected, a root-nding method, such

as the Brent-Dekker method (Press et al. 1992), is used to nd

the collision point, contact normal, and barycentric coordinates,

given the current and initial geometry state (at the beginning of

the timestep). Then, the corresponding non-penetration constraint

is initialized, activated, and stored in matrix J(see Section 2.3).

Likewise, the corresponding friction constraints are initialized and

stored in Jt. Since this collision check is performed when the solver

converges, new constraints are added as long as the state is not

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:13

Fig. 8. Simulations of multiple elastic objects. The collision response is eiciently computed through our method, which can handle complex situations

such as tens of thousands of constraints, large impact forces, and complex interactions (see the text and accompanying video).

collision free. This is similar to the Constraint Manifold Rene-

ment (CMR) method of Otaduy et al. (2009), to ensure that no col-

lisions/constraints are missed. Please note that the collision check

relies on the candidate pairs so that (multiple) tree traversals are

avoided. In some exceptional cases, a vertex can move out of its

extended bounding volume such that collisions might be missed.

If such a case is detected at convergence (line 25), using a sim-

ple vertex-in-box check, we need to search locally for additional

missed collisions. This search is done by rst computing the ex-

tended bounding box and rechecking the BVH for collisions with

the updated box. If any new box-box intersections are found, the

corresponding candidate lists are updated, and a collision check

is performed on the updated candidate lists. The overhead of this

additional check is relatively small—up to 5% of the total collision

detection time.

6RESULTS

In this section, we validate our approach by providing quantitative

and qualitative results, and comparing these to those of existing

methods. An overview of example results is shown in Figure 8.

6.1 Varying Parameters

The plot in Figure 9shows the average number of solver iterations

during the rst second of the experiment shown in Figure 8(e) for

dierent values of Δt. In general, a larger Δtrequires more iter-

ations per simulation step, but fewer simulation steps are needed

for advancing the simulation to a given timestamp. However, in

all cases, the total amount of solver iterations is comparable. We

Fig. 9. Number of solver iterations per simulation step for dierent values

of Δt(s)andtheexperimentshowninFigure8(e), with E=5×106Pa.

observed that simulations with smaller timesteps reveal subtle mo-

tions of objects but require more iterations; however, such details

are not visible when larger timesteps are used.

We have also changed the stiness parameter Ewhile keeping

Δtxed at 0.001s. A smaller stiness parameter generally results in

faster convergence for unconstrained problems. When the objects

are less sti, we observed that the method requires more New-

ton steps due to larger deformations, and this often requires more

iterations. For instance, the setup shown in Figure 8(e) is simu-

lated using varying stiness parameters starting from 5 ×106Pa

to 3.125 ×105Pa by dividing Eby two for every simulation. Only

for the case E=3.125 ×105Pa was the total amount of iterations

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:14 • M. Verschoor and A. C. Jalba

about 1.5 times larger than for E=5×106Pa. In all other cases,

these numbers were similar. Please note that it is dicult to quan-

tify these results because a dierent stiness parameter results in

a dierent behavior of the material (and simulation). In case of a

collision, the time that objects have contact is larger for exible

objects, which inuences the behavior of the method.

6.2 Comparative Results

In this section, we compare various versions of our method against

ICA (Otaduy et al. 2009) and SP (Kaufman et al. 2008). For this

comparison we have simulated three setups with varying di-

culty degrees (see Figures 8(h), (e), and (b)). All methods used

double-precision arithmetic and converged to the same absolute

error (ϵ1=5×10−5). Additionally, our method uses a threshold

for updating vectors δkof ϵθ=1.2 degrees and used a constraint

tolerance/safety distance ϵ2=5×10−6. All objects had the fol-

lowing material properties: ν=0.2 (Poisson’s ratio), E=5×105Pa

(Young’s modulus), and ρ=1,000kg/m3(density). Furthermore, a

gravitational acceleration of д=9.81m/s2was used. The FEM ma-

chinery is based on co-rotated nite elements (Müller and Gross

2004), and no additional damping was used. Our test machine was

equipped with a 4GHz AMD FX-8350 CPU (using one core) and

16GB of RAM memory. All methods use a warm start (reuse val-

ues from the previous simulation iteration), the same collision de-

tection system, the same optimized routines for vector-vector and

matrix-vector operations, and the same tolerances/precision in an

attempt to make a fair comparison.

The rst experiment from Figure 8(h) contains 120 randomly

placed elastic rings, simulated with a timestep Δt=0.001s. The to-

tal number of contact points grew to more than 1,500. The second

experiment (Figure 8(e)) contains 140 objects, which are aligned

in a pyramid. For Δt,we used 0.0005. The experiment shown in

Figure 8(b) uses complex objects in which many internal elements

exist. For this experiment, we randomly placed 120 bunnies with a

Young’s modulus Eof 5 ×106Pa and simulated with Δt=0.001s.

The friction coecient was set to 0.5 for all simulations. Table 1

shows, for each method, the average (and median) time spent on

collision detection, contact resolution, solving the whole contact

problem, and the average number of iterations performed by all

methods. Furthermore, additional details about the simulations

are provided. The application of the Full preconditioner required

about 15% of the total time, whereas its construction time was

negligible—less than 0.1%.

6.2.1 Hyper-Elastic Materials. In addition to linear FEM, we

also made a comparison using highly deformable, hyper-elastic

models. The stiness of hyper-elastic materials changes with the

amount of compression. For a neo-Hookean material, the stress

will approach innity when the volume of the object approaches

zero. Due to this, numerical methods have to deal with large con-

tact forces. Unfortunately, directly using these materials can cause

problems, as small changes in deformation could result in exces-

sively large forces. To deal with this, the underlying energy den-

sity function is linearly extrapolated, as described in Stomakhin

et al. (2012). Furthermore, since more deformation is involved, all

methods need to re-linearize constraints more often. For ICA, this

implies that the LCP matrix also needs to be re-computed. On

Fig. 10. Total runtime and solver iterations for a hyper-elastic object

(see Figure 1and the Armadillo case in Table 1). The total running-

time includes all tasks performed during the process, including collision

detection.

average, constraints are re-linearized 5 times per timestep, with

peaks approaching 10 times. In our test case (see Figure 1), a neo-

Hookean energy density function is used and extrapolated when

the volume of an element drops below 70% of its initial volume.

Furthermore, the Lamé parameters were set using Young’s mod-

ulus of elasticity E=5×105Pa and Poisson ratio ν=0.2. An Ar-

madillo consisting of roughly 200K degrees of freedom is pulled

through a set of rotating cylinders, resulting in large compressions,

deformation, and contact forces. The total number of iterations and

total computation time are presented in Figure 10. For all meth-

ods, the total number of iterations and computation time increase

with the amount of compression. This test also faces the under-

lying collision detection with numerous challenging cases, which

are all resolved correctly.

6.2.2 Comparison to ICA. We compared our approach to the

elegant and exible ICA method of Otaduy et al. (2009). We chose

this method for comparison because it constructs and solves com-

plete LCPs (instead of an approximation (Duriez et al. 2006)) and

takes the full generalized mass matrix into account when comput-

ing collision responses. Both of these aspects are essential when

dealing with FEM-based deformable bodies. Furthermore, the com-

putation of non-penetration and friction multipliers are combined,

making the method very ecient. Please note that we needed

to compute the unconstrained velocity with a slightly lower

tolerance to guarantee that the nal approximation is accurate

enough.

In Figure 11 and Table 1, a comparison is shown between our

method and ICA. We compare the average numbers of iterations

and average time per timestep. ICA performs, per iteration, up

to two Sparse Matrix-Vector (SpMV) multiplications: one for per-

forming a (block) Gauss-Seidel step in the outer loop and one

(block) Jacobi step for setting up the right-hand side of the LCPs.

Additionally, the iterations spent on computing the unconstrained

velocity are considered. We did not explicitly count the number of

iterations used for solving the LCPs, as these matrices generally

are very sparse, and the LCPs converge quite quickly.

For both methods, we have observed that computing the multi-

pliers converged quickly compared to the global problem. Within

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:15

Fig. 11. Number of solver iterations per timestep for dierent methods, performing the simulation shown in Figure 8(h) (le) and Figure 8(e) (right). CR

(Full) represents our complete method including the Full preconditioner. CR (Diag) represents our method with the diagonal preconditioner, in whichthe

friction cone is replaced by a friction pyramid. SP (Active Set) is an implementation of the SP method, in which the QP problems are solved using two

CR-based Active Set methods. SP (2xCR) represents an implementation of the SP method, in which the QP problems are solved by a modified version of our

diagonally preconditioned CR method. All methods converged to the same absolute error ϵ1=5×10−5, and used the same constraint tolerance ϵ2=10−6

and double-precision arithmetic. The dashed plots represent test case “Rings*,” in which the stiness was increased.

ICA, a small LCP is solved per iteration, which converges very

rapidly. In our approach, the convergence of the multipliers is

slower because each iteration improves the multipliers by just a

bit, whereas ICA actually solves an LCP. Nevertheless, the conver-

gence rate of the contact problem is mostly bounded (especially

for deformable bodies) by the convergence of the velocity (the de-

formation part) rather than that of the multipliers. For more com-

plex cases, like the Pyramid setup, a signicant amount of time

is spent on the LCPs as well. In the hyper-elastic test case (Fig-

ures 1and 10), ICA tends to perform slower over time. First, per

timestep, more re-computations of the LCPs are required due to

the non-linear motion and deformation. Second, due to the com-

putation of the unconstrained velocity (which releases all stress),

more collisions are detected, and more constraints than needed are

generated. This results in a much larger overhead spent on con-

structing and solving the LCPs. Due to the increased stiness of

the problem, the PGS and GS methods converge slower as well.

Finally, since the test case in Figure 1also involves rigid bodies,

the constructed LCP contains dense regions, which increases the

time per PGS iteration. In Section 7, we shall further discuss the

dierences between both methods.

6.2.3 Comparison to SP. We also compared our approach to SP

(Kaufman et al. 2008). The SP method solves the contact problem

by rst computing the unconstrained velocity, which is then cor-

rected by separately computing impulses of the non-penetration

and friction constraints. This correction procedure rst solves a QP

problem for non-penetration constraints, provided that some esti-

mate of the friction impulses is available, followed by a QP solve

of the friction problem using non-penetration impulse estimates.

This process continues until an optimum is found that minimizes

both the friction and non-penetration sub-problems. Since a FEM-

based discretization results in a large yet sparse matrix A,wehave

used a diagonally preconditioned MINRES/CR-based Active Set

approach for solving the QP problems rather than a dense solver,

as in the original work (Kaufman et al. 2008). Each individual solve

uses a “warm start.” The relative error of the friction impulses is

computed by solving a linear problem using the CG method. Since

the SP method does not guarantee a collision-free state, we have re-

placed the CR solver within our framework from Algorithm 1with

the SP method such that at convergence, additional constraints can

be added and corrected.

In Figure 11 and Table 1, a comparison between our approach

and the SP method is shown. Since SP solves two QP problems per

iteration, the total number of QP solver iterations per simulation

step is counted. We have also used a modied version of our CR

approach as a QP solver for SP. In this solver, the kinetic friction

treatment, described in Section 3.2, is replaced by one in which a

friction pyramid is used. This is because our approximation of the

friction cone is not suitable for use in the SP method.

The main reason for the dierence in the number of solver it-

erations is that SP solves two QP problems, which both inuence

each other. In our approach, both non-penetration and friction im-

pulses are approximated, and constraints are allowed to update

their state more frequently. Due to this, our approach switches

the state of a constraint when the current approximation starts

to deviate from the (unknown) global minimum. Since SP keeps

a part of the constraints xed, while updating the other set, it

can, for instance, omit changing the state of a non-penetration

constraint while solving for the friction impulses. This can result

in a sequence of approximations that is deviating from the (un-

known) global minimum for a longer stretch of iterations. In some

exceptional cases, we have observed a slow convergence due to

cycling between non-penetration and friction constraints. The to-

tal speedup of our method compared to the Active Set–based SP

method is roughly between 7 and 12 times. Replacing the Active

Set solvers by modied versions of our method, an improvement

in the iteration count of about 2 times was obtained when a diag-

onal preconditioner was used. Additionally, we have also applied

a modied version of our Full preconditioner (in which either the

active non-penetration or static friction constraints were present),

but this approach was not successful.

To run the experiment from Figure 8(e) using SP, we needed

to reduce Δtto 0.0005s, because for larger timesteps, the method

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

17:16 • M. Verschoor and A. C. Jalba

did not converge. Even with the smaller Δt, solving both QP sub-

problems converged properly, but applying each outcome to the

other sub-problem resulted in an oscillating and diverging behav-

ior. This problem appeared, for example, when the rst two layers

of objects collided with a large impact; the eects are visible in

Figure 11(b), in which larger iteration counts (spikes) can be seen.

A similar observation was done for the hyper-elastic test (see Fig-

ures 1and 10). Here also the method takes a large number of it-

erations for solving the individual QPs, and then it requires many

steps for nding a global optimum. A tighter coupling between the

friction and non-penetration constraints seems to be necessary in

these kinds of situations. Using our method, we were able to in-

crease Δteven further and even for stier models (see Section 6.1).

When the stiness of the models is increased (setup “Rings*”), SP

seems to converge much slower compared to both ICA and CR.

When stier and more complex objects are used (case “Bunnies”),

SP did not properly converge, whereas the QP problems did con-

verge. Therefore, these results are not present in Table 1.

6.2.4 Comparison to Reduced-form Methods. Reduced-form

methods transform the complete contact problem into a reduced

one and solve dynamics and contact separately. These forms re-

quire the Delassus operator W=LA−1LT,whichisoftenusedin

methods in which the number of degrees of freedom per object is

relatively small, such as granular materials, rigid bodies, reduced

deformable bodies, or ber simulations. In those cases, the gen-

eralized mass matrix Acan be inverted eciently. For deformable

bodies with a large amount of degrees of freedom, the computation

of A−1is more demanding and may bring extra inaccuracies. As

suggested in Bertails-Descoubes et al. (2011), A−1can be found

through a Cholesky decomposition followed by forward and back-

ward substitutions. Since A−1contains large and dense blocks, and

not all columns of A−1are required for constructing W,itisprefer-

able to compute Wthrough mforward and backward substitu-

tions involving A,LT,andL, with mthe number of constraints (see

Daviet et al. (2011)). This omits the explicit form of A−1, which can

have a very large memory footprint.

The method in Tonge et al. (2012) does not explicitly compute

Wbut computes, per contact block, each individual LA−1LTfor

each constraint and object associated with the contact block and

accumulates this in a small matrix. The computational complexity

is similar to the method in Daviet et al. (2011), in which only the

non-zero blocks of Ware computed. Their running-time analysis

for constructing Wassumes that the degrees of freedom per ob-

ject are bounded, and that the computation time is dominated by

the squared number of constraints. Hence, by exploiting the block-

diagonal structure of A,Wcan be assembled eciently.

The main problem with deformable bodies is to compute W

in reasonable time. Unfortunately, all mentioned methods assume

that A−1is easy to compute, which is not the case for deformable

bodies with a large amount of degrees of freedom. Figure 12 shows

the time consumed for computing Wthrough a Cholesky decom-

position (by also taking the block structure of Ainto account

(Davietetal.2011)) and our method for the same number of con-

straints. This clearly shows that the computation time of Wgrows

with the number of constraints, where its slope is determined by

Fig. 12. Timing comparison of our method compared to the time required

for constructing the Delassus operator LA−1LTusing the optimized ap-

proach of Daviet et al. (2011) for the Rings, Armadillo, and Bearing test

cases, respectively, in Table 1 (see also Figures 1,8(h), and 6). The numbers

in the legend refer to the le (1) or right (2) y-axis.

the complexity of computing A−1(which mainly depends on its

structure and/or conditioning). Once all blocks of the Delassus op-

erator are computed, the methods can start solving the problem,

typically using a (P)GS method in which Wis used as the iter-

ation matrix (Daviet et al. 2011; Tonge et al. 2012) (both meth-

ods explicitly require the diagonal blocks of W), or by using a

Newton method in which at each iteration the search direction

and step size is found by solving linear systems involving W

(Bertails-Descoubes et al. 2011). Alternatively, in the latter method,

the Delassus operator can be applied implicitly using an opera-

tor that solves a linear system involving A. However, we experi-

enced convergence issues when solving a linear problem involv-

ing this operator for the examples shown in Figures 1and 8(h).

This is likely caused by the bad conditioning of Wdue to dupli-

cate constraints or multiple constraints between the same degrees

of freedom, which typically occur between rigid and/or deformable

objects, or in cases of large compression. In fact, they mention

that their method cannot solve these types of problems, including

stacking of rigid bodies as shown in Figure 2(c) for our method.

Similar issues are mentioned in Daviet et al. (2011) when Lbe-

comes rank decient. Please note that Figure 12 only considers the

time required for constructing the Delassus operator. On top of

that, the actual running time of the method must be added. Fur-

thermore, the plot does not take into account additional updates

of Wdue to re-linearized constraint Jacobians, which boils down

to re-computing Wa few times per timestep.

6.2.5 Comparative Timings. Comparing only the iteration

count, our approach requires between 10 and 60 times fewer it-

erations compared to SP. Similarly, our method requires between

2 and 8 times fewer iterations than ICA. When the actual compu-

tation time is taken into account, the dierences are small for rela-

tively simple models. When the complexity of the models increases

(e.g., due to arbitrary shaped tetrahedral elements and many in-

ternal vertices), the timing dierences become larger. This is due

to the increased density and conditioning of matrix A. The con-

ditioning aects the convergence rate, whereas the density aects

the time spent per iteration. Furthermore, when a model has many

ACM Transactions on Graphics, Vol. 38, No. 2, Article 17. Publication date: March 2019.

Eicient and Accurate Collision Response for Elastically Deformable Models • 17:17

Table 1. Comparison of Our Method (CR (Full)) Against Various Instances of SP (With Active Set Solvers or a Modified Version of Our Approach) and ICA

Method Resolution (s) Collision (s) Time (s) Iterations Constraints Objects Elements Faces Setup Δt(s)E(Pa)

SP (Active Set) 5.6 (3.2) 0.68 (0.72) 6.2 (3.9) 1,546 (780) 2,385 (2,919) 120 12,960 17,280 Rings 0.001 5 ×105

SP (2xCR Diag) 5.0 (4.4) 0.68 (0.72) 5.7 (5.2) 814 (728) 2,340 (2,886) 120 12,960 17,280 Rings 0.001 5 ×105

CR (Diag) 2.8 (2.3) 1.1 (1.0) 3.9 (3.5) 451 (340) 2,435 (2,976) 120 12,960 17,280 Rings 0.001 5 ×105

ICA 0.8 (0.7) 0.85 (0.85) 1.6 (1.5) 180 (134) 2,846 (3,180) 120 12,960 17,280 Rings 0.001 5 ×105

CR (Full) 0.52 (0.44) 0.94 (0.96) 1.46 (1.43) 97 (76) 2,280 (2,466) 120 12,960 17,280 Rings 0.001 5 ×105

SP (Active Set) 20.8 (11.75) 2.9 (2.9) 23.7 (14.9) 1,088 (604) 8,647 (9,651) 140 60,480 73,920 Pyramid 0.0005 5 ×105

SP (2xCR Diag) 15.6 (11.5) 3.7 (3.8) 19.3 (15.4) 463 (332) 8,901 (9,939) 140 60,480 73,920 Pyramid 0.0005 5 ×105

CR (Diag) 7.6 (6.1) 4.4 (4.3) 12.0 (10.8) 229 (179) 8,871 (9,877) 140 60,480 73,920 Pyramid 0.0005 5 ×105

ICA 14.2 (3.8) 3.77 (3.61) 17.95 (7.77) 558 (75) 8,734 (9,765) 140 60,480 73,920 Pyramid 0.0005 5 ×105

CR (Full) 2.3 (1.9) 3.77 (3.70) 6.0 (5.6) 69 (59) 8,565 (9,546) 140 60,480 73,920 Pyramid 0.0005 5 ×105

SP (Active Set) 20.2 (15.65) 0.9 (1.06) 21.7 (16.7) 3,373 (2,423) 2,290 (2,892) 120 12,960 17,280 Rings* 0.001 5 ×106

ICA 2.1 (1.7) 0.78 (0.75) 2.7 (2.5) 655 (550) 2,439 (3,217) 120 12,960 17,280 Rings* 0.001