Efficient implementation of the Particle Level Set method

Size: px
Start display at page:

Download "Efficient implementation of the Particle Level Set method"

Transcription

1 LiU-ITN-TEK-A--10/050--SE Efficient implementation of the Particle Level Set method John Johansson Department of Science and Technology Linköping University SE Norrköping, Sweden Institutionen för teknik och naturvetenskap Linköpings Universitet Norrköping

2 LiU-ITN-TEK-A--10/050--SE Efficient implementation of the Particle Level Set method Examensarbete utfört i medieteknik vid Tekniska Högskolan vid Linköpings universitet John Johansson Handledare Doug Roble Examinator Jonas Unger Norrköping

3 Upphovsrätt Detta dokument hålls tillgängligt på Internet eller dess framtida ersättare under en längre tid från publiceringsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka kopior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervisning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säkerheten och tillgängligheten finns det lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsmannens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida Copyright The publishers will keep this document online on the Internet - or its possible replacement - for a considerable time from the date of publication barring exceptional circumstances. The online availability of the document implies a permanent permission for anyone to read, to download, to print out single copies for your own use and to use it unchanged for any non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional on the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its WWW home page: John Johansson

4 Efficient implementation of the Particle Level set method John Johansson 1 Department of Science and Technology Linköping University A thesis submitted for the degree of Master of Science September 10, johjo729@student.liu.se

5 placeholder

6 Abstract The Particle Level set method is a successful extension to Level set methods to improve the volume preservation in fluid simulations. This thesis will analyze how sparse volume data structures can be used to store both the signed distance function and the particles in order to improve access speed and memory efficiency. This Particle Level set implementation will be evaluated against Digital Domains current Particle Level set implementation. Different degrees of quantization will be used to implement particle representations with varying accuracy. These particles will be tested and both visual results and error measurments will be presented. The sparse volume data structures DB-Grid and Field3D will be evaluated in terms of speed and memory efficiency.

7 placeholder

8 Contents 1 Introduction Surface tracking The Particle Level set method Digital Domain Sparse volume data structures Motivation Aim Structure of the report Background Implicit functions Implicit surfaces Geometric properties Signed distance functions Level set methods Discretization Advection Spatial discretization Temporal discretization Renormalization Optimizations Particle Level set method Overview Massless particles Initialization Advection Error correction Radius adjustment Reseeding Sparse volume data structures DB-Grid Field3D v

9 CONTENTS CONTENTS 3 Implementation Current implementation Storing the particles Class Interface Particle pool Multiple arrays STL containers Traversing particles Particle representation Normal implementation Semi-Compact implementation Compact implementation Dynamic seeding condition Putting the Particle Level set together Grids Level set advection Level set renomalization Particle advection Radius adjustment and Reseeding Results Evaluating DB-Grid and Field3D Random access Sequential access Particle Level set implementation Deformation test Smart seeding Cache behaviour and threading Particle implementations Deformation Test Error measurement Comparing Particle Level set implementations Discussion 41 6 Conclusion Future work References 46 A Hamilton-Jacobi ENO 51 B Hamilton-Jacobi WENO 53 C Additional results 55 vi

10 List of Figures 2.1 The level set of a 2D implicit sphere Discrete representations in two dimensions Trilinear interpolation DB-Grid example in 2D Scheme of the block array The Stanford Dragon represented with level sets using DB-Grid Particle pool structure Multiple arrays structure Deformation test performed on Level set Deformation test performed on Particle Level set Deformation test performed on Particle Level set, smart seeding is used Normal particle implementation Semi-compact particle implementation Compact particle implementation C.1 Higher resolution Particle Level set deformation test vii

11

12 List of Tables 4.1 DB-Grid and Field3D random access test DB-Grid and Field3D sequential access test Statistics from the Deformation test with and without smart seeding Particle Level set advection with varying block size and number of threads Statistics from the Deformation test with different particle implementations Comparing error of the different particle implementations Comparing Particle Level set implementations Time breakdown of the new Particle Level set implementation ix

13

14 Chapter 1 Introduction Since computer generated special effects, or Visual effects as it is called, started to get popular in the early 90 s, fluids such as water, fire and smoke has been one of the most common effects. The reason is that it is easier and cheaper to simulate the fluid than to shot the real thing. It is also easier to direct the fluid and make it behave like the director wants. In order to create fluid effects that look natural and realistic, the movement and apperance is based on equations that describe the motion of fluid flow. These equations are known as the Navier-Stokes equations. When simulating liquid using these equations, the surface has to be tracked using a special method. 1.1 Surface tracking One of the first successful methods of tracking propagating surfaces was the Level set methods, introduced by Osher and Sethian in 1988 [26]. This method tracks the surface using a signed distance function, that is represented using a Eulerian grid. The method is widely used in other fields such as computational physics, image processing, computer vision, medical image analysis and 3D reconstruction [25]. The method has however problems conserving volume when undergoing deformation. Another Eulerian method of tracking the liquid surface is the Volume of Fluid (VOF) [11], where each cell in a grid stores how much percent water it contains. The problem with this method is that geometric properties can not be computed in the same straigtforward way as with Level set methods. A different approach of tracking a surface is the Lagrangian representation, where particles are used to track the surface. This was first introduced in [10], where they used marker particles to track the surface. The method tracks the interface with a much higher accuracy and preserves volume better than grid-based methods, but it is harder to calculate geometric properties such as gradient and curvature. Extracting a smooth surface mesh that is used in rendering is easier on a grid than from a large number of particles. Recent research has introduced two new methods that uses particles to track the fluid, Smoothed Particle Hydrodynamics (SPH) [20] and Fluid-Implicit-Particle (FLIP) [36]. In these methods the particles are used to track the whole volume of the fluid instead of just the surface. 1

15 1.2 The Particle Level set method 1. INTRODUCTION 1.2 The Particle Level set method The Particle Level set (PLS) method [5] is an interface capturing method that uses the advantages of both Eulerian and Lagrangian methods. The main representation is a signed distance function evolved using Level set methods and it uses auxiliary marker particles to accurately track the surface and correct the signed distance function. The method has been very popular and succefully used in both research and in Visual Effects. In research it was initially used in fluid simulation to track water surfaces [7], but has since then also been used to track surfaces when simulating multiple interacting fluids [18], simulating interaction between rigid objects, deformable objects and fluids [30] and simulating water with splashes and spray [19]. To create spray, the authors used escaped particles to trigger a separate particle simulation based on the SPH method. Examples of when the PLS was used in Visual Effects includes simulation of a melting character in Terminator 3: Rise of the Machines [34], when simulating water pouring into a sinking ship in Poseidon [9] and when simulating water flooding New York City in Day After Tomorrow [13]. 1.3 Digital Domain Digital Domain is a Visual Effects studio located in Venice, California. They have been involved in 80+ feature films and have earned three Academy awards for Best Visual Effects and three Scientific and Technical Achievement awards. Their fluid simulation engine fsim has earned them one of the Scientific and Technical Achievement awards. It is a grid-based solver that can simulate both liquids and fire. When simulating liquid it uses the Particle Level set method to track surfaces. 1.4 Sparse volume data structures In the last couple of years, scientists at Digital Domain have developed an efficient data structure for sparse volume data, the DB-Grid [22]. A similar data structure, Field3D [35], has been developed at Sony Pictures Imageworks and made public as open source. Both these data structures are very capable of representing the data used for the level set method and the Particle Level set method. These new data structures are based on the simple concept of dividing the grid domain into blocks and only allocating memory in blocks where data is explicit set. According to [21], DB-Grid should theoretically be faster than any previous sparse level set data structure. 1.5 Motivation The current Particle Level set implementation at Digital Domain is considered one of the slowest and most memory consuming parts of the fluid simulation. The company wants a Particle Level set implementation that is based on one of the new sparse volume data structures. This would make it more efficient both in terms of speed and memory consumption, which would make it possible to perform simulations at higher resolutions with faster execution speed. 2

16 1. INTRODUCTION 1.6 Aim 1.6 Aim The first step is to evaluate the two new sparse data structures, DB-Grid and Field3D. The evaluation should test their performances in random access and sequential access. The goal is to determine which one is best in terms of speed and memory efficiency. The data structure that proves to be superior should then be used as the foundation for a new C++ implementation of the Particle Level set method. The aim of the implementation is to achieve a working prototype where both the signed distance function and the particles are stored using the sparse volume data structure. Regarding the storage of particles, a general purpose particle storage structure is requested to be developed. To reduce the memory footprint of the particles, different levels of particle quantization should be implemented and tested. The final implementation needs to be tested against the regular Level set solution and Digital Domains current Particle Level set implementation. 1.7 Structure of the report This report is structured as following: Chapter 2 describes the theory that is needed in order to implement a Particle Level set solution and describe the two sparse volume data structures. Chapter 3 will give specific details on our implementation. Chapter 4 presents results from the tests that was carried out with the implementation. Chapter 5 will discuss the implementation and results from the tests. Chapter 6 concludes the report and lists what can be done to improve the implementation. 3

17

18 Chapter 2 Background This chapter will describe the theoretical base that is needed for the implementation in the next chapter. It will describe the math behind implicit functions and signed distance functions, how Level set methods are used to evolve these functions over time and how the Level set methods are extended with particles to improve accuracy. The last section will describe concept and details of new sparse volume data structures. 2.1 Implicit functions In Level set methods, a signed distance function is used to represent the surface we want to track [26]. A signed distance function is a three dimensional implicit function, where the surface is defined as 0. Mathematical functions can be classified as either implicit or explicit. An implicit function is defined as f (x, y, z) = k, f : R 3 R (2.1) where the function f depends on x, y, z and equals a scalar value k. An explicit function on the other hand, is a function that depends on x, y and explicitly gives the value of z. z = f (x, y) (2.2) As an example, the implicit function of a sphere with radius r can be expressed as: Implicit surfaces f (x, y, z) = x 2 + y 2 + z 2 r 2 (2.3) A implicit surface is a contour in the domain Ω given by a three dimensional implicit function. The surface can be extracted by only selecting the set of points where φ (x, y, x) = c. The constant c is called the iso value and the set of the values that is selected is called a iso-surface or level set of the implicit function φ (x, y, x). The zero level set or interface is denoted as Γ. The constant c can be varied to select different subsets of the function values, but the most common value to use as the iso value c is 0. This makes it easy to classify a value in the domain Ω because if the φ value is > 0 it is located outside the 5

19 2.1 Implicit functions 2. BACKGROUND surface and if it is < 0 it is located inside the surface. The implicit function with c = 0 can be defined as φ ( x) > 0 if x Ω + φ ( x) = 0 if x Γ (2.4) φ ( x) < 0 if x Ω < 0 > 0 = 0 Figure 2.1: The level set of a 2D implicit sphere Geometric properties Implicit functions has very convinient tools for analytically calculating geometric properties such as gradient, normal and mean curvature. The gradient of the implicit function is defined as ( φ φ = x, φ y, φ ), (2.5) z which means the partial derivative in all dimensions. The normal of the implicit function is expressed as the normalized gradient N = φ φ (2.6) The mean curvature of the implicit function is defined as the divergence of the normal ( ) φ κ = (2.7) φ This can be expanded to the following expression of first and second partial derivatives of φ: κ = (φ 2 xφ yy 2φ x φ y φ xy + φ 2 yφ xx + φ 2 xφ zz 2φ x φ z φ xz +φ 2 zφ xx + φ 2 yφ zz 2φ y φ z φ yz + φ 2 zφ yy )/ φ 3 (2.8) Signed distance functions A general distance function is defined as d ( x) = min ( x x I ) for all x I Γ, (2.9) 6

20 2. BACKGROUND 2.2 Level set methods which means that d ( x) gives the Euclidean distance to the closest point x I on the interface Γ. A signed distance function is a subset of implicit functions. It can be expressed as φ ( x) = d ( x). It has all the properties of a implicit function plus a couple of new that are unique for signed distance functions. One property is the Eikonal equation, φ = 1. (2.10) It assures that the distances are uniformly distributed and that the derivative is continuous, which is needed in order to have a gradient perpendicular to the interface. Another property is the closest point tranform, a function that takes a point x in space and returns the closest point on the interface. x C = x φ ( x) N (2.11) 2.2 Level set methods Most geometry used in Computer Graphics and Computational Physics is represented as surfaces. The most common surface representation is the polygonal mesh, an explicit representation where points on the surface are stored and connected to form an enclosed surface. Another type of surface representation is the implicit representation, where an implicit function is sampled on points in space. Level set methods enables implicit surfaces, defined as signed distance functions, to be time dependent and dynamic. Level set methods was introduced by Osher and Sethian in 1988 [26], where they used it to track propagating interfaces in time dependent physics problems. To solve the timedependent equations that expresses a moving implicit surface, level set methods use a Hamilton-Jacobi approach. It has since then been improved with higher order spatial and temporal integration schemes and memory efficient data structures. For a thorough review of Level set methods, consult the books by Osher and Fedkiw [25] and Sethian [32]. The motion of the zero level set can be defined by a speed function F (x, n, φ,...) = n dx dt = φ φ dx dt where x is a point on the interface and the partial derivative d x dt n. (2.12) is projected on the normal Discretization When working with spatially defined functions in a discrete environment such as a computer, the values has to be sampled. There are two general representations that can be used, the Lagrangian representation and the Eulerian representation. 7

