Sei sulla pagina 1di 173

Meshless ApproximationMethods andApplicationsinPhysicsBased ModelingandAnimation

BartAdams MartinWicke

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

PartI:Meshless Approximation Methods

Meshless Approximations
Approximateafunctionfromdiscretesamples

1D

2D,3D

Useonlyneighborhoodinformation

Meshless ApproximationMethods
SmoothedParticleHydrodynamics(SPH)
simple,efficient,noconsistencyguarantee popularinCGforfluidsimulation

Meshfree MovingLeastSquares(MLS)
alittlemoreinvolved,consistencyguarantees popularinCGforelastoplasticsolidsimulation

Meshless ApproximationMethods

FluidsimulationusingSPH

ElasticsolidsimulationusingMLS

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

SmoothedParticle Hydrodynamics

SmoothedParticleHydrodynamics(SPH)
Integralrepresentationofascalarfunctionf

Dirac deltafunction

SmoothedParticleHydrodynamics(SPH)
ReplaceDirac byasmoothfunctionw

Desirablepropertiesofw
1. compactness: 2. deltafunctionproperty: 3. unitycondition(setf to1): 4. smoothness

SmoothedParticleHydrodynamics(SPH)
Example:designingasmoothingkernelin2D
Forsimplicityset Wepick Satisfytheunityconstraint(2D)

SmoothedParticleHydrodynamics(SPH)
Particleapproximationbydiscretization

SmoothedParticleHydrodynamics(SPH)
Example:densityevaluation

SmoothedParticleHydrodynamics(SPH)

SmoothedParticleHydrodynamics(SPH)
Derivatives
replaceby
Z

linear,productrule

SmoothedParticleHydrodynamics(SPH)
Particleapproximationforthederivative

Someproperties:
simpleaveragingoffunctionvalues onlyneedtobeabletodifferentiatew gradientofconstantfunctionnotnecessarily0
willfixthislater

SmoothedParticleHydrodynamics(SPH)
Example:gradientofoursmoothingkernel
Wehave with Gradientusingproductrule:

SmoothedParticleHydrodynamics(SPH)
Alternativederivativeformulation
Oldgradientformula: Productrule: Use(1)in(2): (1) (2)

Gradientofconstantfunctionnowalways0.

SmoothedParticleHydrodynamics(SPH)
Similarly,startingfrom

Thisgradientissymmetric:

SmoothedParticleHydrodynamics(SPH)
Otherdifferentialoperators
Divergence

Laplacian

SmoothedParticleHydrodynamics(SPH)
Problem:Operatorinconsistency
Theoremsderivedincontinuoussettingdonthold

Solution:Deriveoperatorsforspecificguarantees

SmoothedParticleHydrodynamics(SPH)
Problem:particleinconsistency
constantconsistencyincontinuoussetting

doesnotnecessarilygiveconstantconsistencyin discretesetting(irregularsampling,boundaries)

Solution:seeMLSapproximation

SmoothedParticleHydrodynamics(SPH)
Problem:particledeficienciesnearboundaries
integral/summationtruncatedbytheboundary
example:wrongdensityestimation

Solution:ghostparticles
real particles

boundary

ghost particles

SPHSummary(1)
Ascalarfunctionf satisfies

ReplaceDirac byasmoothfunctionw

Discretize

SPHSummary(2)
Functionevaluation:

Gradientevaluation:

SPHSummary(3)
Furtherliterature
SmoothedParticleHydrodynamics,Monaghan,1992 SmoothedParticles:Anewparadigmforanimatinghighlydeformablebodies, Desbrun &Cani,1996 SmoothedParticleHydrodynamics,AMeshfree ParticleMethod,Liu&Liu,2003 ParticleBasedFluidSimulationforInteractiveApplications,Mller etal.,2003 SmoothedParticleHydrodynamics,Monaghan,2005 AdaptivelySampledParticleFluids,Adamsetal.,2007 FluidSimulation,Chapter7.3inPointBasedGraphics,Wicke etal.,2007 Manymore

Preview:ParticleFluidSimulation
SolvetheNavierStokesmomentumequation

Lagrangian pressure viscosity gravity derivative force force

Preview:ParticleFluidSimulation
Discretized andsolvedatparticlesusingSPH

