An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea...

52
An Adaptive Level-Set Method for Reaction-Diffusion Systems on Moving Surfaces Michael Shann of Zurich, ZH, Switzerland Master Thesis Supervisor: Dr. Sylvain Reboux Date of Submission: April 18, 2011 Prof. Dr. Ivo F. Sbalzarini MOSAIC Group Department of Computer Science ETH Zurich http://www.mosaic.ethz.ch

Transcript of An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea...

Page 1: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

An Adaptive Level-Set Method forReaction-Diffusion Systems on

Moving Surfaces

Michael Shannof Zurich, ZH, Switzerland

Master ThesisSupervisor: Dr. Sylvain Reboux

Date of Submission: April 18, 2011

Prof. Dr. Ivo F. SbalzariniMOSAIC Group

Department of Computer ScienceETH Zurich

http://www.mosaic.ethz.ch

Page 2: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours
Page 3: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Acknowledgments

I was very fortunate to write this thesis under the patient guidance of my supervisorDr. Sylvain Reboux. He was so open-minded as to accept an “anumeriketos” - one that isnot proficient in computational science - and always had time for me whenever I did notknow how to proceed. I also would like to express my gratitude to Prof. Ivo F. Sbalzariniwho has created a dynamic and fascinating environment with his MOSAIC group. Notto forget all the folks within MOSAIC who work hard to make the “PPM experience” aspleasurable as possible. Lastly, I would like to thank Luba, my parents and friends for theall their love and support that keeps me going on every day.

i

Page 4: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

ii

Page 5: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Abstract

This thesis presents a novel pure-particle algorithm for the simulation of reaction-diffusionsystems on deforming surfaces, which represent an important class of biological models.because they provide explanations to complex phenomena such as pattern formation ormorphogenesis. The algorithm uses an implicit Lagrangian level-set representation to trackthe motion of the surface, the framework of discretization-corrected PSE operators todiscretize the spatial derivatives of the governing equations as well as pseudo-forces toadapt the particle distribution to local resolution requirements, which renders the use ofCartesian grids unnecessary. We validate the method is by a series of test problems anddiscuss its advantages and drawbacks.

The second contribution of the thesis is the conclusion that discretization-correctedPSE operators to approximate spatial derivatives cannot be used to integrate any type ofadvection equation due to numerical instabilities. This is shown by a von Neuman stabilityanalysis.

iii

Page 6: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

iv

Page 7: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Contents

Acknowledgments i

Abstract iii

1 Introduction 1

2 Theoretical background 32.1 Reaction-diffusion systems on moving surfaces . . . . . . . . . . . . . . . . 32.2 The level-set method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.3 Lagrangian particle methods . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2.3.1 Function approximation . . . . . . . . . . . . . . . . . . . . . . . . 62.3.2 Approximation of derivatives . . . . . . . . . . . . . . . . . . . . . . 72.3.3 Evolution equations . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.4 Lagrangian formulation for reaction-diffusion . . . . . . . . . . . . . . . . . 10

3 Function extension 113.1 Grid-based methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.2 Particle-based methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.2.1 Stability analysis for the advection equation . . . . . . . . . . . . . 133.2.2 An alternative approach to extension . . . . . . . . . . . . . . . . . 16

4 Reinitialization and adaptation 204.1 Level-set reinitialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204.2 Adaptation of the particle distribution . . . . . . . . . . . . . . . . . . . . 22

5 The Algorithm 245.1 Initial particle placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.2 Computing derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.3 Determining ∆t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255.4 Reconstructing the interface . . . . . . . . . . . . . . . . . . . . . . . . . . 26

6 Numerical experiments 276.1 Consistency of the discretized Laplacian operator . . . . . . . . . . . . . . 276.2 Diffusion on a sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286.3 Growth of a sphere . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

v

Page 8: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

7 Discussion 317.1 Extension: final remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317.2 Neighbour lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317.3 Resolution function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327.4 DC PSE operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

8 Summary and Conclusion 35

A A note on the implementation 37A.1 Source files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37A.2 PPM - Parallel Particle-Mesh Library . . . . . . . . . . . . . . . . . . . . . 38A.3 Some aspects of a PPM client . . . . . . . . . . . . . . . . . . . . . . . . . 38

List of Figures 43

vi

Page 9: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 1

Introduction

An important class of biological models are reaction-diffusion systems on moving surfacesas they provide explanations to complex phenomena such as pattern formation or morpho-genesis [6]. In order to gain deeper understanding of such systems, numerical simulationsare indispensable due to the potential complexity of both the equations and the geometryof the surface. Simulating a reaction-diffusion system involves two parts. On the one hand,the concentrations of the different chemical species have to be interconverted according totheir kinetic rate laws. On the other hand, the species must be diffused on the surfacewhich is itself subject to deformation.

In a recent work, Bergdorf et al. developed a hybrid particle-mesh algorithm to simulatesuch systems, combining the implicit surface representation of level-set methods with theframework of Lagrangian particles [2]. This algorithm makes use of a uniform Cartesiangrid. A drawback of a uniform grid is that it does not render the algorithm spatiallyadaptive, since the grid cannot be refined or coarsened in regions where higher or lowerresolutions are desirable.

The goal of this thesis is to enhance the algorithm by Bergdorf et al. to make it spatiallyadaptive. The approach we use does not to rely on a grid in any part of the algorithm.This requires on the one hand to use discretization corrected PSE operators [12] to computespatial derivatives on scattered particle locations. On the other hand, we use the frameworkof self-organizing particles developed by Reboux et al. [9] to distribute the particles in sucha way as to introduce multi-resolution features into the simulation as well as to render anyre-meshing technique unnecessary.

A main part of this thesis was to develop a solution to the problems of function extensionand level-set reinitialization, both of which are core issues in any level-set algorithm. Wehave come to the conclusion that the PDE based methods that are used in [2] cannotbe transferred to a pure particle setting where the spatial derivatives are discretized withDC PSE operators. We present the even more general result that spatial discretizationwith DC PSE operators leads to numerical instabilities in any kind of advection equation.Despite this negative result, we demonstrate that it is still possible to design and implementschemes for extension and reinitialization for pure particle methods.

The rest of the thesis is structured as follows. In the next section, the theory concern-

1

Page 10: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

2 CHAPTER 1. INTRODUCTION

ing reaction-diffusion systems, level-set methods and Lagrangian particles is summarized.Sections 3 and 4 discuss function extension and level-set reinitialization. The completealgorithm is presented in Section 5, followed by a set of validation tests in Section 6 anda discussion of some core issues in Section 7. Finally, Section 8 provides a short summarywith advantages and drawbacks of the presented approach.

Page 11: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 2

Theoretical background

In this section, we introduce the theory that is needed to understand the algorithm. Thisconcerns especially the description of reaction-diffusion systems, the framework of La-grangian particles and the level-set method.

2.1 Reaction-diffusion systems on moving surfaces

The term reaction-diffusion system is used to describe a physico-chemical phenomenonthat comprises two elements, namely chemical reactions and diffusion. A chemical reactionsystem consists of N species X1, ..., XN (e.g. molecules) together with M reaction channels,

r1, ..., rM . Each reaction channel defines the stoichiometry of a reaction rm :∑

i αimXikm−→∑

j βjmXj. This describes the idea that whenever the species i come together with molarconcentrations αi, they are interconverted to the species j with molar concentrations βjwith a specific reaction rate km. Using the law of mass action [7], one can derive a systemof differential equations for the change of the concentration of each species,

∂ci∂t

=M∑m=1

km(βim − αim)N∏l=1

cl(t)αlm , (2.1)

or in matrix notation∂c

∂t= MS · r(t), (2.2)

where MS is the stoichiometric matrix and r the rate vector describing the speed of eachreaction [14]. In the following, we will use the shorthand notation Ri(c) to denote thereaction terms on the right-hand side of Eq. (2.1).

The second phenomenon, diffusion, refers to the process of thermal motion of molecules.It is the process by which for example warm and cold water intermingles until the waterhas a uniform temperature (at thermal equilibrium) or by which a fragrant smell spreadsin a room. The general macroscopic diffusion equation for species i = 1, 2, . . . , N is

∂ci∂t

= ∇ · (Di∇ci), (2.3)

3

Page 12: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

4 CHAPTER 2. THEORETICAL BACKGROUND

where Di denotes the diffusion tensor of species i, a matrix that defines how well themolecule i diffuses into the different spatial directions. Diffusion can be classified asisotropic or anisotropic and homogeneous or inhomogeneous. Here, we consider only ho-mogeneous isotropic diffusion. In this case, the diffusion of a molecule is independent ofits position, and it is symmetric in all spatial directions. Mathematically, this implies thatthe diffusion tensor is the product of a scalar value times the identity matrix, Di = Di 1.Then, Eq. (2.3) simplifies to

∂ci∂t

= Di∇ · (∇ci) = Di ∆ci. (2.4)

