Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

LandslideSIM/Archive_MaterialPointSolver.jl_paper

Repository files navigation

MaterialPointSolver.jl Archive

License: MIT

This repo is used to store the archive files for MaterialPointSolver.jl. It includes the source code for the solver as well as the files needed to reproduce the examples in the paper.

Warning

MaterialPointSolver.jl is actively under development, with ongoing improvements not only in performance but also in feature enhancements. Please refer to the latest version "https://github.com/LandslideSIM/MaterialPointSolver.jl" for the current status.

Citation

If you find MaterialPointSolver.jl useful or have used it in your research, please cite it as follows:

@article{HUO2025107189,
title = {A high-performance backend-agnostic Material Point Method solver in Julia},
journal = {Computers and Geotechnics},
volume = {183},
pages = {107189},
year = {2025},
issn = {0266-352X},
doi = {https://doi.org/10.1016/j.compgeo.2025.107189},
url = {https://www.sciencedirect.com/science/article/pii/S0266352X25001387},
author = {Zenan Huo and Yury Alkhimenkov and Michel Jaboyedoff and Yury Podladchikov and Ludovic RΓ€ss and Emmanuel Wyser and Gang Mei},
keywords = {MPM, Julia language, Heterogeneous computing, Effective memory throughput}
}

How to use

  1. Install Julia Language on your system, please refer to here. By using this command to enter julia:

    bash> julia
                   _
       _       _ _(_)_     |  Documentation: https://docs.julialang.org
      (_)     | (_) (_)    |
       _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
      | | | | | | |/ _` |  |
      | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
     _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
    |__/                   |
    
    julia>
    
  2. Download or clone this repo and cd to folder <MaterialPointSolver.jl_paper_archive>, and then enter julia's Pkg mode :

    bash> cd MaterialPointSolver_paper_archive
    bash> julia
                   _
       _       _ _(_)_     |  Documentation: https://docs.julialang.org
      (_)     | (_) (_)    |
       _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
      | | | | | | |/ _` |  |
      | | |_| | | | (_| |  |  Version 1.10.4 (2024-06-04)
     _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
    |__/                   |
    
    julia> ] # press enter
    (@v1.10) pkg>
    
  3. Install the package:

    (@v1.10) pkg> dev .
    

    Based on your backend, take CUDA as an example, check the package status of CUDA.jl (This will download CUDA toolkit automatically):

    (@v1.10) pkg> test CUDA
    β”Œ Info: System information:
    β”‚ CUDA runtime 12.5, artifact installation
    β”‚ CUDA driver 12.6
    β”‚ NVIDIA driver 560.70.0
    β”‚ 
    β”‚ CUDA libraries:
    β”‚ - CUBLAS: 12.5.3
    β”‚ - CURAND: 10.3.6
    β”‚ - CUFFT: 11.2.3
    β”‚ - CUSOLVER: 11.6.3
    β”‚ - CUSPARSE: 12.5.1
    β”‚ - CUPTI: 2024.2.1 (API 23.0.0)
    β”‚ - NVML: 12.0.0+560.70
    β”‚ 
    β”‚ Julia packages:
    β”‚ - CUDA: 5.4.3
    β”‚ - CUDA_Driver_jll: 0.9.2+0
    β”‚ - CUDA_Runtime_jll: 0.14.1+0
    β”‚ 
    β”‚ Toolchain:
    β”‚ - Julia: 1.10.4
    β”‚ - LLVM: 15.0.7
    β”‚ 
    β”‚ 
    β”‚ 1 device:
    β””   0: NVIDIA GeForce MX450 (sm_75, 1.658 GiB / 2.000 GiB available)
    
    ...
    
    Test Summary: |  Pass  Broken  Total  Time
      Overall     | 25055      12  25067      
       SUCCESS
        Testing CUDA tests passed
    
  4. Using the solver:

    julia> using MaterialPointSolver
    
    ╔═══════════════════════════════════════════════════════╗
    β•‘                                                       β•‘
    β•‘        ⭐ Welcome to MaterialPointSolver.jl ⭐       β•‘
    β•‘           ─────────────────────────────────           β•‘
    β•‘                                                       β•‘
    β•‘ Version    : v0.1.0                                   β•‘
    β•‘ Description: A high-performance MPM solver in Julia   β•‘
    β•‘ Start Date : 01/01/2022                               β•‘
    β•‘ Affiliation: Risk Group, UNIL-ISTE                    β•‘
    β•‘                                                       β•‘
    β•‘ Tips: ⚠ please try to warm up before simulating       β•‘
    β•‘ ───────────────────────────────────────────────       β•‘
    β•‘ help?> MaterialPointSolver.warmup(devicetype; ID=0)   β•‘
    β•‘   1). devicetype can be one of :CUDA, :ROCm, and :CPU β•‘
    β•‘   2). ID (optional) is 0 by default                   β•‘
    β•‘ julia> MaterialPointSolver.warmup(:CUDA)              β•‘
    β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
    
  5. Run the example cases: Taking 2D collapse as an example, cd to this folder and enter julia to install some extra packages:

    bash> cd 02_soil_collapse
    bash> julia
    
    julia> ]
    (@v1.10) pkg> add HDF5, CairoMakie, DelimitedFiles, KernelAbstractions
    

    And then run this command:

    julia> include(joinpath(@__DIR__, "2d_collapse.jl"))
     [ Info: code warm-up, wait a moment πŸ”₯
     β”Œ Info: 2d_collapse [2D/CUDA]
     β”‚ ────────────────┬─────────────┬─────────────────
     β”‚ Ξ”T  : 1.40e-05s β”‚ PIC :  0.00 β”‚ scheme   : MUSL
     β”‚ Ttol: 1.00e+00s β”‚ FLIP:  1.00 β”‚ coupling : OS
     β”‚ pts : 1.28e+04  β”‚ ΞΆs  :  0.00 β”‚ animation: false
     β”‚ nds : 3.28e+04  β”‚ ΞΆw  :  0.00 β”‚ precision: FP64
     β”‚ MVL :    false  β”‚ HDF5:  true β”‚ material : D-P
     β”” ────────────────┴─────────────┴─────────────────
     [β–² I/O: host [β‰ˆ 0.0 GiB] β†’ device 0 [CUDA]
     [ Info: solving 100% β—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Όβ—Ό  Time: 0:01:58
     [β–Ό I/O: device 0 [CUDA] β†’ host
     [β€’ I/O: free device 0 memory
     β”Œ Info: performance
     β”‚ ─────────────────────
     β”‚ wtime: 00:01:58
     β”‚ iters: 7.12e+04
     β”‚ speed: 6.04e+02  it/s
     β”‚ MTeff: 1.71e+01 GiB/s
     β”” ─────────────────────
    
  6. Other useful links: CUDA.jl, KernelAbstractions.jl, Julia documentation, Julia hands-on

About

πŸ—„οΈ This repo is the paper archive for MateiralPointSolver.jl.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published