|
5 | 5 | :attr:`add_spring` |
6 | 6 | ================== |
7 | 7 |
|
8 | | -This keyword is used to add a spring between a ghost atom and the centroid of atoms in a selected group. |
| 8 | +This keyword adds spring interactions to selected atom groups at each step of a run. |
| 9 | + |
| 10 | +It supports three modes: :attr:`ghost_com`, :attr:`ghost_atom`, and :attr:`com_com`, which add spring forces between a ghost atom and the center of mass (COM) of a group, between ghost atoms and their corresponding atoms in a group, and between the COMs of two groups, respectively. The ghost atom(s) can be static or move at a constant velocity. Each mode supports two spring types: :attr:`couple` (a single radial spring) and :attr:`decouple` (three independent springs along the x, y, and z directions). |
9 | 11 |
|
10 | 12 | Syntax |
11 | 13 | ------ |
12 | 14 |
|
13 | | -This keyword is used in one of the following two ways:: |
| 15 | +The complete syntax for the six combinations is:: |
14 | 16 |
|
15 | | - add_spring ghost_com <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> couple <k_couple> <R0> <offset_x> <offset_y> <offset_z> # usage 1 |
16 | | - add_spring ghost_com <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> decouple <k_decouple_x> <k_decouple_y> <k_decouple_z> <offset_x> <offset_y> <offset_z> # usage 2 |
| 17 | + add_spring ghost_com <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> couple <k_couple> <R0> <offset_x> <offset_y> <offset_z> |
| 18 | + add_spring ghost_com <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> decouple <k_decouple_x> <k_decouple_y> <k_decouple_z> <offset_x> <offset_y> <offset_z> |
| 19 | + add_spring ghost_atom <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> couple <k_couple> <R0> <offset_x> <offset_y> <offset_z> |
| 20 | + add_spring ghost_atom <group_method> <group_id> <ghost_vx> <ghost_vy> <ghost_vz> decouple <k_decouple_x> <k_decouple_y> <k_decouple_z> <offset_x> <offset_y> <offset_z> |
| 21 | + add_spring com_com <group_method> <group_id_1> <group_id_2> couple <k_couple> <R0> |
| 22 | + add_spring com_com <group_method> <group_id_1> <group_id_2> decouple <k_decouple_x> <k_decouple_y> <k_decouple_z> |
17 | 23 |
|
18 | | -The function of the coupled spring potential is given by the equation: |
| 24 | +The coupled spring potential is: |
19 | 25 |
|
20 | 26 | .. math:: |
21 | 27 |
|
22 | 28 | U_{\mathrm{couple}} = \frac{1}{2} k_{\mathrm{couple}} (R - R_0)^2 |
23 | | - |
24 | | -where :math:`R` is the distance between the ghost atom and the centroid of the selected group. The function of the decoupled spring potential is given by the equation: |
| 29 | +
|
| 30 | +where :math:`R` is the distance between the two points connected by the spring. |
| 31 | + |
| 32 | +The decoupled spring potential is: |
25 | 33 |
|
26 | 34 | .. math:: |
27 | 35 |
|
28 | | - U_{\mathrm{decouple}} = \frac{1}{2} k_{\mathrm{decouple},x} (x - x_{\mathrm{ghost}})^2 + \frac{1}{2} k_{\mathrm{decouple},y} (y - y_{\mathrm{ghost}})^2 + \frac{1}{2} k_{\mathrm{decouple},z} (z - z_{\mathrm{ghost}})^2 |
29 | | - |
30 | | -where :math:`(x_{\mathrm{ghost}}, y_{\mathrm{ghost}}, z_{\mathrm{ghost}})` is the position of the ghost atom and :math:`(x, y, z)` is the position of the centroid of the selected group. |
| 36 | + U_{\mathrm{decouple}} = \frac{1}{2} k_{\mathrm{decouple},x} (x_2 - x_1)^2 + \frac{1}{2} k_{\mathrm{decouple},y} (y_2 - y_1)^2 + \frac{1}{2} k_{\mathrm{decouple},z} (z_2 - z_1)^2 |
31 | 37 |
|
32 | | -* Force is added to atoms in group :attr:`group_id` of group method :attr:`group_method`. |
33 | | -* In the first usage, a spring is coupled to the ghost atom with spring constant :attr:`k_couple` and equilibrium distance :attr:`R0`. |
34 | | -* In the second usage, a spring is decoupled from the ghost atom with spring constants :attr:`k_decouple_x`, :attr:`k_decouple_y`, and :attr:`k_decouple_z` in the x, y, and z directions, respectively. |
35 | | -* The ghost atom starts at the position of the centroid of the selected group plus the offset vector (:attr:`offset_x`, :attr:`offset_y`, :attr:`offset_z`), and moves with velocity (:attr:`ghost_vx`, :attr:`ghost_vy`, :attr:`ghost_vz`). |
| 38 | +where :math:`(x_1, y_1, z_1)` and :math:`(x_2, y_2, z_2)` are the Cartesian coordinates of the two points connected by the spring. |
| 39 | + |
| 40 | +* In :attr:`ghost_com` mode, force is added to atoms in group :attr:`group_id` of group method :attr:`group_method` with mass-weighted distribution. The ghost is initially placed at the COM + (:attr:`offset_x`, :attr:`offset_y`, :attr:`offset_z`) and is displaced by (:attr:`ghost_vx`, :attr:`ghost_vy`, :attr:`ghost_vz`) at each step. |
| 41 | +* In :attr:`ghost_atom` mode, each atom in group :attr:`group_id` is attached to its own ghost anchor. The anchor is initially placed at the atom position + (:attr:`offset_x`, :attr:`offset_y`, :attr:`offset_z`) and is displaced by (:attr:`ghost_vx`, :attr:`ghost_vy`, :attr:`ghost_vz`) at each step. The input spring constant(s) (:attr:`k_couple` or :attr:`k_decouple_x`, :attr:`k_decouple_y`, :attr:`k_decouple_z`) represent the total stiffness of the entire group and are divided internally by the number of atoms in the group. Thus, each atom experiences a spring with an effective stiffness of :attr:`k / N_atoms`. |
| 42 | +* In :attr:`com_com` mode, a spring interaction is applied between the COM of group :attr:`group_id_1` and the COM of group :attr:`group_id_2` under the same :attr:`group_method`. Equal and opposite forces are applied to the two groups with mass-weighted distribution within each group. |
| 43 | +* In :attr:`couple` mode, :attr:`k_couple` must be positive and :attr:`R0` must be non-negative. |
| 44 | +* In :attr:`decouple` mode, :attr:`k_decouple_x`, :attr:`k_decouple_y`, and :attr:`k_decouple_z` must be non-negative. |
| 45 | +* In :attr:`com_com` mode, :attr:`group_id_1` and :attr:`group_id_2` must be different. |
36 | 46 | * Force is in units of eV/Å, distance is in units of Å, velocity is in units of Å/step, and spring constant is in units of eV/Ų. |
37 | | -* Spring forces are written to `spring_force_*.out`, where the asterisk is replaced by a zero-based index that increments with each invocation of the command. The meaning of each column in the file is:: |
| 47 | +* Spring forces are written to the file :attr:`spring_force_*.out`, where the asterisk is replaced by a zero-based index that increments with each invocation of the command. The meaning of each column in the file is:: |
| 48 | + |
| 49 | + # step mode Fx Fy Fz Ftotal energy |
| 50 | + |
| 51 | +where :attr:`mode` is an integer flag: 0 = ghost_com, 1 = ghost_atom, 2 = com_com. In :attr:`com_com` mode, the reported :attr:`Fx`, :attr:`Fy`, and :attr:`Fz` correspond to the net spring force applied to :attr:`group_id_1`. |
| 52 | + |
| 53 | +Example 1 (ghost_com + couple) |
| 54 | +------------------------------ |
| 55 | + |
| 56 | +Add a coupled spring with spring constant 10 eV/Ų and equilibrium distance 0 Šbetween a static ghost atom and the COM of atoms in group 2 defined by group method 0. The ghost atom is initially located at the COM:: |
| 57 | + |
| 58 | + add_spring ghost_com 0 2 0 0 0 couple 10 0 0 0 0 |
| 59 | + |
| 60 | +Example 2 (ghost_com + decouple) |
| 61 | +-------------------------------- |
38 | 62 |
|
39 | | - # step call mode Fx Fy Fz energy spring_force |
| 63 | +Add a decoupled spring with spring constants 10 eV/Ų in the x direction and 0 eV/Ų in the y and z directions between a ghost atom moving at velocity (0.00005, 0, 0) Å/step and the COM of atoms in group 2 defined by group method 0. The ghost atom is initially located at the COM:: |
40 | 64 |
|
| 65 | + add_spring ghost_com 0 2 0.00005 0 0 decouple 10 0 0 0 0 0 |
41 | 66 |
|
42 | | -Example 1 |
43 | | ---------- |
| 67 | +Example 3 (ghost_atom + couple) |
| 68 | +------------------------------- |
44 | 69 |
|
45 | | -Add a coupled spring with spring constant 10 eV/Ų and equilibrium distance 0 Šbetween a static ghost atom and the centroid of atoms in group 2 of group method 0. The ghost atom is initially in the same position as the centroid:: |
| 70 | +Add a coupled spring between each atom in group 2 defined by group method 0 and its corresponding moving ghost anchor. Each anchor is initially placed at the corresponding atom position and moves at velocity (0.00005, 0, 0) Å/step:: |
46 | 71 |
|
47 | | - add_spring ghost_com 0 2 0 0 0 couple 10 0 0 0 0 |
| 72 | + add_spring ghost_atom 0 2 0.00005 0 0 couple 10 0 0 0 0 |
48 | 73 |
|
49 | | -Example 2 |
50 | | ---------- |
| 74 | +Example 4 (com_com + decouple) |
| 75 | +------------------------------ |
51 | 76 |
|
52 | | -Add a decoupled spring with spring constants 10 eV/Ų in the x direction and 0 eV/Ų in the y and z directions between a ghost atom moving with velocity (0.00005, 0, 0) Å/step and the centroid of atoms in group 2 of group method 0. The ghost atom is initially in the same position as the centroid:: |
| 77 | +Add a decoupled Cartesian spring between the COM of group 1 and the COM of group 2 under the same group method 0:: |
53 | 78 |
|
54 | | - add_spring ghost_com 0 2 0.00005 0 0 decouple 10 0 0 0 0 0 |
| 79 | + add_spring com_com 0 1 2 decouple 10 0 0 |
55 | 80 |
|
56 | 81 | Note |
57 | 82 | ---- |
58 | 83 |
|
59 | | -This keyword can be used multiple times during a run. |
| 84 | +This keyword can be used multiple times during a run. |
0 commit comments