ume˚a university - umu. · pdf filesurface forces are the forces exerted on the boundary of...

64
FEM-BASED SIMULATION OF SOFT-BODIES Hans Mannby May 27, 2007 Master’s Thesis D, 20 credits Supervisor at Department of Mathematics: August Johanson Examiner: Mats G. Larson Ume ˚ a University Department of Mathematics SE-901 87 UME ˚ A SWEDEN

Upload: buidung

Post on 07-Mar-2018

216 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

FEM-BASED SIMULATION OF SOFT-BODIES

Hans Mannby

May 27, 2007Master’s Thesis D, 20 credits

Supervisor at Department of Mathematics: August JohansonExaminer: Mats G. Larson

Umea UniversityDepartment of Mathematics

SE-901 87 UMEASWEDEN

Page 2: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure
Page 3: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Abstract

This report aims to give an understanding of the theory behind the soft-body imple-mentation, which has been the main part of this thesis. This report provides a theoreticintroduction to the finite element modeling (FEM) technique used for discretizationwhen simulating soft-bodies. A method which in a step-by-step manner transforms themodel equations governing the response of a soft-body into it’s discrete counterpart isintroduced. The report also sheds some light on the phenomena called ”locking”, whichmay occur when a material is taken to the incompressible limit. As a way to avoidlocking the discontinuous Galerkin method is introduced in the report. When dealingwith environments containing several objects it becomes crucial to determine whetheror not the objects are in contact. Therefore different algorithms and techniques used forcollision detection are presented and analyzed based on their ability to handle the addedcomplexity arising due to the soft-bodies ability to deform. To resolve and determinethe consequences of a collision, the subject of collision response is also briefly covered.

FEM-BASED SIMULATION OF SOFT-BODIES

Page 4: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

ii

Page 5: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Contents

1 Introduction 11.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Problem Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Soft Body Simulation 32.1 A Crash Course In Solid Mechanics . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.1.2 Stress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.1.3 Strain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.1.4 Relation between stress and strain . . . . . . . . . . . . . . . . . 82.1.5 Volume strain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.2 Mathematical Model Of Linear Elasticity . . . . . . . . . . . . . . . . . 102.2.1 The Green-Lagrange Strain Measure . . . . . . . . . . . . . . . . 102.2.2 A Linear Strain Measure . . . . . . . . . . . . . . . . . . . . . . . 11

2.3 Discretization, The Finite Element Method . . . . . . . . . . . . . . . . 122.3.1 The Weak Form, A Variational Statement . . . . . . . . . . . . . 122.3.2 The Galerkin Method . . . . . . . . . . . . . . . . . . . . . . . . 15

2.4 Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182.4.1 Integration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

2.5 The Co-Rotated Method . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.5.1 Determining the orientation . . . . . . . . . . . . . . . . . . . . . 21

2.6 Dealing With Incompressibility, The Discontinuous Galerkin Method . . 222.6.1 The Incompressible Limit, The Crouzeix-Raviart Element . . . . 26

2.7 Collision Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.7.1 Bounding Volume Hierarchies . . . . . . . . . . . . . . . . . . . . 272.7.2 Spatial partitioning . . . . . . . . . . . . . . . . . . . . . . . . . 332.7.3 Image space techniques . . . . . . . . . . . . . . . . . . . . . . . 372.7.4 Distance fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

2.8 Collision Response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402.8.1 The Penalty Based Method, Springs . . . . . . . . . . . . . . . . 402.8.2 Lagrange Undetermined Multipliers . . . . . . . . . . . . . . . . 41

iii

Page 6: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

iv CONTENTS

3 Accomplishment 453.1 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.2 How the work was done . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.3 Implemented features . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4 Conclusions 494.1 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5 Acknowledgements 51

References 53

Page 7: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

List of Figures

2.1 Body under the influence of external forces . . . . . . . . . . . . . . . . 32.2 Forces on a thin surface . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Decomposed surface forces . . . . . . . . . . . . . . . . . . . . . . . . . . 42.4 Infinitesimal box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.5 Decomposed internal forces . . . . . . . . . . . . . . . . . . . . . . . . . 52.6 Normal strain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.7 Example of shear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.8 Deformed square element . . . . . . . . . . . . . . . . . . . . . . . . . . 72.9 Triangular element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.10 Linear base functions in 2D and 3D . . . . . . . . . . . . . . . . . . . . . 152.11 Deformed bar with globally large deformations . . . . . . . . . . . . . . 202.12 Deformed tetrahedron . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.13 Two neighboring elements in 2D . . . . . . . . . . . . . . . . . . . . . . 242.14 Integrated penalty term . . . . . . . . . . . . . . . . . . . . . . . . . . . 252.15 Example of a self intersecting shape . . . . . . . . . . . . . . . . . . . . 322.16 Example of a self intersecting shape . . . . . . . . . . . . . . . . . . . . 322.17 Scan line intersections on a 2D figure . . . . . . . . . . . . . . . . . . . . 382.18 Illustration of the stages in a LDI-based collision detection . . . . . . . . 38

v

Page 8: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

vi LIST OF FIGURES

Page 9: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Chapter 1

Introduction

1.1 Background

This thesis was conducted at the institution of mathematics under the guidance of Prof.Mats G. Larsson and in cooperation with the company Surgical Science AB. SurgicalScience develops surgical simulators to be used to assess and train medical professionalsin laparoscopic surgery. One of the major issues in virtual surgery is how one shouldsimulate and describe the soft-bodies. Together we identified some of the problemswhich needs to be solved in order to meet the demands on higher realism in surgerysimulations. The key-issues where found to be those of improved handling of incom-pressible bodies and the modeling of contacts between them and other bodies.

The improved handling of incompressibility is of importance since most human organsare in fact close to incompressible. The modeling of contacts is of great importance sinceit’s the most natural way for bodies to interact. Some of the problems when dealingwith contacts is how to avoid the objects penetrating each other and how to render theforces needed to fulfill this. This problem is further complicated by demanding that thecontact forces rendered should be plausible enough to be used as input to haptic devices.

1

Page 10: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2 Chapter 1. Introduction

1.2 Problem Description

The main task which this thesis aim to solve is the simulation of interacting soft-bodies.A significant part of this thesis has been to gain in-depth knowledge of the theory behindsimulating soft-bodies.

The first part of the thesis consists of the following theory parts:

• An in-depth study of FEM modeling for soft-bodies and the model of elasticity.

• An in-depth study of the discontinuous Galerkin method.

• An in-depth study of collision detection algorithms to aid in future implementation.

• An in-depth study of collision response algorithms to aid in future implementation.

The implementation part of the thesis is to:

• Implement a FEM-formulation of soft-bodies operating on tetrahedrons.

• Implement a simulation environment which is visualized using either Direct-X orOpenGL.

• Implement a FEM-formulation using the discontinuous Galerkin method to avoidlocking when dealing with materials which are close to incompressible.

• Implement solvers to solve the equation systems governing the dynamics of thesystem.

Page 11: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Chapter 2

Soft Body Simulation

2.1 A Crash Course In Solid Mechanics

This chapter aims to give a brief introduction to the different notations and conceptsused in solid mechanics. Solid mechanics is also known as the theory of elasticity andis a branch of physics that governs the response of solid materials to applied stress(e.g external forces, applied displacements, etc.). If you are interested in a more thor-ough explanation of the concepts introduced in this chapter I recommend the followingliterature [16][13][10].

Figure 2.1: A body being affected by external forces. The arrows marked Pi are surface forceswhile the gradient arrow F is a body force.

3

Page 12: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

4 Chapter 2. Soft Body Simulation

2.1.1 Forces

The most common source of applied stress is due to external forces. The external forcesacting on a body belong to one of the following two categories:

Body forces

Body forces act on the mass of matter present without the need of physical contact withthe body, some examples of body forces are gravity and magnetism.

Surface forces

Surface forces are the forces exerted on the boundary of the body due to contact withother bodies.

2.1.2 Stress

External forces applied to a body causes forces distributed through the material whichtransmit the effects of the external forces between their points of application. Theseforces are called internal forces. Internal forces are specified in terms of a quantitycalled stress.

Figure 2.2: A thin slice where theforces acting on opposite sides of thesurfaces coincide at point C

Figure 2.3: The internal force dividedinto its tangential and normal compo-nents

Consider a slice of material caught between two imaginary planes, as in figure 2.1. Theparts of the body separated by the plane exert internal forces distributed over the sur-face of the slice. If the body, as a whole, is in equilibrium then so is the slice. If theslice is made infinitesimally thin the lines of action of the forces acting on the oppositesurfaces of the slice will coincide at any position, C. C can be seen as a particle subjectto two forces at equilibrium (see figure 2.2).

Since the internal forces are continuously distributed over the surfaces of the slice itwould be reasonable to relate the magnitude of the forces to the area they act on. Thatis to calculate the pressure generated by the forces. Let ∆A be a small part of thesurface, then the average pressure is defined as:

∆P

∆A= (Tn)average

Page 13: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.1. A Crash Course In Solid Mechanics 5

where ∆P is the force acting on area element, ∆A, and n is the normal of the surface(see figure 2.2). If ∆A is taken to limit a point C, the stress on surface n at C is definedas:

lim∆A→0

∆P

∆A= Tn

Since all forces acting on a surface element can be divided into a normal and tangentialcomponent, so can the pressure (see figure 2.3). This would also give a more intuitiveunderstanding of the stress on surface n at C, as it is described in terms of either normalstress:

lim∆A→0

∆PN

∆A= σn

or shear (the tangential stress):

lim∆A→0

∆PT

∆A= τn

where PN and PT is the normal and tangential component of the force. The normalstress describe the compressive or expansive forces while the tangential stress describethe shearing forces acting on the surface.

If another slice was made through the same point but with a different normal, thestresses would in general be different. One could now assume that we would have tomeasure the stress along all different directions to fully define and perceive the stateof stress at point C. Luckily for us this is not the case. In a three dimensional body,a complete definition of the stress at a specific point only requires knowing the stressalong three mutually perpendicular planes, which define a box of infinitesimal dimensionaround the point (see figure 2.5).

Figure 2.4: 1) negative x-side, 2) pos-itive x-side

Figure 2.5: The internal forces di-vided into its tangential and normalcomponents

Page 14: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

6 Chapter 2. Soft Body Simulation

By choosing coordinate-axes that are parallel to the edges of the box, the surfaces ofthe box are named by the direction of their normal relative to the axes, as in figure 2.4.The stress on each surface is then decomposed into its x, y and z components. In figure2.5 this has been done for the x-surface where the components σxx , τxy and τxz areinterpreted as:

σxx the stress component on the x surface acting in the x direction

τxy the stress component on the x surface acting in the y direction

τxz the stress component on the x surface acting in the z direction

The stress components for all surfaces can now be collected in a matrix, which can beused to find the stress along any direction around a point C:

σ =

σxx τxy τxz

τyx σyy τyz

τzx τzy σzz

(2.1)

This matrix is called the stress tensor [10] and its components σij is the stress on thei-surface acting in the j-direction. Through equilibrium equations it can be shown thatthis matrix is symmetric.

2.1.3 Strain

The deformation of a material due to stress is measured relative to the materials restshape. The proportion of deformation to the original length is called strain [10]. Inother words strain is defined as:

ε =size of deformation

original length

The strain is also decomposed into shear and normal strain. Normal strain, which iscaused by normal stress, is a measure of deformation along an axis. It gives a quantitywhich relates to the change of length.

Figure 2.6: A figure depicting normal strain

If the deformations along the x-axis is given by ux as in figure 2.6 the definition fornormal strain is given by:

lim∆x→0

ux(x + ∆x)− ux(x)∆x

= ux,x (2.2)

Page 15: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.1. A Crash Course In Solid Mechanics 7