densityestimation

pressureforce

viscosityforce

Preview:ParticleFluidSimulation

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

MovingLeastSquares

Meshless Approximations
Sameproblemstatement: Approximateafunctionfromdiscretesamples

1D

2D,3D

MovingLeastSquares(MLS)
Movingleastsquaresapproach

Locallyfitapolynomial

Byminimizing

MovingLeastSquares(MLS)

Solution: with Approximation:

MovingLeastSquares(MLS)
Approximation:

withshapefunctions

weightfunction completepolynomialbasis

momentmatrix

byconstructiontheyareconsistent uptotheorderofthebasis byconstructiontheybuildapartitionofunity

Demo
(demoshapefunctions)

MovingLeastSquares(MLS)

MovingLeastSquares(MLS)
Derivatives

MovingLeastSquares(MLS)
Consistency
havetoprove: or:

MovingLeastSquares(MLS)
Problem:momentmatrixcanbecomesingular
Example:
particlesinaplanein3D Linearbasis

MovingLeastSquares(MLS)
Stablecomputationofshapefunctions

translatebasisby scaleby

Itcanbeshownthatthismomentmatrixhas alowerconditionnumber.

MLSSummary

MLSSummary(2)
Literature
MovingLeastSquareReproducingKernelMethods(I)Methododology and Convergence,Liuetal.,1997 MovingLeastSquaresParticleHydrodynamicsI.ConsistencyandStability, Dilts,1999 ClassificationandOverviewofMeshfree Methods,Fries&Matthies,2004 PointBasedAnimationofElastic,PlasticandMeltingObjects,Mller etal.,2004 Meshless AnimationofFracturingSolids,Pauly etal.,2005 Meshless ModelingofDeformableShapesandtheirMotion,Adamsetal.,2008

Preview:ElasticSolidSimulation

Preview:ElasticSolidSimulation

Preview:ElasticSolidSimulation

PartI:Conclusion

SPH MLSComparison

SPH

MLS

local fast simpleweighting notconsistent

local slower matrixinversion(canfail) consistentuptochosenorder

Lagrangian vs Eulerian Kernels


Lagrangian kernels
neighborsremainconstant

Eulerian kernels
neighborschange

[Fries&Matthies 2004]

Lagrangian vs Eulerian Kernels


Lagrangian kernelsareOKforelasticsolid simulations,butnotforfluidsimulations

[Fries&Matthies 2004]

MovingLeastSquaresParticle Hydrodynamics(MLSPH)
UseideaofvariablerankMLS
(SPH)

(MLS)

startforeachparticlewithbasisofhighestrank ifinversionfails,lowerrank Consequence:shapefunctionsarenotsmooth

TutorialOverview
MeshlessMethods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

SearchDataStructures

SearchforNeighbors
Approximateintegralsusingsumsoversamples
Bruteforce:O(n2) Localkernelswithlimitedsupport Sumonlyoverneighbors:O(nlog n)

Findingneighborsefficientlykey

SearchDataStructures

Spatialhashing
limitedadaptivity cheapconstruction andmaintenance

kdtrees
moreadaptive,flexible moreexpensiveto buildandmaintain

SpatialHashing:Construction

H(i,j)
i,j

SpatialHashing:Query

SpatialHashing:Query

SpatialHashing
Noexplicitgridneeded
Particularlyusefulforsparsesampling Hashcollisionsleadtospurioustests

Gridspacings adaptedtoqueryradiusr

d=2r 2d cellssearched

d=r 3d cellssearched

kdTrees:Construction

kdTrees:Query

Comparison
Spatialhashing:
constructfromn points:O(n) insert/movesinglepoint:O(1) query:O(r)foraveragepointdensity hashtablesizeandcellsizemustbeproperlychosen

kdTrees:
constructfromn points:O(n logn) query:O(k logn)fork returnedpoints handlesvaryingquerytypesorirregularsampling

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

Application1:

ParticleFluidSimulation

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

FluidSimulation

Eulerian vs.Lagrangian
Eulerian Simulation
Discretization ofspace Simulationmeshrequired Betterguarantees/operatorconsistency Conservationofmassproblematic Arbitraryboundaryconditionshard

