Skip to content

Commit c23b208

Browse files
committed
add readme.md
1 parent e9ad2b6 commit c23b208

9 files changed

Lines changed: 46 additions & 2 deletions

File tree

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Muda-based Solid Simulatoion Tutorial
2+
This is a tutorial for the Solid Simulation using Muda (a CUDA programming paradigm https://github.com/MuGdxy/muda).
3+
4+
The basic architecture of the simulators mimics Minchen Li's Solid-Sim-Tutorial(https://github.com/phys-sim-book/solid-sim-tutorial).
5+
6+
The tutorial (which is also written by a beginner) may provide some help for the beginners to learn how to write simple CUDA codes for implicit solid simulation.
7+
## Usage
8+
1. Clone the repository
9+
```bash
10+
git clone https://github.com/Roushelfy/solid-sim-muda
11+
cd solid-sim-muda
12+
git submodule update --init --recursive
13+
```
14+
15+
2. build with cmake
16+
```bash
17+
mkdir build
18+
cd build
19+
cmake ..
20+
cmake --build .
21+
```
22+
23+
## Requirements
24+
Eigen3==3.4.0
25+
26+
CMake>=3.29
27+
28+
CUDA>=11.0
29+
30+
## Simulators
31+
32+
### 1. Simple Mass-Spring System
33+
![Simple Mass-Spring System](./img/1.png)
34+
### 2. Dirichlet Boundary Condition
35+
![Dirichlet Boundary Condition](./img/2.png)
36+
### 3. Contact
37+
![Contact](./img/3.png)
38+
### 4. Friction
39+
![Friction](./img/4.png)
40+
### 5. Moving Dirichlet Boundary
41+
![Moving Dirichlet Boundary](./img/5.png)
42+
### 6. Neohookean Model
43+
![Neohookean Model](./img/6.png)
44+
### 7. Neohookean Model with Self Collision
45+
![Neohookean Model with Self Collision](./img/7.png)

img/1.png

11 KB
Loading

img/2.png

17.7 KB
Loading

img/3.png

9.93 KB
Loading

img/4.png

14.5 KB
Loading

img/5.png

8.4 KB
Loading

img/6.png

7.37 KB
Loading

img/7.png

5.32 KB
Loading

simulators/5_mov_dirichlet/src/simulator.cu

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ template <typename T, int dim>
1414
struct MovDirichletSimulator<T, dim>::Impl
1515
{
1616
int n_seg;
17-
T h, rho, side_len, initial_stretch, m, tol, mu, DBC_stiff;
17+
T h, rho, side_len, initial_stretch, m, tol, mu, DBC_stiff = 1000;
1818
int resolution = 900, scale = 200, offset = resolution / 2, radius = 5;
1919
std::vector<T> x, x_tilde, v, k, l2, DBC_limit, DBC_v, DBC_target;
2020
std::vector<int> e, DBC, DBC_satisfied, is_DBC;
@@ -145,7 +145,6 @@ void MovDirichletSimulator<T, dim>::Impl::step_forward()
145145
update_x_tilde(add_vector<T>(x, v, 1, h));
146146
frictionenergy.update_mu_lambda(barrierenergy.compute_mu_lambda(mu));
147147
update_DBC_target();
148-
update_DBC_stiff(10);
149148
DeviceBuffer<T> x_n = x; // Copy current positions to x_n
150149
update_v(add_vector<T>(x, x_n, 1 / h, -1 / h));
151150
int iter = 0;

0 commit comments

Comments
 (0)