Shear strain is defined in a similar manner as normal strain. In the case of shear strainit’s the amount of deformation perpendicular to a given line, rather than parallel to it,which is measured. Shear strain is defined as half of the change in angle of the line, thatis γ/2 in figure 2.8.

Figure 2.7: Shear is measured as the change in angle of a material line. For an infinitesimalelement the angle can be found by γ = tan( deformation

original length) ≈ deformation

original length.

Figure 2.8: a) An infinitesimal square element that has been deformed. b) To make the shearstrain more apparent a rigid body transformation has been applied to align the deformed statewith the undeformed state.

To determine the shear of a surface we start by studying an infinitesimal element thatis deformed in the xy plane as in figure 2.8. The angles γ1 and γ2 in the figure can befound using the small-angle approximation:

γ1 = lim∆y→0

ux(x, y + ∆y)− ux(x, y)∆y

= ux,y

γ2 = lim∆x→0

uy(x + ∆x, y)− uy(x, y)∆x

= uy,x

The definition of shear-strain in the xy plane is now stated as the average of these.

εxy =γxy

2=

ux,y + uy,x

2(2.3)

The strain in the xz, yz planes are found analogously.

The general state of strain may be written in matrix form analogously with the stress-tensor 2.1:

ε =

εxxγxy

2γxz

2γyx

2 εyyγyz

2γzx

2γzy

2 εzz

(2.4)

Page 16: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

8 Chapter 2. Soft Body Simulation

where the diagonal elements represents the normal strain and the off-diagonal elementsrepresents shear-strain, i.e γxy

2 is the shear-strain in the xy plane. So, using the abovedefinitions, (2.3)(2.2), for normal and shear strain, element εij can be defined as afunction of the displacement-field, u:

εij =ui,j + uj,i

2(2.5)

2.1.4 Relation between stress and strain

If a body is subject to a specific load or stress, can any conclusions be drawn aboutwhat the material strain is? Or given the strain, can any conclusions be drawn aboutthe material stress? The answers are yes. Several material dependent relations havebeen found which couples stress with strain. The most common one, and the one thisreport will deal with, is when there exists a linear dependence between stress and strain.When the stress is low almost all solids exhibit this form of linear relation. The propor-tionality coefficient for this region is called modulus of elasticity, or Young’s modulus[10], and the region of deformation is called linear elasticity.

This report considers linear elastic homogeneous isotropic materials. That is, materialsexhibiting a linear relation between stress and strain which does not change over thematerial or along different directions.

Constitutive equations

In engineering one often approximates the stress-strain relationship for linearly elasticmaterials by using the generalized Hooke’s law [63], i.e

sij = cijklεkl

where c is a fourth order tensor containing 81 material coefficients, which can be foundfor a variety of different materials in engineering literature. Since ε is symmetric andthe materials considered are isotropic the tensor c will remarkably only depend on twoindependent material constants. The stress-strain relationship can therefore be writtenas:

σ = 2µε + λtr(ε) (2.6)

where λ and µ are the Lame coefficients [10][63]. λ describes the incompressibility ofa material, i.e its resistance to a change in volume. µ is called the shear or rigiditymodulus and as the name implies determines the materials rigidity.

One of the easiest ways to see how the relation between stress and strain stated in 2.6was once obtained is to study a rod-like specimen. When the material is subject to anormal tension, σxx, along the x-axes we get:

εxx =σxx

E(2.7)

where E is the proportionality coefficient in the linear elastic region called Young’smodulo or the modulo of elasticity. E is empirically found as the slope in a stress straindiagram. When the material element is subject to a uniaxial tension it will usuallyexhibit some shrinkage in the lateral direction, just as a rubber bar that contracts and

Page 17: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.1. A Crash Course In Solid Mechanics 9

becomes thinner when you pull it at both ends. The ratio of lateral strain and axialstrain is defined as Poisson’s ratio ν [16], i.e

εyy = −νεxx = −νσxx

E

εzz = −νεxx = −νσxx

E

(2.8)

This is what happens due to normal stress, but what happens to the material whenshear stress is present? Shear stress, say τxy in the xy-plane, cause shear strain ∝ γxy

(see figure 2.8). The constant of proportionality is µ, i.e

γxy =τxy

µ(2.9)

The response to shear along the planes xz and yz is found analogously. Since σ issymmetric the state of stress can always be seen as if it was composed solely of normal-stress along the stress-tensors principal axes [10]. This means that µ can be expressedin E and ν:

µ =E

2(1 + ν)(2.10)

Previously it was stated that the relation between stress and strain only depend ontwo independent parameters, λ and µ. But now, two more parameters have appeared,namely E and ν. Either of these parameters can be used to describe a linear elasticisotropic material and the dependence between the two is [16]:

λ =νE

(1 + ν)(1− 2ν)(2.11)

2.1.5 Volume strain

So why is λ referred to as the incompressibility of a material? The answer can be foundby calculating the volume change of a box with sides a,b and c, subject to a state ofstrain expressed by the tensor 2.4. When using this general strain the volume changebecomes:

Vnew = a(1 + εx)b(1 + εy)c(1 + εz) = V + V (εx + εy + εz) + O(ε2) (2.12)

So the volume strain in first order is given by:

change in volume

original volume=

V + V (εx + εy + εz)− V

V= εx + εy + εz (2.13)

But this is exactly the term multiplied by λ in 2.6. So, given a specific stress the volumechange would be smaller if λ was larger, i.e λ describes the materials resistance to achange in volume.

Page 18: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

10 Chapter 2. Soft Body Simulation

2.2 Mathematical Model Of Linear Elasticity

Elasticity, seen from a mathematical perspective, starts with the following model equa-tions describing a solid in equilibrium:

σ = 2µε(u) + λtrε(u)I in Ω (2.14)−∇ · σ = f in Ω (2.15)

n · σ = g on ∂Ω1 (2.16)u = u1 on ∂Ω2 (2.17)

These equations govern the displacement u of a linear elastic material occupying spaceΩ with boundary δΩ = δΩ1 ∪ δΩ2. σ is the tension and ε is the strain throughout thematerial. f is the body force and g describes the surface forces acting on boundary ∂Ω1.λ and µ are the Lame parameters. To make use of this model it must first be determinedwhat strain measure, ε, to use and how this measure depends on the displacement.

2.2.1 The Green-Lagrange Strain Measure

To make sense of the model equation stated in the section above, a definition of thestrain tensor, ε, and its dependence on the displacement u is necessary. The strain gen-erated by a certain displacement can be found and described in several different ways. Inthis section a rotationally invariant measure will be presented, but first a few notationsmust be introduced.

Let the position vector of a point in the body be denoted x(t) at time t. Let the originalundeformed position measured from t = 0 be denoted x(0) = X. Assuming there is aone-to-one correspondence between X and x(t) we can write

x(t) = x(X) (2.18)

The total displacement from t = 0 is then given by:

u(t) = x(X)−X (2.19)

Consider a material line dX of infinitesimal length in the undeformed state, the materialline is changed to dx in the deformed state. The relation between dX and dx can beestablished as:

dx =∂x∂X

dX = F dX (2.20)

where F = ∂x∂X is known as the deformation gradient and Fij = ∂xi

∂Xj.

A strain measure should be invariant to displacements that are pure translations orrotations. That is, rigid transformations should not generate any strain. Knowing thatlength is preserved during these operations, a strain measurement can be found bystudying the quadratic difference, ∆X, of the material lines.

∆X = dx · dx− dX · dX (2.21)

Inserting 2.20 into 2.21 gives:

∆X = dXT (FT F− I)dX (2.22)

Page 19: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.2. Mathematical Model Of Linear Elasticity 11

A strain measure expressed as a tensor depending on the deformation can now be definedas:

ε =12(FT F− I) (2.23)

This is called the Green-Lagrange strain tensor[63]. Using this definition the straintensor given that x = X + u is:

ε(u) =12((I +

∂u∂X

)T (I +∂u∂X

)− I) =12(∂u∂X

+∂u∂X

T

+∂u∂X

T ∂u∂X

)

2.2.2 A Linear Strain Measure

The non-linear strain tensor 2.23 derived in the section above behaves linearly when thedeformations are small and the quadratic part in the formula becomes negligent. Thestrain tensor can then be expressed as:

ε =12(∂u∂X

+∂u∂X

T

) (2.24)

where εij = 12 (ui,j + uj,i). The strain is now expressed as a linear combination of the

spatial derivatives of u.

We have just removed the non-linear part from the original strain-measure, so whatcan be said about this new measure? Is it still invariant to translational and rotationaldisplacements? Well, since the new measure is a linear combination of the spatialderivatives it’s invariant to translations, but what about rotations? Assuming that thebody is rotated by R that is x = RX (u = (R− I)X). Formula 2.24 gives:

ε =12(R− I)T + (R− I) 6= 0

So 2.24 is not rotationally invariant. This should not come as a surprise since rotationsresult in non-linear displacements. Inserting the linear expression 2.24 into 2.14 givesthe same expression for the stress as in 2.6.

Here on after when referring to ε the linear strain measure 2.24 is meant.

Page 20: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

12 Chapter 2. Soft Body Simulation

2.3 Discretization, The Finite Element Method

The finite element method (FEM) is the dominant discretization technique in structuralmechanics [21]. The basic concept in FEM is the subdivision of the mathematical modelinto disjoint components of simple geometry called finite elements. The response ofeach element is then expressed in terms of a finite number of degrees of freedom (d.o.f),characterized as the value of an unknown function, or functions, at a set of nodal points.The solution to the mathematical model is then approximated by the response of thediscrete model obtained by assembling the collection of elements.

Each finite element, or element for short, possesses a set of distinguishing points callednodal points or nodes. Nodes serve a dual purpose, to define the element geometry,and as a home for degrees of freedom. When a distinction is necessary the former arecalled geometric nodes and the latter connection nodes. Nodes are usually located at thecorners or end points of elements, as illustrated in figure 2.9. In so-called higher-orderelements, nodes are also placed on sides, faces or possibly in the interior of the element.

Figure 2.9: A simple triangular element defined by its three nodes.

The finite element method works by transforming the strong form, i.e the set of govern-ing partial differential equations(PDEs) with boundary conditions, to a set of discreteequations. This procedure is performed as follows:

Strong form ⇔ Weak form ≈ Galerkin approximation ⇔ Matrix form

These concepts will be explained in the following sections.

2.3.1 The Weak Form, A Variational Statement

The variational statement, or the weak form of a problem, is found by varying the gov-erning equation by a test function, v. That is by multiplying the original equation byv and integrating over the domain. To make it all clear the weak form of the elasticityequations will now be derived.

Equation 2.15 states that:∇ · σ(u) + f = 0 (2.25)

By multiplying this equation with a test function, v, and integrating it over Ω we getthe variational form: ∫

Ω

(∇ · σ(u) + f) · v = 0 (2.26)

This equation should of course be valid for any v satisfying the essential boundarycondition stated in equation 2.17. Using the variational form a weak formulation, alsocalled a variational statement of the problem can be stated as:

Page 21: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.3. Discretization, The Finite Element Method 13

Find U ∈ V where V is a Hilbert space [1] satisfying the essential boundarycondition 2.17 so that ∫

Ω

(∇ · σ(U) + f) · v = 0 (2.27)

for all v ∈ V.

For the true solution this is of course valid when we vary v over any function-space thatsatisfy 2.17. Why the boundary condition is called essential will be explained later on.So what has this accomplished? Well, in a manner it has relaxed the problem. Insteadof finding an exact solution everywhere, the demands has been lowered to that of findingthe solution that satisfies the strong form on average across the domain. Of course, sofar, the reformulation doesn’t give any special advantages. The variational statementmade above was just an example to show how the problem can be restated in a weakerform, where the problem is finding a solution, U, that fulfills the equations on averageacross the domain.