Eulerian vs.Lagrangian
Lagrangian Simulation
Discretization ofthe material Meshless simulation Noguaranteeson consistency Masspreserved automatically(particles) Arbitraryboundary conditionseasy(per particle)

NavierStokesEquations
Momentumequation:

Continuityequation:

ContinuityEquation
Continuumequationautomaticallyfulfilled
Particlescarrymass Noparticlesadded/deleted Nomassloss/gain

CompressibleFlow
Often,incompressibleflowisabetterapproximation Divergencefreeflow(later)

MomentumEquation

Lefthandsideismaterialderivative
Howdoesthevelocityofthispieceoffluidchange? UsefulinLagrangian setting

MomentumEquation

InstanceofNewtonsLaw Righthandsideconsistsof
Pressureforces Viscosityforces Externalforces

DensityEstimate
SPHhasconceptofdensitybuiltin

i =

X
j

wij mj

Particlescarrymass Densitycomputedfromparticledensity

Pressure
Pressureactstoequalizedensitydifferences

p = K( 0

1)

CFD: =7,computergraphics: =1 largeKand requiresmalltimesteps

PressureForces

p Discretize ap =

UsesymmetricSPHgradientapproximation

Preserveslinearandangularmomentum

PressureForces
Symmetricpairwise forces:allforcescancelout
Preserveslinearmomentum

xi xj Pairwise forcesactalong
Preservesangularmomentum

Viscosity

Discretize usingSPHLaplace approximation

Momentumpreserving Veryunstable

XSPH(artificialviscosity)
Viscosityanartifact,notsimulationgoal Viscosityneededforstability Smoothesvelocityfield Artificialviscosity:stablesmoothing

Integration
Updatevelocities

Artificialviscosity

Updatepositions

BoundaryConditions
Applytoindividualparticles
Reflectoffboundaries

2waycoupling
Applyinverseimpulsetoobject

SurfaceEffects
Densityestimatebreaksdownatboundaries Leadstohigherparticledensity

SurfaceExtraction
Extractisosurfaceofdensityfield Marchingcubes

Demo
(sph)

Extensions
AdaptiveSampling[Adamsetal08] Incompressibleflow[Zhuetal05] Multiphaseflow[Muelleretal05] Interactionwithdeformables [Muelleretal04] Interactionwithporousmaterials

[Lenaerts etal08]

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

Application2:

ElasticSolidSimulation

Goal
Simulateelasticallydeformableobjects

Goal
Simulateelasticallydeformableobjects efficientandstablealgorithms ~ differentmaterials
elastic,plastic,fracturing

~ highlydetailedsurfaces

ElasticityModel
Whatarethestrainsandstresses foradeformedelasticmaterial?

ElasticityModel
Displacementfield

ElasticityModel
Gradientof displacementfield

ElasticityModel
GreenSaintVenant nonlinearstraintensor

symmetric3x3matrix

ElasticityModel
StressfromHookes law

symmetric3x3matrix

ElasticityModel
Forisotropicmaterials

YoungsmodulusE Poissonsratiov

ElasticityModel
Strainenergydensity

Elasticforce

ElasticityModel
Volumeconservation force

preventsundesirable shapeinversions

ElasticityModel
FinalPDE

ParticleDiscretization

SimulationLoop

SurfaceAnimation
Twoalternatives
UsingMLSapproximationof displacementfield Usinglocalfirstorderapproximationof displacementfield

SurfaceAnimation Alternative1
SimplyuseMLSapproximation ofdeformationfield

Canusewhateverrepresentation: trianglemeshes,pointclouds,

SurfaceAnimation Alternative1
Vertexpositionupdate

Approximatenormalupdate
firstorderTaylorfordisplacementfieldatnormaltip tipistransformedto

SurfaceAnimation Alternative1
EasyGPUImplementation

scalars remainconstant

onlyhavetosendparticledeformationstotheGPU

SurfaceAnimation Alternative2
UseweightedfirstorderTaylorapproximation fordisplacementfieldatvertex

Updatedvertexposition

avoidstoringpervertexshapefunctions atthecostofmorecomputations

Demo
(demoelasticity)

Plasticity
Includeplasticityeffects

Plasticity
Storesomeamountofthestrainand subtractitfromtheactualstrain intheelasticforcecomputations

