|
1 | | -## Case Study: Dropping Block* |
| 1 | +## Case Study: ABD Square Drop* |
2 | 2 |
|
3 | | -Now, let’s implement ABD in 2D for the [square on slope](./lec10-square_on_slope.md) simulation. |
4 | | -This just need the modification of a few lines of the standard IPC simulation code. |
| 3 | +Let’s now implement Affine Body Dynamics (ABD) in 2D for a neo-Hookean version of the [square drop](./lec8.3-square_drop.md) simulation. This requires only minor modifications to the standard IPC simulation code. The full implementation is available in the `9_reduced_DOF` folder of our [solid simulation tutorial](https://github.com/phys-sim-book/solid-sim-tutorial). |
5 | 4 |
|
6 | | -First, we introduce a function to compute the reduced basis. For our specific ABD case, we are modeling near-rigid affine transformations. Consequently, when calling this function, we specify `method=0` (polynomial basis) and `order=1` (linear basis) to obtain the linear basis: |
| 5 | +We begin by introducing a function to compute the reduced basis. In ABD, we consider only affine deformations. Therefore, we use `method=1` (polynomial basis) and `order=1` (linear basis) to extract the linear basis: |
7 | 6 |
|
| 7 | +{{imp}}{imp:lec25:compute_reduced_basis}[Compute reduced basis, utils.py] |
8 | 8 | ```python |
9 | 9 | {{#include solid-sim-tutorial/9_reduced_DOF/utils.py:compute_reduced_basis}} |
10 | 10 | ``` |
11 | 11 |
|
12 | | -<!-- basis calculation, file description --> |
| 12 | +Here, `method=0` refers to full-space simulation and returns immediately without computing a basis. |
| 13 | +`method=1` computes polynomial bases, including linear, quadratic, and cubic functions. For each basis vector, the displacement components at each node are expressed as polynomial functions of the node’s material-space coordinates. |
| 14 | +`method=2` computes bases via linear modal analysis, which solves the eigensystem of the elasticity Hessian and extracts displacement fields that correspond to the deformation modes that increases the least amount of energy. This will be discussed in more detail in [the next lecture](./lec25.6-modal_reductions.md). |
13 | 15 |
|
14 | | -Next, the Hessian matrix and the gradient vector are projected onto the reduced degrees of freedom (DOFs). This projection is performed according to the chain rule, as described in Equation {{eqref: eq:lec25:newton_chain_rules}}. The relevant code snippet is shown here: |
| 16 | +After computing the basis, we restrict the simulation to the corresponding subspace by projecting the Hessian matrix and the gradient vector. This projection follows the chain rule, as described in Equation {{eqref: eq:lec25:newton_chain_rules}}. The relevant implementation is: |
| 17 | + |
| 18 | +{{imp}}{imp:lec25:search_dir}[Compute reduced search direction, time_integrator.py] |
15 | 19 | ```python |
16 | 20 | {{#include solid-sim-tutorial/9_reduced_DOF/time_integrator.py:search_dir}} |
17 | 21 | ``` |
18 | 22 |
|
19 | | -These modifications allow us to simulate the ABD version of square on slope example: |
| 23 | +These changes enable us to run the ABD version of the square-drop simulation: |
20 | 24 |
|
21 | 25 | <figure> |
22 | 26 | <center> |
23 | 27 | <img src="img/lec25/abd_sim.gif"> |
24 | | - <figcaption><b>{{fig}}{fig:lec25:abd_sim}</b> An illustration of ABD simulation.</figcaption> |
| 28 | + <figcaption><b>{{fig}}{fig:lec25:abd_sim}</b> ABD simulation of a square dropped onto the ground.</figcaption> |
25 | 29 | </center> |
26 | 30 | </figure> |
27 | 31 |
|
28 | | -Here we use a small stiffness parameter making the body softer to amplify the deformation of the affine body to better demonstrate the difference between ABD and IPC. The blue is the collision mesh, and the red one is the embedding mesh. |
| 32 | +In this example, we reduce the stiffness parameter to make the body softer, emphasizing the difference between ABD and standard IPC. The blue mesh is the original mesh (also used for collision), while the red triangle visualizes the reduced degrees of freedom. |
0 commit comments