The goal is now to obtain a weak formulation, or a variational statement, containingonly first order partial derivatives. By applying Green’s formula [50] the ∇ operator istransfered from σ to the test function v, which gives:∫

Ω

f · v +∫

∂Ω1

((n · σ(u)) · v)−∫

Ω

σ(u) : ∇v = 0 (2.28)

Writing all these integral signs can drive anyone insane, so lets ease our minds byintroducing the common notations:

(a,b)Ω =∫

Ω

a : b =∫

Ω

∑ij

aijbij for tensors a and b (2.29)

(u,v)∂Ω =∫

∂Ω

u · v for vectors u and v (2.30)

Inserting the natural boundary condition expressed in 2.16 and 2.14 into the formula2.28 gives:

(f ,v)Ω + (g,v)∂Ω1 − (2µε(u) + λtrε(u)I,∇v)Ω = 0 (2.31)

This can be further reduced by noticing that any matrix can be written as the sum ofa symmetric and an anti-symmetric part, therefore ∇v can be written as:

∇v =(∇v +∇vT )

2+

(∇v −∇vT )2

Inserting this into 2.31, the equation reduces to:

(f ,v)Ω + (g,v)∂Ω1 − (2µε(u) + λtrε(u)I,(∇v +∇vT )

2+

(∇v −∇vT )2

)Ω = 0 (2.32)

Since 2µε(u) + λtrε(u)I is symmetric and ∇v−∇vT

2 is antisymmetric the following con-clusion is made:

(2µε(u) + λtrε(u)I,∇v−∇vT

2)Ω = 0

Page 22: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

14 Chapter 2. Soft Body Simulation

By rewriting equation 2.32 so that the right hand side contains all the terms that onlydepend on v we get:

(2µε(u) + λtrε(u)I,(∇v +∇vT )

2) = (σ(u), ε(v))Ω = (g,v)∂Ω1 + (f ,v)Ω (2.33)

Now we can see that the right hand side is symmetric, since u and v can exchange placewithout altering the result. The right hand side is now denoted by:

a(u,v) = (σ(u), ε(v))Ω (2.34)

where a is a bilinear symmetric form.

The left hand is denoted by:

l(v) = (g,v)∂Ω1 + (f ,v)Ω (2.35)

where l is a linear functional.

A weak formulation can now be stated:

Find U ∈ V where V is a Hilbert space satisfying the essential boundary condition2.17 so that

a(U,v) = l(v) for all v ∈ V. (2.36)

For the true solution this is of course valid when we vary v over any function-space thatsatisfy 2.17.

So why is the boundary condition in 2.16 referred to as natural and the condition in2.17 as essential? It’s because the natural boundary condition appears ”naturally” inthe variational formulation while the essential boundary condition states an ”essential”demand on the function space.

Page 23: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.3. Discretization, The Finite Element Method 15

2.3.2 The Galerkin Method

The Galerkin method is used to convert a differential equation into a linear system ofequations. This method relies on the weak formulation of an equation and works inprinciple by restricting the possible solutions, as well as the test functions, to a smallerapproximation space.

Taking the model equations (2.14-2.17) the discretization is done by first dividing thebody, Ω, into a finite element mesh and thereafter choosing a smaller function space,in which an approximation can be found. In this report piecewise linear functions willbe used to span the approximation space and the three dimensional domain, Ω, will bedivided into a tetrahedron mesh, T .

LetF = v : v ∈ [L2(Ω)]3,v|T ∈ P 1 and v = u1 on ∂Ω2 for all T ∈ T

be the approximation space consisting of continuous piecewise linear functions. Herev|T denotes the restriction of v to element T , that is the function defined on T agreeingwith v on T . P 1 is the set of all linear functions. Also note that the essential boundarycondition in 2.17 has been directly imposed on the approximation space.

The problem can be formulated, using the weak formulation in 2.36 as:

Find U ∈ F so that

a(U,v) =∑T∈T

(σ(U), ε(v))Ω = l(v) (2.37)

for all v ∈ F .

The problem has now been reduced to finding an approximated solution, in this casea displacement field, U, which satisfies the weak-form in a given approximation space.The objective is now to derive a set of numerical equations which can be solved to findthe solution, U, for this approximation space.

A linear function φi(x, y, z) is associated with each node, i. The function φi has supportonly in the elements sharing its node, furthermore its value is one at its associated nodeand zero in all the others. This is illustrated for lower dimensions in the figures below.

Figure 2.10: a) The linear base function φi(x), for node i in 1-D. b) The linear base functionφi(x, y) for node i in 2-D. The base function for each node, i, has support only in the elementssharing the node. Its value is defined to be one at the position of the node (i.e point xi, Pi) andzero at all the others.

Page 24: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

16 Chapter 2. Soft Body Simulation

Since the displacement is three dimensional we need three d.o.f in every node, one foreach spatial dimension. If the discretization of Ω contains N nodal points one of thebases for the function space F are the functions φix, φiy, φizN . That is, for node iwe have three base functions, one for the displacement in each direction. Writing U inthis basis we get:

U =N∑

i=1

uixφix + uiyφiy + uizφiz =N∑

i=1

φiui

where the displacement of node i is:

ui =

uix

uiy

uiz

If equation 2.37 is satisfied for all base functions it’s automatically satisfied for all v ∈ F .Using this fact we get N equations for each spatial dimension x, y and z. Below theequations regarding the x-components of the displacements are stated:

a(N∑

n=1

φnun, φ1x) = l(φ1x)

...

a(N∑

n=1

φnun, φN x) = l(φN z)

(2.38)

This leads to 3N equations in total. Since a(u,v) is a bilinear form and the displacementsat each node are constants each of these equation can be rewritten as:

N∑j=1

(a(φjx, φix)ujx + a(φjy, φix)ujy + a(φj z, φix)ujz) = l(φix) (2.39)

This can also be written in the matrix form:

Ku = f (2.40)

where

Kij =

a(φix, φjx) a(φix, φjy) a(φix, φj z)a(φiy, φjx) a(φiy, φjy) a(φiy, φj z)a(φix, φjx) a(φix, φjy) a(φix, φj z)

fi =

l(φix)l(φiy)l(φiz)

ui =

uix

uiy

uiz

K is called the global stiffness matrix. The global stiffness matrix is calculated by as-sembling the local stiffness matrices, Ke, associated with each element, e. That is by

Page 25: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.3. Discretization, The Finite Element Method 17

adding the contribution from the integrals performed on each separate element.

A linear equation system approximating the true solution has now been found. Sincethe base-functions only have local support most of the integrals will be zero, making K asparse matrix. Some other benefits of using the weak-form to discretize the equations isthat the abstraction makes it possible to draw conclusions about the result by studyingthe properties of the operator a and l. For example proofing the existence of a solutionfor certain problems through the use of Lax-Milgram lemma [35] or putting bounds onthe error (residual).

The Galerkin method makes the residual, r = U− u, ”orthogonal” to the approxima-tion space, a characteristic called Galerkin orthogonality [36]. This can be seen fromthe fact that a(U− u,v) = a(r,v) = 0 where u is the correct solution.

Page 26: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

18 Chapter 2. Soft Body Simulation

2.4 Dynamics

By adding the inertial forces to the static equilibrium equation stated in 2.15 we get theequations of dynamics[63]:

ρu−∇ · σ(u) = f in Ωwhere u = d

dtu.Discretizing this equation in the same manner as in the preceding section and using thatu = x−X we get the equation system:

Mu + Ku = Mx + K(x−X) = f (2.41)

where M is called the mass-matrix with elements:

Mij = (ρφi, φj)Ω

Using nodal quadrature to calculate M has the nice effect of making all off-diagonalelements zero. The diagonal matrix M is then called a lumped mass matrix [36]. Addingdampening [63], C, we arrive at the equation system:

Mx + Cx + K(x−X) = f (2.42)

whereM is called the mass matrix and is symmetric and positive definiteC is called the dampening matrix and is symmetric and semi-positive definiteK is called the stiffness matrix and is symmetric and semi-positive definitef are the forces acting on the system, due to gravity, collisions etc.

2.4.1 Integration

The solution to a differential equation system can be found through integration. How-ever, many systems can be either impractical or impossible to solve exactly. This iswhere numerical integration schemes enter the scene. Numerical integration schemesare used to approximate the solution of a differential equation to a certain order ofaccuracy expressed in the step size, h. There exists an abundance of numerical schemesand which one to choose depends on the context. If, for example the accuracy at aparticular snapshot of time is of interest an explicit scheme like Runge-Kutta or explicitEuler works well, even though these methods may be unstable when used to determineglobal or transient behaviors [18][5]. On the other hand, if the evolution of the systemas a whole is of interest, as in physically based simulations, stability becomes an issueof great importance and the demand for local accuracy can often be relaxed in favorof better global behavior. If the energy behavior of the system is of less importancea scheme like implicit Euler would work sufficiently well since it’s unconditionally sta-ble but dissipates energy[18]. If preservation of physical invariants such as energy andmomentum is important a variational or geometrical integrator may be of interest. Vari-ational integrators originate from geometric or Lagrange mechanics where the correctpath is found as the path minimizing a certain action [53][43][17]. Many of these inte-grators automatically conserve momenta, are symplectic[31] and have very good energybehaviors, some examples are the Newmark method[60] and symplectic Euler[53].

To give a demonstration of how numerical integration techniques are used the follow-ing section will briefly describe the most common Euler schemes. The resulting time-discretized equations attained when applying the scheme to equation 2.42 will also beshown.

Page 27: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.4. Dynamics 19

Euler Schemes

The Euler schemes presented here have in common that they are based on first orderTaylor expansions. They also approach the true solution if the time step h → 0. Tomake the reasoning more clear we start from the general initial value problem:

y(t) = F(y(t), t)y(0) = y0

(2.43)

Forward EulerForward Euler, or explicit Euler, approximates the solution at t + h by using a Taylorexpansion around t, i.e

y(t + h) = y(t) + y(t)h = y(t) + F(y(t), t)h (2.44)

Forward Euler uses the knowledge of the function at t to approximate its value at t+h.The method is fast to compute since it’s an explicit method, i.e the new value y(t + h)is explicitly expressed in known values. However, since the method determines the fu-ture values solely based on the past, it suffers from severe stability and energy blow-upproblems[53]. The method therefore requires the step size to be very small.

Applying this scheme on equation 2.42 we get:

x(t + h) = x(t) + v(t)h

v(t + h) = v(t) + hM−1(f −K[x(t)−X]−Cv(t))(2.45)

Backward EulerBackward Euler, also called implicit Euler, uses a Taylor approximation around t+h todetermine the value at t, or rather, backward Euler finds the solution at t + h so that aforward Euler step backwards leads to y(t), i.e

y(t + h) = y(t) + y(t + h)h = y(t) + F(y(t + h), t + h)h (2.46)

To find y(t + h) the implicit equation stated above must be solved. This is why themethod is often referred to as implicit Euler. Unlike forward Euler backward Eulercouples the new value to the old one by requiring that a forward Euler step backwardsreturns the value to the old one. This ”continuum” demand comes at the added priceof having to solve an implicit equation. But on the upside, it does make the methodunconditionally stable, allowing the use of very large step sizes. Unlike the forwardEuler method that builds up energy backward Euler dissipates energy[53].

Applying this scheme on equation 2.42 we get:

x(t + h) = x(t) + v(t + h)h

(M + Ch + Kh2)v(t + h) = Mv(t) + h(f −K[x(t)−X])(2.47)

Page 28: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

20 Chapter 2. Soft Body Simulation

2.5 The Co-Rotated Method

