Roberto Toro, March 2019
The original repository is https://github.com/yuanming-hu/taichi_mpm, and the c++ code can be directly downloaded from http://bit.ly/mls-mpm88. This link contains 2 files:
taichi.h, with linear algebra and helper functions; and
mls-mpm88.cpp with the actual implementation of the material point method.
algebra.js file, and the MPM code in the
mls-mpm.js file (with the
88 removed, because now it's 148 lines... but there's much more comments, so we're still good).
A main tricky thing in the translation, which still is not completely solved, is that matrices in Taichi are coded transposed. In the translation, there's still a mix of functions that work transposed (svd, polar_decomp, mulMatVec), and those that don't. That makes some parts of the code a bit convoluted. Ideally, I'd like to move all the code to standard non-transposed matrix encoding.