{"id":27307130,"url":"https://github.com/kekeblom/mpm","last_synced_at":"2025-04-12T04:03:49.579Z","repository":{"id":147287173,"uuid":"259419905","full_name":"kekeblom/mpm","owner":"kekeblom","description":"A simple CUDA accelerated material point method simulation.","archived":false,"fork":false,"pushed_at":"2020-04-27T20:35:04.000Z","size":43558,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T04:03:07.663Z","etag":null,"topics":["computer-graphics","cpp","cuda","docker","mpm","opengl","physically-based-simulation","physics-simulation","simulations"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kekeblom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-27T18:37:32.000Z","updated_at":"2025-03-18T08:22:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"8501c8d8-e3fa-4e8a-bc12-537156851cbc","html_url":"https://github.com/kekeblom/mpm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekeblom%2Fmpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekeblom%2Fmpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekeblom%2Fmpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kekeblom%2Fmpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kekeblom","download_url":"https://codeload.github.com/kekeblom/mpm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248514228,"owners_count":21116903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-graphics","cpp","cuda","docker","mpm","opengl","physically-based-simulation","physics-simulation","simulations"],"created_at":"2025-04-12T04:02:09.097Z","updated_at":"2025-04-12T04:03:46.344Z","avatar_url":"https://github.com/kekeblom.png","language":"C++","readme":"\nThis repository contains code for a simple CUDA accelerated material point method simulation.\n\nHere is a demo of the simulation which was rendered offline using Blender. (Click to view)\n\n[![Watch the video](assets/snowman.png)](https://youtu.be/_fLnN2TTFfY)\n\n## Running using Docker\n\nThe easiest way to run the code is using the provided Docker configuration. Build the image by running `docker build -t mpm .` from the project directory. Once built, the image can be run with `./docker_run.sh`. Any arguments passed in, will be passed on to the simulation program. Check `include/options.h` for a full list of arguments.\n\nHere are some example simulations to try:\n```\n./docker_run.sh --scene scenes/rubber_duck.toml -N 16 --particle-count 10000\n./docker_run.sh --scene scenes/liquid_bunny.toml -N 32 --particle-count 1000000\n./docker_run.sh --scene scenes/snowman.toml -N 64 --particle-count 500000\n```\n\nYou should see the real-time debug view pop up. It looks 2D, but the simulation is actually run in 3D.\n![Debug view](assets/snowman_debug.png)\n\nTo export meshes add the `--save-dir out/` as an option.\n```\n./docker_run.sh --save-dir out/\n```\nReconstructed meshes will be written to the directory `out/meshes`.\n\n## Installing natively\nOur code was developed on Linux  (Ubuntu, specifically). It should work anywhere, of course, but has never been tested on Windows or Mac. The below instructions will therefore be specific to Ubuntu. Please feel free to apply them to the system of your choice analogously.\n\nWe use cmake to build stuff.\n\n## Dependencies\n\nThe following dependencies are required:\n - OpenGL\n - GLFW 3\n - OpenMP (Kind-of required. If not available, set the cmake option `USE_OPENMP` to `OFF`)\n - Boost\n - Eigen3\n\nAnd these are optional:\n - Partio (just for exporting particles)\n - GTest (but of course there are no bugs, so...)\n\n### Installing dependencies:\nOn Ubuntu, the following should do:\n```\nsudo apt install libeigen3-dev libgtest-dev libboost1.65-dev libglfw3-dev libomp-dev cmake\n```\n\n## Building\n\n### Default\nThe usual cmake procedure\n```\nmkdir build \u0026\u0026 cd build\ncmake -DCMAKE_BUILD_TYPE=Release ..\nmake -j\n```\n### Using Partio (optional)\n\nWe make use of the [Partio](http://partio.us/) for saving particles to a file. To install the library, I would recommend creating a local install folder and installing it there. Roughly, the installation goes like this:\n```\nmkdir ~/local_build # Or anywhere else you would like to install the library.\nexport LOCAL_BUILD=~/local_build\ngit clone https://github.com/wdas/partio.git\ncd partio\nmake -j prefix=$LOCAL_BUILD install\n```\n\nCreate a build directory, run cmake to generate the makefile, run make, then run the binary.\n```\nmkdir build \u0026\u0026 cd build\ncmake -DLOCAL_INCLUDE_DIR=$LOCAL_BUILD/include -DLOCAL_LIB_DIR=$LOCAL_BUILD/lib -DCMAKE_BUILD_TYPE=Release ..\nmake -j\n```\n\n## Running\nFrom the build directory, type\n```\n./bin/mpm --scene ../scenes/snowman.toml\n```\nThis should open a small 2D visualization of the simulation with a yellow snowman and start simulating.\n\nSome command line options are available; these are the most important ones:\n\n`dt` \t\ttimestep (default 1e-4)\n\n`N` \t\tnumber of MPM-grid cells per dimension (default 60)\n\n`particle-count`  number of particles per unit cube. Note: the simulation domain is a unit cube. (default 500000)\n\n`save-dir`   where to save the output (mesh or particles) (default is empty, so no output is generated)\n\n`laplacian smooth` whether to apply laplacian smoothing to the output mesh (0 or 1, default is 0).\n\nFor further options, please refer directly to the file  `options.h`.\n\nExample usage:\n```\n./bin/mpm -N 80 --dt 1e-4 --save-dir ./output/ --laplacian_smooth 0\n```\n\n## Credits\n\nThis project was created in collaboration [Simon Duenser](https://github.com/sduenser). The simulation implements the method as detailed in the paper\n\u003e Hu, Yuanming, et al. \"A moving least squares material point method with displacement discontinuity and two-way rigid body coupling.\" ACM Transactions on Graphics (TOG) 37.4 (2018): 1-14.\n\nTheir [simplified](https://github.com/yuanming-hu/taichi_mpm/blob/master/mls-mpm88-explained.cpp) implementation helped us get started.\n\nThe license is GPLv3 due to the marching cubes library used from libigl.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekeblom%2Fmpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkekeblom%2Fmpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkekeblom%2Fmpm/lists"}