Skip to content

Commit b28b3c0

Browse files
committed
Update adhesion.rst
1 parent 280802d commit b28b3c0

File tree

3 files changed

+68
-60
lines changed

3 files changed

+68
-60
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
tutorial/getting_started.rst
1414
tutorial/convergent.rst
1515
tutorial/nonlinear_ccd.rst
16+
tutorial/adhesion.rst
1617
tutorial/simulation.rst
1718
tutorial/misc.rst
1819
tutorial/faq.rst

docs/source/tutorial/adhesion.rst

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,40 @@
11
Adhesion
2-
--------
3-
Adhesion simulates the sticking interaction between surfaces, such as glue bonding or material contact.
4-
Provides functionality to compute normal adhesion (perpendicular forces) and tangential adhesion (parallel forces).
2+
========
3+
4+
Adhesion simulates the sticking interaction between surfaces, such as glue bonding or material contact.
5+
6+
We provide functionality to compute normal adhesion (perpendicular forces) and tangential adhesion (parallel forces) using the model of :cite:`Fang2023AugmentedStickyInteractions`.
57

68
Normal Adhesion
7-
^^^^^^^^^^^^^^^
9+
---------------
810

9-
For a given distance :math:`d`:
11+
The normal adhesion potential models the attraction force based on the distance between two surfaces.
12+
13+
.. math::
14+
A_n(\mathbf{x}) = \sum_{k \in C} a(d_k(\mathbf{x}); \hat{d}_p, \hat{d}_a, Y, \epsilon_c)
1015
11-
- If :math:`d < \hat{d}_p`:
12-
13-
.. math::
14-
A_n(d) = a_1 \cdot d^2 + c_1, \quad \text{where } a_1 = a_2 \left(1 - \frac{\hat{d}_a}{\hat{d}_p}\right)
16+
For a given distance :math:`d`:
1517

16-
- If :math:`\hat{d}_p \leq d < \hat{d}_a`:
18+
.. math::
19+
a(d)= \begin{cases}
20+
a_2\left(1-\frac{\hat{d}_a}{\hat{d}_p}\right) d^2+a_2\left(\hat{d}_a-\hat{d}_p\right)^2-d_p^2 a_1 & 0<d<\hat{d}_p \\
21+
a_2 d^2 - 2 a_2 \hat{d}_a d+a_2 \hat{d}_a^2 & \hat{d}_p \leq d<\hat{d}_a \\
22+
0 & \hat{d}_a \leq d
23+
\end{cases}
1724
18-
.. math::
19-
A_n(d) = (a_2 \cdot d + b_2) \cdot d + c_2, \quad \text{where } b_2 = -2 a_2 \hat{d}_a, \, c_2 = a_2 \hat{d}_a^2
25+
and
2026

21-
- If :math:`d \geq \hat{d}_a`:
27+
.. math::
28+
a_2=\frac{Y \varepsilon_c}{2\left(\hat{d}_p-\hat{d}_a\right)}.
2229
23-
.. math::
24-
A_n(d) = 0
30+
The parameters are:
2531

