1 / 55

Simulation and Animation

Simulation and Animation. Soft Body Simulation. Motivation. Applications of Deformable Objects Entertainment Movies Pixar: Shrek, Nemo , The Incredibles … Computer games Virtual simulator Medicine Surgery, therapy, registration Computational science Buildings, bridges.

braima
Download Presentation

Simulation and Animation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simulation and Animation Soft Body Simulation

  2. Motivation Applications of Deformable Objects • Entertainment • Movies • Pixar: Shrek, Nemo, The Incredibles… • Computer games • Virtual simulator • Medicine • Surgery, therapy, registration • Computational science • Buildings, bridges

  3. Deformation Models • The first physically realistic model was introduced to computer graphics in 1987 • Mathematically deformation can be described as a time-varying vector valued function F(x, t) x is the material coordinate F is the world coordinate u is the displacement vector

  4. Dynamic Simulations Lagrange Equation of Motion: External forces are in equilibrium with internal forces composed of elastic force, damping force and acceleration force. K : Stiffness C : Damping M : Mass

  5. Mass-Spring systems Body is modeled by masses linearly linked by springs with freely rotation springs.

  6. Mass-spring simulation • Spring Link • Edge = spring • Vertex = mass • Hooke´slaw • Scalar Spring stiffness D

  7. Mass-spring simulation • Volume preservation • Introducevolumeforces • Scalar Volume stiffnessDv Fi Fv Fi Fi

  8. Time Integration • Verlet Integration (per vertex) – explicit scheme • Easy & fast • Numericalaccuracyiscritical • Timestepshavetobesmall (explicit scheme)  Fasteraccumulationofroundingerrors • Dampingnecessary

  9. Positions Forces Algorithm Forever // Force calculation foreveryvertex calculateforce endfor // Time integration foreveryvertex update position endfor endfor

  10. Mass-Spring systems • Body is modeled by masses linearly linked by springs • Advantage: • Simple • Disadvantages: • Realistic physical properties difficult to model • Unstable Explicit Integration for stiff materials

  11. Excursion

  12. Data structures • Howtostore per-vertexadjacencyinformation? • IncidentEdges • Calculationofvolumeforcesproblematic • Incidenttetrahedra • Calculationof spring andvolumeforces • Store tetrahedra (edges) directly(not onlyindicesinto a sharededge/tetrahedralist) • Memory consuming, but avoids additional dependencylevel • Disadvantages • Tetrahedraarestored multiple times • #Neighborsis not constant

  13. Data structures (cont.)

  14. Data structures (cont.) • Sort vertices according to their valence • Stack of textures thatgets smaller to the top • Reduces memory overhead • Further optimization • Early z-test

  15. Force calculation forevery point p0 forevery tetrahedron t incident on p0 // via four texture fetches get center vertex coordinate p0 get corner indices i1-3, get element stiffness es get rest spring lengths l1-3, get rest volume v // via three dependent fetches get coordinates of p1-3 through i1-3 calculate force on p0 add to total force on p0 endfor endfor

  16. Results

  17. Finite Stuff…

  18. Finite difference method FDM Remember FDM from CFD

  19. CFD – Computational Fluid Dynamics • Discretization • Layout ofgridpoints on a grid • Locationofdiscretepointsacrossthedomain • Arbitrarygridscanbeemployed • Structured orunstructuredgrids • Implicitor explicit representationoftopology (adjacencyinformation) • Uniform grids: uniform spacingofgridpoints in x and y y Pij+1 Pi-1j+1 Pi+1j+1 y Pij Pi-1j Pi+1j y = x Pij-1 Pi-1j-1 Pi+1j-1 x x

  20. CFD – Computational Fluid Dynamics • Finite differences • Approximate partial derivatives by finite differencesbetweenpoints • Derivedbyconsideringthe Taylor expansion

  21. CFD – Computational Fluid Dynamics • Finite differences for higher order and mixed partial derivatives

  22. CFD – Computational Fluid Dynamics • Differenceequations - example • The 2D waveequation Partial Differential Equation Discretization on a 2D CartesiangridsyieldsDifferenceEquation

  23. Finite Elements method (FEM)?

  24. FEM • FEM is a method used for finding approximate solution of partial differential equations (PDE) • Method: split the domain into a (possibly large) but finite number of elements (triangles, rectangles, tetrahedra, hexahedra, etc.) • Good for • complex domains (cars, planes, parts) • Dynamic domains (soft bodies, moving boundaries) • when the desired precision varies over the entire domain

  25. FEM • Split into the domain into a finite number of elements • Define shape functions (Interpolations- funktionen) in elements (e.g. barycentric interpolation) • Approximate PDE solution between the sample points by the shape function with the sample points as variables. • Compute partial derivative based on interpolated solution

  26. FEM • Multiply PDE with “test function” • Spacial Integration (over p) over partial derivatives within finite element • Result: element equation (not dependent on p anymore) • Combine element equations into a single global equation system (via shared sample points) • Solve this (possibly non linear) system

  27. FEM vs. FDM • FDM is an approximation to the differential equation; the finite element method is an approximation to its solution. • FEM is its able to handle complex geometries (and boundaries), FDM in its basic form is restricted to handle rectangular shapes and simple alterations thereof • FDM can be very easy to implement. • FDM can be seen as a special case of the FEM approach • there are reasons to consider the mathematical foundation of the FEM more sound, for instance, because the quality of the approximation between grid points is poor in FDM. • The quality of a FEM approximation is often higher than in the corresponding FDM approach, but this is extremely problem dependent and several examples to the contrary can be provided

  28. Mass-spring systems • Pros • Fast • No pre-process • GPU Implementation • Cons • Volume not considered • Physical laws violated! • Material Properties hard tochoose • Spring constants vs. elastic modulus • Stable simulation requires very small time steps • performance gets worse than expected • almost impossible for stiff material

  29. To the next level …

  30. Elasticity theory •  : Total energy • u(x) : Displacement field • f(x) : External (surface) forces • g(x) : Volumetric forces (e.g. gravity) • (u) : Linearized notation strain tensor E • D : Material law (Hooke‘s law)

  31. Elasticity theory: Terms • 2nd Term: (Distant) Volume Forcese.g. Gravity, Linear/Angular Momentum, magnetic/electric fields • 3rd Term: (Direct) Surface Forcese.g. push/pull, collision/contact

  32. Now consider only the first part … Elastic Energy:

  33. Elasticity theory cont. Strain (Dehnung) Tensor Edescribes elongations ofinfinitesimal small volumeelement along coordinates axes y Eyy Eyx Exy Eyz Ezy Exx x Exz Ezx Ezz z

  34. Elasticity theory cont. Stress (Spannung) Tensor internal forces acting on coordinate planes y yy  yx  xy  yz  zy  xx x  xz  zx  zz z

  35. Elasticity theory cont. Material Law • Strain Tensor E and Stress Tensor  arecoupled via Hooke‘s law • ,  : Lamé coefficients “deformation” “elongation along axes”

  36. Elasticity theory cont. Lamé coefficients • derived from elasticity modulus Emand Poisson‘s ratio (Querkontraktion) 

  37. Elastic Modulus Em… … is a measure of the stiffness of a given material, not of a given part.

  38. Poisson‘s ratio…

  39. Auxetic Materials

  40. Linearized Notation • E is a symmetric tensor using only upper triangular part is sufficient

  41. Intuition: Elastic Energy • We haveyou can think if this integral as

  42. Strain Formulations • Cauchy strain (linear, constant matrix) • BroNielsen ’96 • Corotated Cauchy strain (linear, dynamic matrix) • Rankin ’88, Müller ’02, Hauth ’04 • Green strain (non-linear, dynamic matrix)

  43. Linear approximation of Strain • Cauchy Strain • ignores non linear part • looses rotational invariance

  44. Linear approximation of Strain Linear vs. non-linear vs. co-rotational strain

  45. Back to FEM So far: • considered continuous elasticity Now: • discretize to a finite number of cells/elements Remember: • We are looking primarily for u (displacement vector)

  46. FEM Consider the continuous u as: • a set of supporting points (FEM vertices) • a continuum in between the supporting points generated from the interpolation of u at the supporting points  big difference to finite differences here!!

  47. FEM Elements:

  48. Considering a single element Can use tetrahedron  barycentric interpolation

  49. Remember this slide? • Split into the domain into a finite number of elements • Define shape functions in elements • Approximate PDE solution between the sample points by the shape function with the sample points as variables. • Compute partial derivative based on interpolated solution

  50. Tet - FEM

More Related