# Taichi Implicit MPM Solver

## 实现

h(\mathbf{v}^{n+1})=\mathbf{M} \mathbf{v}^{n+1} - \Delta t \mathbf{f}(\mathbf{x}^n+\Delta t \mathbf{v}^{n+1}) - \mathbf{M} \mathbf{v}^n=0

\mathbf{v}^{(i + 1)} = \mathbf{v}^{(i)}-(\frac{\partial h}{\partial v}(\mathbf{v}^{(i)} ))^{-1}h(\mathbf{v}^{(i)} )

E(v_i)=\sum_{i}\frac{1}{2}m_{i}\vert\vert v_i - v_i^n\vert \vert^2+ \Phi(x_i^n+\Delta t v_i)

## 感想

\frac{\partial f}{\partial v} 非常painful，自己尝试推了一天，最后参考了蒋老师的 ziran2020 库里面的求解式子。以及在解方程的时候，collision 情况的考虑需要自己仔细想一想。

## Future work

• 修复一些已知的 Bugs，改进数据布局和一些 quick-and-dirty 的实现。
• 由于要考虑 \Psi ,\frac{\partial \Psi}{\partial \mathbf{F}} ,\frac{\partial^2 \Psi}{\partial \mathbf{F} \partial \mathbf{F}} 等众多量的求解，目前只实现了一个 fixed corotated 模型，以后会抽象成一个专门的 stress 类。
• 用 possion disk sampling 实现 mesh to particles.
• 把 implicit solver 用于 IQMPM，anisoMPM 等。

## References

[1] Gonzalez, O. and Stuart, A. (2008). A first course in continuum mechanics. Cambridge University Press.
[2] Gast, T., Schroeder, C., Stomakhin, A., Jiang, C., and Teran, J. (2015). Optimization integrator for large time steps. IEEE Trans Vis Comp Graph, 21(10):1103–1115.
[3] C. Jiang, C. Schroeder, J. Teran, A. Stomakhin, and A. Selle. 2016. The material point method for simulating continuum materials. In SIGGRAPH Course. 24:1–24:52.
[4] C. Jiang, C. Schroeder, A. Selle, J. Teran, and A. Stomakhin. 2015. The affine particle-in-cell method. ACM Trans Graph 34, 4 (2015), 51:1–51:10.

10 Likes

\begin{array}{c} -\delta \mathbf{f}_{\mathfrak{i}}=\sum_{j} \frac{\partial^{2} e}{\partial \hat{x}_{i} \partial \hat{x}_{j}}(\hat{x}) \delta u_{j}=\sum_{p} V_{p}^{0} A_{p}\left(F_{p}^{n}\right)^{\top} \nabla w_{i p}^{n} \\ A_{p}=\frac{\partial^{2} \Psi}{\partial F \partial F}\left(\hat{\mathbf{F}}_{p}(\hat{x})\right):\left(\sum_{j} \delta u_{j}\left(\nabla w_{j p}^{n}\right)^{\top} F_{p}^{n}\right) \end{array}\tag{1}