21 2.2 Level set methods 2. BACKGROUND Lagrangian representation In the Lagrangian representation, a number of points are tracked in space that each store properties. The advantages of this representation are that the whole computational domain does not need to be stored and it can store the position of each point with very high precision. Drawbacks with this representation are that it can be hard to compute geometrical properties and if the points are connected, it can be hard to manage topology changes. Particle simulations and polygonal meshes uses the Lagrangian representation. y y (a) Lagrangian x (b) Eulerian x Figure 2.2: Discrete representations in two dimensions. Eulerian representation The Eulerian representation stores information at points with uniform distance between eachother, forming a regular grid. The distance between each point decides how accurate the sampling will be. The distance is denoted x, y, z and to simplify the implementation the distance can be the same for all dimensions x = y = z, forming a Cartesian grid. Knowing the distance between all the points makes it easy and fast to calculate geometric properties such as gradient and curvature. This is one main reason why signed distance functions are best represented using the Eulerian representation. There are some problems with this representation that has to be considered. It suffers from high numerical dissipation and requires large amounts of memory to store. Interpolation When a signed distance function are sampled on a discrete Eulerian grid, function values can only be accessed on grid points. In order to obtain a function value that is located within a grid cell, interpolation has to be used. The most basic interpolation method is called Nearest neighbour and as the name suggests the value of the nearest grid point is used. This method does not give good results though, in order to achieve decent results more sophisticated methods are needed. A common and straightforward method is called trilinear interpolation, where three linear interpolations are performed, one for each dimension. There are also more advanced interpolation methods, such as cubic 8

22 2. BACKGROUND 2.2 Level set methods interpolation and hermite interpolation, but the accuracy these methods provide are not needed for this application. Trilinear interpolation Trilinear interpolation is as described earlier three linear interpolations, one for each dimension. It will interpolate the value at position x, y, z using the eight surrounding grid values. The grid cell i, j, k which is used as base for the interpolation is determined by Ci,j+1,k+1 Ci+1,j+1,k+1 Ci,j,k+1 Ci+1,j,k+1 x,y,z Ci,j+1,k Ci+1,j+1,k Ci,j,k Ci+1,j,k Figure 2.3: Trilinear interpolation flooring the position x, y, z, and these two coordinates are used to calculate the interpolation weights i = x α = x i j = y β = y j (2.13) k = z γ = z k The first step is to perform linear interpolation in the x dimension, reducing 8 values to 4. X 00 = (1 α) C i,j,k + αc i+1,j,k X 10 = (1 α) C i,j+1,k + αc i+1,j+1,k (2.14) X 01 = (1 α) C i,j,k+1 + αc i+1,j,k+1 X 11 = (1 α) C i,j+1,k+1 + αc i+1,j+1,k+1 The second step is the y dimension, where 4 values are linearly interpolated to 2. Y 0 = (1 β) X 00 + βx 10 Y 1 = (1 β) X 01 + βx 11 (2.15) The third and final dimension where 2 values are weighted together to one value. Z = (1 γ) Y 0 + γy 1 (2.16) 9

23 2.2 Level set methods 2. BACKGROUND Advection The interface of a signed distance function can be evolved over time using a external velocity field V. The simplest way to describe the motion of an evolving surface is the Lagrangian formulation, where points on the surface are moved using the corresponding velocity vector in the velocity field. This formulation is expressed as the ordinary differential equation d x dt = V ( x) (2.17) for all points x with φ ( x) = 0. This means all points x on the interface will be moved according to the vector V ( x). The problem with this formulation is that if the interface is using a Lagrangian represention, topological changes are hard to handle and geometrical properties are non-trivial to approximate. Therefore an Eulerian formulation is better suited for advection of a signed distance function. The Eulerian formulation is a partial differential equation (PDE) that uses φ to both represent and evolve the interface. φ t φ t + φ V = 0 (2.18) + φ F (x, n, φ,...) = 0 (2.19) where is the gradient operator. The gradient is expressed as φ V = û φ φ + ˆv x y + ŵ φ z (2.20) Equation 2.18 and 2.19 are commonly known as the Level set equations. For the Lagrangian formulation 2.17 the velocity field V only needs to be defined at the interface but for the Eulerian formulation it has to be defined for the whole computational domain Ω. In order to solve the Eulerian PDE 2.18, the spatial and temporal partial derivatives of φ must be numerically approximated. Solutions to this will be described in the to following sections Spatial discretization The gradient is one of the most important properties of a implicit function. Analytically, it is calculated by solving a partial differental equation for each dimension. But in the discrete case, the signed distance function is sampled on a Cartesian grid, where a numerical scheme is needed to approximate the derivative. A collection of numerical schemes that is well suited for this is the finite difference (FD) schemes. There are different FD schemes that gives different accuracy on the result, all with different computational requirements and implementation complexity. The schemes presented here will only be shown for the x dimension, the scheme is applied in the same way for y and z. Upwind differencing The simplest scheme is the first order accurate forward and backward upwind difference. These schemes are derived by using the first two terms of the Taylor expansion. The 10

24 2. BACKGROUND 2.2 Level set methods forward scheme uses the value at the current grid point i and at the next grid point i + 1 to approximate the derivative. φ x D+ x φ = φ i+1 φ i x (2.21) x denotes the grid spacing in the current dimension. The backward scheme is almost the same as the forward scheme, but uses the value at the current grid point i and at the previous grid point i 1 instead. φ x D x φ = φ i φ i 1 x (2.22) Central difference A slightly more accurate scheme is the second order accurate central difference. It uses values at grid points on both sides of the current grid point i. This scheme is actually derived as a combination of a forward and a backward upwind step. φ x D xφ = φ i+1 φ i 1 2 x (2.23) The problem with second order accurate central differencing is that the value at the central grid point is not evaluated. If this point should contain a value very different from its neighbors, the approximated derivative would be wrong. There is also a second order accurate central differencing scheme for approximation of the second order partial derivative. 2 φ x 2 D+ x Dx φ = φ i+1 2φ i + φ i 1 x 2 (2.24) Higher order schemes The numerical solutions of upwind differencing can be consideraby improved by replacing the first order upwind schemes with higher order schemes. Two schemes that has proven to give good numerical solutions for level set methods are the Hamilton-Jacobi methods ENO (essentially nonoscillatory) [27] and WENO (weighted essentially nonoscillatory) [14]. Hamilton-Jacobi ENO is a third order accurate upwind scheme that approximates a Newton polynomial and its derivative. Hamilton-Jacobi WENO is a third to fifth order accurate upwind scheme that approximates three ENO polynomials and weights them together. The schemes are described in detail in Appendix A and B. Numerical stability Osher and Fedkiw [25] mentiones thatthe Level set equations (2.18 and 2.19) has two important properties, it is a hyperbolic PDE and it is a Hamilton-Jacobi equation. Being a hyperbolic PDE means the function does not depend on derivatives of order greater than one. It also gives a special behaivor where they propagate information along certain directions. Because of this, special care has to be applied when approximating spatial derivatives. To approximate the partial derivative φ n x, upwind differencing has to be 11

25 2.2 Level set methods 2. BACKGROUND performed in the reverse direction of the velocity field flow. This can be divided into the following cases φ + x, V n < 0 φ n x = φ x, V n > 0 (2.25) 0, V n = Temporal discretization In order to evolve the zero level set over time, the temporal derivative has to be approximated and used to advance the interface. There are a number of different schemes for integration over time and all schemes can be classified as one of two types, implicit or explicit. Implicit methods are unconditionally stable but are generally hard to implement. Explicit schemes on the other hand are often straightforward to implement but has stability issues. Forward Euler The simplest time integration scheme is forward Euler. It is an explicit scheme and is only first order accurate. The reason it is popular is because it is computationally fast and easy to implement. The general formulation is derived from the first two terms of an Taylor expansion. y n+1 = y n + hf (t n, y n ) (2.26) Forward Euler uses the current value y n and adds one timestep h times the function f (t n, y n )to reach the next value y n+1. The Forward Euler formulation can be applied to the Level set equation, which gives the following PDE for integrating the zero level set in time. φ n+1 φ n t + φ n u n = 0 (2.27) TVD Runge-Kutta Total Variation Diminishing (TVD) is a property of certain temporal integration schemes. The total variation of a discrete quantity u can be calculated as T V (u) = j u j+1 u j (2.28) and a method is considered to TVD if the following condition is fullfilled. T V (u n+1 ) T V (u n ) (2.29) Osher and Shu [33] introduced Runge-Kutta time integrators that had the TVD property. They used the fact that convex combinations are TVD for non-negative coefficients and Runge-Kutta integrators are convex combinations of Forward Euler steps. The first order TVD RK is identical to forward Euler, presented in section

26 2. BACKGROUND 2.2 Level set methods TVD RK2 The second order TVD Runge-Kutta is a convex combination of two Forward Euler steps. The method is also known as the midpoint rule or modified Euler and is an explicit scheme. Begin by taking one Euler step to t n + t: φ n+1 φ n t + φ n u n = 0 (2.30) which is used for the second Euler step to t n + 2 t: φ n+2 φ n+1 t + φ n+1 u n+1 = 0 (2.31) Finally an averaging step that takes the convex combination of the initial data and the result of 2.31, gives the result for time t n + t: φ n+1 = 1 2 φn φn+2 (2.32) TVD RK3 The third order TVD Runge-Kutta is proposed to be used for level set time integration by Enright et al. [5]. The scheme can be broken down into three Forward Euler steps and two convex combinations. Begin with a Forward Euler step to t n + t: φ n+1 φ n t + φ n u n = 0 (2.33) which is used for a second Euler step to t n + 2 t: φ n+2 φ n+1 t + φ n+1 u n+1 = 0 (2.34) Average to t n t using: φ n+ 1 2 = 3 4 φn φn+2 (2.35) Take a third Euler step to t n t φ n+ 3 2 φ n+ 1 2 t + φ n+ 1 2 u n+ 1 2 = 0 (2.36) followed by a second averaging step: This produces a third order accurate solution. φ n+1 = 1 3 φn φn+ 3 2 (2.37) 13

27 2.2 Level set methods 2. BACKGROUND CFL condition The CFL (Courant-Friedreichs-Lewy) condition [4] is a condition to make sure that time integration of the Level set equation 2.18 is numerically stable. By dividing the cell width with the greatest velocity field component, the calculated timestep t will make sure the zero level set will only be moved at most one cell width. t < x max u ( x i,j,k ) (2.38) This contition can be enforced by introducing a CFL number α. The multidimensional CFL condition can then be written as { } u ( xi,j,k ) v ( x i,j,k ) w ( x i,j,k ) t max = α (2.39) x y z where α is a value (0, 1). α is according to Osher and Fedkiw [25], commonly selected as a value in the range [0.5, 0.9] Renormalization According to [28], in order to maintain a signed distance function it needs to be renormalized every time the interface has been evolved over time. This is done by solving the initial value formulation of the eikonal equation: φ t = sgn ( φ 0) (1 φ ) (2.40) Osher and Fedkiw [25] points out that the sign can be replaced by a smoothing function S (φ) that improves the numerical solution. S (φ) = φ φ 2 + φ 2 ( x) 2 (2.41) A way of calculating the norm of the gradient vector φ was presented in [31], where they used Godunov s method for solving PDEs. The square of the partial derivative is given by ( max max (φ x, 0) 2, min (φ + x, 0) 2), if F > 0 ( φ 2 x = max min (φ x, 0) 2, max (φ + x, 0) 2), if F < 0 (2.42) 0 F = 0 and the total norm is expressed as φ = φ 2 x + φ 2 y + φ 2 z (2.43) Solving equation 2.40 for the whole signed distance function can be very computation heavy. Therefore, Sethian introduced the Fast Marching Method to efficiently solve the equation. This method is described in detail in the book Level Set Methods and Fast Marching Methods [32]. 14

28 2. BACKGROUND 2.2 Level set methods Optimizations Since the level set methods was introduced, recent research has not only improved the discretization schemes, there has also been work done trying to reduce the amount of data needed to be computed and efficient ways of storing the significant parts of the signed distance function. Narrow band method The narrow band technique is an optimization to the level set methods where computations are only performed within a distance δ from the interface. The band between δ and δ is called the narrow band. The condition can be expressed as abs (φ i,j,k ) < δ (2.44) The method was later improved by Peng et. al. [28] where they divide the narrow band into several bands. β defined the computational band and γ defined a extended band that was used as a smooth transition to reduce oscilliations at the boundaries. They used the following cutoff function to achieve the smooth transition. 1 if φ β ( φ γ) c (φ) = 2 (2 φ 3β+γ) if β < φ γ (γ β) 3 0 otherwise (2.45) Efficient data structures One of the biggest problem when working with signed distance functions is the large memory footprint. Sampling a signed distance function on a grid will require at least 512 MB of memory. For each operation 134 million elements has to be processed. To overcome this a couple of data structures has been developed, that takes advantage of the nature of the signed distance function. One approach of storing signed distance functions more efficiently was to use an Octree [17]. This make it possible to store data with a varying detail level, depending on the relevance of the data. Data near the interface could have higher resolution than data far away from it. One drawback with this approach is that it is complicated to implement and it takes O (log (n)) time to random access a value. A different approach than the Octree was the DT-Grid (Dynamic tubular grid) by Nielsen and Museth [23]. It is a hierarchical compression technique that recursively compresses each dimension using a similar technique to what is used to compress sparse matrices. This technique only stores the signed distance function within the narrow band, reducing both memory consumption and the amount of elements that has to be processed. Houston et. al. [12] combined the DT-Grid concept with the compression technique Run Length Encoding to form the Hierarchical Run Length Encoding method. 15