The linear strain model in 2.24 is a good approximation when the strains and rotationsare small. Unfortunately knowing that the strains are locally small does not guaranteethat the linear model will suffice, as illustrated in figure 2.11. As can be seen in thefigure, each element is only affected by small strains but since the rotations are largethe linear strain model yields erroneous strains. One could solve this problem by simplychoosing to use the non-linear model in 2.23, but this would greatly increase the cost ofeach assembly and furthermore demand the re-assembly of the stiffness matrix in eachsimulation step.

Figure 2.11: A deformed bar with locally small strain but large deformations, the black rectangleillustrates an element that is mostly affected by a rigid transformation.

Another solution is to decompose the displacement into rotation and shear and negatethe effect of rotations by transforming the element into its original undeformed state.This can equivalently be seen as if we would negate the effect of rotations by co-rotatingthe element so that only shear is present.

This process is summarized in the following steps:

1. Determine how much the element has rotated, R, relative to its associated unde-formed state (coordinate frame).

2. Apply the inverse rotation, R−1 = RT , to transform the element into its unde-formed coordinate frame.

3. Perform the calculations using the linear model since rotations will not causeerroneous strains.

4. Transform the result back into the deformed state by applying the rotation R.

If element e with vertices x and local stiffness matrix Ke has rotated R from its unde-formed state, X, the algorithm is as follows

R−1x rotate the tetrahedron back to the undeformed stateKe(R−1x−X) calculate the stiffness forcesRKe(R−1x−X) rotate the result back to the deformed state

That is, the equilibrium solution to solve becomes

RKe(R−1x−X) = fe

This is called the co-rotated or stiffness warping method [54][20][28][15] and eliminatesthe need to recalculate the stiffness matrix given that the strains present are small.

Page 29: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.5. The Co-Rotated Method 21

2.5.1 Determining the orientation

Using the procedure outlined in the section above, the linear strain model can be usedregardless of rotations as long as the strains are small. The only problem now is how todetermine the orientation of the element in the deformed state.

Figure 2.12: A tetrahedron deformed from the state described by p0, ...,p3 to p′0, ...,p

′3.

Knowing that the deformed state is a one-to-one mapping with the undeformed statea point is expressed by its barycentric coordinates β0, ..., β3. We look at a tetrahe-dron whose vertices have coordinates p0, ...,p3 in the undeformed state and coordinatesp′

0, ...,p′

3 in the deformed state (as illustrated in figure 2.12). A point p in the unde-formed tetrahedron can be expressed using its barycentric coordinates as:

p0x p1x p2x p3x

p0y p1y p2y p3y

p0z p1z p2z p3z

1 1 1 1

β0

β1

β2

β3

=

px

py

pz

1

or more compactly as:

Pβ = p

Thus the barycentric coordinates of the point are given by:

β = P−1p

The point p′in the deformed tetrahedron that corresponds to the point p has the same

barycentric coordinates, only expressed in the deformed tetrahedrons coordinate frame.Given that P

′is the matrix state of the deformed tetrahedron the point p

′can be found

throughp′= P

′β = P

′P−1p

where P′P−1 has the form [

Q t~0 1

]The vector t describes the translative part of the transformation while Q contains allshear and rotation. So by using for example polar decomposition of Q the rotation ofthe tetrahedron can be found. The articles [34][19] describes different decompositionroutines which can be successfully used to decompose a matrix into matrices describingthe shear and rotation.

Page 30: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

22 Chapter 2. Soft Body Simulation

2.6 Dealing With Incompressibility, The Discontinu-ous Galerkin Method

This section will briefly cover the subject of incompressibility. A material becomes in-compressible at the limit when µ → 0.5. That is when λ as seen in 2.11 approachesinfinity. So what happens with the discretization of these equations when the materialbecomes incompressible?

When λ approaches infinity, the numerical equations derived earlier in 2.42 becomesincreasingly stiff1. It also results in a phenomena called locking[21]. Locking is, as thename implies, when the deformations of a material are suppressed, i.e when the struc-tural response is too stiff. The term coined in the 70ies reflect the graphical perceptionthat the structure ”locks” itself against deformation.

P. Hansbo and M.G. Larson describes a discontinuous-Galerkin (DG) method in article[38], which is an alternative discretization technique that can be used to prevent locking.In a DG method the approximation space consists of discontinuous piecewise polyno-mials. That is, the functions used to approximate the solution are no longer forced tobe continuous along inter-element boundaries. Continuity and boundary conditions areinstead weakly enforced through the bilinear form.

Starting again from the model equations:

σ = 2µε(u) + λtrε(u)I in Ω−∇ · σ = f in Ω

n · σ = g on ∂Ω1

u = u1 on ∂Ω2

where ε is the linear strain model given by 2.24.

The body Ω is divided into a finite element mesh consisting of tetrahedrons, T . All faces,F , belonging to the mesh are divided into two disjoint subsets consisting of internal andboundary faces:

F = Finternal ∪ Fboundary

where the boundary faces, Fboundary, are further divided according to which boundarythey belong:

Fboundary = F∂Ω1 ∪ F∂Ω2

Furthermore, with each face we associate a fixed unit normal, n, such that for boundaryfaces n is the exterior unit normal. We choose the approximation space:

DF = v : v ∈ [L2(Ω)]3,v|T ∈ P 1 and v = u1 on ∂Ω2 for all T ∈ T

where DF is a space of discontinuous piecewise linear functions.

1A stiff equation is a differential equation for which certain numerical methods used to solve theproblem are numerically unstable, unless the step size is taken to extremely small. The stiffness is oftenmeasured as the quotient of the absolute values of the smallest and the biggest eigenvalue of the system[35][5][37]

Page 31: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.6. Dealing With Incompressibility, The Discontinuous Galerkin Method23

The following operators and notations will come in handy when dealing with discontin-uous functions.

The jump operator:

[v] =

v+ − v− if v ∈ Finternal

v+ if v ∈ Fboundary.(2.48)

where:v± = lim

ε↓0v(x∓ εn) when x ∈ F

The jump operator gives a measure of the discontinuity along the boundary betweentwo tetrahedrons.

The average operator:

〈v〉 = v++v−

2 if v ∈ Finternal

v+ if v ∈ Fboundary(2.49)

The average operator is used to denote the average size of the jump.

The identity:[uv] = 〈u〉[v] + 〈v〉[u] (2.50)

The projection operator:

P0v|F =1|F |

∫F

v (2.51)

where F ∈ F and |F | is the area of the face.

The volume of a tetrahedron T is denoted by |T |.

The DG-method can be formulated as:

Find U ∈ DF so that:

a(U,v) = l(v) for each v ∈ DF (2.52)

There exists many different formulations for the bilinear form, a, in the DG-method. Inthis report the following definition, given in article [38], will be used:

a(U,v) =∑T∈T

(σ(U), ε(v))T −∑F∈F

(〈n · σ(U)〉, [v])F + (〈n · σ(v)〉, [U])F

+ (2µ + λ)γ0

∑F∈F

(h−1[P0U], [P0v])F + 2µγ1

∑F∈F

(h−1[U], [v])F

(2.53)

where h is given by:

h|E = (|T+|+ |T−|)/2|F | for F = ∂T+ ∩ ∂T− (2.54)

The linear form, l, is given by [38]:

l(v) =∑T∈T

(f ,v)T +∑

F∈F∂Ω1

(g,v)F

Page 32: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

24 Chapter 2. Soft Body Simulation

Let’s try to break these formulas down a bit, hopefully making them more intuitive.

On each element we have the internal boundary conditions:

[u] = 0 on ∈ Finternal displacement continuity[n · σ(u)] = 0 on ∈ Finternal stress flow continuity

Previously, when dealing with continuous piecewise linear functions, continuity was di-rectly imposed by making the geometric and connection nodes coalesce. Since eachnode in the discontinuous model is only coupled with the other nodes in the same ele-ment, a coupling must be created which enforces these boundary conditions. By varyingequation 2.15 on each element we get:∑

T∈T−(∇ · σ(U),v)T =

∑T∈T

(f ,v)T

Using Green’s formula on (∇ · σ(U),v)T the equation above becomes:∑T∈T

(σ(U),∇v)T −∑T∈T

(n · σ(U),v)∂T =∑T∈T

(f ,v)T (2.55)

When the approximation space consists of continuous functions, the integrals carried outon the internal faces sum to zero. But when the functions are discontinuous this doesn’tneed to be the case since there may be a jump-discontinuity between the elements. Toinvestigate these terms further lets consider a face, F , with associated unit normal nbordering two elements T1 and T2 (much like the figure below).

Figure 2.13: A figure showing two neighboring elements and their common face.

Each such internal face will contribute with two terms to∑

T∈T (n ·σ(U),v)∂T namely:

(n1 · σ(U+),v+)F + (n2 · σ(U−),v−)F = (n · σ(U+),v+)F − (n · σ(U−),v−)F

(2.56)

Using the identity in 2.50 the contribution above can be written as:

(n · σ(U+),v+)F − (n · σ(U−),v−)F = (〈n · σ(U)〉, [v])F + ([n · σ(U)], 〈v〉)F (2.57)

For the true solution the second term will be zero so this term can be removed withoutexcluding the true solution. To make the formula symmetric the term ([n ·σ(v)], 〈U〉)F

is added. This may seem strange but works fine since 〈U〉 is zero for the true solution.Formula 2.55 can now be written as:∑T∈T

(σ(U),∇v)T−∑

F∈Finternal

(〈n·σ(U)〉, [v])F +(〈n·σ(v)〉, [U])F =∑T∈T

(f ,v)T +∑

F∈F∂Ω1

(g,v)F

(2.58)

Page 33: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.6. Dealing With Incompressibility, The Discontinuous Galerkin Method25

Some resemblance with the bilinear form defined for the DG-method can now be seen.Only two terms are missing, namely:

(2µ + λ)γ0

∑F∈Finternal

(h−1[P0U], [P0v])F (2.59)

and2µγ1

∑F∈Finternal

h−1[U], [v])F (2.60)

So where does these missing terms come from? The answer is that they are purelyartificial penalty terms added to gain further stability, and a control over the jumpdiscontinuity in U. Now you’re hopefully asking the question of how the penalty termscontrol the jump discontinuity and how you can justify adding seemingly random termsto an equation? Doesn’t this rule out the true solution and change the original equation?These questions will soon be answered, but the penalty terms are not random and themethod is still consistent with the true solution u in the sense that:

a(u−U,v) = 0 for all v ∈ DF

To analyze the behavior of the first penalty term, lets see how it behaves at its extremes.That is when this term has heavy influence, when γ0 or λ becomes very large, and bothare non-zero. When solving the system it will strive after a solution, U , that minimizesthis penalty term. It will try to enforce [P0U] = 0 when the penalty factors become verylarge. Figure 2.14 demonstrates a solution satisfying this for the case when the penaltyterm acts along an edge in a two-dimensional mesh.

Figure 2.14: A constellation where [P0U ] is zero along an edge of length |E|. Since the differ-ence of the linear functions is also linear the sum of the differences along the line is zero onlywhen the difference is zero at the midpoint, |E|

2.

The penalty term acts to drive the integrated difference of the jump across two facestowards zero. Since U is linear it forces the midpoint of the faces together.

The second penalty term will force [U ] → 0 as the penalty parameter γ1 →∞. From aphysical perspective this penalty term can be seen as adding springs along the surfaceof the faces with spring constants ∝ γ1.

Well, how does this new formulation remove locking? Simply put, by relaxing thedemand for intra element continuity some of the structural stiffness is removed. Butthere exists many other benefits with the discontinuous Galerkin method, e.g:

• The approximation space can be chosen very widely.

• Easy to couple different meshes using different elements.

One of the main disadvantages of using the DG method is that it results in a massiveincrease in the DOF since nodes will no longer be shared to the same extent.

Page 34: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

26 Chapter 2. Soft Body Simulation

2.6.1 The Incompressible Limit, The Crouzeix-Raviart Element