26-
The normal adhesion potential models the attraction force based on the distance between two surfaces.
32+
- :math:`\hat{d}_p` (``dhat_p``) is the threshold distance for adhesion (in units of distance) where the largest adhesion force is applied
33+
- :math:`\hat{d}_a` (``dhat_a``) is the adhesion activation distance (in units of distance), representing the maximum range where adhesion forces are active
34+
- :math:`Y` (``Y``) is the adhesion stiffness (in units of stress, such as Young's modulus), controlling the intensity of adhesion forces
35+
- :math:`\epsilon_c` (``eps_c``) is the adhesion coefficient (unitless) that defines the critical strain at which adhesion forces decrease
2736

28-
Here dhat_p (:math:\hat{d}_p) is the threshold distance for adhesion (in units of distance) where the largest adhesion force is applied.
29-
Here dhat_a (:math:\hat{d}_a) is the adhesion activation distance (in units of distance), representing the maximum range where adhesion forces are active.
30-
Here Y (:math:Y) is the adhesion stiffness (in units of stress, such as Young's modulus), controlling the intensity of adhesion forces.
31-
Here eps_c (:math:\epsilon_c) is the adhesion coefficient (unitless) that defines the critical strain at which adhesion forces decrease.
37+
We can build a normal adhesion potential object and compute the adhesion potential for a given set of normal collisions.
3238

3339
.. md-tab-set::
3440

@@ -41,8 +47,8 @@ Here eps_c (:math:\epsilon_c) is the adhesion coefficient (unitless) that define
4147
const double Y = 1e3;
4248
const double eps_c = 0.5;
4349

44-
const NormalAdhesionPotential A(dhat_p, dhat_a, Y, eps_c)
45-
double adhesion_potential = A(normal_collisions, collision_mesh, displacement);
50+
const ipc::NormalAdhesionPotential A_n(dhat_p, dhat_a, Y, eps_c)
51+
double adhesion_potential = A_n(normal_collisions, collision_mesh, vertices);
4652

4753
.. md-tab-item:: Python
4854

@@ -53,13 +59,13 @@ Here eps_c (:math:\epsilon_c) is the adhesion coefficient (unitless) that define
5359
Y = 1e3
5460
eps_c = 0.5
5561
56-
A = NormalAdhesionPotential(dhat_p, dhat_a, Y, eps_c)
57-
adhesion_potential = A(normal_collisions, collision_mesh, displacement)
62+
A_n = ipctk.NormalAdhesionPotential(dhat_p, dhat_a, Y, eps_c)
63+
adhesion_potential = A_n(normal_collisions, collision_mesh, vertices)
5864
59-
Normal Derivatives
65+
Derivatives
6066
^^^^^^^^^^^
6167

62-
We can also compute the first and second derivatives of the normal adhesion potential with respect to the displacement.
68+
We can also compute the first and second derivatives of the normal adhesion potential with respect to the vertex positions.
6369

6470
.. md-tab-set::
6571

@@ -68,39 +74,42 @@ We can also compute the first and second derivatives of the normal adhesion pote
6874
.. code-block:: c++
6975

7076
Eigen::VectorXd adhesion_potential_grad =
71-
A.gradient(normal_collisions, collision_mesh, displacement);
77+
A_n.gradient(normal_collisions, collision_mesh, vertices);
7278

7379
Eigen::SparseMatrix<double> adhesion_potential_hess =
74-
A.hessian(normal_collisions, collision_mesh, displacement);
80+
A_n.hessian(normal_collisions, collision_mesh, vertices);
7581

7682
.. md-tab-item:: Python
7783

7884
.. code-block:: python
7985
80-
adhesion_potential_grad = A.gradient(
81-
normal_collisions, collision_mesh, displacement)
86+
adhesion_potential_grad = A_n.gradient(normal_collisions, collision_mesh, vertices)
8287
83-
adhesion_potential_hess = A.hessian(
84-
normal_collisions, collision_mesh, displacement)
88+
adhesion_potential_hess = A_n.hessian(normal_collisions, collision_mesh, vertices)
8589
8690
Tangential Adhesion
87-
^^^^^^^^^^^^^^^
91+
-------------------
8892

8993
The tangential adhesion potential models resistance to sliding (parallel to surfaces).
9094

91-
For displacement :math:`x`:
95+
It is structured similar to the friction model with a smooth transition between sticking and sliding and lagged normal forces and tangential bases.
9296

93-
- If :math:`0 \leq x < 2 \varepsilon_a`:
97+
.. math::
98+
A_{t}(\mathbf{u}) = \sum_{k \in C} \mu_a \lambda_{k}^a f_{0}^a(\|\mathbf{T}_k^⊤ \mathbf{u}\|; \epsilon_a)
9499
95-
.. math::
96-
A_t(x) = \frac{x^2}{\varepsilon_a} \left(1 - \frac{y}{3 \varepsilon_a}\right)
100+
where :math:`C` is the lagged collisions, :math:`\lambda_k^a` is the normal adhesion force magnitude for the :math:`k`-th collision, :math:`\mathbf{T}_k` is the tangential basis for the :math:`k`-th collision, and :math:`f_0^a` is the smooth tangential adhesion function used to approximate the non-smooth transition from sticking to sliding.
97101

98-
- If :math:`x \geq 2 \varepsilon_a`:
102+
For relative displacement magnitude :math:`y`:
99103

100-
.. math::
101-
A_t(x) = \frac{4 \varepsilon_a}{3}
104+
.. math::
105+
f_0^a(y) = \begin{cases}
106+
-\frac{y^3}{3\epsilon_a^2} + \frac{y^2}{\epsilon_a} & 0 < y < 2 \epsilon_a \\
107+
\frac{4 \epsilon_a}{3} & 2 \epsilon_a \leq y
108+
\end{cases}
102109
103-
Here ``eps_a`` (:math:`\epsilon_a`) is the adhesion threshold (in units of displacement) used to smoothly transition.
110+
where :math:`\epsilon_a` (``eps_a``) is the adhesion threshold (in units of displacement) used to smoothly transition from sticking to sliding.
111+
112+
We can build a tangential adhesion potential object and compute the adhesion potential for a given set of tangential collisions.
104113

105114
.. md-tab-set::
106115

@@ -109,16 +118,16 @@ Here ``eps_a`` (:math:`\epsilon_a`) is the adhesion threshold (in units of displ
109118
.. code-block:: c++
110119

111120
const double eps_a = 0.01;
112-
const TangentialAdhesionPotential A(eps_a);
113-
double adhesion_potential = A(tangential_collisions, collision_mesh, displacement);
114-
121+
const ipc::TangentialAdhesionPotential A_t(eps_a);
122+
double adhesion_potential = A_t(tangential_collisions, collision_mesh, displacement);
123+
115124
.. md-tab-item:: Python
116125

117126
.. code-block:: python
118127
119128
eps_a = 0.01
120-
A = TangentialAdhesionPotential(eps_a)
121-
adhesion_potential = A(tangential_collisions, collision_mesh, displacement);
129+
A_t = ipctk.TangentialAdhesionPotential(eps_a)
130+
adhesion_potential = A_t(tangential_collisions, collision_mesh, displacement);
122131
123132
Derivatives
124133
^^^^^^^^^^^
@@ -132,17 +141,15 @@ We can also compute the first and second derivatives of the tangential adhesion
132141
.. code-block:: c++
133142

134143
Eigen::VectorXd adhesion_potential_grad =
135-
A.gradient(tangential_collisions, collision_mesh, displacement);
144+
A_t.gradient(tangential_collisions, collision_mesh, displacement);
136145

137146
Eigen::SparseMatrix<double> adhesion_potential_hess =
138-
A.hessian(tangential_collisions, collision_mesh, displacement);
147+
A_t.hessian(tangential_collisions, collision_mesh, displacement);
139148

140149
.. md-tab-item:: Python
141150

142151
.. code-block:: python
143152
144-
adhesion_potential_grad = A.gradient(
145-
tangential_collisions, collision_mesh, displacement)
153+
adhesion_potential_grad = A_t.gradient(tangential_collisions, collision_mesh, displacement)
146154
147-
adhesion_potential_hess = A.hessian(
148-
tangential_collisions, collision_mesh, displacement)
155+
adhesion_potential_hess = A_t.hessian(tangential_collisions, collision_mesh, displacement)

docs/source/tutorial/getting_started.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ This returns a scalar value ``barrier_potential`` which is the sum of the barrie
132132
Mathematically this is defined as
133133

134134
.. math::
135-
B(x) = \sum_{k \in C} b(d_k(x), \hat{d}),
135+
B(\mathbf{x}) = \sum_{k \in C} b(d_k(\mathbf{x}); \hat{d}),
136136
137-
where :math:`x` is our deformed vertex positions, :math:`C` is the active collisions, :math:`d_k` is the distance (squared) of the :math:`k`-th active collision, and :math:`b` is IPC's C2-clamped log-barrier function.
137+
where :math:`\mathbf{x}` is our deformed vertex positions, :math:`C` is the active collisions, :math:`d_k` is the distance (squared) of the :math:`k`-th active collision, and :math:`b` is IPC's C2-clamped log-barrier function.
138138

139139
.. note::
140140
This is **not** premultiplied by the barrier stiffness :math:`\kappa`.
@@ -392,14 +392,14 @@ Now we can compute the friction dissipative potential using the ``FrictionPotent
392392

393393
.. code-block:: c++
394394

395-
const FrictionPotential D(eps_v);
395+
const ipc::FrictionPotential D(eps_v);
396396
double friction_potential = D(tangential_collisions, collision_mesh, velocity);
397397

398398
.. md-tab-item:: Python
399399

400400
.. code-block:: python
401401
402-
D = FrictionPotential(eps_v)
402+
D = ipctk.FrictionPotential(eps_v)
403403
friction_potential = D(tangential_collisions, collision_mesh, velocity)
404404
405405
Here ``eps_v`` (:math:`\epsilon_v`) is the static friction threshold (in units of velocity) used to smoothly transition from dynamic to static friction.
@@ -408,18 +408,18 @@ Here ``eps_v`` (:math:`\epsilon_v`) is the static friction threshold (in units o
408408
The friction potential is a function of the velocities rather than the positions. We can compute the velocities directly from the current and previous position(s) based on our time-integration scheme. For example, if we are using backward Euler integration, then the velocity is
409409

410410
.. math::
411-
v = \frac{x - x^t}{h},
411+
\mathbf{v} = \frac{\mathbf{x} - \mathbf{x}^t}{h},
412412
413-
where :math:`x` is the current position, :math:`x^t` is the previous position, and :math:`h` is the time step size.
413+
where :math:`\mathbf{x}` is the current position, :math:`\mathbf{x}^t` is the previous position, and :math:`h` is the time step size.
414414

415415
This returns a scalar value ``friction_potential`` which is the sum of the individual friction potentials.
416416

417417
Mathematically this is defined as
418418

419419
.. math::
420-
D(v) = \sum_{k \in C} \mu\lambda_k^nf_0\left(\|T_k^\top v\|, \epsilon_v\right),
420+
D(\mathbf{v}) = \sum_{k \in C} \mu\lambda_k^nf_0\left(\|\mathbf{T}_k^\top \mathbf{v}\|; \epsilon_v\right),
421421
422-
where :math:`C` is the lagged collisions, :math:`\lambda_k^n` is the normal force magnitude for the :math:`k`-th collision, :math:`T_k` is the tangential basis for the :math:`k`-th collision, and :math:`f_0` is the smooth friction function used to approximate the non-smooth transition from dynamic to static friction.
422+
where :math:`C` is the lagged collisions, :math:`\lambda_k^n` is the normal force magnitude for the :math:`k`-th collision, :math:`\mathbf{T}_k` is the tangential basis for the :math:`k`-th collision, and :math:`f_0` is the smooth friction function used to approximate the non-smooth transition from dynamic to static friction.
423423

424424
Derivatives
425425
^^^^^^^^^^^

0 commit comments

Comments
 (0)