# Related Work
// Thesis explains MPM for in general, for solids and fluids  
[The Material Point Method for the Physics-Based Simulation of Solids and Fluids](https://www.math.ucla.edu/~jteran/student_thesis/jiang.pdf)  
  
// Shader program based optimizations  
[Material Point Method based Fluid Simulation on GPU using Compute Shader](https://www.researchgate.net/profile/Dody_Dharma2/publication/319525082_Material_Point_Method_based_Fluid_Simulation_on_GPU_using_Compute_Shader/links/59b0ca69458515a5b484e9b0/Material-Point-Method-based-Fluid-Simulation-on-GPU-using-Compute-Shader.pdf)  

# Concept
### Pseudocode for fluids
1. Particles position initialization, velocity and strain.   
2. Mass, momentum, and internal forces in particles are mapped into grid by using interpolation function.   
3. Momentum equation is solved at the grid node.   
4. Particles velocity and position are updated based on grid velocity.   
5. Record the convected grid velocity   
6. Calculate the new velocity gradient and strain on particles. If the particles are fluid:   
    1. Apply the fluid equation   
    2. Update the fluid particle energy   
7. Re-grid   
8. Jump to step-2   