We now know that when γ0 is non-zero and λ goes towards infinity the penalty termsin 2.59 forces the midpoints of the internal faces to coincide. So by restricting the DGmethod to the space of Crouzeix-Raviart (CR) functions [38] we get:

CF = v ∈ DG : [P0v] = 0 , for all F ∈ F (2.61)

This space consists of discontinuous functions that are continuous at the midpoint ofthe faces. Practically this means that the connection nodes are placed at the midpointsof each element face. Using the CR functions the bilinear form 2.53 stated in the sectionabove can be reduced to:

a(U,v) =∑T∈T

(σ(U), ε(v))T + 2µγ1

∑F∈F

(h−1[U], [v])F (2.62)

The linear functional is unchanged.

Page 35: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 27

2.7 Collision Detection

The problem of detecting if a collision has, or will, take place between a set of objectsis encountered in a large number of different fields, such as computer graphics, roboticsand surgery simulations. As a result many different methods and heuristics exists whichtries to handle this problem, in the best way given the context of their problem. Thisleads to a plethora of different techniques. Detecting collisions between rigid-bodies is awell-investigated problem and several routines exists which can handle large systems atinteractive rates. When it comes to soft bodies this is not the case. However, deformablecollisions detection is a rapidly growing research area, much due to the impact of cloth-simulation in physically based animations. Having said that, this section will try to shedsome light on the problem. Different techniques suited for interactive applications withsoft bodies will be introduced, investigated and reviewed.

2.7.1 Bounding Volume Hierarchies

Bounding volume hierarchies (BVHs) is one of the most common data structures usedfor collisions detection, both due to its efficiency and to its implementation ease [59]

The BVH is defined by the following properties [33]:Each node of the hierarchy is associated with a subset of primitives together with abounding volume (BV) that encloses this subset and all descendants with the smallestinstance of some specified class of shape.

The choice of which BV to use is of great importance and there are many alternatives:

Spheres [56] The volume bounding the object is a sphere defined by a center and aradius.

Intersection test: A collision check between two spheres is performed by deter-mining if the centers of the spheres are separated by more than the sum of theirradiuses. If not, the spheres collide.

Oriented bounding boxes (OBBs) [32][22][46][42] The volume bounding the ob-ject is a box that is oriented to optimally fit the object. OBBs rely on calculatingthe eigenvectors of a covariance matrix describing the distributions of the objectsconstituting primitives. The eigenvectors are used to determine the orientation ofthe box. Each box can be defined by a maximum and minimum value along eacheigenvector.

Intersection test: A collision check between two boxes is commonly performed bychecking to see if the boxes overlap along the direction of the eigenvectors.

Axis aligned bounding boxes (AABBs) [8] The volume bounding the primitivesare simply boxes aligned with the default axes. The boxes can be defined by twocorners.

Intersection test: A collision check between two boxes is performed by checking tosee if the boxes overlap along the default axes.

Page 36: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

28 Chapter 2. Soft Body Simulation

Discrete oriented polytopes (k-DOPs) [52] [62] The DOP is a generalization ofAABB. It’s the convex polytope constructed by taking a number of suitably ori-ented planes at infinity and moving them until they collide with the object. TheDOP is defined as the convex polytope resulting from intersection of the half-spacesbounded by the planes. A DOP constructed from k planes is called a k-DOP, soan AABB is a DOP with k = 6.

Intersection test: A collision check between two k-DOPs is performed by deter-mining if the objects overlap along the k

2 -directions.

OBBs require a lot of preprocessing to determine the covariance matrices. This makesthem to slow when the bodies may deform and thereby demand the BVH to be updated.For this reason OBBs are seldom used when dealing with soft bodies in interactiveapplications.

Construction of a BVH

A BVH is created by recursively partitioning the primitives defining the object (poly-gons, NURBS etc.) until some terminating leaf criterion is met. When building a BVHfor collision detection either top-down or bottom-up strategies are used. There is a thirdincremental strategy but this is seldomly used in the field of collision detection and willtherefore not be included.

The two main strategies bottom-up and top-down are summarized below.

Bottom-Up strategy:

1. Start with object-representing primitives.

2. Fit a bounding volume to a given number of primitives.

3. Group primitives and bounding volumes recursively.

4. Stop if a single bounding volume is left.

The advantages of bottom-up methods is that they can take the topology of objects intoaccount by grouping primitives that are topologically connected.

One way of grouping the primitives which takes the topology into account and has beenproved to be very efficient when dealing with deformable bodies, is to base the groupingheuristic on the mesh connectivity. The resulting structure can also be efficiently usedto speed up self-intersection detection. When mesh connectivity is not used to build theBVH, primitives may be grouped only on their original location which in many cases isfar from optimal. For example, if we were to build a BVH of a human model we couldend up grouping the pelvis and hands of the model in a single BV, only because thehuman model had his hands in his pockets at the time the BVH was created. You canimagine what happens to the BVH when the model takes his hands out of the pocketsand the BV is refitted, still believing that the hands and the pelvis are in vicinity ofeach other.

Page 37: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 29

Top-Down strategy:

1. Start with object.

2. Fit a bounding volume to the object.

3. Split object and bounding volume recursively, according to a given heuristic.

4. Stop if all bounding volumes in a level contain less than n primitives.

The advantages of using a top-down strategy is that the hierarchy optimally fits thegeometry according to the given heuristic. The strategy also grants control over thetime spent in construction, by varying the method.

The most common heuristics used to determine how to split an object in a top-downstrategy are:

Min Sum - Minimize the summed volume of the children.Min Max - Minimize the volume of the largest child.Splatter - Split along the axis of highest variance.Longest side - Split along the axis along which the BV is longest.

The Min Sum and Min Max heuristic requires that six different bounding volumes arecreated, two pairs for each axis. By using a greedy optimization strategy the axis whichgives the best result is chosen. The Longest side heuristic often gives good result andis by far the easiest, but it only makes sense when using OBBs or k-DOPs.

The most common splitting heuristic when dealing with soft-bodies is to simply makethe split orthogonal to the longest axis, that is to use the Longest side heuristic. Fur-ther information about splitting heuristics can be found in articles [46][3][52].

Another property of a BVH is its branch-factor, that is how many children each non-leaf node has. When dealing with rigid objects binary trees are common. When dealingwith deformable bodies 4-ary and 8-ary trees have shown better performance [4]. Thisis mainly because fewer nodes needs to be updated.

Page 38: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

30 Chapter 2. Soft Body Simulation

Traversing a BVH

The most common traversal technique to determine if two BVHs A and B are collidingis to use the algorithm presented in pseudo code below.

Traverse(A,B)1

Input: Two BVHs A and BResult: Performs a collision test between two BVHs

if A does not collide with B then2

return;3

end4

if A and B are leaf nodes then5

return PrimitiveIntersectionTest (A,B);6

end7

foreach x in children(A) do8

foreach y in children(B) do9

return Traverse (x,y);10

end11

end12

Algorithm 1: The BVH traversal algorithm, PrimitiveIntersectionTest is a collisionroutine that determines if the enclosed primitives are colliding.

Updating a BVH

During a simulation objects may move or deform, updating is therefore necessary. Whenthe objects are rigid the transformations can be directly applied to the BVs. However,when dealing with soft bodies the whole BVH will have to be updated bottom-up sincethe primitives may deform. The easiest way to take the deformations into account wouldbe to simple rebuild the whole BVH, but this is of course very slow. Refitting is muchfaster than rebuilding, but the overlap volumes may increase during large deformations.Still it has been shown that refitting is about ten times faster compared to a completerebuild of an AABB hierarchy [8].

Since updating a BVH during simulation of soft-bodies is a necessity, choosing a BVHstructure that is relatively fast to update is important. However, a simple structurethat is fast to update may not represent the object well enough, resulting in more falsepositives in collision detection. The cost estimate function for BVHs introduced byKlosowski[52] gives a good insight into how different design choices affect performance:

T = NuCu + NoCo + NpCp (2.63)

whereNu Average number of updatesCu Average cost per updateNo Average number of overlap testsCo Average cost per overlap testNp Average number of primitive intersection testsCp Average cost per primitive intersection test

There are many ways to speed up the rebuild or refitting process, but in most cases

Page 39: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 31

reducing one of the factors results in the others increasing.

For example:

• Choosing a simpler BV type would result in a lower update and overlap cost. Butthe number of overlap and primitive intersection tests would increase. This isbecause a simpler BV often has a looser fit and approximates the object with alarger volume.

• Using the velocities to approximate an inflated BV removes the need of refittingor rebuilding until the object has moved out of the BV. This reduces the numberof updates, but only works for relatively static scenes since larger volumes increasethe number of overlap tests.

• Using top-down update of the hierarchy only updating a BV if its parent collide.This technique strives to achieve Nv = Nu but it has been shown to be less efficientthat bottom-up, if many deep nodes are reached [46].

• By implementing a hybrid hierarchy update one can exploit the fact that top-downupdate is faster than bottom-up, if only few deep nodes are reached. In the hybridmethod the upper levels are updated using bottom-up while the deep nodes areupdated ”on-the-fly”, using top-down. However this demands the geometries tobe stored not only in the leaves but also in the upper nodes [4].

The hybrid method has some very nice properties, although it demands more memory.Since most interactive applications with FEM-modeled soft-bodies have a relatively lowtetrahedron count this should not cause any problem.

Self collisions

One of the most problematic parts when dealing with soft-bodies is that the bodies mayself-intersect. BVHs can be efficiently used to accelerate self-collision detection.

In general, collisions and self-collisions are performed the same way using BVHs. Theonly difference is that during self-collision detection the BVH is tested against itself.This seems easy enough, but since the BVs of neighboring regions often overlap, evenwhen there are no self-collisions, simply checking a BV against it’s own BVH can resultin many false positives. To remove the need of unnecessary intersection tests differentheuristics have been proposed which can quickly determine if its impossible for twoneighboring regions to overlap. In an article by Volino and Thalmann[57] a method isintroduced which quickly culls adjacent regions which do not intersect. The method isbased on the following theorem:

Theorem 2.7.1. A region R cannot self-intersect if the following hold:

1. There exists a vector v which has the property that its dot product with all facenormals, n, in the region is positive, i.e

n · v > 0 for all n ∈ R

2. The projection of the of the boundary of R onto the plane defined by v does notself-intersect.

Page 40: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

32 Chapter 2. Soft Body Simulation

So how does this work? Well, since there exists a vector which has a positive dot productwith all face normals, no ”loops” can exist since it would require the normals to differ byan angle of more than π radians (illustrated in figure 2.15). When ”loops” are excludedwe’re left with the possibility of self-collision due to, for example stretch effects. Thiscollision type is detected by an overlap of the contour of R in the plane defined by v asillustrated in the figure below.

Figure 2.15: A case where no vectorv satisfying criteria one of theorem2.7.1 can be found, thereby signalingthe possibility of a self-collision.

Figure 2.16: A figure showing theprojection of region R onto the planedefined by the vector v satisfying cri-teria one in theorem 2.7.1. If a self-collision exist the boundary curve inthis projection must intersect.

Another approach proposed in an article by Provot[49] is based on a curvature test.This idea is based on the fact that convex regions with sufficiently ”low curvature”cannot self-intersect. The algorithm works by first calculating normal cones for eachregion. The normal cone is constructed as the superset of all normal directions for aregion. The cones of each region are then merged using the BVH (using mesh-topology,bottom-up) and are updated during the hierarchy update. The apex angle, α, of thenormal cone represents the curvature, indicating a possible self intersection if α > π.This is of course only valid if two regions are adjacent. This test is not entirely consistentsince it misses collisions of the overlap type covered by the second paragraph in theorem2.7.1.

Page 41: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 33

2.7.2 Spatial partitioning

In a spatial subdivision the domain is most commonly divided into disjoint sets whereeach set is associated with the objects they intersect. Various approaches that dividesspace has been proposed, among the more popular ones are:

