Download presentation
Presentation is loading. Please wait.
Published byDina Reeves Modified over 9 years ago
1
Methods for the Physically Based Simulation of Solids and Fluids Geoffrey Irving Stanford University May 16, 2007
2
Outline Three topics – Robust finite element simulation – Incompressible deformable solids – Large scale water simulation Solids go first so I get more questions
3
Invertible Finite Elements for Robust Simulation of Large Deformation with Joseph Teran and Ron Fedkiw
4
Goal: Keep Lagrangian Simulations from breaking Finite element method: volumetric objects tessellated with tetrahedra. Simulation only as robust as the worst element. One inversion can halt the simulation.
5
Previous work Mass-spring systems: – Palmerio 1994 - psuedopressure term – Cooper 1997, Molino 2003 - altitude springs Rotated linear finite elements: – Etzmuss 2003, Muller 2004 – used polar decomposition to fix rotation errors from linearization ALE and remeshing: – Hirt 1974, Camacho 1997, Espinoza 1998
6
Why not masses and springs? Altitude springs or psuedopressure terms work well: fast and robust. Unless you want to change the material behavior. Harder to add plasticity, biphasic response for flesh, etc. No intuitive relationship between different force components.
7
Our approach: Invertible finite elements Start with standard finite elements. Forces on nodes result from stress in each tetrahedron. Modify stress to behave correctly through inversion. Resulting forces reasonable for all possible configurations (inverted, flat, line, point, etc.).
8
Example
9
Outline State of each tetrahedron given by deformation gradient F (3x3 matrix). Diagonalize F to remove rotations: F = UF D V T Use first Piola-Kirchhoff stress: P = UP D V T Forces on nodes are linear in P: G = PB m
10
Deformation Gradient: F Maps vectors in material space to world space. deformed (world coordinates) undeformed (material coordinates)
11
Standard approach: Green Strain We could write stress in terms of Green strain 1/2(F T F-I). Bad for two reasons: – Already nonlinear in deformation. – Can’t detect inversion! Instead, we write stress P directly in terms of F, and ignore strain.
12
Diagonalization of F Isotropic materials are invariant under rotations of material and world space, but not under reflections. Standard SVD gives F = UF D V T with – V a pure rotation – U a pure rotation or a reflection – Diagonal F D with all positive entries If U is a reflection, we negate an entry of F D and the corresponding column of U. Heuristic: choose smallest entry of F D to make tetrahedron recover as quickly as possible.
13
Diagonalization of F SVD must be robust to zero or duplicate singular values.
14
First Piola-Kirchhoff Stress For an isotropic model, diagonal F D gives a diagonal stress P D. Can consider one stress component at a time. St. Venant-Kirchhoff useless for large compression.
15
First Piola-Kirchhoff Stress Better models have a singularity at the origin Adds severe stiffness Still dies if numerical errors cause inversion.
16
First Piola-Kirchhoff Stress We fix this by extrapolating the curve through inversion after a threshold. Diagonalization makes this easy for any model.
17
Constant vs. linear extrapolation In practice, constant extrapolation fails. Energy function not strictly convex. Slightly deformed tetrahedra can improve at the cost of inverted tetrahedra. Tangling results in incoherent inversion directions. Model explodes slowly.
18
Force Computation Given a correct diagonal stress P D, the forces can be computed as G = PB m = UP D V T B m B m is a matrix depending only on the rest state of the tetrahedron. Since forces are linear in P, robust P means robust forces.
19
Element inversion is physical continuous deformation by grey colored object discrete version illustrates element inversion
20
Results Elastic sphere compressed between two gears.
21
Results Buddha model compressed between two gears.
22
Results Buddha model colliding with kinematic sphere.
23
Damping and anisotropy Damping forces computed analogously to elastic forces. Difficult to conserve angular momentum during damping for flat or inverted elements, but no visual artifacts from lack of conservation. For anisotropic constitutive models, use V to rotate anisotropic terms into diagonal space.
24
Results: anisotropy Anisotropic constitutive model for muscles.
25
Plasticity We use multiplicative plasticity: F = F e F p Elastic forces computed from elastic deformation F e. Plastic deformation F p clamped away from inversion to ensure robustness. Plasticity can be controlled by accepting only deformations that move towards a target shape.
26
Results: plasticity Plastic sphere controlled towards a disk shape.
27
Results: plasticity A more obvious example of plasticity control
28
Results: plasticity Plastic shell compressed between two gears.
29
Generalization to other elements Inversion fixes modify underlying PDE. Any (Lagrangian) discretization can be applied to the new PDE. For other element types, modified P(F) is evaluated at each Gauss point.
30
Results: hexahedra Hexahedral mesh collapsing into a puddle.
31
Conclusions Simple method for robust FEM: – Diagonalize F to remove rotations. – Modify first Piola-Kirchhoff stress P for inversion. Diagonal setting helps intuition. Works for arbitrary constitutive models, including anisotropy. Easy to add plasticity and plasticity control.
32
Volume Preserving Finite Element Simulations of Deformation Models with Craig Schroeder and Ron Fedkiw
33
Motivation Virtual humans increasingly important – Stunt doubles – Virtual surgery Most biological tissues incompressible – Muscles, skin, fat Volume preservation is local – Conserving total volume insufficient
34
Motivation Important principle of animation Lasseter 1987: “The most important rule to squash and stretch is that, no matter how squashed or stretched out a particular object gets, its volume remains constant.”
35
Three main challenges Volumetric locking – Incompressibility aliases with other modes – Turns entire object rigid Volume preservation infinitely stiff – Implicit integration necessary – Might introduce oscillations in other modes Not the only infinite force (collisions)
36
Our approach Volumetric locking – Caused by too many constraints – Conserve volume per node (one-ring) – Fewer constraints: no locking Volume preservation stiffness – Use separate implicit solves for position and velocity – Cancels errors without introducing oscillations – Analogous to projection method in fluids Incorporate collisions into linear solves
37
Example
38
Previous work Spring-like forces for volume preservation – Cooper and Maddock 1997, many others Quasi-incompressibility – Simo and Taylor 1991 – Weiss et al. 1996, Teran et al. 2005: muscle simulation Per-node pressure variables – Bonet and Burton 1998: averaged nodal pressure – Lahiri et al. 2005: variational integrators – Cockburn et al. 2006: discontinuous Galerkin
39
Basic setup Start with linear tetrahedral elements – Position, velocity located at each node – Elastic forces computed per tetrahedron Preserve volume of each one-ring
40
Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results
41
Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results
42
Time discretization Start with any time integration scheme Add two new steps: – When updating position, solve for pressure to correct volume loss – After updating velocity, solve for pressure to correct divergence Correspond to elastic and damping forces
43
Volume correction Add volume correction to position step Set final volume equal to rest volume
44
Volume correction Want to linearize Time derivative of volume is divergence: Linearization is div is integrated divergence
45
Volume correction Volume correction is gradient of pressure Gives Poisson equation for pressure Solve with conjugate gradient
46
Volume correction All volume error corrected in one step O( x) errors give O(1) values of x Do not use x to update v!
47
Divergence correction Once volume error is removed, adjust velocity to avoid future change Same as before except no volume term This is a pure projection
48
Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results
49
Volumetric locking Obvious approach: preserve volume of each tetrahedron This approach fails – Mesh has N nodes, 4-5N tetrahedra – 3N degrees of freedom – At least 4N constraints – 4N > 3N – Excessive artificial stiffness
50
Volumetric locking Poisson’s ratio 0.3, volume forces per-tetrahedron
51
Volumetric locking Poisson’s ratio 0.499, volume forces per-tetrahedron
52
One-rings: no locking Could use higher order elements – Loses simplicity Instead, just preserve volume at each node – 3N degrees of freedom – N constraints – No locking
53
One-rings: no locking Poisson’s ratio 0.5, volume preserved per one-ring
54
Spatial discretization Poisson equation is Need to define V, div, grad
55
Divergence Measuring one-ring volume is easy Define volume-weighted divergence as the gradient of the volume function Equivalent to integrating pointwise divergence over each one-ring
56
Gradient Can’t define gradient with volume integral – Single tetrahedron would have constant gradient – Wrong boundary conditions – Violates momentum conservation Instead, define – div maps velocity to pressure – grad maps pressure to velocity Results in symmetric linear systems
57
Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results
58
The problem Incompressibility is infinitely strong Collisions are infinitely stronger Volume correction tries to cause large interpenetration every time step Self-collisions fight back… …Jagged, tangled surfaces
59
Contact constraints Make pressure forces collision-aware Projection matrix P removes normal component of velocity at each contact New pressure solves coupled between colliding objects
60
Contact constraints Particle-object, point-triangle, edge-edge Common form:
61
Enforcing contact constraints Projecting out one normal component is easy N constraints C T v = 0 hard Need to invert NxN matrix C T M -1 C Much too slow for every CG iteration
62
Gauss-Seidel Luckily, don’t need exact answer A few Gauss-Seidel sweeps is sufficient But Gauss-Seidel breaks symmetry – don’t commute – Can’t use in CG
63
Symmetric Gauss-Seidel Solution: alternate sweeps Symmetric even if it doesn’t converge 4 iterations sufficed Fast enough for use inside CG
64
Outline Time Discretization Spatial Discretization Collisions and Contact Discussion and Results
65
Results: varying stiffness High stiffness
66
Results: varying stiffness Medium stiffness
67
Results: varying stiffness Low stiffness
68
Results: rigid body collisions
69
Results: self-collisions
70
Singularities Pressure matrix not always positive definite Too many collisions can cause singularities Solution: use MINRES instead of CG Doesn’t require definiteness Stable for large examples
71
Results: 100 tori
72
Conclusions Keep simplicity of constant strain tetrahedra Enforce volume preservation per node – Avoids locking Separate treatment of volume and divergence – Position errors don’t cause huge velocities Make pressure solve collision aware – Symmetric Gauss-Seidel usable inside MINRES
73
Efficient Simulation of Large Bodies of Water by Coupling Two and Three Dimensional Techniques with Eran Guendelman, Frank Losasso, and Ron Fedkiw
74
Motivation Large scale water phenomena important – Rivers, lakes, oceans, floods Fast option: height field methods – Nice wave propagation – Can’t handle overturning Accurate option: 3D Navier Stokes – Captures three dimensional behavior – Slow at high resolutions: O(N 4 )
75
Solution: use both Uniform 3D Navier-Stokes near interface Coarsen elsewhere using tall cells uniform tall cells
76
Solution: use both
77
Related work: 2D Deep water – Fournier and Reeves 1986, Peachy 1986 – Recent: Thon et al. 2000, Hinsinger 2002 Shallow Water – Kass and Miller 1990, O’Brien and Hodgins 1995 Rivers and streams – Chen and Lobo 1994, Thon and Ghazanfarpour 2001
78
Related work: 3D Uniform Navier-Stokes water – Foster and Metaxas 1997, Foster and Fedkiw 2001 – Enright et. al 2002: Particle level set method Large bodies of water – Takahashi et al. 2003: spray and foam – Mihalef et al. 2004: breaking waves Adaptive simulation – Losasso et al. 2004: Octree grids – Houston et al. 2006: Run-Length Encoded (RLE) grids
79
Why height fields work Water likes to stay flat Only water-air interface is visible Vertical structure simpler than horizontal
80
Mixing height fields and 3D Specify “optical depth” where we expect turbulent motion Use uniform 3D cells within optical depth Use height field model elsewhere optical depth
81
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
82
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
83
Grid structure Start with uniform MAC grid Keep cells within optical depth of the interface Outside optical depth, merge vertical sequences of cells into single tall cells
84
Grid structure: storing values Start with MAC grid storage – Level set values in cell centers near interface – Pressure values in cell centers – Velocity components on corresponding faces
85
Grid structure: pressure Two pressure samples per tall cell Linear interpolation between Allows
86
Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)
87
Grid structure: velocity Velocity corresponds to pressure gradients Horizontal velocity (u and w)Vertical velocity (v)
88
Refinement and coarsening Grid is rebuilt whenever fluid moves based on current level set Linear time (Houston et al. 2006) Velocity must be transferred to new grid – optionally transfer pressure as initial guess
89
Transferring velocity InterpolateLeast squares Main criterion: conserve momentum
90
Transferring velocity (cont) Interpolate: Least squares:
91
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
92
Uniform solver Navier-Stokes equations for velocity: Level set equation: Standard uniform MAC grid within uniform band Level set exists only in uniform cells
93
Uniform solver (cont) Advect velocity and add gravity – use semi-Lagrangian for uniform cells (Stam 1999) Solve Laplace equation for pressure Apply pressure correction to velocity
94
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
95
Tall cell advection Can’t use semi-Lagrangian for tall cells Use conservative method for plausible motion Simplest option: first order upwinding Ignored by semi-Lagrangian
96
First order upwinding (uniform) Average to control volume face Compute flux based on upwind velocity Adjust velocities based on flux
97
First order upwinding (tall cells) Pretend to do the following – Refine to uniform grid – Advect – Coarsen back to original grid Simulate this by applying least squares directly to uniform discretization Same answer but faster
98
Advection issues Occasional instabilities near steep terrain Fix by clamping to affine combination
99
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
100
Pressure solve on tall cells Pressure projection is Need to define two operations: – Gradient (pressure to velocity) – Divergence (velocity to pressure)
101
Pressure solve: gradient Gradient is easy:
102
Pressure solve: divergence
103
Pressure solve: Laplacian Compose divergence and gradient to get linear system Symmetric and positive definite since we used the same weights in both Solve using preconditioned conjugate gradients
104
Outline Grid structure Uniform solver Advection on tall cells Pressure solver on tall cells Parallel implementation Discussion and Results
105
Parallelize only along horizontal dimensions – No harder than parallelizing a uniform code – Vertical dimension already cheap Exchange data with neighbors every step Solve for pressure on all processors globally Parallel implementation
106
Results: splash (300 x 200) Optical depth equal to water depth
107
Results: splash (300 x 200) Optical depth 1/4 th water depth
108
Results: splash (300 x 200) fully refined 1/4 th refined
109
Results: splash (300 x 200) Optical depth 1/16 th water depth
110
Results: deep splash Water depth doubled
111
Results: boat (1500 x 300) Vortex particles from Selle et al. 2005
112
Matching bottom topography Tall cells match ground for free Octrees would require extra refinement Less important in very deep water
113
Results: river (2000 x 200)
115
Comparison with octrees Advantages over octrees: – Easy to parallelize – Reduces to MAC discretization with refinement – Matches bottom topography for free Main disadvantage: relies on vertical simplicity for efficiency Not applicable for all flows – rising bubbles, colliding droplets, etc.
116
Conclusion Want high resolution near interface – Uniform interface resolution sufficient Plausible bulk motion enough elsewhere Many flows have simple vertical structure Use this to create hybrid 2D/3D method
117
Future work Improved advection scheme – Match ENO/WENO schemes for shallow water Better parallelism – Remove global linear system solve Find optimal adaptive structure – Hybrid RLE / octree grid?
118
Acknowledgements Weronika Ron Fedkiw My committee: Adrian Lew, Leo Guibas, Matt West, Michael Kass Co-authors: Joey Teran, Eftychis Sifakis, Frank Losasso, Eran Guendelman Craig Schroeder, Tamar Shinar, Andrew Selle, Jonathan Su Stanford Physically-Based Modeling group Neil, Josh, Igor, Duc, Fred, Sergey, Rachel, Avi, Jerry, Nipun Pixar Research Group John Anderson, Tony DeRose, Michael Kass, Andy Witkin, Mark Meyer Funding agencies – NSF, ONR, ARO, Packard and Sloan Foundations
119
The End Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.