Combining equations (2.1) and (2.4), we get the so called reaction-diffusion equation.The equations for a reaction-diffusion system on a surface Γ ⊂ Ω ⊆ <3 are then

∂ci∂t

= Ri(c) +Di ∆Γci, i = 1, . . . , N, (2.5)

where ∆Γ ≡ ∇Γ · ∇Γ is called the Laplace-Beltrami operator on Γ.Furthermore, the surface Γ itself is subject to motion: Γ = Γ(t) = x(t) : x ∈ Γ with

dxΓ/dt = v(xΓ, c, t). Taking everything together, the equations for a reaction-diffusionsystem on a moving surface Γ are given by

∂ci∂t

+∇Γ · (civ) = Ri(c) +Di ∆Γci i = 1, . . . , N. (2.6)

Note that in Eq. (2.6), the spatial operators ∇Γ and ∆Γ are defined only on the surfaceΓ. This requires the surface to be described by an explicit parametrisation, which canlead to some numerical issues in the case of large deformations or topological changes.Some numerical methods like the level-set method (see Section 2.2) address this difficultyby relying on an implicit description of the surface. In that case Γ is no longer knownexplicitly, and Eq. (2.6) becomes

∂ci∂t

+∇ · (civ) = Ri(c) +Di ∆ci i = 1, . . . , N. (2.7)

This requires that the quantities c and v are expanded into the volume Ω as

∂ci∂n

= 0 and∂(n · v)

∂n= 0. (2.8)

The equations in (2.8) state that the concentration ci and the speed of the normalvelocity, n · v, are both constant along the surface normal n.

2.2 The level-set method

Level-set methods are a class of algorithms for analysing and computing moving interfaces,with a variety of applications in fields such as physics and computer vision [13]. The main

Page 13: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

2.2. THE LEVEL-SET METHOD 5

idea is that it is easier to represent and evolve an interface implicitly by isocontours of alevel-set function φ than to parametrise it explicitly.

In the following, we summarize some important aspects of level-set methods found in [8]and [2]. Let Γ (t) be a closed moving interface in <n, and let Ψ (t) be the region that isinside Γ (t). The level-set function φ (x, t) is defined as

φ (x, t)

< 0 if x ∈ Ψ (t)

= 0 if x ∈ Γ (t)

> 0 if x ∈ <n\Ψ (t).

(2.9)

The elegance of this technique stems from the idea that moving the interface Γ can bedone implicitly by updating the level-set φ without needing to know where it is located.On the other hand, the interface is defined by its zero level, Γ = x : φ (x, t) = 0, whichmakes its reconstruction easy.

The evolution equation for the level-set is obtained as follows. Consider a sampleparticle trajectory x (t) on the interface. Because the particle is located on the interface,φ(x) = 0. Now if the particle is advected by a flow velocity v(x, t), the derivative of φsatisfies

dt=∂φ

∂t+ v · ∇φ = 0. (2.10)

This equation fits especially well into the framework of Lagrangian particle methods,since Eq. (2.10) describes exactly how a Lagrangian particle is advected in a flow field.Therefore, if the level-set method is used within the framework of Lagrangian particles,the above equation states that the level-set value of a particle is constant as the particle ismoved by a flow field.

Usually, one wants the level-set function to have the signed distance property, accordingto which the value of φ of any particle equals the particle’s signed distance to the closestpoint on the interface,

φ(x) =

distance(x) if x ∈ Ψ (t)

−distance(x) if x ∈ <n\Ψ (t),(2.11)

which implies that ‖∇φ‖ = 1.Since one is only interested in the value of the quantities on the level-set, it is not

necessary to perform the calculations on the whole computational domain Ω. One canactually restrict the computations to a narrow band Γε around the interface,

Γε = x : ‖x‖ < ε. (2.12)

We can recover some geometric properties of the interface from the level-set function.The surface normal (see Figure 2.1) n is given by

n = ∇φ/‖∇φ‖, (2.13)

and the curvature κ can be computed as the divergence of the normal,

κ = ∇ · (∇φ/‖∇φ‖). (2.14)

Page 14: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

6 CHAPTER 2. THEORETICAL BACKGROUND

Figure 2.1: The surface normal n. At every point x ∈ Γ, the surface normal by defined asn = ∇φ/‖∇φ‖.

2.3 Lagrangian particle methods

Lagrangian particle methods are a class of numerical algorithms based on unstructuredspatial discretization. In contrast to mesh-based algorithms, where spatial derivatives areapproximated on a grid, for example with finite differences, Lagrangian particle methodsmake use of a fundamentally different concept, called computational particles. A particleis defined by a triple (x, ω, v)p: its position, xp, its extensive quantity, ωp, which is relatedto an intensive field c as ωp = vpc (if c is constant within vp), and its volume, vp [10]. Aparticle can be thought of as a control volume tracked in the Lagrangian frame of reference:it can be moved by a flow field, its strength ωp, however, is not changed by this advection:dωp/dt = 0. As mentioned before, the particle discretization of the computational domainis not in any way restricted by topological constraints (i.e. particles can in principle beplaced in any desired way), such that the method is very adaptive with respect to flowproblems and therefore naturally suited for the simulation of reaction-diffusion systems [9].

In the following, we will briefly discuss how particle methods approximate field functionsand spatial derivatives, and what the evolution equations of particles look like. This leadsnaturally to the reformulation of the governing equations for reaction-diffusion systems(see Eq. (2.7)) in Section 2.4.

2.3.1 Function approximation

We now summarize how a continuous field function f : <d → < can be approximated byparticles. This can be done in three steps [10]: integral representation, mollification anddiscretization.

Page 15: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

2.3. LAGRANGIAN PARTICLE METHODS 7

Integral representation. We can write the field f as an integral

f(x) =

∫f(y)δ(x− y)dy, (2.15)

where δ(x) is the Dirac delta function, defined as

δ(x) =

∞ if x = 0

0 otherwise.(2.16)

Mollification. The Dirac delta function needs to be smoothed and is therefore replacedby a kernel function of characteristic width ε: ζε = ε−dζ(x

ε). We require that

∫ζdx = 1

and limε→0 ζε = δ. The new smooth function approximation is then of the form

fε(x) =

∫f(y)ζε(x− y)dy. (2.17)

This approximation is of order r, fε = f(x) + O (εr), if the moments s = 2, ..., r − 1 ofζ vanish, ∫

xsζε(x)dx = 0. (2.18)

Discretization. The third step consists in discretizing the integral of Eq. (2.17) as asum over all particles (midpoint quadrature),

fhε (x) =N∑p=1

ωhp ζε(x− xhp) =N∑p=1

f(xhp)vp ζε(x− xhp), (2.19)

since the particles’ extensive strengths can be written as ωhp = f(xhp)vp.In total, we get for the approximation error the following equation,

fε = f(x) +O (εr) +O

(h

ε

)k, (2.20)

where r and k are the order and the number of continuous derivatives of the kernel ζ(k →∞ for infinitely smooth kernels), respectively, and h the inter-particle distance. Fromthis follows what is known as the overlap condition: h/ε < 1, namely that the distancebetween two particles, h, must be smaller than the kernel width, ε, if the approximationerror is to remain small.

2.3.2 Approximation of derivatives

The method for approximating spatial derivatives that is used in this project is the gener-alized integral particle strength exchange operator (PSE operator) [3], or rather its moreaccurate counterpart the discretization-corrected PSE operators (DC PSE operators). Thediscussion of the DC PSE operators follows closely the framework presented in [12].

Page 16: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

8 CHAPTER 2. THEORETICAL BACKGROUND

Given a field f : <d → <, the integral PSE operator to approximate an arbitrary spatialderivative

∂|β|f(x)

∂xβ1

1 ∂xβ2

2 ...∂xβdd

(2.21)

is defined as

Qβf(x) =1

εd

∫f(y)± f(x)ηβ

ε (x− y)dy, (2.22)

where x = (x1, x2, . . . , xd), and β = (β1, β2, . . . , βd) is a multi-index. Modulus, factorial andexponentiation with a multi-index are defined as |β| =

∑βi, β! =

∏βi! and xβ =

∏xβii .

One uses the convention that the sign in Eq. (2.22) is positive for odd |β| and negative foreven |β|.

The kernel function ηε(x) = ε−dη(x/ε) is mollified to width ε. To get an approximationof order r, the kernel has to satisfy the continuous moment conditions [3]

∫(y − x)αηβ

ε (x− y)dy =

(−1)|β|β!, if α = β

0, if α 6= β, |α| < |β|+ r − 1.(2.23)

The next step consists in discretizing Eq. (2.23) by midpoint quadrature over the par-ticle positions,

Qβhf(x) =

1

εd

∑p∈N(x)

vpf(xp)± f(x)ηβε (x− xp), (2.24)

where the sum goes over all particles p in a neighbourhood ball of radius rp, and vp is thevolume of particle p. One then defines the discrete moment conditions analogously to thecontinuous ones,