Uniform grids [59]Space is divided into uniform cells that tilespace, each cell is a associated with theobjects it intersects.

Pros

• Easy to implement.

• Good for cases where the domain islimited and the data is uniformly dis-tributed.

• Object independent.

Cons

• Memory consuming.

• Determining the cell size. To small cells leads to an increased memory usage andunnecessary empty cells. To large, each cell will intersect with more objects leadingto unnecessary collision tests.

• Unsuitable for non-uniform data distributions.

Collision detection is performed by looping over all cells and if any cell contains pointersto more than one object, these objects are checked for intersection.

Page 42: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

34 Chapter 2. Soft Body Simulation

Octrees [6]Space is first partitioned into eight uniformaxis aligned cells. Thereafter each cell isrecursively split into eight new cells untila leaf-criterion is met. Each internal nodecontains pointers to its sub-cells, whereasthe leaf nodes contains pointers to thepartitioned data.

Pros

• More adaptive than uniform grids,suited for non-uniform data.

Cons

• Can be memory consuming.

• Unsuitable for uniform data distribution.

Collision detection is done by checking if any leaf-nodes point to more than one object,if so these objects are checked for intersection.

Page 43: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 35

Binary space partitioning tree (BSPtrees) [44][23]A k-dimensional space is recursively splitinto two disjoint sets by a k−1 dimensionalhyper plane at an arbitrary point.

Pros

• Can exploit the nature of the scene, e.guse walls and roofs as splitting planes.

• Can guarantee balanced trees.

Cons

• Determining splitting directions and splitting points.

• Complex.

Collision detection is performed in a similar manner as octrees.

k dimensional trees (k-d trees) [11][12]Splitting technique which can be seen as astricter version of the BSP tree or a relaxedversion of the octree. Each cell is splitalong one of the default axis at an arbitrarypoint. That is, the split directions must bealong the default axis.

Page 44: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

36 Chapter 2. Soft Body Simulation

Spatial hashing [29]Implicitly subdivides R3 into grid cells, ahash function maps the grid cells to a hashtable.

Pros

• Can handle infinite grids.

• Easy to implement.

• Memory efficient.

• Object independent.

Cons

• Determining the cell size. To small leads to an increased memory usage andunnecessary empty cells. To large, each cell will intersects with more objectsleading to unnecessary collision tests.

• Determining a good hash function.

• Determining the hash table size.

• Hash collisions, since a larger domain will be mapped to a smaller collisions willoccur.

Collision detection is done by looping over all the ”buckets” in the hash-table, if a bucketcontains more than one object these are checked for intersection.

Since the generation of BSP and k-d trees is both complex and time consuming they arenot suited for collision detection with soft-bodies, altough they have been used success-fully for rigid bodies, static scenery, and for ray tracing. Spatial subdivision schemesalso suffers from the fact that they don’t separate primitives and objects into disjointsets. Thus, more than one cell often share a primitive, which leads to a single primitivebeing processed more than once. The fact that most spatial structures are costly tobuild and don’t exploit the topology of the objects as well as BVHs, makes them rare inapplications dealing with soft-bodies. However a spatial subdivision technique tailoredfor deformable tetrahedral meshes is introduced in article [29]. This method uses spatialhashing to increase speed and reduce the memory cost. The algorithm proceeds in twostages which are presented below:

1. Hash all vertices.

2. Process all tetrahedrons. If the tetrahedrons AABBs overlap a hash entry, allvertices in this entry are checked for intersection against the tetrahedron usingbarycentric coordinates.

The algorithm easily detects self-collisions and has a close to linear time complexity. Themethod is further developed in article [30] where a post processing step is added whichuses a propagation technique to determine consistent collision normals and penetrationdepths.

Page 45: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 37

2.7.3 Image space techniques

Image space methods analyze the projections of objects to accelerate collision queries.Since these methods often only process the projections they do not require any pre-processing, thereby making these methods especially appropriate for environments withdynamically deforming objects.

A model tailored to detect collisions between a medical instrument and the environmentin virtual laparoscopy surgery is proposed in the article [48]. By approximating theinstrument with the view-frustum of a camera, collision detection can be reduced to asimple visibility query. The scene is rendered from the camera, if nothing is visible nocollisions exist, otherwise parts of the intersecting primitives can be found. This methodheavily relies on how well the surgical tool can be approximated by a view-frustum.

An algorithm capable of detecting collisions between arbitrarily-shaped deformable bod-ies is introduced in article [26]. The proposed algorithm successfully detects collisionsand self-collision of watertight objects in the following three stages:

Stage 1

Determines the volume of interest (VoI). The volume of interest is an AABBrepresenting the volume where the collision queries are to be performed. Whena collision test is performed between a pair of objects, the VoI is given as theintersection of their AABB hierarchies. If the VoI is empty no collision is detectedand the algorithm aborts. In the case of a self-collision test the VoI is chosen tobe the AABB of the object.

Stage 2

Computes a layered depth imaged (LDI)[55] for the objects inside the VoI. A LDIis an image-based rendering technique used for complex geometries. The LDIdata structure stores multiple depth values per pixel, so instead of a 2D arrayof depth values, it stores a set of depth values for each pixel along one line ofsight. The representation therefore grows linearly with the depth complexity2 ofthe image. Furthermore, the LDI provides a rasterized volume that can be usedto approximate the shape of the object.

The LDI is created by using an orthographic projection along one of the VoIs sides.Each pixel in the LDI projection is associated with layers of depth values repre-senting the object surfaces. The depth values can be interpreted as intersectionsof 3D scan lines entering or exiting the object (see figure below).

2The depth complexity of a pixel is the number of surfaces projected to that pixel. The maximumdepth complexity of an object is the maximum number of surfaces intersected by a scan-line whengenerating the LDI.

Page 46: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

38 Chapter 2. Soft Body Simulation

Figure 2.17: A figure showing all intersections between the scan lines and the objects surfacein the VoI for a 2D object. The resolution of the LDI determines the number of scan lines.Red dots mark the depth-value as an ”entering” value, blue dots mark the depth-value as an”exiting” value.

The writers expand the method to handle self-collisions in article [27], this is doneby associating each depth-value with the face orientation of the rasterized prim-itive. One can then determine if an intersection is either entering or exiting anobject. That means that a LDI projects the VoI into a layered image that strictlyclassifies the object into inside and outside regions.

Since this stage is basically a phase where the primitives constituting the surfacesare rasterized it can be implemented using the GPU.

Stage 3

Three different collision queries can be performed using the LDI presentation ofthe objects.

1. Detection of self-collisions by analysing the order in which each scan line en-ters (front-face) and exits (back-face) the objects. If they correctly alternate,there is no self-collision. If invalid sequences of front-faces and back-facesare detected, the operation provides the explicit representation of the selfintersection volume.

2. Detection of collisions between pairs of objects by combining their LDIs usingboolean intersection. If the intersection of all inside regions is empty, no colli-sion is detected. Otherwise the operation provides an explicit representationof the intersection volume.

3. Detection of vertex collisions by testing individual vertices against the volumeof the object. The collision detection is performed by transforming the vertexinto the local coordinate system of the LDI. A collision is detected if the vertexintersects with an inside region of the object.

The stages are illustrated for the two dimensional case in figure 2.18.

Figure 2.18: The stages of the LDI-based collision detection algorithm. Stage 1) The VoI isdetermined as the intersection of the objects BVHs. Stage 2) A LDI is created for the objectsinside the LDI. Stage 3b) Determines the intersection volume.

Page 47: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.7. Collision Detection 39

Since the LDI generation is a comparatively expensive process three different imple-mentations was proposed and analysed in the article. Two of the proposed generationtechniques employed the GPU, exploiting it’s rasterization power, while the last one,motivated by the high latency of GPU-buffer read backs relied entirely on the CPU.When implemented on the GPU n depth buffer read backs must be made, where nis the maximum depth-complexity of the object. Comparisons of the different imple-mentations showed that the CPU based LDI generation outperformed the GPU basedalternatives when the geometric complexity was low. However, when the scenes growsmore complex the read-back delays from the GPU plays a smaller role and the GPUbased alternatives becomes more time efficient. When using LDIs to compute the col-lisions between objects the resolution of the LDI directly limits the accuracy of thecollision data (normals, penetration depth etc.). The resolution becomes a parameterwhich can be used to balance accuracy with performance.

Another popular image-based approach that speeds up collision detection is that ofocclusion culling [41][45]. The idea is to remove sets of possibly colliding primitivesfrom further investigation by showing that they do not occlude each other along acertain viewing direction. The method can be efficiently implemented on the GPU andsince it only needs the result of a visibility test, no expensive depth-buffer read backsare necessary. The performance of this method is highly dependent on both the viewingdirection used as well as the resolution of the projection. Since it’s based on a visibilitytest it may miss collisions because the resolution is to low or because primitives withnormals perpendicular to the viewing direction becomes invisible.

2.7.4 Distance fields

In physics a field is an assignment of a physical quantity to every point in space [50].

A scalar field where each point is associated with the minimum distance to a closedsurface is called a distance field. The distance may be signed to distinguish betweenthe inside and outside of the objects. If one has a distance field representing a closedsurface, it’s easy to see the benefits of this representation. Evaluating the direction anddistance to the closest object is a simple lookup, which is completely independent of thecomplexity of the object.

A distance field in three dimensions is a mapping D : R3 → R and the surface is definedby the zero level set, i.e S = x|D(x) = 0.

Construction

When it comes to the problem of efficiently computing a distance field, one of thefollowing methods are commonly used: Voronoi diagrams[40], propagation methods[14]and rasterization methods[51]. Computing a discretized distance field is heavy dutywork since the distance field should contain information about the distance to the closestsurface for all points in the field. Many different representations of the field have beenproposed, among the more popular ones are uniform grids, Octrees and BSP-trees. Whenusing uniform grid techniques, distance values are computed for each grid point andvalues between these are interpolated. Altough there exists many different methods thatspeed up the build process of the distance fields, using for example the GPU, distancefield generation is still not fast enough for interactive applications with deforming bodies,when the fields must be updated during run-time [59][25].

Page 48: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

40 Chapter 2. Soft Body Simulation

2.8 Collision Response

There are two main branches in collision response for deformable bodies, penalty and La-grange multiplier methods. The concepts of these two methods will briefly be explainedin this chapter but first it should be noted that simulating deformable-bodies can beseen as an optimization procedure. That is, the equations of motion can be found as theconditions guaranteeing that the path corresponds to an extremum of some function F[63][21][36].

Since simulating the body is an optimization procedure, optimization concepts can beused to modify it. A constrained optimization procedure finds a minimum of a func-tion on a specified subspace. A simplified formulation of the constrained optimizationproblem can be stated as [7][5]:

minimizex

F (x), subject to g(x) = 0 (2.64)

where g(x) = 0 describes a subspace of the state space to which the solutions should bebound. This formulation is easily extended to the case where N constraints exists

minimizex

F (x), subject to gi(x) = 0 for i = 1, ..., N (2.65)

2.8.1 The Penalty Based Method, Springs

The physical interpretation of the penalty method is to add a spring which attractsthe physical state to the subspace g(x) = 0. This is done by adding an ”energy”term, ∝ g(x)2

2 , to the original optimization problem. Thus the constrained optimizationproblem in 2.64 is transformed into the unconstrained optimization problem:[7][5]

minimizex

p(x) = F (x) +cg(x)2

2(2.66)

where c > 0 is the spring constant. The added penalty term is always positive unless theconstraint is fully satisfied. Since the minimization procedure is greedy this formulationmay not give a solution that fulfills the constraints. This may happen because p(x) mayhave a minima that does not lie on the constraint subspace if the decrease in F (x) isgreater than the added penalty term there. The only way to guarantee that the solutionfulfills the constraints is by letting c →∞.

