Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed May 31, 2017 7:16 am 
Offline

Joined: Wed May 31, 2017 6:19 am
Posts: 4
Hi all,

I'm currently trying to work through a Position Based approach to a soft body. The basic idea is to take Position Based Fluids (PBF) and use a constitutive model instead of the density constraint. Since it's a meshless model I'm using the idea of an incremental deformation gradient from here and trying to use a fixed corotated constitutive model from here.

The constraint would be to minimize the energy density for each particle. Calculating the energy is relatively easy but I'm having a hard time deriving the gradient of the energy with respect to the new particle position.

The snow paper gives an equation for the derivative of the energy with respect to the deformation gradient:

Attachment:
energy.png
energy.png [ 3.76 KiB | Viewed 1973 times ]


I believe I could just multiply that by the derivative of the deformation gradient with respect to the new positions(X is a matrix of current positions, Y is a matrix of predicted positions):

Attachment:
deformation.png
deformation.png [ 3.54 KiB | Viewed 1973 times ]


But... that's just the incremental update so it needs to be multiplied by the cumulative deformation (which for differentiation is just a constant). Since I want the gradient of the energy constraint my understanding is that I would multiply the above two derivatives (which are both 3x3 matrices) by the gradient of the shape function to end up with a 3 element vector. That is the part of PBF that I don't completely understand.

Attachment:
pbf_constraint_gradient.png
pbf_constraint_gradient.png [ 4.85 KiB | Viewed 1973 times ]


Shows the gradient of the density constraint. The gradient for each particle is summed up and used in the lambda calculation but based on the above formulation don't they end up canceling out? Since the calculation for the ith particle is actually the sum of all other particles.

I'd love some help understanding the lambda calculation in PBF or the derivative of the deformation gradient with respect to new positions.

Thanks


Top
 Profile  
 
PostPosted: Thu Jun 01, 2017 11:26 pm 
Offline

Joined: Wed May 31, 2017 6:19 am
Posts: 4
I found a helpful implementation of the Position Based Fluids paper that showed me how the constraint is actually calculated.

https://github.com/InteractiveComputerGraphics/PositionBasedDynamics/blob/master/PositionBasedDynamics/PositionBasedFluids.cpp

Inside the function "computePBFLagrangeMultiplier" it sums the gradient of all neighbor particles and separately sums the squared norm of all gradients. At the end it adds the squared norm of the sum of the gradients which is the ith particle's contribution. That was the part I misunderstood, even though the signs are opposite that doesn't matter if it is summing the squared norm (where they will all be positive).

Still working through the gradient of the constraint, but I'm thinking it may be easier to use the Strain Based Dynamics approach first since that doesn't require extracting the rotation.


Top
 Profile  
 
PostPosted: Mon Jun 05, 2017 6:36 am 
Offline

Joined: Wed May 31, 2017 6:19 am
Posts: 4
Working through the gradient calculation using the Strain Based Dynamics approach, here's what I got (first time writing LaTeX, it's kinda funky):

Attachment:
partial derivative deformation.png
partial derivative deformation.png [ 18.07 KiB | Viewed 1754 times ]


There's a problem here once you start using the SPH weights.

Depending on how you decide to apply it, is it the weight calculated for the predicted position? The current position?

Or maybe multiply each column of Y by the weight at the predicted position and each column of X by the weight at the current position?

If you multiply Y by the predicted weight than the above derivation falls apart because each column of XY depends on all 3 components, instead of giving you clean columns like above. I guess that's not a big deal, I might try both ways and see which gives good results.


Top
 Profile  
 
PostPosted: Thu Jun 29, 2017 8:47 pm 
Offline

Joined: Sat Aug 19, 2006 11:52 pm
Posts: 211
Have you tried the approach described in Muller "Meshless Deformations Based on Shape Matching"? AFAIK that's a popular way to implement meshless soft bodies with plastic deformations in a position-based simulation that might be worth a look. This paper from the same author has some useful references: http://matthias-mueller-fischer.ch/publications/stablePolarDecomp.pdf


Top
 Profile  
 
PostPosted: Wed Nov 15, 2017 2:21 am 
Offline

Joined: Wed May 31, 2017 6:19 am
Posts: 4
This is a little delayed but...

I have been looking at the shape matching papers. The problem with those is even though they are "meshless", they still have the idea of an "original" position. For my purposes that doesn't really work since I'm working with a fluid. I've tried it where the current positions are considered the original position for just that frame, but it doesn't preserve volume very well and doesn't have the best performance. I'm guessing there is just too much drift per frame.

I ended up using position based fluids combined with "fake" friction. I calculate the average velocity of all the neighbor particles (using SPH weights as well) and then constrain the motion of each particle to be along that direction. It kind of works but has weird artifacts so I'm still playing with it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group