29 2.3 Particle Level set method 2. BACKGROUND 2.3 Particle Level set method The Particle Level set method is an extension to Level set methods. It uses marker particles as a complementary to the Eulerian grid-based signed distance function. The particles are used to correct the signed distance function when its solution is weak. The Lagrangian approach tracks the interface more accurate and it makes it possible to capture details that are smaller than what is possible with only a grid-based solution. This higher accuracy makes it possible to preserve the volume of the level set better when is gets deformed. The concept of using marker particles was first introduced by Foster and Fedkiw [8]. They used particles on the inside of the interface to correct the signed distance function when its solution was weak. The method was improved by Enright et. al. [5] where they used particles on both sides of the interface. The method was further improved by Enright et. al. in [6], where they introduced Semi-Lagrangian advection and fast marching techniques to improve efficiency Overview The Particle Level set method can be divided into several well-defined steps: Initialize particles around the zero level set. For each timestep t : 1. Advect the zero level set one timestep. 2. Advect all particles one timestep. 3. Correct the signed distance function using escaped particles. 4. Renormalize the signed distance function. 5. Correct again with escaped particles. 6. Adjust the radius of each particle. 7. Add and remove particles where needed Massless particles To track the interface, particles are used as a complementary to the signed distance function. Because particles are only used for tracking, there is no need to store any mass. Each particle is represented with a position and a radius. The radius vary between the particles and is used to store the distance to the zero level set. This means that the particles represent a sampled Lagrangian version of the signed distance function. The radius is limited according to r min = 0.1 max ( x, y, z) (2.46) r max = 0.5 max ( x, y, z) Particles are classified as positive or negative, where all positive particles represent the outside of the interface and the negative represent the inside. It is also necessary to keep track of the particles that are considered as escaped. 16

30 2. BACKGROUND 2.3 Particle Level set method Initialization Initialization is done by inserting a specified number of particles in the cells near the zero level set. This is done for all cells that has a corner within 3 x of the zero level set. Enright et. al. [5] suggests inserting 32 positive and 32 negative particles into each cell. Each particle is randomly placed within the cell and an attraction step is performed to attract it to a band in its corresponding side of the interface. The band is defined as b min φ b max, where b min = r min and b max = 3 x. The attraction step requires a target, in this case φ goal. The value is randomly selected within the range [b min, b max ]. It steps the position x p closer to the band according to x new = x p + λ (φ goal φ ( x)) N ( x). (2.47) λ = 1 when the attraction starts and for each iteration λ is halved. This procedure is performed until φ ( x p ) is within the band. When a particle is correctly placed in its corresponding band, its radius is set to the distance to the zero level set. The distance is given by interpolating the φ value at the position of the particle. To make sure the radius does not get to large or small, it is fitted to the correct range using r max if s p φ( x) > r max r p = s p φ( x) if r min s p φ( x ) r max (2.48) r min if s p φ( x) < r min. where s p is the sign of the particle Advection The zero level set and the particles are advected independently. Particles are advected using the Lagrangian formulation described in section In [5] they suggest using the third order TVD Runge-Kutta integration scheme (section 2.2.4) for both level set and particle advection. In [6] it is proposed that the semi-lagrangian method for level set advection and second order TVD Runge-Kutta integration for particles will give equally good results with faster computational time. Semi-Lagrangian advection The semi-lagrangian advection method is a first order accurate advection scheme. The scheme handles both spatial and temporal integration. Spatial integration is done with linear interpolation according to φ n+1 i,j,k = αβγφn i+1,j+1,k+1 + (1 α) βγφ n i,j+1,k+1 + α (1 β) γφ n i+1,j,k+1 + αβ (1 γ) φ n i+1,j+1,k + (1 α) (1 β) γφ n i,j,k+1 + (1 α) β (1 γ) φ n i,j+1,k + α (1 β) (1 γ) φ n i+1,j,k + (1 α) (1 β) (1 γ) φ n i,j,k (2.49) 17