This formulation is easily extended to the case where N constraints exists as in 2.65.The problem is transformed by simply adding many springs.

minimizex

p(x) = F (x) +N∑

i=1

cig(x)2

2(2.67)

where ci is the spring constant for spring i.

Page 49: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.8. Collision Response 41

Pros

• Ease of use. As has been shown, adding constraints is easy since adding a springto the system requires little work.

• Balancing, when several constraints exists which doesn’t need to be exactly fulfilledthe penalty method is a good choice since the solution will compromise betweenthem.

Cons

• Inexact, the penalty method will never completely satisfy the constraints withsprings of finite strength.

• Stiffness, the penalty method suffers from stiffness problems often requiring thesolvers to take small time steps to ensure stability.

• Parameter dependence, tuning spring stiffness and dampening can be very difficult.

Penalty methods are the oldest and simplest approach to computing contact forces, al-though they do not strictly enforce non-penetration. In the case of inter-object collisions,stiff springs are attached to push the objects apart. When this has been accomplishedthe spring is removed. The spring forces are easily calculated and can be used as inputto haptic devices. Penalty methods are common in rigid body simulation [47][18] but areespecially useful in deformable body simulations[63][24][39] since the springs are easilyincorporated into the existing minimization process.

2.8.2 Lagrange Undetermined Multipliers

The Lagrange multiplier method is similar to the penalty method, only in the respectthat it transforms constrained optimization problems into unconstrained optimizationproblems. Lagrange multipliers, named after the genius Joseph Louis Lagrange, is ananalytic method used to find the local extrema of a function subject to constraints. Themethod converts a problem in n variables with k constraints to a problem with n + kvariables with no constraints.[2]

To derive the Lagrange multiplier method we start by stating a couple of facts, themethod is then reached through intuitive reasoning that stems from these facts.

1. A point satisfying the constraint g(x) = 0 may always take infinitesimal steps or-thogonal to ∇g(x) without breaking the constraint. This gives the legal directionsalong which the point may move on the constraint surface.

2. The condition of an extreme point for the constrained problem is that F (x) shouldnot increase when taking a legal infinitesimal step, i.e all legal steps should beorthogonal to ∇F (x).

By combining the two facts stated above a criteria for a local extrema of the constrainedproblem becomes [7][5]:

∇F (x) = λ∇g(x) (2.68)

where λ 6= 0 is a constant. So by forming the penalty function

p(x) = F (x) + λg(x)

Page 50: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

42 Chapter 2. Soft Body Simulation

and extending the state space with λ we get the following unconstrained minimizationproblem:

minimizex,λ

p(x) = F (x) + λg(x) (2.69)

Knowing that the gradient should be zero for an extrema we get the following equations:

∇xp(x) = ∇xF (x) + λ∇xg(x) = 0 (2.70)∇λp(x) = g(x) = 0 (2.71)

And voila, the problem has been reduced to that of finding the extremum of p(x) inthe state space extended by λ. This is called the method of Lagrange undeterminedmultipliers.

The constrained optimization problem with multiple constraints, 2.65, is analogouslytransformed to the following unconstrained minimization problem:

minimizex,λ

p(x) = F (x) + λT g(x) (2.72)

where

λ =

λ1

...λN

,g(x) =

g1

...gN

and λi 6= 0 for i = 1, ..., N .

Demanding that the solution should be a critical point in the extended state space leadsto the following equation system:

∇xp(x) = ∇xF (x) +∇xgT λ = 0 (2.73)∇λp(x) = g(x) = 0 (2.74)

Pros

• Fulfills the constraints.

• Renders correct constraint forces.

Cons

• Each new constraint adds a new variable, thereby adding to the complexity.

• Converts quadratic minimization problems to saddle point problems, thereby mak-ing gradient solvers useless. Position yourself into the problem imagining yourselfstanding at a minimum of F (x) where the constraint is not satisfied, now you canalways take a walk along the λ direction making p(x) go to ±∞.

When solving a problem using the Lagrange multiplier method the multipliers, λ:s, of-ten have a physical meaning[58]. In the case of contact problems with non-penetrationconstraints they represent the contact-forces needed to fulfill the constraint and can beused as input to haptic devices.

Page 51: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

2.8. Collision Response 43

The Lagrange multiplier method increases the complexity of the system and places moredemands on the solvers. Soft-bodies often have many contact points and each contactpoint introduces a new undetermined multiplier.This may make it difficult to estimatethe time consumed by the solver. Perhaps this is the reason why there isn’t as manyarticles about the multiplier method as there are about the penalty method when re-garding deformable bodies.

However, there still exists a plethora of different techniques incorporating the Lagrangeundetermined multiplier method. The books [63][39] explains and presents many dif-ferent Lagrangian multiplier methods, e.g the perturbed Lagrangian method and theaugmented Lagrangian method. The augmented Lagrangian method is one of many hy-brid methods which combine the penalty and multiplier method. This is done by addingsprings (∝ g(x)2) to p(x) in the Lagrangian method. Depending on the spring parame-ters one can greatly increase the methods convergence properties. It’s also common torelax the constraints in different parts of the solving procedure, either by adding extraterms to the penalty function or by modifying the solver or time stepping scheme[18].Article [61] presents a modified conjugate gradient(MCG) solver which filters out allmoves that would break the contraints. The method is further developed in article [9]where it is also proven that the MCG method is a projection method.

Page 52: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

44 Chapter 2. Soft Body Simulation

Page 53: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Chapter 3

Accomplishment

3.1 Preliminaries

When I first started the MT project my plan was to write the in-depth study whilereading up on subjects such as the co-rotated method, FEM-simulations, collision de-tection and collision response. This would have given me the insight to implement thesoft-body simulation directly after writing the in-depth study. However, I found it hardto write the report before I had implemented anything and therefore I gave up on thisapproach after little more than a month.

To get started with the implementation I received a small demo-application from SurgicalScience incorporating a FEM simulation of soft-bodies. The application used an explicitpenalty formulation for collision response and an optimized spatial hash method forcollision detection. It also used a propagation technique to estimate consistent collisionnormals and penetration depths.

3.2 How the work was done

After analysing the code given to me by Surgical Science, I met with both Mats G.Larson and Claude Lacoursiere. Claude advised me to first build the framework for thegraphics engine, which I did. I wanted the scene-oriented graphics engine to provide acommon render-system interface that abstracts all the details of using underlying systemlibraries, like Direct3D and OpenGL. This allows the use of either Direct3D or OpenGLwithout having to change anything except which rendering system to use. Since thesimulation requires fast and extensive memory management as well as number crunch-ing abilities, it had to be programmed in either C or C++. The construction of thegraphics engine and the rendering system interface took a couple of weeks but no majorglitches occurred.

After the framework for the graphics engine was completed I had a meeting with Claudeabout how to structure the FEM related data, and how to couple it with the renderingengine. After the meeting I began planning how to build and solve the FEM-systems.Most of the thoughts were about what structures to choose, and how the data shouldbe shared between the different modules in the program. I wanted to prevent needlessly

45

Page 54: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

46 Chapter 3. Accomplishment

sharing data between different modules since this results in a redundant coupling thatcould complicate future parallelization. The trade off is that most structures are very ex-tensive so recurrently copying the structures to prevent coupling results in a downgradeof performance. After implementing a FEM-module for Co-Rotated linear elasticity anda couple of solvers for elliptic problems, I began studying different articles on collisiondetection and collision response. Claude once again gave me some pointers to relevantarticles and tips about solvers for contact problems.

While reading up on different articles I implemented the same optimized spatial hashmethod with consistent penetration normal and penetration depth estimation as in thesample code from Surgical Science. This method works well and detects both inter andintra object collisions when using tetrahedronalized objects. The propagation techniquerenders collision depth and collision normals for all vertices colliding with another body.This is exactly what one wants when using an explicit penalty formulation. However, ifone wants to incorporate the collision response into the energy minimization procedure,as presented in the section about Penalty methods, one needs to know which verticescollided with which. This information can be extracted from the method, however acollision detection routine that solely deals with the surface meshes seemed more attrac-tive. Using a mesh-based collision detection routine would be far more general. It couldbe used with any triangle-mesh based object instead of only working with tetrahedron-meshes and it wouldn’t require any parameter tweaking. Using smart culling techniquesthe collision detection can be performed quickly, the only drawback is detecting self-collisions which could become more of a hassle. Using a mesh-based collision techniquewould also detect edge-face collisions, something that the optimized spatial hash methodmay miss.

Since I at the time couldn’t determine which collision detection technique to replace theoptimized spatial hash method with, I started to implement the discontinuous Galerkinmethod. After implementing the method, and assembling and solving the systems gener-ated by the technique, I encountered some problems due to cache-misses. The Galerkinmethod greatly increases the DOFs and the amount of data to be processed. The waydata was handled required some re-design of parts in the FEM-module. Apart fromthis setback the implementation of the DG-method and the FEM-module using the Co-Rotated method went well.

At this point in time I started to read up on different integrators since a time-steppingscheme without numerical dissipation was sought for. At the time I used implicit Euler,a self damped scheme which dissipates energy even when no dampening is present. Aftertalking to Mats I also implemented a Newmark scheme, which for certain parametersis a symplectic method and preserves energy. This scheme works well and makes itpossible to explicitly control the dampening. However, due to the stiffness of the systemthis scheme requires the time step to be significantly reduced.

By this time I began to write my MT-thesis and further implementations were put onhold. I had planned to start dabbling with a haptic-device during the time I wrote myMT-thesis but this was postponed due to lack of time.

Page 55: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

3.3. Implemented features 47

3.3 Implemented features

o A scene-oriented graphics engine, still growing at a size of over 160 files. Thegraphics engine uses a render-system interface, much like OGRE (Object-OrientedGraphics Rendering Engine). The render-system library abstracts all the detailsof using underlying system libraries like Direct3D and OpenGL.

o A FEM module

• Linear elasticity module.

• Co-rotated linear elasticity module.

• Discontinuous Galerkin with co-rotated linear elasticity module.

o Templated/parameterized solvers

• CG-solver.

• Preconditioned CG-solver.

• Filtered/projected preconditioned CG-solver.

• Gauss-Seidel solver.

• SOR Gauss-Seidel solver.

o A tetrahedronalization interface, used to give support for dynamic re-meshingusing Tetgen.

o Support for file-formats describing surface or tetrahedron-meshes.

• Tetgen filehandler, supports all Tetgen files, off-files, face/node/smesh/spoly,etc.

• Netgen filehandler, supports all Netgen files.

o Support for collision detection using optimized spatial hash with consistent pene-tration depth and penetration normal estimation.

o Time-stepping schemes

• Newmark.

• Implicit Euler.

Page 56: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

48 Chapter 3. Accomplishment

Page 57: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Chapter 4

Conclusions

Overall the MT-project has given me a great opportunity to explore some of the areasI find very interesting. I’ve read a countless amount of articles and have devoted muchtime to programming. But since there’s still so much to learn it feels like I’ve just be-gone. The project has been an extremely useful experience, especially when it comes todevelopment. Before starting the project I had little experience in developing anythingbesides small applications. I had little skill in assessing the amount of work and timegoing into planning and implementing a feature. I’m still far from experienced but I’veat least gotten rid of some naivety.

From the beginning I had planned on implementing far more than I accomplished. Thereason for this was a combination of lack of time and my indetermination when it cameto determine which of all alternatives to choose; what technique, algorithm or structureto use, and so on. Instead of simply implementing something decent, I chose to pickup another book or article in quest of an even better solution. Even in hindsight Icannot regret this since I’ve now found the answers to most of my questions and canimplement a far better solution. However, I do regret that I didn’t explore existingopen-source physics engines like Bullet, Newton Game Dynamics, ODE and DynaMechbefore implementing the FEM-module since they had encountered and solved many ofthe problems I faced. After having looked at OPAL (Open Physics Abstraction Layer)I also noticed that I should have implemented some interfaces slightly different.