strainstatevariable

Plasticity
Strainstatevariablesupdatedby absorbingsomeoftheelasticstrain
Absorbsomeoftheelasticstrain:

Limitamountofplasticstrain:

Plasticity
Updatethereferenceshapeand storetheplasticstrainstatevariables

DuctileFracture
Initialstatistics:
2.2knodes 134ksurfels

Finalstatistics:
3.3knodes

144ksurfels

Simulationtime:
23sec/frame

ModelingDiscontinuities
Onlyvisible nodes shouldinteract
crack

ModelingDiscontinuities
Onlyvisible nodes shouldinteract
collectnearestneighbors
crack

ModelingDiscontinuities
Onlyvisible nodes shouldinteract
collectnearestneighbors performvisibilitytest
crack

ModelingDiscontinuities
Onlyvisible nodes shouldinteract
collectnearestneighbors performvisibilitytest
crack

ModelingDiscontinuities
Onlyvisible nodes shouldinteract Discontinuityalongthe cracksurfaces
crack

ModelingDiscontinuities
Onlyvisible nodes shouldinteract Discontinuityalongthe cracksurfaces Butalsowithinthedomain
undesirable!
crack

ModelingDiscontinuities
VisibilityCriterion

Weightfunction

Shapefunction

ModelingDiscontinuities
Solution:transparencymethod1
nodesinvicinityofcrack partiallyinteract bymodifyingtheweight function
crack

crackbecomestransparent nearthecracktip
1

Organ etal.:ContinuousMeshless ApproximationsforNonconvex BodiesbyDiffractionandTransparency,Comp.Mechanics,1996

ModelingDiscontinuities
VisibilityCriterion TransparencyMethod

Weight function

Shape function

Demo
(demoshapefunctions)

Resampling
Addsimulationnodeswhennumberof neighborstoosmall Local resamplingofthe domainofanode
distributemass adaptsupportradius interpolateattributes
crack

Shapefunctionsadaptautomatically!

Resampling:Example

BrittleFracture
Initialstatistics:
4.3knodes 249ksurfels

Finalstatistics:
6.5knodes

310ksurfels

Simulationtime:
22sec/frame

Summary

Summary
Efficientalgorithms
forelasticity:shapefunctionsprecomputed forfracturing:localcuttingofinteractions

Nobookkeepingforconsistentmesh
simpleresampling shapefunctionsadaptautomatically

Highqualitysurfaces
representationdecoupledfromvolumediscretization deformationontheGPU

Limitations
Problemwithmomentmatrixinversions
cannothandleshells(2Dlayersofparticles) cannothandlestrings(1Dlayerofparticles)

Plasticitysimulationratherexpensive
recomputing neighbors reevaluatingshapefunctions

Fracturinginmanysmallpiecesexpensive
excessiveresampling

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

Application3:

Shape&MotionModeling

ShapeDeformations

ShapeDeformations:Objective
Findarealisticshapedeformation giventheusersinputconstraints.

ShapeDeformations

ShapeDeformations

ShapeDeformations

DeformationFieldRepresentation
Usemeshless shapefunctionstodefine acontinuousdeformationfield.

DeformationFieldRepresentation

Precompute foreverynodeandneighbor

Completelinearbasisin3D

DeformationFieldOptimization
Weareoptimizingthedisplacementfield

nodaldeformations unknownstosolvefor

DeformationFieldOptimization
Thedisplacementfieldshould satisfytheinputconstraints. Positionconstraint

quadraticintheunknowns

DeformationFieldOptimization
Thedisplacementshouldberealistic. Locallyrigid(minimalstrain)

Volumepreserving

degree6intheunknowns nonlinearproblem

DeformationFieldOptimization
Thetotal energy tominimize

SolveusingLBFGS
unknowns:nodaldisplacements needtocomputederivatives withrespecttounknowns

NodalSampling&Coupling
Keepnumberofunknownsaslowaspossible.

NodalSampling&Coupling
Ensurepropercouplingbyusing materialdistanceinweightfunctions.

NodalSampling&Coupling
Setofcandidatepoints: verticesandinteriorsetofdensegridpoints

NodalSampling&Coupling
Gridbasedfastmarchingto computematerialdistances.

