Skip to content

Commit

Permalink
MUDA GPU urls
Browse files Browse the repository at this point in the history
  • Loading branch information
liminchen committed Aug 3, 2024
1 parent 01b393d commit 7227fef
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 16 deletions.
3 changes: 1 addition & 2 deletions src/lec10-square_on_slope.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ In this section, based on our learnings from [Frictional Contact](lec9-friction.
Following this extension, we implement friction for the slope, tested by simulating an elastic square dropped onto it. Depending on the friction coefficient $\mu$, the square either stops at various points on the slope or continues to slide.

The excutable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `4_friction` folder.

Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/4_friction` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/4_friction` folder.
3 changes: 1 addition & 2 deletions src/lec11.2-compress_square.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

We simulate compressing an elastic square using a ceiling.
The excutable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `5_mov_dirichlet` folder.

Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/5_mov_dirichlet` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/5_mov_dirichlet` folder.

The ceiling in our simulation is modeled as a half-space with a downward normal vector $\mathbf{n}=(0,-1)$. The distance from the ceiling to other simulated Degrees of Freedom (DOFs) can be calculated using Equation {{eqref: eq:lec7:half_space_dist}}. To effectively apply the penalty method, it's necessary that the ceiling's height also serves as a DOF.

Expand Down
2 changes: 1 addition & 1 deletion src/lec15-inv_free_elasticity.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

At the end of this chapter, we implement the Neo-Hookean model introduced in the previous lectures to simulate inversion-free elastic solids.
The excutable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `6_inv_free` folder.
Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/6_inv_free` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/6_inv_free` folder.
Instead of discretizing elasticity onto the springs as in the mass-spring model, we discretize the Neo-Hookean model onto triangle elements, apply chain rules to compute elastic forces according to the relation between deformation gradient $\mathbf{F}$ and world-space nodal position $\mathbf{x}$, and then develop a root-finding based approach to filter the initial step size of line search for guaranteed non-inversion.
2 changes: 1 addition & 1 deletion src/lec21-2d_self_contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
We have finished connecting linear finite elements to the weak form derivation for elastodynamics and frictional contact. Now, it's time to see how these concepts are implemented in code. In this lecture, we will implement 2D frictionless self-contact based on our Python development of the inversion-free elasticity simulation from [Case Study: Inversion-free Elasticity](./lec15-inv_free_elasticity.md).

The executable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `7_self_contact` folder.
Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/7_self_contact` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/7_self_contact` folder.
We will implement frictional self-contact in the next lecture.
2 changes: 1 addition & 1 deletion src/lec22-2d_self_fric.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
In this lecture, we implement 2D friction based on our 2D self-contact implementation in [Case Study: 2D Self-Contact](./lec21-2d_self_contact.md). The executable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial).

For simplicity, we will focus on implementing a semi-implicit version of friction. This means the normal force magnitude $\lambda$ and the tangent operator $T$ will be discretized to the last time step, and we solve the optimization once per time step without further fixed-point iterations that converge to solutions with fully-implicit friction ([Frictional Contact](./lec9-friction.md)) under the `8_self_friction` folder.
Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/8_self_friction` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/8_self_friction` folder.
Combined with the smoothly approximated static-dynamic friction transition in IPC, implementing friction into an optimization time integration framework is as straightforward as adding an extra potential energy.
8 changes: 4 additions & 4 deletions src/lec4-2d_mass_spring.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Case Study: 2D Mass Spring*

Up to now, we have completed a high-level introduction to the optimization-based solids simulation framework. In this lecture, we elaborate on how to implement a simple 2D elastodynamics simulator with <a href="https://www.python.org/" target="_blank">Python3</a>.
Up to now, we have completed a high-level introduction to the optimization-based solids simulation framework. In this lecture, we elaborate on how to implement a simple 2D elastodynamics simulator with <a href="https://www.python.org/" target="_blank">Python3</a> (CPU) and [MUDA](https://github.com/MuGdxy/muda) (GPU).

Sections in this book with Python implementations will be marked with a * right after the title.
All the Python implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial).
The excutable Python project for this section is in the `/1_mass_spring` folder of this repository.
Sections in this book with Python CPU and MUDA GPU implementations will be marked with a * right after the title.
All the Python and MUDA implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) and [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu), respectively.
The excutable project for this section is in the `/1_mass_spring` folder of these repositories.
2 changes: 1 addition & 1 deletion src/lec4.6-gpu_accel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## GPU-Accelerated Simulation

We now rewrite the 2D mass-spring simulator to leverage GPU acceleration. The source code can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) in the `simulators/1_mass_spring` folder.
We now rewrite the 2D mass-spring simulator to leverage GPU acceleration.
Instead of directly writing [CUDA](https://developer.nvidia.com/cuda-toolkit), we resort to [MUDA](https://github.com/MuGdxy/muda), a lightweight library that provides a simple interface for GPU-accelerated computations.

The architecture of the GPU-accelerated simulator is similar to the Python version. All function and variable names are consistent with the Numpy version. However, the implementation details are different due to the GPU architecture and programming model. Before delving into the details, let's first get a feeling of the speedup that GPU could bring us from the following gif ({{ref: fig:lec4:cpu_vs_gpu}}).
Expand Down
3 changes: 1 addition & 2 deletions src/lec5.3-hanging_square.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
## Case Study: Hanging Square*
We use a simple case study to end this lecture. Based on the [mass-spring system](lec4-2d_mass_spring.md) developed in a previous section, we implement gravitational energy and sticky Dirichlet boundary conditions to simulate a hanging square.
The excutable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `2_dirichlet` folder.

Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/2_dirichlet` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/2_dirichlet` folder.

Gravitational energy has
$$
Expand Down
3 changes: 1 addition & 2 deletions src/lec8.3-square_drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
To conclude, let's consider a case study where we simulate a square dropped onto a fixed planar ground. Building on our previous mass-spring model for an elastic square, we augment a barrier potential into its Incremental Potential and apply the filter line search scheme to manage the contact between the square's degrees of freedom (DOFs) and the ground.

The excutable Python project for this section can be found at [https://github.com/phys-sim-book/solid-sim-tutorial](https://github.com/phys-sim-book/solid-sim-tutorial) under the `3_contact` folder.

Cuda implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/3_contact` folder.
[MUDA](https://github.com/MuGdxy/muda) GPU implementations can be found at [https://github.com/phys-sim-book/solid-sim-tutorial-gpu](https://github.com/phys-sim-book/solid-sim-tutorial-gpu) under the `simulators/3_contact` folder.

If we further limit the planar ground to be horizontal, e.g. at \\(y=y_0\\), its signed distance function can be made even simpler than Equation {{eqref: eq:lec7:half_space_dist}}:
$$
Expand Down

0 comments on commit 7227fef

Please sign in to comment.