The application can simulate about 2-3k tetrahedron in real-time on my laptop, 1.8GHz64bit AMD-processor. Considering the amount of data needing to be processed I don’tthink this can be further increased. However, given a multi-core CPU each core couldeasily solve a different collision group since the problem is highly parallelizable.

49

Page 58: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

50 Chapter 4. Conclusions

4.1 Future work

If I were to continue expanding the FEM-module in the future I would re-design manyparts. After exploring other open-source physics engines there are some things in thestructural layout I would like to do differently. Of course, many other things needsfurther development and a few examples are:

+ Add support for shaders and multi-pass techniques in the graphics engine.

+ Extending the simulation-environment to handle rigid bodies.

+ Develop a GUI.

+ Add extensive post-processing capabilities.

+ Add collision detection.

+ Add collision response. Both Lagrange multiplier and penalty methods.

Page 59: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

Chapter 5

Acknowledgements

I would like to thank my supervisor Mats G. Larson and Claude Lacoursiere for theirtips and infinite wisdom. My fiancee Lisa who helped me completing this thesis. Myfamily and friends for just being there.

51

Page 60: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

52 Chapter 5. Acknowledgements

Page 61: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

References

[1] G.Sparr A. Sparr. Kontinuerliga System. Studentlitteratur AB, 2000.

[2] R.A. Adams. A Complete Course Calculus. Addison Wesley Longman Ltd, 1999.

[3] T. Larsson T. Akenine-Moller. A dynamic bounding volume hierarchy for general-ized collision detection. Technical report, 2005.

[4] T. Larsson T. Akenine-Moller. Collision detection for continuously deforming bod-ies. Technical report, Computer Graphics, University of Freiburg, Germany, 2006.

[5] A.Witkin. Physically based modeling, course notes. Technical report, Pixar Ani-mation Studios, 2002.

[6] D. Hearn M.P. Baker. Computer Graphics, C Version. Prentice Hall, 1998.

[7] J.C. Platt A.H. Barr. Constraint methods for flexible models. Technical report,California Institute of Technology, Pasadena, 1988.

[8] G. Van Den Bergen. Efficient collision detection of complex deformable modelsusing aabb trees. Technical report, Department of Mathematics and ComputingScience Eindhoven University of Technology, Eindhoven, Netherlands, 1998.

[9] U.M. Ascher E. Boxerman. On the modified conjugate gradient method in cloth sim-ulation. Technical report, Department of Computer Science, University of BritishColumbia, Vancouver, Canada., 2001.

[10] J. Baxter Brown. Introductory Solid Mechanics. John Wiley & Sons, INC, 1973.

[11] J.R. Bruce. Real-time motion planning and safe navigation in dynamic multi-robotenvironments. Technical report, Computer Science Carnegie Mellon University,2006.

[12] Wikipedia Community. Kd-tree. http://en.wikipedia.org/wiki/Kd-tree (visited2007-02-05).

[13] R.D. Cook. Finite Element Modeling For Stress Analysis. John Wiley & Sons, INC,1995.

[14] O. Cuisenaire. Distance transformations: Fast algorithms and applications to med-ical image processing. Technical report, Univerite Catholique de Louvain, Labora-toire de Telecommunications et Teledetection, 1999.

[15] M. Muller J. Dorsey L. McMillan R. Jagnow B. Cutler. Stable real-time deforma-tions. Technical report, ETH Zurich and MIT CS, Zuric, Switzerland, 2002.

53

Page 62: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

54 REFERENCES

[16] T. Dahlberg. Teknisk Hallfasthetslara. Studentlitteratur AB, 2001.

[17] L. Kharevych Weiwei Y. Tong E. Kanso J. E. Marsden P. Schroder M. Desbrun. Ge-ometric, variational integrators for computer animation. Technical report, Caltech,2006.

[18] K. Erleben J. Sporring K. Henriksen H. Dohlmann. Physics-Based Animation.Charles River Media, INC, 2005.

[19] K. Shoemake T. Duff. Matrix animation and polar decomposition. Technical report,University of Pennsylvania, Computer Graphics Laboratory, Philadelphia, USA,1992.

[20] M. Nesme Y. Payan F. Faure. Efficient, physically plausible finite elements. Tech-nical report, IMAG, Grenoble, France, 2005.

[21] C.A. Felippa. Introduction to finite element methods. Department of AerospaceEngineering Sciences and Center for Aerospace Structures, 2004.

[22] R. Fleming. Bounding volumes: Spheres and obbs. Technical report, 2005.

[23] R.G. Luque J.L.D. Comba C.M.D.S. Freitas. Dynamic plane shifting bsp traversal.Technical report, Instituto de Informatica, UFRGS, 2005.

[24] G. Hirota S. Fisher A. State C. Lee H. Fuchs. An implicit finite element methodfor elastic solids in contact. Technical report, Department of Computer Science,University of North Carolina at Chapel Hill, 2001.

[25] A. Fuhrmann. Real-time collision detection for dynamic virtual environments - dis-tance fields. Technical report, Fraunhofer Institute for Computer Graphics Darm-stadt, Germany, 2005.

[26] B. Heidelberger M. Teschner M. Gross. Real-time volumetric intersections of de-forming objects. Technical report, Computer Graphics Laboratory, ETH Zurich,Switzerland, 2003.

[27] B. Heidelberger M. Teschner M. Gross. Detection of collisions and self-collisionsusing image-space techniques. Technical report, Computer Graphics Laboratory,ETH Zurich, Switzerland, 2004.

[28] M. Muller M. Gross. Interactive virtual materials. Technical report, ETH Zurich,Zuric, Switzerland, 2004.

[29] M. Teschner B. Heidelberger M. Muller D. Pomeranets M. Gross. Optimized spatialhashing for collision detection of deformable objects. Technical report, ComputerGraphics Laboratory, ETH Zurich, Switzerland, 2003.

[30] M. Teschner B. Heidelberger M. Muller R. Keiser M. Gross. Consistent penetrationdepth estimation for deformable collision response. Technical report, ComputerGraphics Laboratory, ETH Zurich, Switzerland, 2004.

[31] E. Hairer. Introduction to geometric numerical integration. Technical report, Cal-tech, Geneva, 2004.

Page 63: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

REFERENCES 55

[32] C. Fares Y. Hamam. Collision detection for rigid bodies: A state of the art review.Technical report, 2003.

[33] H. J. Haverkort. Introduction to bounding volume hierarchies. Technical report,2004.

[34] N.J. Higham. Computing the polar decomposition with applications. Technicalreport, The University of Manchester, Manchester Institute for Mathematical Sci-ences, Manchester, UK, 1986.

[35] C. Johnson. Numerical solution of partial differential equations by the finite elementmethod. Studentlitteratur AB, 1987.

[36] K. Eriksson D. Estep P. Hansbo C. Johnson. Computational Differential Equations.Studentlitteratur AB, 1996.

[37] H.G. Matthies J. Steindorf O. Kayser-Herold. Numerical methods for odes, coursenotes. Technical report, Institute of Scientific Computing, Technical UniversityBraunschweig, Braunschweig, Germany, 2002.

[38] P. Hansbo M.G. Larson. Discontinuous galerkin and the crouzeix-raviart element:Application to elasticity. 2001.

[39] A. Cardona M. Gerardin. Flexible Multibody Dynamics. John Wiley & Sons, INC,2000.

[40] K.E. Hoff T. Culver J. Keyser M.C. Lin D. Manocha. Fast computation of gener-alized voronoi diagrams using graphics hardware. Technical report, Department ofComputer Science, University of North Carolina at Chapel Hill, USA, 1999.

[41] N.K. Govindaraju S. Redon M.C. Lin D. Manocha. Cullide: Interactive collisiondetection between complex models in large environments using graphics hardware.Technical report, Department of Computer Science, University of North Carolinaat Chapel Hill, USA, 2003.

[42] S. Gottschalk M.C. Lin D. Manocha. Obb-tree: A hierarchical structure for rapidinterference detection. Technical report, Departement of Computer Science, Uni-versity of North Carolina, North Carolina, USA, 1996.

[43] J.M. Wendlandt J.E. Marsden. Mechanical integrators derived from a discretevariational principle. Technical report, 1997.

[44] S. Melax. Dynamic plane shifting bsp traversal. Technical report, BioWare, 2001.

[45] N. Boldt J. Meyer. Self-intersections with cullide. Technical report, Department ofComputer Science, University of Copenhagen, Denmark, 2004.

[46] J. Mezger. Tutorial: Collision handling in dynamic simulation environments bound-ing volume hierarchies. Technical report, University of Tubingen, WSI/GRIS,Tubingen, Germany, 2005.

[47] M. Moore and J. Wilhelms. Collision detection and response for computer anima-tion. Technical report, Computer Graphics and Imaging Laboratory, Santa Cruz,1988.

Page 64: Ume˚a University - umu. · PDF fileSurface forces are the forces exerted on the boundary of the body due to contact with ... The internal force divided ... is to calculate the pressure

56 REFERENCES

[48] J.C. Lombardo M.P. Cani F. Neyret. Real-time collision detection for virtualsurgery. Technical report, IMAG/INRIA, France, 2004.

[49] X. Provot. Collision and self-collision handling in cloth model dedicated to designgarments. Technical report, INRIA, France, 1998.

[50] A. Ramgard. Vektoranalys 3:e upplagan. THS AB, 2000.

[51] T.R. Jones S.F. Frisken R.N. Perry A.P. Rockwood. Adaptively sampled distancefields: A general representation of shape for computer graphics. Technical report,MITSUBISHI ELECTRIC RESEARCH LABORATORIES, 2000.

[52] J. T. Klosowski M. Held J. S.B. Mitchell H. Sowizral. Efficient collision detectionusing bounding volume hierarchies of k-dops. Technical report, 1996.

[53] A. Stern. Discrete geometric mechanics and variational integrators. Technicalreport, Caltech, California, USA, 2006.

[54] M. Hauth W. Strasser. Corotational simulation of deformable solids. Technicalreport, WSI/GRIS, University of Tubingen, Sand 14, D-72076 Tubingen, Germany,2002.

[55] J. Shade S. Gortler L. Hey R. Szeliskiz. Layered depth images. Technical report,1998.

[56] J. Spillmann M. Becker M. Teschner. Efficient updates of bounding sphere hierar-chies for geometrically deformable models. Technical report, Computer Graphics,University of Freiburg, Germany, 2006.

[57] P. Volino N.M. Thalmann. Collision and self-collision detection: Efficient and robustsolutions for highly deformable surfaces. Technical report, MIRALAB, Universityof Geneva, 1998.

[58] J.B. Marion S.T. Thornton. Classical Dynamics of Particles and Systems. SaundersCollege Publishing, 1995.

[59] M. Teschner S. Kimmerle B. Heidelberger G. Zachmann L. Raghupathi A.Fuhrmann M.P. Cani F. Faure N. Magnenat-Thalmann W. Strasser P. Volino. Col-lision detection for deformable objects. Technical report, 2004.

[60] C. Kane J.E. Marsden M. Ortiz M. West. Variational integrators and the newmarkalgorithm for conservative and dissipative mechanical systems. Technical report,2000.

[61] D. Baraff A. Witkin. Large steps in cloth simulation. Technical report, RoboticsInstitute, Carnegie Mellon University, 1998.

[62] G. Zachmann. Rapid collision detection by dynamically aligned dop-trees. Technicalreport, Fraunhofer Institute for Computer Graphics, Darmstadt, Germany, 1996.

[63] Z. Zhong. Finite Element Procedures for Contact Impact Problems. Oxford Uni-versity Press, 1993.