31 2.3 Particle Level set method 2. BACKGROUND The interpolation weights are calculated by tracing a Lagrangian particle backwards in time in the velocity field flow as expressed in t r = i u i,j,k, α = (i r) x u i,j,k t (2.50) x x t s = j u i,j,k y t t = k u i,j,k z, β = (j s) y u i,j,k t y, γ = (k t) z u i,j,k t z (2.51) (2.52) Enright et. al. [6] states that the method is unconditionally stable because of the linear interpolation and the Lax-Richtmyer theorem gives that it will converge to a correct solution. Being unconditinally stable means the timestep is not bound by the CFL condition Error correction After both the zero level set and the particles have been advected the particles are used to correct the level set interface where its solution is weak. Because the particles has been advected independent of each other, the particles carry a more accurate solution of the advection. Therefore only the particles that does not match the zero level set are used in the correction. This is done by first determining all particles that is considered escaped. Escaped means the particle has appeared on the wrong side of the interface by more than its radius. For positive particles, this means the interpolated φ value at its center is 0 and for negative particles it means φ value > 0. For each escaped particle a local distance function φ p is calculated at each of the eight cell corners surrounding the particle. φ p ( x) = s p (r p x x p ) (2.53) where s p is the sign of the particle, x is the position of the cell corner, r p is particle radius and x p is particle position. If the value φ p deviates from φ there is a possiblility of an error in the level set. All the positive escaped particles are used to correct the φ > 0 region of the signed distance function and all the negative escaped particles are used for the φ 0 region. The calculated value φ p is compared to the value stored at the cell corner and the maximum is used. For positive particles this can be expressed as and for negative particles it can be expressed as φ + = max p E + ( φp, φ +) (2.54) φ = min p E ( φp, φ ) (2.55) It is not certain that φ + and φ will agree. They are merged to a final value with { φ + if φ + φ φ = φ if φ + > φ (2.56) 18

32 2. BACKGROUND 2.4 Sparse volume data structures Radius adjustment When the signed distance function has been corrected, all particles must be adjusted to fit the new location in respect to the interface. This is done by setting the radius of each particle to its current distance to the zero level set, φ ( x p ). It is done in the same way as when the particles were initialized, by clamping the distance value using equation There are some exceptions, when a particle is closer to the interface than r min. In that case, the radius is unchanged. Particles that remain escaped after the correction has its radius set to ±r min, depending on what side of the interface they are located Reseeding When the zero level set evolves over time, the shape and size of the surface will change. In order to maintain the desired number of particles in each cell, reseeding has to be performed. Each cell that contains particles has to be examined to determine if there is any need to add or delete particles. If there are to few particles, a positive and a negative particle is added until the right amount is achieved. The particles are added in the same way as in the initialization step (described in section 2.3.3). If there are to many particles in a cell, all particles in that cell that are not escaped are sorted based on their distance to the interface. Then the particle with the greatest distance are deleted until the cell contains the right amount of particles. It can be costly to examine each cell for every timestep of advection. The simplest solution to avoid this is to only perform reseeding after a fixed number of timesteps. Another more sophisticated solution is to measure how much the surface area has changed over time. If the difference is greater than a predefined threshold, reseeding is performed. The surface area of the zero level set is given by δ (φ) φ d x (2.57) where δ (φ) is a numerically smeared out delta function. With first order accuracy it can be expressed as 0 ( ) φ < ɛ 1 δ (φ) = 2ɛ + 1 2ɛ cos πφ ɛ ɛ φ ɛ (2.58) 0 ɛ < φ where ɛ = 1.5 x. 2.4 Sparse volume data structures In section the need for efficient data structures to store signed distance functions is described. A couple of data structures dedicated to signed distance functions are briefly presented. In recent years research at two Visual Effects studios has resulted in two new general purpose volume data structures, DB-Grid and Field3D. Both these data structures are based on a block concept which provides sparse storage and should theoretically be more efficient in terms of speed and memory consumption compared to previous data structures. 19

33 2.4 Sparse volume data structures 2. BACKGROUND DB-Grid DB-Grid (Dynamic Blocked Grid) is a highly efficient volume data structure, developed by Ken Museth at Digital Domain. The data structure is briefly described in [21] and [22]. It is specifically designed to handle sparse volume data. Therefore it is perfectly suited for representing signed distance functions, where for most operations the only useful information needed is located at and within a close distance to the interface. Only storing information on and around the interface instead of the whole domain considerably reduces the amount of data that is needed to be processed and stored. Fast access to data is also important when working with signed distance fields. DB-Grid provides both random access in constant time and sequential access in linear time, which is highly desirable. Design concept The data structure divides the grid domain into equally sized blocks and all blocks have the same size in all dimensions. The block size is a number power of 2, usally 8 or 16. Blocks are represented as its own block object and stores an array that constains its elements. The element array can be allocated as a two dimensional array, where the second dimension is used to access different layers of data. Blocks are accessed through the block array, an array that stores pointers to all blocks. The blocks are classified as either Dirty block Outside block Inside block where the data structure contains multiple Dirty block, one Outside block and one optional Inside block. The Dirty blocks are the blocks that stores explicitly set data. The Outside block is the key to make the data structure sparse. The elements of this block are all set to a predefined fill value. When the data structure is initialized, all the pointers in the block array will point at the Outside block. This means that everywhere in the grid domain the fill value will be returned, but there will only be one block of data allocated. When data is set explicitly, block objects classified as Dirty blocks will be allocated. A nice benefit of allocating data this way is that the data will be cache coherent. As long as a block is containing explicitly set data, the block will remain in memory. As soon as the data is removed, the block object will be deallocated and the block pointer will point at the Outside block again. Bit operators are used to quickly convert Cartesian grid coordinates to a block coordinate and a element coordinate, by transforming three dimensional coordinates into one dimensional linear offsets. Both the block coordinate and the element coordinate is a linear offset into each corresponding array. Only two dereferences and the coordinate conversion is needed for random access of a data value. 20

34 2. BACKGROUND 2.4 Sparse volume data structures Figure 2.4: Shows a two dimensional example of a implicit sphere represented using the DB-Grid concept. Green blocks represent Dirty blocks, blocks outside the interface are Outside blocks and the block inside is the Inside block. Block array Block 0 Block 1 Block 2 Block 3 Block 4 Block 5 Block 6 Block 7 Outside block Inside block Figure 2.5: This scheme shows the block array and how it points to the different blocks. Fast iterators The most common way of accessing data when working with signed distance functions is sequential access. To provide this in a convinient and efficient way, iterators are used. These iterators have a sparse behavior, which means they do not step throught all elements in the grid, only where explicit set data are stored. To keep track of explicit data, bit masks are used. One bit mask for the block array and one for the element array in each block object. This enables sequential access in linear time. When travering the grid using a sparse iterator it also provides a convinient method that will return the grid coordinate at the current position. The grid coordinate can easily be transformed into world coordinates using a transformation matrix provided by the DB-Grid. Level set customization This concludes the general purpose volume data structure. When used for signed distance functions a small extension is added. To complement the Outside block, the Inside block is used. It represents the inside of the zero level set and contains the same fill value as the outside block, but with a negative sign. In order to correctly assign inside and outside, a sign correction algorithm has to be run. 21

35 2.4 Sparse volume data structures 2. BACKGROUND Earlier in this section, different layers of data was described. When working with level sets this is a very useful feature. In can be used to store the level set solution at different time t when performing time integration. Figure 2.6: The Stanford Dragon represented as a signed distance function using DB-Grid. Green blocks show the Dirty blocks and the yellow box represents the whole grid domain Field3D Field3D was developed at Sony Pictures Imageworks and it was made open source in 2009 [35]. It is a complete volume data API developed in C++ that can handle both dense and sparse volume data. It also supports the file format HDF5, a format developed by Nasa for storage of volume data. In this thesis we only focus on the SparseField of Field3D. This data structure uses the same concept as DB-Grid, by diving the grid domain into equally sized blocks. Each block is represented as a block object and each block object contains an element array and a single value. When the data structure is initialized, the domain is divided into blocks and a block object will be allocated for each. However, the element array will not be allocated. Instead only the single value will be set that represents the whole subdomain of the block. It is not until the user explicitly sets data into the block the element array will be allocated. This gives the data structure the ability to use two levels of detail within the grid domain. It provides a sparse behavior which is very well suited for representing signed distance functions where the interesting data is on and close to the interface. The Field3D API provides iterators which makes it easy to traverse all the data and transformation to transform grid coordinates to world coordinates etc. 22

36 Chapter 3 Implementation This chapter will describe how a Particle Level set solution was implemented. It is based on the theory described in chapter 2. The implementation will use the advantages of the sparse volume data structures described in 2.4, to both store the signed distance function and the particles. There will also be suggested a couple of particle implementations, with varying accuracy and memory requirements. 3.1 Current implementation The current implementation of the Particle Level set method is an integral and important part of Digital Domains Award winning fluid simulation package fsim. Implemented in the mid 2000 it does not feature any efficient data structures. It is considered one of the slowest parts of the fluid simulation along with the Projection solver. The signed distance function is stored in a dense three dimensional grid, where the grid is implemented as a linear array. It is extended with the narrow band solution where a mask is used to keep track of the interface and its surroundings. Particles are stored in two arrays, one array with positive particles and one with negative particles. Each particle object contains Position in world coordinates, 3 x float Radius, 1 x float Escaped, 1 x boolean The particles are mapped to its corresponding grid cell using a special mapper class. This is computational heavy because every time the particles are moved, it has to remap all the moved particles. 3.2 Storing the particles This section will describe the implementation of the particle storage. An efficient way to store and locate particles is a very important part of the Particle Level set implementation. There was a number of guidelines from Digital Domain regarding the implementation of the particle container. 23

37 3.2 Storing the particles 3. IMPLEMENTATION Based on a sparse volume data structure General purpose Cache coherent Minimize memory allocation Support parallellism Query particles from cell Query cell from particle Particle quantization Two different approaches of storing particles will be described, one uses an array for each element in the sparse volume and the other uses a single array and all elements points to its area in the array. We came up with the concept of the multiple arrays approach, the other approach was inspired by the solution of Nielsen and Museth [24]. Because of time limitations only the approach with multiple arrays was implemented and tested Class Interface The particle container was implemented as a general purpose framework that can be used for any problems that deals with particles. Therefore it is necessary to have a logical and simple interface. The following methods are suggested Add particle(cell coordinate, particle) Move particle(cell coordinate from, cell coordinate to) Remove particle(cell coordinate, particle id) Clear particles(cell coordinate) Get Particle Count(cell coordinate) Get Total Particle Count Clear field One thing that is common for both approaches is that position of each particle is stored in local cell coordinates. The cell coordinate space is defined as [0, 1) for each dimension. This means that the particle itself does not know where in the grid it is located. When a particle gets advected it can be moved at max one cell according to the CFL condition This means that the particle can have a position in the range [ 1, 2) before it gets moved to its new cell. 24

38 3. IMPLEMENTATION 3.2 Storing the particles Particle pool The particle pool approach is similar to the particle bin method used in [24]. All particles are stored in a big array and each element in the volume data structure stores a linear offset and the number of particles the element contains. A predefined value determines the maximum number of particles an element can have. The particle array allocates as many position as there are allocated elements in the grid times the maximum number of particles per element. When accessing particles for a particular element, particle iterators will be returned that only accesses the particles that belongs to that element. The start iterator will point at the particle that is located where the linear offset points in the particle array and the end iterator will point at the linear offset added by the number of particles in that cell. This implementation can execute in parallell by diving the particle array into intervals and let each thread work on one interval. Pros Allocated memory is coherent. Particles can be traversed without travering the grid. Cons Complex implementation. The particle array needs to be resized each time particles are added to a new element or all particles are moved from an element. Storing an offset and size for each element requires extra memory. Grid elements Offset: 0 Offset: 5 Offset: 9 Size: 5 Size: 4 Size: 6 Particle array Figure 3.1: Particle pool structure. 25

39 3.2 Storing the particles 3. IMPLEMENTATION Grid elements Particle arrays Figure 3.2: Multiple arrays structure Multiple arrays This approach uses one array per element to store the particles that are geometrically located within its grid cell. To avoid allocating arrays for each element of a block, a pointer is stored. If particles are added to a particular element, an array is allocated and the particles are inserted. Each element of a block stores a boost shared pointer to an array and the array stores the particle objects. boost is a utility library for C++ and the shared pointer is a pointer implementation that provides reference counting which eases memory management. If an object created using the shared pointer is not referenced anywhere in the implementation, it will automatically be deleted. This implementation can execute in parallell by letting each thread work on different arrays or different blocks of arrays. Pros Easy to add particles to new an element or remove all particles from an element. Straightforward to implement. The arrays can be adjusted to fit the cache memory in a threaded implementation. Cons Arrays could be allocated at different locations in the memory. Small memory overhead for each array that is created. In order to traverse particles, the grid needs to be traversed. 26

40 3. IMPLEMENTATION 3.2 Storing the particles STL containers In both particle storage approaches, an array is needed to store the particle objects. The C++ Standard Library (STL) provides a couple of container classes, all with different advantages. The classes are all templated, which means any type of object can be stored. All the classes provides methods for safe access, add object to front, add object to back and get size. They also provide iterators for simple traversal of the data. Vector The Vector [3] is the STL implementation of a standard linear array. When a Vector object is created it internally allocates memory for a predefined number of the templated object. If more objects are added than the Vector has pre-allocated for, it has to internally create a new array with enough space. The stored objects then has to be copied to the new array and the old array is deleted. This makes the Vector useful in a case where a large number of objects are to be stored and the number of objects does not change over time. The allocated data is memory coherent. List The List [2] is a doubly linked list. Each element is stored as a node and these nodes are linked forward and backward, forming a chain. It starts out with one node and for each new element that is added, a new node is created and linked to chain. Elements can not be accessed directly by their index number, instead the list has to iterate to the desired index. The List is useful when the amount of objects to store is constantly changing and objects needs to be inserted anywhere in the list. Because new nodes are allocated anywhere in memory, the allocated memory will not be coherent. It can move and remove nodes fast by only changing the pointers that link the nodes together. Deque Deque is acronym for Double-Ended Queue [1]. The Deque internally allocates data by grouping elements into blocks and each time more elements needs to be allocated, a new block of elements is added. The blocks are linked by pointers. This is similar to a List, but in this case each node is an array of subelements. Nothing of this is exposed to the programmer, giving it the impression of a regular array. The Deque is useful when storing a small number of objects and you want the ability to quickly allocate space for a couple of more objects. It will provide memory coherency because each block of elements is allocated together in memory. 27

41 3.3 Particle representation 3. IMPLEMENTATION Traversing particles Most of the operations performed on particles in the Particle Level set method applies to all particles. Therefore it is convinient to have a simple way of traversing all particles. Both volume data structures provides sparse iterators that will allow us to iterate through only grid elements that contains particles. They also has an easy method of finding out the grid coordinate (i, j, k) of the current element. The grid coordinate can be transformed to world space coordinates (I, J, K) using a grid-to-world transform provided by the volume data structure. The world space grid coordinate can the be used to compute the world space position of the particle according to where x p is the particle position in local space. x = I + x p x (3.1) 3.3 Particle representation One of the bottlenecks when implementing the Particle Level set method is the amount of particles needed. The surface area can grow very fast when the zero level set is evolved over time, which means the particle amount increases considerably. One thing we have explored in this thesis is to implement the particle representation with different accuracy and see what concequences it has on the resulting signed distance function. As a minimum, a particle must be represented with a position, a radius and it must keep track if it has escaped and if it is a positive or negative particle. In all three implementations the radius is used to keep track of if it is a positive or negative particle. This is easily done by letting the radius be positive for positive particles and negative for negative particles. It is important that each particle implementation has the same interface. This makes it easy to switch between the different implementations without having to change any other code. Here is a simple and straightforward interface that was used for all the particle implementations setposition( float, float, float ) getposition() setradius( float ) getradius() setescaped( boolean ) hasescaped() 28

42 3. IMPLEMENTATION 3.3 Particle representation Normal implementation This is a very simple solution that uses floats to store position and radius. It gives high precision on each property, but it also leads to a large memory footprint. Position: 3 floats (3 x 32 bits) Radius: 1 float (1 x 32 bits) Escaped: 1 boolean (1 x 8 bits) Total memory usage per particle is 17 bytes (136 bits). The implementation is very straightforward and no special considerations has to be done in respect to position and radius range Semi-Compact implementation The semi-compact solution replaces floats with unsigned short integers which gives half the precision of a float. Also the escaped property is not stored as a boolean. Instead one bit of the radius variable is used to keep track of this property. Position: 3 unsigned short integers (3 x 16 bits) Radius: 1 shared unsigned short int (15 bits) Escaped: 1 shared unsigned short int (1 bit) The total memory usage per particle is 8 bytes (64 bits), less than half of the normal implementation. In this implementation, values has to be stored as integers. This means the float values that is passed in to the particle object has to be quantizied and scaled to fit the integer value. The quantization is done similar to what is suggested in [24]. An unsigned short integer is stored using 16 bits precision, which gives 2 16 = levels of quantization. This amount of levels means a coordinate x can take a quantizised value in the range [0, 65536]. As mentioned in section 3.2 all particle coordinates are limited to the range [ 1, 2). The coordinate x is mapped from the local space to quatized space x q using this equation (x + 1) x q = (3.2) 3 where it first translates the value to the range [0, 3), multiplies by the number of quantization levels and divides by the length of the range. It can be mapped back to local space using x = 3x q (3.3) The radius are mapped in a similar way, but are limited to the the range [ 0.5, 0.5]. This range is determined by r max (equation 2.46), assuming that x = 1 in local space. The sign of the radius determines if the particle is positive or negative. The mapping equation is r q = (r + 0.5) (3.4) 29

43 3.3 Particle representation 3. IMPLEMENTATION where the radius is translated to [0, 1] and multiplied by the number of quantization levels - 1. This is because the first bit is used for the escaped property. The quantizised radius can be mapped back to local space using r = r q & (3.5) where & is the bitwise AND operator. The AND operation will make the equation consider all bits but the one to the far right. The last part of this particle implementation is to be able to set the first bit of the radius variable to 1 or 0 depending on if the particle is escaped or not. To set the bit to 1, meaning the particle has escaped, this equation is used r q = r q 1 (3.6) It uses the OR operator to only modify the first bit. To set the escaped property to 0: Compact implementation r q = r q & (3.7) The compact implementation is very similar to the semi-compact implementation in terms of mapping coordinate and radius and setting the escaped property. The difference is that it uses unsigned char instead of unsigned short integer to store the data. unsigned chars have only 8 bits precision which makes this particle implementation half the size of semicompact and less than a forth of the normal implementation. Each variable will only have 2 8 = 256 quantization levels. Position: 3 unsigned char (3 x 8 bits) Radius: shared unsigned char (7 bits) Escaped: shared unsigned char (1 bit) The total memory usage per particle is 4 bytes (32 bits). Just as with the semi-compact implementation, the coordinate x has to be translated and scaled in order to be transformed to quantized space. 255 (x + 1) x q = (3.8) 3 The quantized coordinate is mapped back to local space The same applies for the radius and when mapping back from quantized space. x = 3x q (3.9) r q = 254 (r + 0.5) (3.10) r = r q & (3.11) 254 where & is the bitwise AND operator. The escaped property bit is set to 1 using the OR operator: r q = r q 1 (3.12) and to set it back to 0: r q = r q & 254 (3.13) 30

44 3. IMPLEMENTATION 3.4 Dynamic seeding condition 3.4 Dynamic seeding condition In order to make the seeding of particles a bit more efficient, we came up with a dynamic seeding scheme where the number of particles to be seeded decreased the furter away from the interface the cell was located. We wanted to see if we could reduce the number of particles without worsen the solution of the signed distance function correction. The following equation was used to determine the number of particles in the current cell n c = n max x φ min (3.14) n max is the maximum number of particles in a cell, x is the grid spacing and φ min is the smallest φ value of the eight that belongs to the current cell. To ensure no division by zero, this was only used where φ min x. 3.5 Putting the Particle Level set together This section describes of the Particle Level set implementation was put together. Some parts are threaded and for the threading the open source package threadpool was used Grids The signed distance function is stored in a DB-Grid where each allocated element stores a float. A secondary DB-Grid is used to store particles. The particle storage method used is the Particle Array method (section 3.2.3) based on Deques. Why DB-Grid was used in favor of Field3D is discussed in chapter 5. To simplify the implementation, the same grid spacing is used in all dimensions which gives x = y = z Level set advection The level set advection uses a threaded implementation where each thread is working on a block. Before the execution, a queue of blocks is created for each thread. Spatial derivatives are calculated using WENO (section 2.2.3) and the level set is time integrated using TVD-RK3 (section 2.2.4). Here, the layers in DB-Grid are very useful because in TVD-RK3 three timesteps are calculated. Each can be stored in a different layer and then merged together Level set renomalization The renormalization is done by solving equation 2.40, where the Godunov scheme (section 2.2.5) is used to calculate the norm of the gradient vector. The time integration is approximated with Forward Euler (section 2.2.4). The timestep used is t = 0.5 x [25]. 31

45 3.5 Putting the Particle Level set together 3. IMPLEMENTATION Particle advection Particle advection is one of the parts of the Particle Level set implementation where threading is implemented. Particles are advected using TVD-RK3, where each thread is advecting one block. However it is only the position of the particles that is advected, the particles are not moved to the correct cell. Instead all particles that has a position ( x < 0 or x 1) is moved to the correct cell as a subsequent step. This cannot be done in parallell because of locking, when multiple treads are trying to move to or from the same Deque Radius adjustment and Reseeding The radius adjustment was also threaded and each thread handled one block. The reseeding is a compution heavy method and according to [5] should not be perform for each timestep. Instead it is performed when the surface area has changed with 5% or 10%. To keep track of the surface area a variable stores the value at initialization. For each timestep the current area is compared to the initial area and if the area has changed too much, reseeding is performed and the initial area variable is reset. To estimate the surface area of the zero level set, we used a crude approximation by counting the number of dirty elements in the grid and dividing this value by the width of the narrowband. 32

46 Chapter 4 Results This chapter will present results from tests performed with the implementation described in previous chapter. The hardware that was used in the tests are 4 Intel Xeon 3 GHz processors with 1024 kb L2 cache, 4 GB of memory and the operating system was Debian 64 bit. All tests use a grid resolution of 100 3, 32 positive and negative particles per cell, 0.5 CFL multiplier and particles are only seeded within 2 cells of the interface. The signed distance functions are visualized by extracting a triangle mesh of the surface using the Marching Cubes algorithm [16]. The mesh are then rendered in the 3D package Houdini using the internal renderer Mantra. 4.1 Evaluating DB-Grid and Field3D In this section test results from the evaluation of DB-Grid and Field3D will be presented. There are two different tests, random access and sequential access Random access For the random access test, positions was randomly selected. The test was then to measure how long time it took to set values at all these positions and how much memory was used after all values was set. Troughout the whole test a block size of 16 3 was used Sequential access Sequential access test was carried out by using the standard iterators for both data structure. These iterators traverse all positions in the grid. In the test a value was set for each position, making the grid fully populated. Time consumption and memory usage was measured. Troughout the whole test a block size of 16 3 was used. 33

47 4.1 Evaluating DB-Grid and Field3D 4. RESULTS Table 4.1: DB-Grid and Field3D random access test. Initialization time Access time Memory usage Grid size: DB-Grid 0.0 s 4.65 s 502 mb Field3D 0.0 s 2.87 s 487 mb Grid size: DB-Grid 0.0 s 5.53 s 1344 mb Field3D 0.04 s 4.46 s 1308 mb Grid size: DB-Grid 0.03 s 5.63 s 1592 mb Field3D 0.30 s 5.07 s 1590 mb Grid size: DB-Grid 0.21 s 6.41 s 1738 mb Field3D 2.31 s 6.01 s 2070 mb Grid size: DB-Grid 1.60 s 6.59 s 2652 mb Field3D Table 4.2: DB-Grid and Field3D sequential access test. Initialization time Access time Memory usage Grid size: DB-Grid 0.0 s 0.18 s 66 mb Field3D 0.0 s 0.27 s 64 mb Grid size: DB-Grid 0.0 s 1.34 s 528 mb Field3D 0.0 s 2.09 s 513 mb Grid size: 1024x1024x512 DB-Grid 0.01 s 5.37 s 2115 mb Field3D 0.03 s 8.34 s 2052 mb 34

48 4. RESULTS 4.2 Particle Level set implementation 4.2 Particle Level set implementation Here different aspects of the Particle Level set implementation are tested and presented. The implementation is based on the details described in section Deformation test The deformation test puts a level set under great deformation and stretching. It is a good way of comparing the volume preservation ability of the level set method and the Particle level set method. It was originally proposed by LeVeque in [15] and has since then been used by Enright et al. in [5] and [6]. The level set/particle level set is advected through a incompressible flow field which combines a deformation in the x-y plane with one in the x-z plane. The velocity field is expressed as u (x, y, z) = 2sin 2 (πx) sin (πy) sin (πz) v (x, y, z) = sin (2πx) sin 2 (πy) sin (2πz) w (x, y, z) = sin (2πx) sin (2πy) sin 2 (πz) (4.1) The scene consists of a implicit sphere with radius 0.15 and it is placed at 0.35, 0.35, 0.35, where the total domain ranges from [0, 1]. The velocity field is modulated in time with period T = 3. This means advecting the implicit sphere from T = 0 to T = 3 through the time dependent velocity field: u ( x, t) = 2sin 2 (πx) sin (πy) sin (πz) cos ( ) πt T v ( x, t) = sin (2πx) sin 2 (πy) sin (2πz) cos ( ) πt T w ( x, t) = sin (2πx) sin (2πy) sin 2 (πz) cos ( ) πt T (4.2) Figure 4.1: Deformation test performed on Level set. T=0.0, 0.4, 0.75, 1.2, 1.4, 1.5, 1.9, 2.3,

49 4.2 Particle Level set implementation 4. RESULTS Figure 4.2: Deformation test performed on Particle Level set. T=0.0, 0.4, 0.75, 1.2, 1.4, 1.5, 1.9, 2.3, 3.0. Table 4.3: Statistics from the Deformation test with and without smart seeding. Time Volume, t=0.0 Volume, t=1.5 Volume, t=3.0 Memory usage, t=0.0 Memory usage, t=1.5 Memory usage, t=3.0 Particle count, t=0.0 Particle count, t=1.5 Particle count, t= Normal 1999 s mb mb mb Smart seed 1870 s mb mb mb Smart seeding Particle Level set advection are compared with and without smart seeding Cache behaviour and threading Different block sizes and number of threads are compared using the Deformation test. 36

50 4. RESULTS 4.2 Particle Level set implementation Figure 4.3: Deformation test performed on Particle Level set, smart seeding is used. T=0.0, 0.4, 0.75, 1.2, 1.4, 1.5, 1.9, 2.3, 3.0. Table 4.4: Particle Level set advection with varying block size and number of threads s s s s s s s s s s s s s s s s s s s s

51 4.3 Particle implementations 4. RESULTS 4.3 Particle implementations Deformation Test The different particle implementations are used in the Deformation test described earlier in this chapter. Table 4.5: Statistics from the Deformation test with different particle implementations. Normal Semi-compact Compact Time 1999 s 1719 s 1788 s Volume, t= Volume, t= Volume, t= Memory usage, t= mb 9.12 mb 6.00 mb Memory usage, t= mb mb mb Memory usage, t= mb mb mb Particle count, t= Particle count, t= Particle count, t= Figure 4.4: Normal particle implementation at T=0.5, T=1.5 and T= Error measurement This test compares how much error is introduced by quantization in the different particle implementations. A randomly selected position , , and radius is passed in to each of the different implementations. The position and radius is then measured after quantization and the error is calculated by comparing with the original value. 38

52 4. RESULTS 4.3 Particle implementations Figure 4.5: Semi-compact particle implementation at at T=0.5, T=1.5 and T=2.1 Figure 4.6: Compact particle implementation at at T=0.5, T=1.5 and T=2.1 Table 4.6: Comparing error of the different particle implementations. Normal Semi-compact Compact Position 0.346,-0.456, ,-0.456, ,-0.459,0.977 Abs. error 0, 0, E-5,3.16E-5,9.84E E-3,2.50E-3,1.12E-2 Rel. error 0, 0, E-4,6.92E-5,9.96E E-2,5.49E-3,1.13E-2 Radius Abs. error E E-3 Rel. error E E-3 39

53 4.4 Comparing Particle Level set implementations 4. RESULTS 4.4 Comparing Particle Level set implementations Here is the results when comparing the speed of execution of the new Particle level set implementation and the old implementation (section 3.1). The test was carried out by performing one timestep of advection. Both implementations used third order TVD Runge- Kutta for level set and particle temporal integration and WENO for spatial integration. The domain size was 256, block size for DB-Grid was 16 and 8 threads was used in the excecution. Table 4.7: Comparing Particle Level set implementations. Method New PLS Old PLS Initialization s s Advection s s Particle count Table 4.8: Time breakdown of the new Particle Level set implementation. Advect level set Advect particles Move particles Correct level set Renormalize level set Correct level set Adjust radius s s s s s s s 40

54 Chapter 5 Discussion The foremost topic to discuss is what data structure proved to be superior in terms of speed and memory efficiency. As can be seen in results section 4.1, Field3D proves to be faster at random access. However it can only handle up to in grid resolution whereas DB-Grid managed without any problems. Regarding memory efficency both data structures used similar amounts of memory, with the exception at where Field3D increases considerable compared to DB-Grid. This could probably be because of a memory overhead in the internal structure, that increases with resolution. The overhead is likely the reason why Field3D was not able to complete the test at resolution. Looking at the results from the sequential access, shows that the memory efficiency is even. DB-Grid proves to be faster at all tested resolutions. This is an important advantage for DB-Grid because when working with signed distance functions and Particle Level sets, it is very common to sequentially traverse all the data. This and the fact that DB-Grid could handle higher resolution at the random access test was the reason why DB-Grid was choosen in favor of Field3D as foundation for the Particle Level set implementation. It is important to take advantage of the size of the cache memory, particularly when implementing a threaded method. In this case it is important to fit all particles of one element or all signed distance function values of a block inside the cache. As seen in table 4.4 in results, the threaded implementation performs very well as long as a block fits inside the cache. When the memory requirements of the block gets to big, the excecution time almost doubles. The particle storage implementation was one of the major parts of the Particle Level set implementation. The reason why the multiple arrays approach was implemented in favor of the particle pool approach was because of implementation complexity and limited time. We would rather have implemented both approaches and evaluated them. In the implementation we only wanted to store 32 or 64 particles for each grid element. For this small number we considered the Deque to be best suited. It does not allocate much memory when it is created and it provides the ability to quickly allocate space for a few more particles if needed. Most of the guidelines from Digital Domain was fullfilled by the multiple arrays approach in combination with Deques. It was based on DB-Grid, it can be used as a general purpose particle container, each array is cache coherent, memory allocation is minimized, 41

55 5. DISCUSSION it supports parallelism and each grid element can be queried for its particles. Another important topic of this thesis is the different particle implementations. It is desirable to reduce the memory footprint of the particles as much as possible, without affecting the resulting zero level set too much. The results in section 4.3 proves that the Semi-compact particle almost halves the memory footprint of the whole Particle level set, without affecting the visual result noticeably. The Compact implementation on the other hand, is an example of that 256 is to few quantization levels. The low accuracy results in a shifted interface which leads to a different deformation. The smart seeding optimization enables less seeding of particles further away from the zero level set. Results shows that is does not affect the visual quality and it reduces memory by about 10%. The results in section 4.4 proves that the new implementation is slightly slower at initialization, likely becasuse it uses a more accurate seeding algorithm. It then shows that performing one timestep of advection is ten times faster with the new implementation. One problem with the new Particle Level set implementation is the need to perform particle advection in two steps, advecting the position and then moving particles to the correct element. The advection step is fast and can be threaded, but the moving is the slow part and cannot be threaded in an easy way. 42

56 Chapter 6 Conclusion This thesis has proved that DB-Grid is slightly faster than Field3D at sequential access and can handle larger resolutions (> ). It has also been shown that DB-Grid definitly is capable as a general purpose volume data structure, in this case for storing arrays of particles. It is also shown that this cache efficient data structure gives the new Particle Level set implementation a speed increase of ten times compared to the current implementation. Quantization of particle position and radius can provide a huge saving of memory while not affecting the visual result. This was shown with the Semi-compact particle implementation. The Compact particle implementation however, proved that using too few quatization levels will introduce noise and shift the zero level set. Smart seeding is a simple and fast way of reducing the total particle amount with about 10% without affecting the visual result. 6.1 Future work Fluid simulation integration A way of really verifying if the Particle Level set implementation is working as intended is to integrate it into Digital Domains fluid simulation engine fsim. This would not mean to much work because it would mostly be to replace the current implementation with the new. Most time would probably be spent trying to match the the class interface with the current implementation. Unfortunately the time reserved for this project was not enough to try this, but it will be first priority for future work. Semi-Lagrangian advection Semi-Lagrangian advection, described in section 2.3.4, would be a good solution if the time efficiency of the level set advection has to be improved. 43

57 6.1 Future work 6. CONCLUSION Customized Deque allocator A customized allocator for the Deque container could improve the cache coherency. As it is now, each time a Deque is allocated with particles, the data can be placed together anywhere in memory. With a custom allocator it could be possible to reserve a region in the memory where all allocated particle Deques are stored. Smarter quantization The quantization of particle position and radius could be made smarter by considering how much the error between the original position and the quantizised position is. The error could be compensated on the original radius, meaning the particle would still carry accurate information about how far away the interface is located. Oriented Particle Level set This is an idea presented in [29], where they for each particle use a vector instead of a single value (radius) to represent the distance to the zero level set. The advantage of using a vector is that it can represent both the distance and the direction at the same time. According to their results, this technique preserves mass and area better than the regular Particle Level set method. 44

58 Acknowledgements First of all I want to thank my supervisor Doug Roble, Creative Director of Software at Digital Domain. I also want to thank to the Field toolkit-team of Digital Domain, Blake Sloan, Maria Barot and Geoff Wedig. Special thanks to Mattias Bergbom and Mårten Larsson who showed me around in Venice and at Digital Domain. Thanks to my examiner Jonas Unger.

59

60 References [1] C++ reference: Deque. [2] C++ reference: List. [3] C++ reference: Vector. [4] R. Courant, K. Friedrichs, and H Lewy. Uber die partiellen differenzengleichungen der mathematischen physik. Mathematische Annalen, 100(1):32 74, [5] Douglas Enright, Ronald Fedkiw, Joel Ferziger, and Ian Mitchell. A hybrid particle level set method for improved interface capturing. Journal of Computational Physics, 183(1):83 116, [6] Douglas Enright, Frank Losasso, and Ronald Fedkiw. A fast and accurate semilagrangian particle level set method. Computers and Structures, 83(6 7): , [7] Douglas Enright, Stephen Marschner, and Ronald Fedkiw. Animation and rendering of complex water surfaces. In SIGGRAPH 02: Proceedings of the 29th annual conference on Computer graphics and interactive techniques, pages , [8] Nick Foster and Ronald Fedkiw. Practical animation of liquids. In SIGGRAPH 01: Proceedings of the 28th annual conference on Computer graphics and interactive techniques, pages 23 30, [9] Willi Geiger, Mohen Leo, Nick Rasmussen, Frank Losasso, and Ron Fedkiw. So real it ll make you wet. In SIGGRAPH 06: ACM SIGGRAPH 2006 Sketches, [10] F. Harlow and J. Welch. Numerical calculation of time-dependent viscous incompressible flow of fluid with free surface. Phys. Fluids, 8(12): , [11] C. W. Hirt and B. D. Nichols. Volume of fluid (vof) method for the dynamics of free boundaries. Journal of Computational Physics, 39(1): , [12] Ben Houston, Michael B. Nielsen, Christopher Batty, Ola Nilsson, and Ken Museth. Hierarchical rle level set: A compact and versatile deformable surface representation. ACM Transaction on Graphics (TOG), 25(1): , [13] Jason Iversen and Ryo Sakaguchi. Growing up with fluid simulation on the day after tomorrow. In SIGGRAPH 04: ACM SIGGRAPH 2004 Sketches,

61 REFERENCES REFERENCES [14] Guang-Shan Jiang and Danping Peng. Weighted eno schemes for hamilton jacobi equations. SIAM Journal on Scientific Computing, 21(6): , [15] Randall J. LeVeque. High-resolution conservative algorithms for advection in incompressible flow. SIAM Journal on Numerical Analysis, 33(2): , [16] William E. Lorensen and Harvey E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. SIGGRAPH Computer Graphics, 21(4): , [17] Frank Losasso, Frédéric Gibou, and Ron Fedkiw. Simulating water and smoke with an octree data structure. In SIGGRAPH 04: ACM SIGGRAPH 2004 Papers, pages , [18] Frank Losasso, Tamar Shinar, Andrew Selle, and Ronald Fedkiw. Multiple interacting liquids. In SIGGRAPH 06: ACM SIGGRAPH 2006 Papers, pages , [19] Frank Losasso, Jerry Talton, Nipun Kwatra, and Ronald Fedkiw. Two-way coupled sph and particle level set fluid simulation. IEEE Transactions on Visualization and Computer Graphics, 14(4): , [20] Matthias Müller, David Charypar, and Markus Gross. Particle-based fluid simulation for interactive applications. In SCA 03: Proceedings of the 2003 ACM SIG- GRAPH/Eurographics symposium on Computer animation, pages , [21] Ken Museth. An efficient level set toolkit for visual effects. In SIGGRAPH 09: ACM SIGGRAPH 2009 Sketches, [22] Ken Museth and Michael Clive. Cracktastic: fast 3d fragmentation in the mummy: Tomb of the dragon emperor. In SIGGRAPH 08: ACM SIGGRAPH 2008 Sketches, [23] Michael B. Nielsen and Ken Museth. Dynamic tubular grid: An efficient data structure and algorithms for high resolution level sets. Journal of Scientific Computing, 26(3): , [24] Michael B. Nielsen, Ola Nilsson, Andreas Söderström, and Ken Museth. Out-of-core and compressed level set methods. ACM Transactions on Graphics (TOG), 26(4):16, [25] Stanley Osher and Ronald Fedkiw. Level Set Methods and Dynamic Implicit Surfaces. Springer, [26] Stanley Osher and James A. Sethian. Fronts propagating with curvature-dependent speed: algorithms based on hamilton-jacobi formulations. Journal of Computational Physics, 79(1):12 49, [27] Stanley Osher and Chi-Wang Shu. High-order essentially nonoscillatory schemes for hamilton-jacobi equations. SIAM Journal on Numerical Analysis, 28(4): , [28] Danping Peng, Barry Merriman, Stanley Osher, Hongkai Zhao, and Myungjoo Kang. A pde-based fast local level set method. Journal of Computational Physics, 155(2): ,

62 REFERENCES REFERENCES [29] Frdric Pighin, Sanjit Patel, Anson Chu, and Jonathan M. Cohen. Oriented particle level set for fluid simulation. In Symposium on Computer Animation 2005 Poster, [30] Avi Robinson-Mosher, Tamar Shinar, Jon Gretarsson, Jonathan Su, and Ronald Fedkiw. Two-way coupling of fluids to rigid and deformable solids and shells. In SIG- GRAPH 08: ACM SIGGRAPH 2008 papers, pages 1 9, [31] Elisabeth Rouy and Agnès Tourin. A viscosity solutions approach to shape-fromshading. SIAM Journal on Numerical Analysis, 29(3): , [32] James A. Sethian. Level Set Methods and Fast Marching Methods. Cambridge University Press, [33] Chi-Wang Shu and Stanley Osher. Efficient implementation of essentially nonoscillatory shock-capturing schemes. Journal of Computational Physics, 77(2): , [34] Nigel Sumner, Samir Hoon, Willi Geiger, Sebastian Marino, Nick Rasmussen, and Ron Fedkiw. Melting a terminatrix. In SIGGRAPH 03: ACM SIGGRAPH 2003 Sketches, [35] Magnus Wrenninge. Field3d: An open source file format for voxel data. http: //code.google.com/p/field3d/, Retrieved [36] Yongning Zhu and Robert Bridson. Animating sand as a fluid. In SIGGRAPH 05: ACM SIGGRAPH 2005 Papers, pages ,

63

64 Appendix A Hamilton-Jacobi ENO Essentially nonoscillatory (ENO) is a third order accurate spatial discretization scheme, based on polynomial interpolation. The first step is to calculate four divided differences. The zeroth divided difference at gridpoint (i, j, k) is defined as D 0 i φ = φ i (A.1) The first divided difference is defined at the midpoint between cell point (i, j, k) and (i + 1, j, k) Di+1/2 1 φ = D0 i+1 φ D0 i φ (A.2) x The second divided difference is defined at the gridpoint (i, j, k) D 2 i φ = D1 i+1/2 φ D1 i 1/2 φ 2 x (A.3) where Di+1/2 1 φ is the forward difference described by equation A.2 and D1 i 1/2φ is the backward difference. The third divided difference is defined at the midpoint between cell point (i, j, k) and (i + 1, j, k) D 3 i+1/2 φ = D2 i+1 φ D2 i φ 3 x (A.4) φ (x) can be approximated using a Newton polynomial, in this case a polynomial of the third order that is reconstructed using the four divided differences. φ (x) Q 0 (x) + Q 1 (x) + Q 2 (x) + Q 3 (x) (A.5) The partial derivative is given as φ (x) x Q 1 (x) + Q 2 (x) + Q 3 (x) (A.6) This expression is used to approximate φ + x or φ x. k = i is used for φ + x and k = i 1 is used for φ x. ) Q 1 (x) = (Dk+1/2 1 φ (x x i ) (A.7) 51

65 A. HAMILTON-JACOBI ENO where the deriviative is Q 1 (x) = D 1 k+1/2 φ. (A.8) When calculating Q 2 D 2 k φ has to be compared to D 2 k+1 φ to determine the one with the least variation. This is determined according to D 2 k φ D 2 k+1 φ and if this is fulfilled c = D 2 k φ and k = k 1, otherwise c = D 2 k+1 φ and k = k. Q 2 (x) = c (x x k ) (x x k+1 ) (A.9) where the derivative is Q 2 (x) = c (2 (i k) 1) x. (A.10) Q 3 is calculated in the same way as Q 2, where Dk 3 D +1/2 φ and 3 k +3/2 φ are compared and the one with least variation is used. This means that if Dk 3 D +1/2 φ 3 k +3/2 φ c = Dk 3 +1/2 φ is used, otherwise c = Dk+3/2 3 φ is used. and the derivative is Q 3 (x) = c (x x k ) (x x k +1) (x x k +2) ( ) Q 3 (x) = c 3 (i k ) 2 6 (i k ) + 2 ( x) 2. (A.11) (A.12) 52

66 Appendix B Hamilton-Jacobi WENO Weighted essentially nonoscillatory interpolation is a third to fifth order accurate spatial integration scheme. It approximates the partial derivative φ x based on three ENO polynomials and weights them together. For φ x there are exactly three possible ENO approximations. By first defining the divided differences as { v1 = D φ i 2, v 2 = D φ i 1, v 3 = D φ i, v 4 = D φ i+1, v 5 = D φ i+2 } the three approximations can be expressed as φ 1 x = v 1 3 7v v 3 6, (B.1) φ 2 x = v v v 4 3, (B.2) and φ 3 x = v v 4 6 v 5 6, (B.3) These three approximations are weighted together φ x = w 1 φ 1 x + w 2 φ 2 x + w 3 φ 3 x (B.4) The weights are determined by first calculating the smoothness of the three ENO approximations described earlier S 1 = (v 1 2v 2 + v 3 ) (v 1 4v 2 + 3v 3 ) 2, (B.5) S 2 = (v 2 2v 3 + v 4 ) (v 2 v 4 ) 2 (B.6) and S 3 = (v 3 2v 4 + v 5 ) (3v 3 4v 4 + v 5 ) 2 (B.7) Each smoothness estimate are used to define α 1 = 0.1 (S 1 + ɛ) 2, (B.8) 53

67 B. HAMILTON-JACOBI WENO and where ɛ is the scaling term α 2 = α 3 = 0.6 (S 2 + ɛ) 2 (B.9) 0.3 (S 3 + ɛ) 2 (B.10) ɛ = 10 6 max { v1, 2 v2, 2 v3, 2 v4, 2 v5 2 } (B.11) The final weights are given as w 1 = α 1 α 1 + α 2 + α 3, α 2 (B.12) w 2 = (B.13) α 1 + α 2 + α 3 and α 3 w 3 = (B.14) α 1 + α 2 + α 3 For more details on the ENO and WENO scheme, consult the book by Osher and Fedkiw [25]. 54

68 Appendix C Additional results Figure C.1: Higher resolution Particle Level set deformation test. Grid resolution: T=0.0, 0.4, 0.75, 1.2, 1.4, 1.5, 1.9, 2.3,

HTTP Based Adap ve Bitrate Streaming Protocols in Live Surveillance Systems

HTTP Based Adap ve Bitrate Streaming Protocols in Live Surveillance Systems HTTP Based Adapve Bitrate Streaming Protocols in Live Surveillance Systems Daniel Dzabic Jacob Mårtensson Supervisor : Adrian Horga Examiner : Ahmed Rezine External supervisor : Emil Wilock Linköpings

More information

CS205b/CME306. Lecture 9

CS205b/CME306. Lecture 9 CS205b/CME306 Lecture 9 1 Convection Supplementary Reading: Osher and Fedkiw, Sections 3.3 and 3.5; Leveque, Sections 6.7, 8.3, 10.2, 10.4. For a reference on Newton polynomial interpolation via divided

More information

Hybrid Particle-Grid Water Simulation using Multigrid Pressure Solver

Hybrid Particle-Grid Water Simulation using Multigrid Pressure Solver LiU-ITN-TEK-G--14/006-SE Hybrid Particle-Grid Water Simulation using Multigrid Pressure Solver Per Karlsson 2014-03-13 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Optimal Coherent Reconstruction of Unstructured Mesh Sequences with Evolving Topology

Optimal Coherent Reconstruction of Unstructured Mesh Sequences with Evolving Topology LiU-ITN-TEK-A-14/040-SE Optimal Coherent Reconstruction of Unstructured Mesh Sequences with Evolving Topology Christopher Birger 2014-09-22 Department of Science and Technology Linköping University SE-601

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final Thesis Network usage profiling for applications on the Android smart phone by Jakob Egnell LIU-IDA/LITH-EX-G 12/004

More information

Design and evaluation of a system that coordinate clients to use the same server

Design and evaluation of a system that coordinate clients to use the same server Linköpings universitet/linköping University IDA Department of Computer and Information Science Bachelor Thesis Information Technology Spring term 2017 LIU-IDA/LITH-EX-G--17/067--SE Design and evaluation

More information

Personlig visualisering av bloggstatistik

Personlig visualisering av bloggstatistik LiU-ITN-TEK-G-13/005-SE Personlig visualisering av bloggstatistik Tina Durmén Blunt 2013-03-22 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen för teknik

More information

Automatic LOD selection

Automatic LOD selection LiU-ITN-TEK-A--17/054--SE Automatic LOD selection Isabelle Forsman 2017-10-20 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen för teknik och naturvetenskap

More information

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field

Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field Level Set Methods Overview Level set methods Formulation of Interface Propagation Boundary Value PDE Initial Value PDE Motion in an externally generated velocity field Convection Upwind ddifferencingi

More information

Institutionen för datavetenskap

Institutionen för datavetenskap Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer Final thesis and Information Science Minimizing memory requirements

More information

Design, Implementation, and Performance Evaluation of HLA in Unity

Design, Implementation, and Performance Evaluation of HLA in Unity Linköping University IDA Bachelor Thesis Computer Science Spring 2017 LIU-IDA/LITH-EX-G-17/007--SE Design, Implementation, and Performance Evaluation of HLA in Unity Author: Karl Söderbäck 2017-06-09 Supervisor:

More information

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations

The Level Set Method. Lecture Notes, MIT J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations The Level Set Method Lecture Notes, MIT 16.920J / 2.097J / 6.339J Numerical Methods for Partial Differential Equations Per-Olof Persson persson@mit.edu March 7, 2005 1 Evolving Curves and Surfaces Evolving

More information

Evaluation of BizTalk360 From a business value perspective

Evaluation of BizTalk360 From a business value perspective Linköpings universitet Institutionen för IDA Kandidatuppsats, 16 hp Högskoleingenjör - Datateknik Vårterminen 2018 LIU-IDA/LITH-EX-G--18/069--SE Evaluation of BizTalk360 From a business value perspective

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis Case Study of Development of a Web Community with ASP.NET MVC 5 by Haci Dogan LIU-IDA/LITH-EX-A--14/060--SE 2014-11-28

More information

PIC/FLIP Fluid Simulation Using A Block-Optimized Grid Data Structure

PIC/FLIP Fluid Simulation Using A Block-Optimized Grid Data Structure LiU-ITN-TEK-A--11/055--SE PIC/FLIP Fluid Simulation Using A Block-Optimized Grid Data Structure Fredrik Salomonsson 2011-09-12 Department of Science and Technology Linköping University SE-601 74 Norrköping,

More information

Tablet-based interaction methods for VR.

Tablet-based interaction methods for VR. Examensarbete LITH-ITN-MT-EX--06/026--SE Tablet-based interaction methods for VR. Lisa Lönroth 2006-06-16 Department of Science and Technology Linköpings Universitet SE-601 74 Norrköping, Sweden Institutionen

More information

Creating User Interfaces Using Web-based Technologies to Support Rapid Prototyping in a Desktop Astrovisualization Software

Creating User Interfaces Using Web-based Technologies to Support Rapid Prototyping in a Desktop Astrovisualization Software LiU-ITN-TEK-A--17/062--SE Creating User Interfaces Using Web-based Technologies to Support Rapid Prototyping in a Desktop Astrovisualization Software Klas Eskilson 2017-11-28 Department of Science and

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis Introducing Mock framework for Unit Test in a modeling environment by Joakim Braaf LIU-IDA/LITH-EX-G--14/004--SE

More information

Advanced Visualization Techniques for Laparoscopic Liver Surgery

Advanced Visualization Techniques for Laparoscopic Liver Surgery LiU-ITN-TEK-A-15/002-SE Advanced Visualization Techniques for Laparoscopic Liver Surgery Dimitrios Felekidis 2015-01-22 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Context-based algorithm for face detection

Context-based algorithm for face detection Examensarbete LITH-ITN-MT-EX--05/052--SE Context-based algorithm for face detection Helene Wall 2005-09-07 Department of Science and Technology Linköpings Universitet SE-601 74 Norrköping, Sweden Institutionen

More information

Information visualization of consulting services statistics

Information visualization of consulting services statistics LiU-ITN-TEK-A--16/051--SE Information visualization of consulting services statistics Johan Sylvan 2016-11-09 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Visual Data Analysis using Tracked Statistical Measures within Parallel Coordinate Representations

Visual Data Analysis using Tracked Statistical Measures within Parallel Coordinate Representations Examensarbete LITH-ITN-MT-EX--05/030--SE Visual Data Analysis using Tracked Statistical Measures within Parallel Coordinate Representations Daniel Ericson 2005-04-08 Department of Science and Technology

More information

Large fused GPU volume rendering

Large fused GPU volume rendering LiU-ITN-TEK-A--08/108--SE Large fused GPU volume rendering Stefan Lindholm 2008-10-07 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen för teknik och

More information

Automatic Test Suite for Physics Simulation System

Automatic Test Suite for Physics Simulation System Examensarbete LITH-ITN-MT-EX--06/042--SE Automatic Test Suite for Physics Simulation System Anders-Petter Mannerfelt Alexander Schrab 2006-09-08 Department of Science and Technology Linköpings Universitet

More information

Calibration of traffic models in SIDRA

Calibration of traffic models in SIDRA LIU-ITN-TEK-A-13/006-SE Calibration of traffic models in SIDRA Anna-Karin Ekman 2013-03-20 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen för teknik

More information

Multi-Video Streaming with DASH

Multi-Video Streaming with DASH Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Datateknik 217 LIU-IDA/LITH-EX-G--17/71--SE Multi-Video Streaming with DASH Multi-video streaming med DASH Sebastian Andersson

More information

Overview of Traditional Surface Tracking Methods

Overview of Traditional Surface Tracking Methods Liquid Simulation With Mesh-Based Surface Tracking Overview of Traditional Surface Tracking Methods Matthias Müller Introduction Research lead of NVIDIA PhysX team PhysX GPU acc. Game physics engine www.nvidia.com\physx

More information

Study of Local Binary Patterns

Study of Local Binary Patterns Examensarbete LITH-ITN-MT-EX--07/040--SE Study of Local Binary Patterns Tobias Lindahl 2007-06- Department of Science and Technology Linköpings universitet SE-60 74 Norrköping, Sweden Institutionen för

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis Migration process evaluation and design by Henrik Bylin LIU-IDA/LITH-EX-A--13/025--SE 2013-06-10 Linköpings universitet

More information

Object Migration in a Distributed, Heterogeneous SQL Database Network

Object Migration in a Distributed, Heterogeneous SQL Database Network Linköping University Department of Computer and Information Science Master s thesis, 30 ECTS Computer Engineering (Datateknik) 2018 LIU-IDA/LITH-EX-A--18/008--SE Object Migration in a Distributed, Heterogeneous

More information

Comparing Costs of Browser Automation Test Tools with Manual Testing

Comparing Costs of Browser Automation Test Tools with Manual Testing Linköpings universitet The Institution of Computer Science (IDA) Master Theses 30 ECTS Informationsteknologi Autumn 2016 LIU-IDA/LITH-EX-A--16/057--SE Comparing Costs of Browser Automation Test Tools with

More information

Face detection for selective polygon reduction of humanoid meshes

Face detection for selective polygon reduction of humanoid meshes LIU-ITN-TEK-A--15/038--SE Face detection for selective polygon reduction of humanoid meshes Johan Henriksson 2015-06-15 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

A collision framework for rigid and deformable body simulation

A collision framework for rigid and deformable body simulation LiU-ITN-TEK-A--16/049--SE A collision framework for rigid and deformable body simulation Rasmus Haapaoja 2016-11-02 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Clustered Importance Sampling for Fast Reflectance Rendering

Clustered Importance Sampling for Fast Reflectance Rendering LiU-ITN-TEK-A--08/082--SE Clustered Importance Sampling for Fast Reflectance Rendering Oskar Åkerlund 2008-06-11 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Development of water leakage detectors

Development of water leakage detectors LiU-ITN-TEK-A--08/068--SE Development of water leakage detectors Anders Pettersson 2008-06-04 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen för teknik

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis A systematic literature Review of Usability Inspection Methods by Ali Ahmed LIU-IDA/LITH-EX-A--13/060--SE 2013-11-01

More information

Computer-assisted fracture reduction in an orthopaedic pre-operative planning workflow

Computer-assisted fracture reduction in an orthopaedic pre-operative planning workflow LiU-ITN-TEK-A--17/003--SE Computer-assisted fracture reduction in an orthopaedic pre-operative planning workflow Ludvig Mangs 2017-01-09 Department of Science and Technology Linköping University SE-601

More information

Automatic Clustering of 3D Objects for Hierarchical Level-of-Detail

Automatic Clustering of 3D Objects for Hierarchical Level-of-Detail LiU-ITN-TEK-A--18/033--SE Automatic Clustering of 3D Objects for Hierarchical Level-of-Detail Benjamin Wiberg 2018-06-14 Department of Science and Technology Linköping University SE-601 74 Norrköping,

More information

Audial Support for Visual Dense Data Display

Audial Support for Visual Dense Data Display LiU-ITN-TEK-A--17/004--SE Audial Support for Visual Dense Data Display Tobias Erlandsson Gustav Hallström 2017-01-27 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Slow rate denial of service attacks on dedicated- versus cloud based server solutions

Slow rate denial of service attacks on dedicated- versus cloud based server solutions Linköping University Department of Computer and Information Science Bachelor thesis, 16 ECTS Information technology 2018 LIU-IDA/LITH-EX-G--18/031--SE Slow rate denial of service attacks on dedicated-

More information

Illustrative Visualization of Anatomical Structures

Illustrative Visualization of Anatomical Structures LiU-ITN-TEK-A--11/045--SE Illustrative Visualization of Anatomical Structures Erik Jonsson 2011-08-19 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Multi-Resolution Volume Rendering of Large Medical Data Sets on the GPU

Multi-Resolution Volume Rendering of Large Medical Data Sets on the GPU LITH-ITN-MT-EX--07/056--SE Multi-Resolution Volume Rendering of Large Medical Data Sets on the GPU Ajden Towfeek 2007-12-20 Department of Science and Technology Linköping University SE-601 74 Norrköping,

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis Towards efficient legacy test evaluations at Ericsson AB, Linköping by Karl Gustav Sterneberg LIU-IDA/LITH-EX-A--08/056--SE

More information

A Toolbox of Level Set Methods

A Toolbox of Level Set Methods A Toolbox of Level Set Methods Ian Mitchell Department of Computer Science University of British Columbia http://www.cs.ubc.ca/~mitchell mitchell@cs.ubc.ca research supported by the Natural Science and

More information

Network optimisation and topology control of Free Space Optics

Network optimisation and topology control of Free Space Optics LiU-ITN-TEK-A-15/064--SE Network optimisation and topology control of Free Space Optics Emil Hammarström 2015-11-25 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Department of Electrical Engineering. Division of Information Coding. Master Thesis. Free Viewpoint TV. Mudassar Hussain.

Department of Electrical Engineering. Division of Information Coding. Master Thesis. Free Viewpoint TV. Mudassar Hussain. Department of Electrical Engineering Division of Information Coding Master Thesis Free Viewpoint TV Master thesis performed in Division of Information Coding by Mudassar Hussain LiTH-ISY-EX--10/4437--SE

More information

Creating a Framework for Consumer-Driven Contract Testing of Java APIs

Creating a Framework for Consumer-Driven Contract Testing of Java APIs Linköping University IDA Bachelor s Degree, 16 ECTS Computer Science Spring term 2018 LIU-IDA/LITH-EX-G--18/022--SE Creating a Framework for Consumer-Driven Contract Testing of Java APIs Fredrik Selleby

More information

Storage and Transformation for Data Analysis Using NoSQL

Storage and Transformation for Data Analysis Using NoSQL Linköping University Department of Computer Science Master thesis, 30 ECTS Information Technology 2017 LIU-IDA/LITH-EX-A--17/049--SE Storage and Transformation for Data Analysis Using NoSQL Lagring och

More information

Functional and Security testing of a Mobile Application

Functional and Security testing of a Mobile Application Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Information Technology 2017 LIU-IDA/LITH-EX-G--17/066--SE Functional and Security testing of a Mobile Application Funktionell

More information

Statistical flow data applied to geovisual analytics

Statistical flow data applied to geovisual analytics LiU-ITN-TEK-A--11/051--SE Statistical flow data applied to geovisual analytics Phong Hai Nguyen 2011-08-31 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Analysis of GPU accelerated OpenCL applications on the Intel HD 4600 GPU

Analysis of GPU accelerated OpenCL applications on the Intel HD 4600 GPU Linköping University Department of Computer Science Master thesis, 30 ECTS Computer Science Spring term 2017 LIU-IDA/LITH-EX-A--17/019--SE Analysis of GPU accelerated OpenCL applications on the Intel HD

More information

HTTP/2, Server Push and Branched Video

HTTP/2, Server Push and Branched Video Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Datateknik 2017 LIU-IDA/LITH-EX-G--17/073--SE HTTP/2, Server Push and Branched Video Evaluation of using HTTP/2 Server Push

More information

Optimizing a software build system through multi-core processing

Optimizing a software build system through multi-core processing Linköping University Department of Computer Science Master thesis, 30 ECTS Datateknik 2019 LIU-IDA/LITH-EX-A--19/004--SE Optimizing a software build system through multi-core processing Robin Dahlberg

More information

OMSI Test Suite verifier development

OMSI Test Suite verifier development Examensarbete LITH-ITN-ED-EX--07/010--SE OMSI Test Suite verifier development Razvan Bujila Johan Kuru 2007-05-04 Department of Science and Technology Linköpings Universitet SE-601 74 Norrköping, Sweden

More information

Numerical Methods for (Time-Dependent) HJ PDEs

Numerical Methods for (Time-Dependent) HJ PDEs Numerical Methods for (Time-Dependent) HJ PDEs Ian Mitchell Department of Computer Science The University of British Columbia research supported by National Science and Engineering Research Council of

More information

Markörlös Augmented Reality för visualisering av 3D-objekt i verkliga världen

Markörlös Augmented Reality för visualisering av 3D-objekt i verkliga världen LiU-ITN-TEK-A-14/019-SE Markörlös Augmented Reality för visualisering av 3D-objekt i verkliga världen Semone Kallin Clarke 2014-06-11 Department of Science and Technology Linköping University SE-601 74

More information

BACK AND FORTH ERROR COMPENSATION AND CORRECTION METHODS FOR REMOVING ERRORS INDUCED BY UNEVEN GRADIENTS OF THE LEVEL SET FUNCTION

BACK AND FORTH ERROR COMPENSATION AND CORRECTION METHODS FOR REMOVING ERRORS INDUCED BY UNEVEN GRADIENTS OF THE LEVEL SET FUNCTION BACK AND FORTH ERROR COMPENSATION AND CORRECTION METHODS FOR REMOVING ERRORS INDUCED BY UNEVEN GRADIENTS OF THE LEVEL SET FUNCTION TODD F. DUPONT AND YINGJIE LIU Abstract. We propose a method that significantly

More information

Evaluation of a synchronous leader-based group membership

Evaluation of a synchronous leader-based group membership Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Information Technology Spring 2017 LIU-IDA/LITH-EX-G--17/084--SE Evaluation of a synchronous leader-based group membership protocol

More information

Debug Interface for Clone of DSP. Examensarbete utfört i Elektroniksystem av. Andreas Nilsson

Debug Interface for Clone of DSP. Examensarbete utfört i Elektroniksystem av. Andreas Nilsson Debug Interface for Clone of 56000 DSP Examensarbete utfört i Elektroniksystem av Andreas Nilsson LITH-ISY-EX-ET--07/0319--SE Linköping 2007 Debug Interface for Clone of 56000 DSP Examensarbete utfört

More information

A Back-End for the SkePU Skeleton Programming Library targeting the Low- Power Multicore Vision Processor

A Back-End for the SkePU Skeleton Programming Library targeting the Low- Power Multicore Vision Processor Linköping University Department of Computer Science Master thesis, 30 ECTS Datateknik 2016 LIU-IDA/LITH-EX-A--16/055--SE A Back-End for the SkePU Skeleton Programming Library targeting the Low- Power Multicore

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Bachelor thesis A TDMA Module for Waterborne Communication with Focus on Clock Synchronization by Anders Persson LIU-IDA-SAS

More information

Multi-Volume Rendering in OpenSpace Using A-Buffers for Space Weather Visualizations

Multi-Volume Rendering in OpenSpace Using A-Buffers for Space Weather Visualizations LiU-ITN-TEK-A--17/006--SE Multi-Volume Rendering in OpenSpace Using A-Buffers for Space Weather Visualizations Jonas Strandstedt 2017-02-24 Department of Science and Technology Linköping University SE-601

More information

Automatic analysis of eye tracker data from a driving simulator

Automatic analysis of eye tracker data from a driving simulator LiU-ITN-TEK-A--08/033--SE Automatic analysis of eye tracker data from a driving simulator Martin Bergstrand 2008-02-29 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Semi-automatic code-to-code transformer for Java

Semi-automatic code-to-code transformer for Java Linköping University Department of Computer Science Master thesis, 30 ECTS Datateknik 2016 LIU-IDA/LITH-EX-A--16/031--SE Semi-automatic code-to-code transformer for Java Transformation of library calls

More information

Design Optimization of Soft Real-Time Applications on FlexRay Platforms

Design Optimization of Soft Real-Time Applications on FlexRay Platforms Institutionen för Datavetenskap Department of Computer and Information Science Master s thesis Design Optimization of Soft Real-Time Applications on FlexRay Platforms by Mahnaz Malekzadeh LIU-IDA/LITH-EX-A

More information

An Approach to Achieve DBMS Vendor Independence for Ides AB s Platform

An Approach to Achieve DBMS Vendor Independence for Ides AB s Platform Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Datateknik 2017 LIU-IDA/LITH-EX-G--17/008--SE An Approach to Achieve DBMS Vendor Independence for Ides AB s Platform Niklas

More information

Raspberry pi to backplane through SGMII

Raspberry pi to backplane through SGMII LiU-ITN-TEK-A--18/019--SE Raspberry pi to backplane through SGMII Petter Lundström Josef Toma 2018-06-01 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Implementing a scalable recommender system for social networks

Implementing a scalable recommender system for social networks LiU-ITN-TEK-A--17/031--SE Implementing a scalable recommender system for social networks Alexander Cederblad 2017-06-08 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Visualisation of data from IoT systems

Visualisation of data from IoT systems Linköping University Department of Computer Science Master thesis, 30 ECTS Datateknik 2017 LIU-IDA/LITH-EX-A--17/027--SE Visualisation of data from IoT systems A case study of a prototyping tool for data

More information

weighted minimal surface model for surface reconstruction from scattered points, curves, and/or pieces of surfaces.

weighted minimal surface model for surface reconstruction from scattered points, curves, and/or pieces of surfaces. weighted minimal surface model for surface reconstruction from scattered points, curves, and/or pieces of surfaces. joint work with (S. Osher, R. Fedkiw and M. Kang) Desired properties for surface reconstruction:

More information

Adapting network interactions of a rescue service mobile application for improved battery life

Adapting network interactions of a rescue service mobile application for improved battery life Linköping University Department of Computer and Information Science Bachelor thesis, 16 ECTS Information Technology Spring term 2017 LIU-IDA/LITH-EX-G--2017/068--SE Adapting network interactions of a rescue

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Master s Thesis An Approach on Learning Multivariate Regression Chain Graphs from Data by Babak Moghadasin LIU-IDA/LITH-EX-A--13/026

More information

Towards automatic asset management for real-time visualization of urban environments

Towards automatic asset management for real-time visualization of urban environments LiU-ITN-TEK-A--17/049--SE Towards automatic asset management for real-time visualization of urban environments Erik Olsson 2017-09-08 Department of Science and Technology Linköping University SE-601 74

More information

Interactive GPU-based Volume Rendering

Interactive GPU-based Volume Rendering Examensarbete LITH-ITN-MT-EX--06/011--SE Interactive GPU-based Volume Rendering Philip Engström 2006-02-20 Department of Science and Technology Linköpings Universitet SE-601 74 Norrköping, Sweden Institutionen

More information

Motion Capture to the People: A high quality, low budget approach to real time Motion Capture

Motion Capture to the People: A high quality, low budget approach to real time Motion Capture Examensarbete LITH-ITN-MT-EX--05/013--SE Motion Capture to the People: A high quality, low budget approach to real time Motion Capture Daniel Saidi Magnus Åsard 2005-03-07 Department of Science and Technology

More information

Institutionen för datavetenskap Department of Computer and Information Science

Institutionen för datavetenskap Department of Computer and Information Science Institutionen för datavetenskap Department of Computer and Information Science Final thesis A database solution for scientific data from driving simulator studies By Yasser Rasheed LIU-IDA/LITH-EX-A--11/017

More information

Design and Proof-of-Concept Implementation of Interactive Video Streaming with DASH.js

Design and Proof-of-Concept Implementation of Interactive Video Streaming with DASH.js Linköping University Department of Computer and Information Science Bachelor thesis, 16 ECTS Datateknik 2017 LIU-IDA/LITH-EX-G--17/081--SE Design and Proof-of-Concept Implementation of Interactive Video

More information

Implementation and Evaluation of Bluetooth Low Energy as a communication technology for wireless sensor networks

Implementation and Evaluation of Bluetooth Low Energy as a communication technology for wireless sensor networks Linköpings universitet/linköping University IDA HCS Bachelor 16hp Innovative programming Vårterminen/Spring term 2017 ISRN: LIU-IDA/LITH-EX-G--17/015--SE Implementation and Evaluation of Bluetooth Low

More information

Intelligent boundary extraction for area and volume measurement

Intelligent boundary extraction for area and volume measurement Linköping University Department of Computer Science Master thesis, 30 ECTS Datateknik 2017 LIU-IDA/LITH-EX-A--17/009--SE Intelligent boundary extraction for area and volume measurement Using LiveWire for

More information

Extending the Stream Reasoning in DyKnow with Spatial Reasoning in RCC-8

Extending the Stream Reasoning in DyKnow with Spatial Reasoning in RCC-8 Institutionen för Datavetenskap Department of Computer and Information Science Master s thesis Extending the Stream Reasoning in DyKnow with Spatial Reasoning in RCC-8 by Daniel Lazarovski LIU-IDA/LITH-EX-A

More information

Dynamic Tubular Grid: An Efficient Data Structure and Algorithms for High Resolution Level Sets

Dynamic Tubular Grid: An Efficient Data Structure and Algorithms for High Resolution Level Sets Journal of Scientific Computing ( 2006) DOI: 10.1007/s10915-005-9062-8 Dynamic Tubular Grid: An Efficient Data Structure and Algorithms for High Resolution Level Sets Michael B. Nielsen 1 and Ken Museth

More information

GPU accelerated Nonlinear Soft Tissue Deformation

GPU accelerated Nonlinear Soft Tissue Deformation LiU-ITN-TEK-A--12/020--SE GPU accelerated Nonlinear Soft Tissue Deformation Sathish Kottravel 2012-03-29 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Design of video players for branched videos

Design of video players for branched videos Linköping University Department of Computer and Information Science Bachelor thesis, 16 ECTS Computer Science 2018 LIU-IDA/LITH-EX-G--18/053--SE Design of video players for branched videos Design av videospelare

More information

Evaluation of cloud-based infrastructures for scalable applications

Evaluation of cloud-based infrastructures for scalable applications LiU-ITN-TEK-A--17/022--SE Evaluation of cloud-based infrastructures for scalable applications Carl Englund 2017-06-20 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden

More information

Level Set Methods and Fast Marching Methods

Level Set Methods and Fast Marching Methods Level Set Methods and Fast Marching Methods I.Lyulina Scientific Computing Group May, 2002 Overview Existing Techniques for Tracking Interfaces Basic Ideas of Level Set Method and Fast Marching Method

More information

Real-Time Ray Tracing on the Cell Processor

Real-Time Ray Tracing on the Cell Processor LiU-ITN-TEK-A--08/102--SE Real-Time Ray Tracing on the Cell Processor Filip Lars Roland Andersson 2008-09-03 Department of Science and Technology Linköping University SE-601 74 Norrköping, Sweden Institutionen

More information

Towards Automatic Detection and Visualization of Tissues in Medical Volume Rendering

Towards Automatic Detection and Visualization of Tissues in Medical Volume Rendering Examensarbete LITH-ITN-MT-EX--06/012--SE Towards Automatic Detection and Visualization of Tissues in Medical Volume Rendering Erik Dickens 2006-02-03 Department of Science and Technology Linköpings Universitet

More information

A Cycle-Trade Heuristic for the Weighted k-chinese Postman Problem

A Cycle-Trade Heuristic for the Weighted k-chinese Postman Problem Linköping University Department of Computer Science Bachelor thesis, 16 ECTS Computer Science 2018 LIU-IDA/LITH-EX-G--18/073--SE A Cycle-Trade Heuristic for the Weighted k-chinese Postman Problem Anton

More information

Adaptive Probabilistic Routing in Wireless Ad Hoc Networks

Adaptive Probabilistic Routing in Wireless Ad Hoc Networks LiU-ITN-TEK-A-13/018-SE Adaptive Probabilistic Routing in Wireless Ad Hoc Networks Affaf Hasan Ismail Liaqat 2013-05-23 Department of Science and Technology Linköping University SE-601 7 Norrköping, Sweden

More information

Partial Differential Equations

Partial Differential Equations Simulation in Computer Graphics Partial Differential Equations Matthias Teschner Computer Science Department University of Freiburg Motivation various dynamic effects and physical processes are described

More information

Ad-hoc Routing in Low Bandwidth Environments

Ad-hoc Routing in Low Bandwidth Environments Master of Science in Computer Science Department of Computer and Information Science, Linköping University, 2016 Ad-hoc Routing in Low Bandwidth Environments Emil Berg Master of Science in Computer Science

More information

Permissioned Blockchains and Distributed Databases: A Performance Study

Permissioned Blockchains and Distributed Databases: A Performance Study Linköping University Department of Computer and Information Science Master thesis, 30 ECTS Datateknik 2018 LIU-IDA/LITH-EX-A--2018/043--SE Permissioned Blockchains and Distributed Databases: A Performance

More information

Skåne University Hospital Lund, Lund, Sweden 2 Deparment of Numerical Analysis, Centre for Mathematical Sciences, Lund University, Lund, Sweden

Skåne University Hospital Lund, Lund, Sweden 2 Deparment of Numerical Analysis, Centre for Mathematical Sciences, Lund University, Lund, Sweden Volume Tracking: A New Method for Visualization of Intracardiac Blood Flow from Three-Dimensional, Time-Resolved, Three-Component Magnetic Resonance Velocity Mapping Appendix: Theory and Numerical Implementation

More information

Monte Carlo Simulation of Light Scattering in Paper

Monte Carlo Simulation of Light Scattering in Paper Examensarbete LITH-ITN-MT-EX--05/015--SE Monte Carlo Simulation of Light Scattering in Paper Ronnie Dahlgren 2005-02-14 Department of Science and Technology Linköpings Universitet SE-601 74 Norrköping,

More information

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications Per-Olof Persson (persson@mit.edu) Department of Mathematics Massachusetts Institute of Technology http://www.mit.edu/

More information

Development of a Maxwell Equation Solver for Application to Two Fluid Plasma Models. C. Aberle, A. Hakim, and U. Shumlak

Development of a Maxwell Equation Solver for Application to Two Fluid Plasma Models. C. Aberle, A. Hakim, and U. Shumlak Development of a Maxwell Equation Solver for Application to Two Fluid Plasma Models C. Aberle, A. Hakim, and U. Shumlak Aerospace and Astronautics University of Washington, Seattle American Physical Society

More information

Real-Time Magnetohydrodynamic Space Weather Visualization

Real-Time Magnetohydrodynamic Space Weather Visualization LiU-ITN-TEK-A--17/048--SE Real-Time Magnetohydrodynamic Space Weather Visualization Oskar Carlbaum Michael Novén 2017-08-30 Department of Science and Technology Linköping University SE-601 74 Norrköping,

More information

Evaluating Deep Learning Algorithms

Evaluating Deep Learning Algorithms Linköping University Department of Computer and Information Science Master thesis, 30 ECTS Datateknik 202018 LIU-IDA/LITH-EX-A--2018/034--SE Evaluating Deep Learning Algorithms for Steering an Autonomous

More information

USE OF THE PARTICLE LEVEL SET METHOD FOR ENHANCED RESOLUTION OF FREE SURFACE FLOWS

USE OF THE PARTICLE LEVEL SET METHOD FOR ENHANCED RESOLUTION OF FREE SURFACE FLOWS USE OF THE PARTICLE LEVEL SET METHOD FOR ENHANCED RESOLUTION OF FREE SURFACE FLOWS a dissertation submitted to the program in scientific computing and computational mathematics and the committee on graduate

More information

Machine Learning of Crystal Formation Energies with Novel Structural Descriptors

Machine Learning of Crystal Formation Energies with Novel Structural Descriptors Linköping University The Department of Physics, Chemistry, and Biology Master thesis, 30 ECTS Applied Physics and Electrical Engineering - Theory, Modelling, Visualization 2017 LIU-IFM/LITH-EX-A--17/3427--SE

More information