1

εd

∑p∈N(x)

vp

(x− xpε

ηβ

(x− xpε

)=

(−1)|β|β!, if α = β

0, if α 6= β,(2.25)

where |α| ∈ |αmin|, . . . , |β|+ r − 1\|β|, and

|αmin| =

0 if |β| odd

1 if |β| even.(2.26)

If the kernel satisfies the continuous moment conditions, this does not imply that it satisfiesthe discrete ones as well. On the contrary, for small particle resolutions (small averageparticle volume), the error terms of order s < r can become dominant. For this reason, onemodifies the kernel function by adding a polynomial correction function P (z,x) in order forthe kernel to satisfy the discrete moment conditions. The discretization-corrected kernelfunction is chosen to be

ηβ(z,x) = P (z,x)ηβ(z) =

∑|γ|

aγ(x)zγ

e−c2|z|2 , (2.27)

Page 17: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

2.3. LAGRANGIAN PARTICLE METHODS 9

where |γ| runs from |αmin| to |β|+ r − 1. Plugging this kernel template into the discretemoment conditions defines a linear system of equations which can be solved to obtain thecoefficients aγ of the polynomial correction function. This results in equations of the form

∑|γ|

aγ(x)wαγ(x) =

(−1)|β|β!, if α = β

0, if α 6= β, |α| ∈ |αmin|, . . . , |β|+ r − 1\|β|(2.28)

where the weights

wαγ(x) =1

ε|α+γ|+d

∑p∈N(x)

vp(x− xp)α+γe−c

2|x−xpε|2 (2.29)

define a square matrix M of size(|β|+r−1+n

d

)−αmin. If the particles are distributed on a

Cartesian grid, then all particles have the same matrix M. However, if the particles are onscattered locations, M is different for every particle and therefore a linear system needs tobe solved for every particle, resulting in some computational effort [12].

As an example, consider the one-dimensional diffusion equation,

∂f

∂t= ∆f. (2.30)

In this case, β = 2 and the discrete moment conditions become

1

ε

∑p∈N(x)

vp

(x− xpε

)αη(2)ε

(x− y

ε

)=

2, if α = 2

0, if α 6= β, α = 1, 3, 4, ..., 1 + r.(2.31)

Finally, the Laplacian operator ∆f can be approximated at any particle location by

∆hf(xp) =1

ε2

∑q

vq(f(xq)− f(xp))η(2)ε (xp). (2.32)

2.3.3 Evolution equations

As mentioned in the beginning of Section 2.3, every particle is defined by a triple ofproperties (x, ω, v)p, each of which is time-dependent. In general, when given the governingequations for some system, e.g. the reaction-diffusion equations, these properties evolve intime, satisfying the governing equations in a Lagrangian frame of reference [10]. Thus, theevolution of every particle p is given by a system of three ordinary differential equationthat describe its change over time,

dxpdt

= f(xp, ωp, vp, ...)

dωpdt

= g(xp, ωp, vp, ...)

dvpdt

= h(xp, ωp, vp, ...). (2.33)

Page 18: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

10 CHAPTER 2. THEORETICAL BACKGROUND

By this notation we mean that in general, the right-hand sides of the ODEs may dependon the particles position, strength, volume as well as other variables, which is given by thegoverning equations. In a concrete problem, these ODEs might have very simple forms,e.g. dωp/dt = 0.

2.4 Lagrangian formulation for reaction-diffusion

We now bring together the pieces gathered in the previous sections, as we want to formulatethe level-set method for reaction-diffusion systems on moving surfaces in a Lagrangianframework.

First, recall the reaction-diffusion equation for a moving surface Γ,

∂ci∂t

+∇ · (civ) = Ri(c) +Di ∆ci i = 1, . . . , N. (2.34)

with ∇ and ∆ defined in <3. The particles are advected by the flow field v. Thereforedxp/dt = v(xp, t). The surface Γ is the zero contour of the level-set function φ,

Γ = x : φ(x) = 0, (2.35)

and the level-set function evolves in time according to the advection equation

∂φ

∂t+ v · ∇φ = 0. (2.36)

Since particles are evolved in a Lagrangian frame of reference, they carry their level-setvalue with them. This implies

dφpdt

= 0. (2.37)

Using a suitable kernel function η, the concentration field c can be approximated by

ch(x, t) =∑

cpη(x− xp(t)). (2.38)

The level-set φ(x, t) is approximated by

φh(x, t) =∑

φpvpη(x− xp(t)), (2.39)

where vp is the volume of particle p.Together, the governing equations, after translating them into the particle framework,

becomedxpdt

= v(xp, t)

dcpdt

= vpF (c) + vpD ∆hc

dvpdt

= vp∇h · v

dφpdt

= 0, (2.40)

where c = (c1, . . . , cN) and D = diag(D1, . . . , DN) [2].

Page 19: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 3

Function extension

One of the most crucial issues in implementing a level-set algorithm is how to do the func-tion extension, i.e. how to extend a quantity c defined on the surface (e.g. the concentra-tions of a chemical species) into the three-dimensional space in a consistent way. Extendingthe quantities off the interface is necessary because the governing equation for reaction-diffusion systems (see Eq. (2.7)) has spatial operators defined in the whole computationaldomain Ω ∈ <3, not only on the surface Γ. The requirement imposed on the extension isthat it be constant along the interface normal n, ∂c/∂n = 0, where n = ∇φ/‖∇φ‖ [2].

3.1 Grid-based methods

For grid based algorithms, there is an elegant technique for extension developed by Penget al. [8]. This approach consists in solving the following partial differential equation tosteady state,

∂c

∂τ+ sig(φ)

∇φ‖∇φ‖

· ∇c = 0, (3.1)

with the boundary condition that c(x, t) = c(x, 0) = const for all x with φ(x) = 0. τ is anartificial time variable independent of the simulation time t, and sig(φ) is the sign functionof the level-set function φ,

sig (φ) =

−1 if φ < 0

0 if φ = 0

+1 if φ > 0.

(3.2)

This partial differential equation is of the form ∂c∂t

+ u · ∇c = 0, which is called anadvection equation. This type of equation cannot by solved in a stable way with thesimplest FTCS Euler scheme and hence requires special treatment. One way of achievingstability is to use a second-order upwind scheme together with forward Euler time stepping.This method uses second order forward/backward finite differences for approximating thegradient ∇c, but evaluates them only on the upwind side of the wind u, which is u =

11

Page 20: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

12 CHAPTER 3. FUNCTION EXTENSION

sig(φ)∇φ/‖∇φ‖ in the case of Eq. (3.1). The second order finite differences are defined as

c+x =

−ci+2 + 4ci+1 − 3ci2h

c−x =ci+2 − 4ci+1 + 3ci

2h

c+y =

−cj+2 + 4cj+1 − 3cj2h

c−y =cj+2 − 4cj+1 + 3cj

2h

c+z =

−ck+2 + 4ck+1 − 3ck2h

c−z =ck+2 − 4ck+1 + 3ck

2h, (3.3)

where the indices i, j and k refer to the grid points in x-, y- and z-direction respectively,and h is the size of the grid spacing.

The full method then becomes

cn+1i,j,k = cni,j,k −∆t(max(s · nx, 0)c−x + min(s · nx, 0)c+

x

+ max(s · ny, 0)c−y + min(s · ny, 0)c+y

+ max(s · nz, 0)c−z + min(s · nz, 0)c+z (3.4)

with surface normal n = (nx, ny, nz) and s = sig(φ). Note that for reasons of efficiency,the computations can be restricted to a narrow band around the surface.

Since the finite differences are always evaluated in upwind direction, this method doesnot need boundary conditions at the external boundaries. The direction of the wind alwayspoints to the outside of the narrow band, therefore the operators are computed inside thenarrow band. For stability, the time step ∆t has to satisfy the Courant-Friedrichs-Lewy(CFL) condition

∆t ≤ h

3 max ‖φ‖. (3.5)

Another numerical scheme that is well suited to solve Eq. (3.1) is the leapfrog timestepping with second-order central finite differences,

∇hx =

ci+1 − ci−1

2h

∇hy =

cj+1 − cj−1

2h

∇hz =

ck+1 − ck−1

2h. (3.6)

The leapfrog time integration computes the next concentration value n + 1 based onthe values of time n− 1,

cn+1 = cn−1 − 2∆t(sig(φ)∇hφ · ∇hc

). (3.7)

This scheme requires some additional memory to store the values of cn−1. Furthermore,there is the problem that initially the value c−1 is not defined (if we denote the initialcondition as c0). The easiest solution for this is to initialize c0 = c1. However, this canlead to numerical oscillations. A better strategy is to compute c1 using forward Eulerintegration ensuring that c1 6= c0.

Page 21: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

3.2. PARTICLE-BASED METHODS 13

3.2 Particle-based methods

The difference between a pure particle method and grid-based approaches is that the gra-dient operator cannot be approximated by finite difference schemes anymore. For this, onecan use the discretization-corrected PSE operators, as described in Section 2.3.2. This leadsto the first approach for function extension in a pure particle setting: evolving Eq. (3.1) tosteady state, but instead of computing the gradient with finite differences, use the DC PSEoperators. For simplicity of the implementation, one can use the leapfrog time steppingscheme with centered DC PSE operators, which means the operators are computed for eachparticle p using all neighbours within a sphere of radius rc,p. One could also use upwindDC PSE operators, meaning that the neighbours of p would only include those particlesthat are on the upwind side of the direction of the wind.

The problem with this approach is that it leads to numerical instabilities due to theDC PSE operators, if the particles are not distributed on a Cartesian grid. This can beshown by a stability analysis for the advection equation using DC PSE operators as spatialapproximation, as will be presented in the next section.

3.2.1 Stability analysis for the advection equation

To analyse the stability of DC PSE operators in the Eq. (3.1), we do a von Neumannstability analysis for the three dimensional advection equation,

∂f

∂t+ u · ∇f = 0. (3.8)

Here we only discretize the spatial operator ∇ and use continuous time t. The results ofthis analysis indicate if the DC PSE operators fulfill the necessary condition for any timestepping scheme to be stable. That is, if the discretized equation is shown to be stable,then one may find a stable time stepping scheme. If, however, the discretized equation isunstable in continuous time, then there exists no stable time stepping scheme and thereforeone cannot use the DC PSE operators to solve Eq. (3.8) and therefore no stable schemeexists for the solution of Eq. (3.1). The methodology in this section follows of the stabilityanalysis in [12]. The main addition is that the analysis is generalized to three dimensions.

Doing numerical simulations on a CPU always introduces small errors e0 (e.g. round-off errors) in the solution. If a numerical scheme is to be stable, it is necessary that theeffects of these errors tend towards 0 over time, i.e. ∃λ < 0 such that |f(e0, t)| ≤ eλt|e0|.Otherwise, they may grow exponentially and eventually make the computations unstable.What one does in modified wavenumber analysis, is to decompose the error e0 into itsdifferent frequencies k and check the stability of each frequency-dependent exponents λk ofthe modified (i.e. discretized) equation. The stability of the scheme is then derived fromthe largest exponent λmax.

To arrive at the modified wavenumber kmod, one first computes the dispersion relationω(k) of a traveling wave ei(kx−ωt) satisfying the original equation. Then, one computes thedispersion relation for the modified equation, where the gradient operator ∇ is substituted

Page 22: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

14 CHAPTER 3. FUNCTION EXTENSION

with the DC PSE operator. The modified wave ei(kmodx−ωt) then satisfies the modifiedadvection equation.

Substituting f = ei(kx−ωt) one obtains the dispersion relation for the original wave,

−iωf + ikf = 0, (3.9)

which simplifies toω = k. (3.10)

If the gradient is approximated by the DC PSE operator, the modified advection equa-tion becomes

−iωf + u · 1

ε

∑p

vp(f(xp)− f(x))ηε(x− xp) = 0, (3.11)

where ηε(x− xp) = (ηxε (x− xp), ηyε (x− xp), ηzε (x− xp))T .Multiplying by i/f(x), one obtains

kmod(k) = − iε

∑p

vp(e−ik(x−xp) − 1)ηε(x− xp). (3.12)

The modified wave ei(kmodx−ωt) satisfying Eq. (3.8) can be written as a product of a realamplitude times an imaginary exponential function,

ei(kmodx−ωt) = eu·Rei(kmod(k)tei(kx−u·Imikmod(k)t), (3.13)

where Rez and Imz denote the real and imaginary part of a complex number z,respectively. Therefore, the amplitude of the modified wave is eλkt with

λk = u · Reikmod(k) = u · Imkmod(k) (3.14)

Stability requires that any numerical perturbation decays (exponentially) in time, andtherefore the maximum exponent λmax = maxkλk must be smaller than 0. Consequently,we obtain the stability condition for the three-dimensional advection equation,

−1

εu · Imi

∑vp(e

−ik(x−xp) − 1)ηε(x− xp) < 0 (3.15)

for all k = (kx, ky, kz). Noting that eiy = cos(y) + i sin(y) and cos(−y) = cos(y), one cansimplify the above expression to

−1

εu ·∑

vp(cos(k(x− xp))− 1)ηε(x− xp) < 0, (3.16)

for all k = (kx, ky, kz). Since this equation has to hold for all k ≥ 0, one obtains thecondition that every component of the modified wavenumber kmod,i (i = 1, 2, 3) has tofulfill uikmod,i < 0, which means

−uiε·∑

vp(cos(k(x− xp))− 1)ηiε(x− xp) < 0. (3.17)

Page 23: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

3.2. PARTICLE-BASED METHODS 15

Figure 3.1: Stability of centered DC PSE operators. The mean values of λmax over 50random particle distribution are plotted versus c.

The above condition is tested on regular (Cartesian) and irregular (random) particledistributions. Due to the Nyquist-Shannon sampling theorem, k can be restricted to aninterval |k|h ∈ (0,

√3π] with inter-particle spacing h [12]. The irregular particle distribu-

tions are obtained by placing the particles on a grid initially, and then perturbing eachof them with random vector r ∈ [0, h/2]3. For random distributions, the experiment isrepeated 50 times. Periodic boundary conditions are used.

The results indicate that DC PSE operators placed on a Cartesian grid are neutrallystable, i.e. λmax = 0. This means that numerical errors are neither amplified nor damped.For irregular particle distributions, the simulations show that the DC PSE operators lead toinstabilities (λmax > 0). This is the case we are actually interested in, since in a simulationof a reaction-diffusion system with a moving surface, particles become distributed non-uniformly (also, we do not want to re-mesh the particles). Consequently, centered DC PSEoperators cannot be used to solve the advection equation with any time stepping scheme ina safe way. Figure 3.1 plots λmax against different values of c, a parameter of the operatorkernel (see equation 2.27) that controls how big the contribution of a neighbouring particleis for the computation of the kernel function. High values of c generally give more accurate,but less stable kernel functions. An alternative method would be to use upwind DC PSEoperators with e.g. forward Euler time stepping, as discussed in Section 3.1. For theupwind operators, the set of neighbouring particles N(xp) for every particle location xpare not chosen from a ball with cutoff radius rc,p anymore, but only the particles that arelocated upwind are included in the set. This leads to three sets of neighbouring particles forevery particle location: the upwind neighbours in the x-, y- and z-direction. The particlesthat are located upwind in the x-direction relative to the particle location x = (x1, x2, x3)

Page 24: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

16 CHAPTER 3. FUNCTION EXTENSION

in some velocity field u = (u1, u2, u3) are all particles y for which

u1(x1 − y1) > 0 (3.18)

and analogously for the other directions. The same numerical experiments as above arerepeated for the upwind DC PSE operators. The results indicate that upwind operatorslead to numerical instabilities as well, regardless of the regularity (Cartesian or perturbed)of the distribution (see Figure 3.2). Again, upwind DC PSE operators cannot be usedto integrate any kind of advection equation. Summing up, the above analysis suggeststhat trying to solve the PDE based approach to extension by replacing the finite-differenceoperators (centered with leapfrog or upwind with Euler) with DC PSE operators does notlead to a stable numerical scheme. Therefore, in a pure particle method where one does notwant to rely on a grid, this method cannot be used. However, there exists an alternativescheme that is better suited to the particle setting, as described in the next section.

3.2.2 An alternative approach to extension

As we have seen in the previous section, one can show that implementing the elegantPDE based approach to extension leads to stability problems when trying to integrateEq. (3.1) with the gradient operator approximated by the DC PSE operators. While thisis unfortunate, it is nevertheless possible to design and implement a working extensionmethod, which is not dependent on solving any partial differential equations.

This alternative approach relies on the fact that the level-set φ has the signed distanceproperty, ‖∇φ‖ = 1. If this is the case, then locating the point on the interface xΓ

p that isclosest to an arbitrary point xp can be done in the following way,

xΓp = xp − φ(xp)∇φ(xp), (3.19)

that is, one projects the point xp along the inverse direction of sig(φ(xp))∇φ (xp) an amountof φ(xp). This projection has the nice property that the point xΓ

p is located exactly on thestraight line defined by xp and the surface normal n at point xΓ

p , since n = ∇φ/‖∇φ‖.Once the projections xΓ

p are computed for all particles, the next step is to compute theset of neighbours for every point xΓ

p within a ball of radius rp, N(xΓp ) = q : ‖xq−xΓ

p‖ ≤ rp.This set of neighbouring points is then used to interpolate the concentration value of theinterface points, cΓ

p with linear interpolation,

cΓp =

∑q∈N(xΓ

p )

wqcq, (3.20)

which are then assigned to the original point xp. The principle of the extension is illustratedin Fig 3.3.

Note that since the projection on the surface is done using the gradient of the level-set function, this extension scheme also has the property that the value of the extendedquantity is constant along the surface normal, i.e. ∂c

∂n= 0. Note that, in some sense,

this method solves Eq. (3.1) exactly by shooting backward from the field values onto thesurface. Put briefly, the extension method that is used in this works is as follows:

Page 25: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

3.2. PARTICLE-BASED METHODS 17

(a) Cartesian distributions (no randomness)

(b) Random distributions

Figure 3.2: Stability of upwind DC PSE operators. The values of λmax are plotted versus c.(a) The particles are placed on a Cartesian grid, (b) the particle distributions are random.

Page 26: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

18 CHAPTER 3. FUNCTION EXTENSION

Figure 3.3: Function extension. A particle xp is advected in the inverse direction ofsig(φ(xp)∇φ(xp) until it hits the surface at xΓ. Then the value of c(xΓ) is interpolatedfrom its neighbours (indicated as crosses)within radius rp. Finally, the particle xp is giventhe concentration c(xΓ).

1. Project each particle p onto the interface: xΓp ← xp

2. Find the set of neighbouring particles of xΓp within a cutoff radius rp and interpolate

the value cΓp

3. Assign cp ← cΓp .

Figure 3.4 shows an example of how the extension can be applied. A concentration cis initialized in a narrow band around the interface of a sphere. All other particles havec = 0 (indicated by the green dots). Then the extension scheme is applied assigning theparticles outside of the narrow band the correct concentration value.

Page 27: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

3.2. PARTICLE-BASED METHODS 19

(a) Before the extension.

(b) After the extension.

Figure 3.4: Function extension. The figures show the section (x, y, z) : |z| < 0.1 of aparticle distribution around a sphere before and after the extension is applied.

Page 28: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 4

Reinitialization and adaptation

Here, we discuss two further problems that have to be addressed in Lagrangian level-setmethods. The first one concerns the level-set itself, namely that we require φ to be a signeddistance function. Generally, when particles are advected by the velocity field v, the level-set eventually loses its signed distance property. The second issue also results from theeffects of advection and is related to the fact that after some time the distribution of theparticles may become so irregular as to prevent further computations, for example if someparticles lack the necessary number of neighbours to compute the DC PSE operators.

4.1 Level-set reinitialization

As mentioned above, we require φ to be a signed distance function, because this makeslocating the interface very cheap (this is used e.g. in the function extension). We brieflydescribe the approach used by Bergdorf et al., which is a grid-based technique, and thendiscuss how in the present work the reinitialization problem is solved.

Since the level-set φ is desired to have a normalized gradient, ‖∇φ‖ = 1, a possibleapproach is to evolve the following partial differential equation to steady state,

∂φ

∂τ+ sig(φ0)(1− ‖∇φ‖) = 0, (4.1)

with φ0 = φ(τ = 0), using an artificial time τ . Doing so leads to the above mentionedcondition that the gradient will be normalized. In [2], this equation solved using a weightedENO (essentially non-oscillatory) scheme. The reader is referred to [4] for more details.

As we have shown in Section 3.2.1, trying to solve advection equations ∂f∂t

+ u · ∇f = 0with Eulerian DC PSE operators can lead to numerical instabilities if the particles are notdistributed on a Cartesian grid (which is the case in which we are interested). Consequently,this also rules out the option of integrating equation (4.1) using DC PSE operators onscattered particle locations. Therefore, an alternative method is required. Here, we proposean approach based on the ideas found by Mourad et al [5].

20

Page 29: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

4.1. LEVEL-SET REINITIALIZATION 21

First, recall the evolution equation for the level-set,

∂φ

∂t+ v · ∇φ = 0. (4.2)

Using the fact that n = ∇φ/‖∇φ‖, one obtains

∂φ

∂t+ vn‖∇φ‖ = 0, (4.3)

where vn = v · n is the dot product of the velocity v and the surface normal n. Fromthis, one sees that it suffices to evolve the level-set function with the normal componentof the advection velocity v. Assume now that the level-set φ is a signed distance function,

Figure 4.1: Particle motion. The normal velocity vn is the normal component of theinterface velocity v. It is extended off the interface such that particles xp and xq movewith the same speed.

‖∇φ‖ = 1. We show that in this case, if the level-set is evolved using the normal velocityvn = vnn, then it keeps its signed distance property:

∂‖∇φ‖2

∂t= 2∇φ · ∂∇φ

∂t

= 2∇φ · ∇∂φ∂t

= −2∇φ · ∇(vn‖∇φ‖2)

= −2∇φ · ∇vn= 0, (4.4)

where we used the property that ‖∇φ‖ = 1.

Page 30: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

22 CHAPTER 4. REINITIALIZATION AND ADAPTATION

The idea is now simply that if all particles that are located on the normal extension ofsome point on the surface move with the same normal velocity, then their level-set valueskeep the signed distance property. To do so, we initialize the level-set at the beginning ofthe simulation as a signed distance function, and then extend the normal velocity vn inevery time step with the scheme described in Section 3.2.2 (see Fig. 4.1). Note that bymoving the particles in this way, there is no need to reinitialize the level-set. However, thisscheme only works as long as ∇φ and vn are sufficiently smooth [5].

4.2 Adaptation of the particle distribution

A related problem is the distortion of the particle distribution. Even if the level-set remainsa signed distance function, the particles themselves might be carried away from each othersuch that some particles may not have enough neighbours to continue the computations.Remember that neighbour lists are important for the extension and the DC PSE operators.

A remedy in grid-based algorithms for this problem is to interpolate the values that theparticles carry with themselves (i.e. concentration and level-set) back onto the mesh - thisis called re-meshing - and later to create new particles at every grid position. However, ina pure particle method this is not possible.

Here, the problem is solved by using the particle adaptation algorithm developed in [9]which makes use of pseudo forces that drive particles in regions where a high resolution isrequired, and insertion or deletion of particles in areas with too few or too many particles,respectively. A target resolution, D(x), is defined which specifies the desired resolution atevery point in space. We use the function

D(x) = minmax(φ(x)/D1)2 , Dmin, Dmax (4.5)

with the three free parameters Dmin, Dmax and D1 (cf. Section 7 for a discussion of theseparameters). With the help of D(x), one then defines a pairwise interaction potential Vpqbetween two particles p and q as

Vpq = D2pqV (|xp − xq|/Dpq), (4.6)

where Dpq = min(Dp, Dq) and V (r) is an arbitrary pair potential, for example V (r) =(1− 1/r)2. Then the goal of the algorithm is to find a particle distribution such that thetotal energy of the system is minimized,

W (x1, ..., xN) ≡∑p,q

Vpq → min, (4.7)

which is achieved (to some grade of approximation) by employing a gradient descent tech-nique. After the final particle configuration has been found, the values of the level-set φand the concentration c are interpolated from the old set of particles to the new one using

Page 31: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

4.2. ADAPTATION OF THE PARTICLE DISTRIBUTION 23

interpolation kernels ζp,

φnewp ← φoldp and

cnewp ← coldp . (4.8)

The question remains as to how often the particle distribution should be adapted. Inprinciple, the adaptation could be performed at every time step as done in [9] (similar tore-meshing at every time step). However, since the adaptation is quite costly in termsof computational complexity, especially in three dimensions, we found it sufficient to callthe adaptation algorithm as soon as some particle does not have the minimum number ofrequired neighbours.

An important consequence of using this particle adaptation method is that it introducesa multi-resolution feature into the simulation. As the name suggests, multi-resolution aimsat having different resolutions in the domain depending on local requirements (e.g. moreparticles where the surface has a high curvature). The advantage of this is that it reducescomputational errors compared to a non-adaptive algorithm with the same number ofparticles because the particles are distributed more “intelligently”. In some cases, it caneven be more efficient compared to grid-based algorithms with the same resolution (i.e.grid size equalling the minimum inter-particle distance) [9].

Page 32: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 5

The Algorithm

After presenting the theoretical background and discussing the core pieces of the method- extension, reinitialization and adaptation - we now come to the description of the wholealgorithm. A rough overview is given first, while more details on the respective steps followlater.

1. Initialization. Position the particles adaptively according to D(x).

2. Time loop. while t < Tend

• Extension. Extend the concentrations c and velocities v.

• Motion. Advect the particles using the velocity v.

• Neighbours. Update the neighbour lists.

• Adaptation. If some particle does not have enough neighbours, rearrange theparticle distribution according to D(x).

• Derivatives. Compute the DC PSE operators and ∇φ.

• Update ∆t. Ensure that ∆t satisfies the CFL condition for diffusion

• Update concentrations. Compute the reaction and diffusion terms and updatethe concentration values using forward Euler time integration.

• t = t+ ∆t

3. Reconstruction. Locate the interface and compute the concentration values on it fora set of sample points.

As function extension, particle motion and adaptation of the particle distribution havebeen discussed at length, for more information, the reader is at this point referred toSections 3.2.2, 4.1 and 4.2, respectively.

24

Page 33: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

5.1. INITIAL PARTICLE PLACEMENT 25

5.1 Initial particle placement

The algorithm starts by finding an appropriate initial distribution of the particles. Thisis simply done by first placing particles on a Cartesian grid and subsequently calling theadaptation routine. The closer the old particle distribution is to the new one, the fasterthe algorithm terminate. Therefore, the grid size h should not be too small nor too largewith respect to the target resolution D(x).

5.2 Computing derivatives

During the time stepping two sets of derivatives are used, namely the Laplacian of theconcentrations ∆c and the gradient of the level-set ∇φ. It may seem as if two sets of coeffi-cients for the DC PSE operators would have to be computed since the moment conditionsfor the kernels of the Laplacian and the gradient operators are different. However, one canapproximate the gradient using the kernels of the discretized Laplacian, η. The formulasfor the corresponding approximations at particle locations xp are [9]

∆hc(xp) =1

ε2

∑q

(c(xq)− c(xp)) ηp (xq) and (5.1)

∇hφ(xp) =1

ε2

∑q

φ(xq) (xp − xq) ηp (xq) . (5.2)

5.3 Determining ∆t

As particles move during each time step and are not regularized on a grid, their pairwisedistances might change and especially get smaller. Therefore the value of the time step ∆thas be to monitored in order to guarantee convergence. For diffusion in three dimensionsthe Courant-Friedrichs-Lewy (CFL) condition for convergence of finite difference methodsis

∆t ≤ ∆x2

6ν, (5.3)

with mesh spacing ∆x and diffusion constant ν. Since in the present case, the particles arenot distributed regularly on a grid, but on scattered locations, ∆x has to be chosen as thesmallest distance between any two particles, Dmin and the time step size therefore needs

to meet the constraint ∆t ≤ D2min

6ν.

This ∆t is then used to update the concentration values with forward Euler integration,

cn+1p = cnp + ∆t · fhp , (5.4)

where fhp comprises both the reaction and diffusion terms at particle location p.

Page 34: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

26 CHAPTER 5. THE ALGORITHM

5.4 Reconstructing the interface

The level-set method defines the surface only implicitly. Therefore it needs to be recon-structed after the time stepping. For this, we use a method similar to the extension methoddescribed in Section 3.2.2. Reconstruction can be done in three parts (see Fig. 5.1):

1. Choose a sample of particles and project them onto the interface by the formulaxΓp = xp − φ(xp)∇φ(xp).

2. For each projected particle xΓp , calculate the set of neighbouring particles within a

cutoff radius rp.

3. Compute the value c(xΓp

)with linear interpolation.

Figure 5.1: Interface reconstruction. A particle xp is advected in the inverse direction ofsig(φ(xp)∇φ(xp) until it hits the surface at xΓ. Then the value of c(xΓ) is interpolatedfrom its neighbours (indicated as crosses)within radius rp.

Page 35: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 6

Numerical experiments

This section is intended to provide a series of tests to validate the presented algorithm.The three test cases verify the consistency of the discretized Laplacian on a sphere, theaccuracy of the time stepping scheme and how well the algorithm handles a deforminggeometry. The first and the third test case are taken from [2].

6.1 Consistency of the discretized Laplacian operator

In the first experiment we validate the consistency of the discretized Laplacian operator∆h

Γc. To do so, we consider the unit sphere S2 and take as test function c = Y 01 (θ, φ), the

spherical harmonic, which is defined as

Y 01 (θ, φ) =

1

2

√3

πcos θ, (6.1)

or in Cartesian coordinates

Y 01 (x) =

1

2

√3

π

z√x2 + y2 + z2

. (6.2)

The exact solution for this case is given by

∆Γc = −2Y 01 . (6.3)

The DC PSE operator to approximate the Laplacian are computed with second order ofaccuracy. The resolution of the particle distribution is controlled by the parameters Dmin

and Dmax, the minimum and maximum inter-particle distance. We fix Dmax = 0.2 and varyDmin = 0.15, 0.1, 0.08 and 0.05, yielding a total number ofN = 12889, 18602, 24399 and 46944particles, respectively. The computational domain is Ω = [−2, 2]3.

Since we use second order accurate DC PSE operators, we expect the solution to con-verge in second order. This is confirmed by the simulation data as seen in Figure 6.1.The reconstructed function values are plotted against the average inter-particle distanceh = 3

√|Ω|/N = 4/ 3

√N .

27

Page 36: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

28 CHAPTER 6. NUMERICAL EXPERIMENTS

Figure 6.1: Convergence study for the discretized Laplacian ∆hΓ. The solid blue and the

dashed green line represent the L∞- and L2-error norms, respectively. The red line hasslope 2. The errors are plotted versus the average inter-particle distance h.

6.2 Diffusion on a sphere

The second test cases expands the first one by introducing time. Again, we take theunit sphere S2 and initialize the concentrations with the spherical harmonic, c(θ, φ, t0) =Y 0

1 (θ, φ). Then we let the concentrations c diffuse according to the diffusion equation

∂c

∂t= ν∆Γc. (6.4)

The solution is given analytically by an exponential decay of the initial condition,

c(θ, φ, t) = Y 01 (θ, φ)e−2νt. (6.5)

We set the diffusion constant ν = 1 and delimit the computational domain to Ω =[−2, 2]3. The time stepping is done until T = 0.1 with ∆t satisfying the CFL condition fordiffusion (see Section 5.3). We set Dmax = 0.2 and Dmin = 0.18, 0.15, 0.12 and 0.1. Theresults of this convergence study are shown in Figure 6.2a, while 6.2b gives an example ofa reconstructed sphere.

6.3 Growth of a sphere

The last experiment assesses the accuracy of our algorithm in the case where the surfaceis moving. Without doing reaction or diffusion, we consider a sphere with radius R = 1.5

Page 37: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

6.3. GROWTH OF A SPHERE 29

(a) Convergence Study

(b) Interface reconstruction

Figure 6.2: Diffusion on a sphere. (a) Convergence Study for the diffusion on a sphere.The blue and green lines represent the L∞- and L2-error norms, respectively. The red linehas slope 2. The errors are plotted versus the average inter-particle distance h. (b) Anexample of a reconstructed sphere.

Page 38: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

30 CHAPTER 6. NUMERICAL EXPERIMENTS

and let it grow with velocity v = n, such that every point on the surface is expanded in thedirection of its normal. If the level-set is a signed distance function, then n = ∇φ. Sincethere is neither reaction nor diffusion, the concentration on the sphere decreases over time,and the exact solution in this case is given by the initial condition times a scaling factor,

c(x, t) =

(R

|x(t)|

)2

c(x(t)/|x(t)|, 0). (6.6)

As initial condition, we take again the spherical harmonic Y 01 as defined in Eq. (6.2).

The computational domain is Ω = [−3, 3]3, and we setDmax = 0.3 andDmin = 0.25, 0.2, 0.15 and 0.12,resulting in total number of particles N = 11793, 13874, 19805 and 25679. The particlesare advanced for 10 time steps with a step size ∆t = 0.008.

From the use of second order DC PSE operators and forward Euler time integration,we expect the numerical solution to convergence in second order. This is confirmed by theobtained data (see figure 6.3).

Figure 6.3: Convergence study for the growing sphere. The blue and green lines representthe L∞- and L2-error norms, respectively. The red line has slope 2. The errors are plottedversus the average inter-particle distance h.

Page 39: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 7

Discussion

This section is intended to discuss some of the points that arose during the implementationand numerical experiments. These concern the function extension, finding good particlesdistributions, neighbour lists and the DC PSE operators.

7.1 Extension: final remarks

In this work, we investigated several methods of implementing an extension routine. Ourmain finding is that PDE based approaches that rely on solving the spatial derivatives withfinite differences cannot be safely transferred to pure particle methods, were the gradientsare approximated by DC PSE operators. The simulation results even suggest that the useof DC PSE operators for solving the advection equation leads to numerical instabilities,both for centered and upwind operators. Therefore, a different scheme had to be developed.

The current solution to this is to project every particle on the surface and then to assignthe value interpolated at the projected location to the particle. The great advantage ofthis scheme is that it is rather independent of the particle distribution, rendering the useof a grid unnecessary. A drawback might be that it requires the level-set function to havethe signed distance property.

7.2 Neighbour lists

In the current form, the algorithm relies heavily on neighbour lists. The two most importantparts where neighbour lists need to be computed are the particle adaptation and thefunction extension. During the particle adaptation one has to ensure that all particles havea minimum number of neighbours, whose value is determined by the order r of the DCPSE operators. Until the final configuration is found, every time the particle distributionchanges by moving and inserting/deleting particles, the neighbour lists have to updatedas well. As mentioned above, during the extension, neighbour lists have to be computedfor all projected particles. Since the real particles move, the projected points will havedifferent neighbours and therefore new neighbour lists have to be computed every time step.

31

Page 40: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

32 CHAPTER 7. DISCUSSION

Computing neighbour lists is a major part of the algorithm, and thus it is of paramountimportance the lists can be populated efficiently.

7.3 Resolution function

Another issue was to find a target resolution function D(x) that leads to particle distri-butions that have high resolutions around the surface, and low ones otherwise. In [9], thefunction that was used is

D(x) =D0√

1 + |∇f(x)|2. (7.1)

Note that this function uses the gradient of f to monitor the resolution. In the case oflevel-set method, however, it makes sense to use f ≡ φ (instead of the gradient ∇φ),because the level-set contains the information where most particles should be placed. Thefunction chosen here is

D(x) = minmax(φ(x)/D1)2 , Dmin, Dmax (7.2)

This function has three free parameters: Dmin and Dmax can be used to set a lower and anupper bound to the inter-particle distance, and D1 defines how smoothly the distributionchanges from high resolutions to low resolutions, i.e. low values of D1 give a fast transitionfrom high to low resolutions with fewer particles, large values result in slow transitionswith more particles.

In practice, setting D1 = 3 was empirically found to give good results. The numberof particles was controlled with Dmin, the minimum inter-particle distance. To get higherresolutions, the value of Dmin was decreased. During simulations, it was found that theadaptation algorithm works better if Dmin and Dmax are close to each other (e.g. Dmin ≈0.5 ·Dmax), resulting in rather regular particle distributions.

To illustrate the effects of the parameters Dmin and Dmax on the particle distribution,we generate two different distributions with Dmax = 0.3, Dmib = 0.15 and Dmax = 0.2,Dmin = 0.05, respectively. The surface is a sphere with radius R = 1 in this case, andthe corresponding level-set function is given by φ(x) = ‖x‖ − 1. In Figure 7.1 the section(x, y, z) : |z| < 0.1 is shown. Note how the band of particles around the interface getssmaller.

7.4 DC PSE operators

As a last topic the DC PSE operators shall be discussed briefly. During the simulations,two problems became apparent. The first one is that the accuracy of the operators candeteriorate at the boundaries. This comes from the fact that the particle adaptationalgorithm uses periodic boundary conditions, which may lead to discontinuities of the fieldvalues at the boundaries of the computational domain. The accuracy of the spatial derivatesplays a vital role, for example in the extension, where the surface needs to be located for

Page 41: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

7.4. DC PSE OPERATORS 33

(a) Dmax = 0.3, Dmin = 0.15

(b) Dmax = 0.2, Dmin = 0.05

Figure 7.1: Two particle distributions. The figures show the section (x, y, z) : |z| < 0.1of two particle distributions around a sphere with radius R = 1 with different resolutions.

Page 42: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

34 CHAPTER 7. DISCUSSION

every particle using the gradient of the level-set. For particles near the boundary, this canbecome problematic. To solve this problem, one would actually have to restrict to thecomputations to a narrow band around the surface.

The second point here is the DC PSE operators have to be computed anew every timethe particles move, because the neighbour lists may have changed. This slows the wholealgorithm down, since computing these operators usually requires solving a linear systemof equations for every particle (i.e. if they are on scattered positions).

Page 43: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Chapter 8

Summary and Conclusion

In this thesis, a novel pure particle algorithm for the simulation of reaction-diffusion systemson moving surfaces was studied. Reaction-diffusion is a mechanism by which molecules ofdifferent species are interconverted by chemical reactions and, at the same time, changetheir concentration due to thermal motion. In addition, the surface where the moleculesare located is itself subject to motion, such that it can change its shape over time.

The presented method is based on the Lagrangian particle level-set representation. Thelevel-set function φ assigns every particle a value that is ideally determined by the signeddistance of the particle to the closest point on the surface. The surface is then representedimplicitly by the zero iso-contour φ = 0, and the level-set is advanced by advection. Thisfits especially well into the framework of Lagrangian particles, since the particles conservetheir level-set value when moving in a flow field. Defining a pair potential function allowsto introduce pseudo-forces that drive particles to regions where high resolutions are needed(e.g. high curvature of the surface). This reduces the number of particles that are necessaryto achieve a certain accuracy of the solution. As soon as the particle distribution becomestoo distorted - such that for example some particles lack the necessary number of neighboursto compute the DC PSE operators - it is adapted using the pseudo forces. The functionextension is done by advecting every particle in the inverse direction of the gradient ofthe level-set until it hits the surface, and then assigning it the value of this point on thesurface, which is computed by linear interpolation. Level-set reinitialization is bypassed byadvecting the particles using the normal velocity of the corresponding point on the surface.

Here, it is appropriate to emphasize that to the best of the author’s knowledge this isone of the first attempts to implement a truly adaptive pure particle level-set algorithm.Traditional techniques such as finite differences and re-meshing are replaced by DC PSEoperators and particle adaptation. The greatest advantage of this approach is that is muchmore flexible whenever the geometry of the problem instance is complex. Compared tonon-adaptive particle methods, the fact that much fewer particles are required to achievea given accuracy of the solution can make this approach more efficient in certain cases [9].

However, the current implementation of the algorithm suffers from a few drawbacks.One is the overhead that arises from the heavy use of neighbour lists throughout thealgorithm. Another issue is the way boundary conditions are handled. While the imple-

35

Page 44: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

36 CHAPTER 8. SUMMARY AND CONCLUSION

mentation of the adaptation algorithm is suited only for periodic boundary conditions, thelevel-set is clearly not periodic.

A byproduct of this work is the conclusion that the framework of DC PSE operatorsis not suitable to integrate any type of advection equation, because it leads to numericalinstabilities. This is true even for upwind DC PSE operators, which is quite surprisingsince mesh-based upwind schemes can be successfully used to solve the advection equation.These results were shown in simulations involving modified wavenumbers derived from avon Neumann stability analysis.

Future work could improve the current method in different areas such as finding moreefficient ways for extension and computations of neighbour lists. In addition, modifyingthe particle adaptation such that it creates particles only in a narrow band around theinterface would be an asset. Lastly, it would be interesting to use the method to simulatea real world problem, for example in a large-scale biological application.

Page 45: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Appendix A

A note on the implementation

The algorithm described in section 5 was implemented in the FORTRAN programminglanguage. FORTRAN is an imperative programming language that was originally devel-oped in 1957. The reason FORTRAN was chosen to implement the algorithm is that thecode is intended to be what is called a “client”, i.e. a user application, for the ParallelParticle-Mesh Library (PPM). The client could therefore be used to perform large-scalesimulations of reaction-diffusion systems. Due to time limitations, it was not possible totest the scalability of the code on several processors.

In the following, we briefly list some of the most important source files of the client,provide an overview of the PPM library as well as a discussion of some intricacies whenprogramming with the PPM library.

A.1 Source files

Here, we provide some of the most important source files of the client together with theirmain functionality. For further details, the reader is referred to the documented sourcecode.

• ppm_als.f: The main program unit. Initializes PPM and does the time stepping.

• als_initial_condition.f: Sets the particles’ strengths to the initial value.

• als_init_levelset.f: Initializes the values of the level-set function.

• als_compgradphi.f: Computes the gradient of the level-set function.

• als_extend.f: Does the function extension.

• als_rhs.f: Computes the right-hand side of the reaction-diffusion equation (see (2.7))

• als_reconstr_solpart.f: Reconstructs the interface.

• Ctrl: Controls important parameters such as the size of the computational domainand the number of time steps.

37

Page 46: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

38 APPENDIX A. A NOTE ON THE IMPLEMENTATION

In addition to these, the client makes use of the self-organizing particle (SOP) library [9].The most important SOP source files used in the client are

• sop_adapt_particles.f90: Adapts the particle distribution.

• module_funcs.f90: Defines the resolution function for the particle distribution.

• general_dc_ops.f90: Computes the kernel functions for the DC PSE operators.

• Ctrl_sop: Controls important parameters such as the minimum and maximum inter-particle distance.

A.2 PPM - Parallel Particle-Mesh Library

The parallel particle-mesh (PPM) library is a software written in the FORTRAN 95 pro-gramming language. It enables the user to simulate large-scale physical systems defined inthe framework of pure particle or hybrid particle-mesh methods [11]. By abstracting thecommunication layer (message parsing interface, MPI) and providing special routines de-signed for interprocess communication, the PPM library facilitates parallelizing simulationprograms. Some important concepts of PPM include [1]:

1. Topologies decompose the computational domain into several parts, called sub-domains,and assign these to different processors.

2. Particles are the fundamental computational unit, as described in Section 2.3.

3. Meshes are Cartesian grids of a defined width h. Meshes can e.g. be used to forthe ODE solver (i.e. numerically integrating an ODE), and for interpolating particleproperties (e.g. for re-meshing).

4. Mappings provide the communication primitives between different processors. Thethree main mapping types are global, local and ghost mappings. For a discussion ofthese, see Appendix A.3.

A.3 Some aspects of a PPM client

An important step in parallelizing a simulation program is domain decomposition. Thismeans splitting the computational domain into several parts, called sub-domains, and as-signing these to different processors. This can be compared to a chess board (the simulationdomain) which is divided into 64 small squares (the sub-domains) each of which could beassigned to a different processor. The PPM command for this is

CALL ppm_mktopo(...)

Page 47: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

A.3. SOME ASPECTS OF A PPM CLIENT 39

with a suitable argument list. After initializing a topology, among other things, one hasto create the particles and to perform a global mapping in order to assign the particles tothe individual processors. This requires an all-to-all communication. The following codeextract shows how to map particles with position xp and strengths wp onto a topology

CALL ppm_map_part_global(topoid,xp,Npart,info)

CALL ppm_map_part_push(wp,Npart,info)

CALL ppm_map_part_send(Npart,Mpart,info)

CALL ppm_map_part_pop(wp,Npart,Mpart,info)

CALL ppm_map_part_pop(xp,ndim,Npart,Mpart,info)

This shows two important things. First, the send buffer is organized as a stack. Thismeans that every processor pushes the information that has to be sent to other processesonto a stack, then performs the send operations and finally pops the content from the sendbuffer.

The second aspect here is the concept of ghost particles. Every sub-domain has anadditional layer of ghost particles around its real particles. The ghost particles are com-putational units that do not belong to this sub-domain but are nevertheless needed toperform computations. For example, when gathering the neighbour list of a particle withina ball of a certain radius, the ball might include areas located on another sub-domain, andtherefore some neighbours might be particles belonging to the domain of another processor,i.e. ghost particles. PPM stores the information on ghost particles in the same array thatis used for the real particles, i.e. the positions of the real particles are stored in the entries1, . . . ,Npart of the array xp, while the positions of the ghost particles are stored in theentries Npart + 1, . . . ,Mpart (Npart and Mpart being the number of real particles and realplus ghost particles, respectively).

From this one can see that whenever one processor does something to its particles thatis relevant to other processors as well, one has to update the ghost particles in order toachieve consistency of the simulation. This is done by the following code:

CALL ppm_map_part_ghost_get(topo_id,xp,ndim,Npart,isymm,cutoff,info)

CALL ppm_map_part_push(wp,Npart,info)

CALL ppm_map_part_send(Npart,Mpart,info)

CALL ppm_map_part_pop(wp,Npart,Mpart,info)

CALL ppm_map_part_pop(xp,ndim,Npart,Mpart,info).

This sends the ghost contributions from every processor to its neighbouring processors.Updating the ghost particles correctly and thus ensuring that all processor use the sameinformation for the computations is one of the most important parts of PPM programming.Failure in this can lead to all sorts of problems, including segmentation faults, incorrectsimulation results, among others.

The last aspect we would like to mention here is the partial mapping, which is necessarywhenever a particle is moved and thereby crosses the sub-domain boundaries. When thishappens, the particle does not belong to the original processor anymore, but changes its

Page 48: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

40 APPENDIX A. A NOTE ON THE IMPLEMENTATION

“owner”. Therefore the processors have to communicate locally (only processors that ownneighbouring sub-domains) in order to reassign particles to sub-domains:

CALL ppm_map_part_partial(topo_id,xp,Npart,info)

CALL ppm_map_part_push(wp,Npart,info)

CALL ppm_map_part_send(Npart,Npart_New,info)

CALL ppm_map_part_pop(wp,Npart,Npart_New,info)

CALL ppm_map_part_pop(xp,ndim,Npart,Npart_New,info).

Taken this together, programming a PPM client is both fascinating and challenging.

Page 49: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

Bibliography

[1] Omar Awile, Omer Demirel, and Ivo F. Sbalzarini. Toward an object-oriented core ofthe PPM library. In Proc. ICNAAM, Numerical Analysis and Applied Mathematics,International Conference, pages 1313–1316. AIP, 2010.

[2] Michael Bergdorf, Ivo F. Sbalzarini, and Petros Koumoutsakos. A Lagrangian particlemethod for reaction-diffusion systems on deforming surfaces. J. Math. Biol., 61:649–663, 2010.

[3] J.D. Eldredge, A. Leonard, and T. Colonius. A General Deterministic Treatment ofDerivatives in Particle Methods. J. Comput. Phys., 180:686–709, 2002.

[4] GS. Jiang and D. Peng. Weighted ENO schemes for Hamilton-Jacobi equations. SIAMJ. Sci Comput., 21(6):2126–2143, 2000.

[5] H. M. Mourad, J. Dolbow, and K. Garikipati. Weighted ENO schemes for Hamilton-Jacobi equations. Int J. Numer. Meth. Engng, 64:1009–1032, 2005.

[6] Gregoire Nicolis and Anne De Wit. Reaction-diffusion systems. Scholarpedia,2(9):1475, 2007.

[7] Eric Weisstein’s World of Chemistry. Law of Mass Action. Available online at http://scienceworld.wolfram.com/chemistry/LawofMassAction.html; last visited onApril 16th 2011.

[8] D. Peng, B. Merriman, S. Osher, H. Zhao, and Kang M. A PDE-Based Fast LocalLevel-set Method. J. Comput. Phys., 155:410–438, 199.

[9] Sylvain Reboux, Birte Schrader, and Ivo F. Sbalzarini. Adaptive multi-resolutionsimulations using self-organizing Lagrangian particles. Submitted to J. Comp. Phys.,December 2010.

[10] I. F. Sbalzarini. Spatiotemporal Modeling and Simulation. Lectures Notes, Version ofAugust 6, 2010.

[11] I. F. Sbalzarini, J. H. Walther, M. Bergdorf, S. E. Hieber, E. M. Kotsalis, andP. Koumoutsakos. PPM – a highly efficient parallel particle-mesh library for thesimulation of continuum systems. J. Comput. Phys., 215(2):566–588, 2006.

41

Page 50: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

42 BIBLIOGRAPHY

[12] Birte Schrader, Sylvain Reboux, and Ivo F. Sbalzarini. Discretization correction ofgeneral integral PSE operators in particle methods. J. Comput. Phys., 229:4159–4182,2010.

[13] J.A. Sethian. Level Set Methods. Cambridge University Press, Cambridge, MA, 1996.

[14] Systems Biology Wiki. Stoichiometry. Available online at hhttp://sysbio.wikidot.com/stoichiometry; last visited on April 16th 2011.

Page 51: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

List of Figures

2.1 The surface normal n. At every point x ∈ Γ, the surface normal by definedas n = ∇φ/‖∇φ‖. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1 Stability of centered DC PSE operators. The mean values of λmax over 50random particle distribution are plotted versus c. . . . . . . . . . . . . . . 15

3.2 Stability of upwind DC PSE operators. The values of λmax are plotted ver-sus c. (a) The particles are placed on a Cartesian grid, (b) the particledistributions are random. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.3 Function extension. A particle xp is advected in the inverse direction ofsig(φ(xp)∇φ(xp) until it hits the surface at xΓ. Then the value of c(xΓ)is interpolated from its neighbours (indicated as crosses)within radius rp.Finally, the particle xp is given the concentration c(xΓ). . . . . . . . . . . . 18

3.4 Function extension. The figures show the section (x, y, z) : |z| < 0.1 of aparticle distribution around a sphere before and after the extension is applied. 19

4.1 Particle motion. The normal velocity vn is the normal component of theinterface velocity v. It is extended off the interface such that particles xpand xq move with the same speed. . . . . . . . . . . . . . . . . . . . . . . . 21

5.1 Interface reconstruction. A particle xp is advected in the inverse directionof sig(φ(xp)∇φ(xp) until it hits the surface at xΓ. Then the value of c(xΓ)is interpolated from its neighbours (indicated as crosses)within radius rp. . 26

6.1 Convergence study for the discretized Laplacian ∆hΓ. The solid blue and the

dashed green line represent the L∞- and L2-error norms, respectively. Thered line has slope 2. The errors are plotted versus the average inter-particledistance h. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

6.2 Diffusion on a sphere. (a) Convergence Study for the diffusion on a sphere.The blue and green lines represent the L∞- and L2-error norms, respectively.The red line has slope 2. The errors are plotted versus the average inter-particle distance h. (b) An example of a reconstructed sphere. . . . . . . . 29

6.3 Convergence study for the growing sphere. The blue and green lines representthe L∞- and L2-error norms, respectively. The red line has slope 2. Theerrors are plotted versus the average inter-particle distance h. . . . . . . . 30

43

Page 52: An Adaptive Level-Set Method for Reaction-Di usion Systems ... · 2.2. THE LEVEL-SET METHOD 5 idea is that it is easier to represent and evolve an interface implicitly by isocontours

44 LIST OF FIGURES

7.1 Two particle distributions. The figures show the section (x, y, z) : |z| < 0.1of two particle distributions around a sphere with radius R = 1 with differentresolutions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33