NodalSampling&Coupling
Resultingsampling isroughlyuniform overthematerial. Resultingcoupling respectsthetopology oftheshape.

SurfaceDeformation
UseAlternative1ofthesurface animationalgorithmsdiscussedbefore

Vertexpositionsandnormals updatedontheGPU

ShapeDeformations

100kvertices,60nodes 55fps

ShapeDeformations

500kvertices,60nodes 10fps

Demo
(demodragon)

DeformableMotions

DeformableMotions:Objective
Findasmoothpathforadeformableobject fromgivenkeyframeposes.

DeformationFieldRepresentation

shapefunctionsinspace shapefunctionsintime

DeformationFieldRepresentation
Frames:discretesamplesintime
keyframe 1 keyframe 2 keyframe 3

frame1

frame2

frame3

frame4

frame5

Solveonlyatdiscreteframes:nodaldisplacements Usemeshless approximationtodefinecontinuousdisplacementfield

DeformationFieldRepresentation

Precompute foreachframeforeveryneighboringframe

Completequadraticbasisin1D

keyframe 1

keyframe 2

keyframe 3

frame1

frame2

frame3

frame4

frame5

DeformationFieldOptimization
Wewantarealisticmotioninterpolatingthekeyframes.
handleconstraints
keyframe 1 keyframe 2 keyframe 3

frame1

frame2

frame3

frame4

frame5

rigidityconstraints volumepreservationconstraints accelerationconstraints obstacleavoidanceconstraints

DeformationFieldOptimization
Wewantasmoothmotion. Accelerationconstraint

forallnodesinallframes

DeformationFieldOptimization
Wewantacollisionfreemotion. Obstacleavoidanceconstraint

forallnodesinallframes

DeformableMotions

59nodes 500kvertices 2keyframes

solvetime:10seconds,25frames

AdaptiveTemporalSampling
Numberofunknownstosolvefor:3NT
keepaslowaspossible!

Constraintsonlyimposedatframes
whatatinterpolatedframes?
keyframe 1 keyframe 2 keyframe 3

frame1

frame2

frame3

frame4

frame5

Adaptivetemporalsamplingalgorithm

AdaptiveTemporalSampling
Solveonlyatthekeyframes.

AdaptiveTemporalSampling
Evaluateoverwholetimeinterval.

AdaptiveTemporalSampling
Introducenewframewhereenergyhighestandsolve.

AdaptiveTemporalSampling
Evaluateoverwholetimeinterval.

AdaptiveTemporalSampling
Iterateuntilmotionissatisfactory.

DeformableMotions

66nodes 166kvertices 7keyframes

interactionrate:60fps,modelingtime:2.5min,solvetime:16 seconds,28frames

Demo
(demotowers)

Demo
(demoanimationphysics)

Summary
Realisticshapeandmotionmodeling
constraintsfromphysicalprinciples

Interactiveandhighquality
MLSparticleapproximation lownumberofparticles shapefunctionsadapttosamplingandobjectsshape decoupledsurfacerepresentation adaptivetemporalsampling

Rotationsarehowevernotinterpolatedexactly

TutorialOverview
Meshless Methods
smoothedparticlehydrodynamics movingleastsquares datastructures

Applications
particlefluidsimulation elasticsolidsimulation shape&motionmodeling

Conclusions

Conclusions

Conclusions
Whyuseameshless method?
requiresonlyaneighborhoodgraph
resamping iseasy topologicalchangesareeasy

Whyuseameshbasedapproach?
moremathematicalstructuretobeexploited
consistencyofdifferentialoperators exactconservationofintegralproperties

Ormaybeuseahybridtechnique?
PIC/FLIP particlelevelset

Website
Allmaterialavailableat
http://graphics.stanford.edu/~wicke/eg09tutorial

Contactinformation
bart.adams@cs.kuleuven.be wicke@stanford.edu

Acknowledgements
Collaborators
RichardKeiser MarkPauly MichaelWand Leonidas J.Guibas HansPeterSeidel PhilipDutr MatthiasTeschner MatthiasMller MarkusGross Maks Ovsjanikov

Funding
FundforScientificResearch,Flanders MaxPlanckCenterforVisualComputing andCommunication

ThankYou!

Potrebbero piacerti anche