You’re absolutely right — the body-frame x-axis (from the rotation matrix) is mapped into the lab frame by the quaternion, so the interaction direction rotates with the particle. That means the interaction vector used in ylz
is always aligned with the current body x-axis, not fixed in space.
Here’s an updated version of your post with that nuance clarified:
Subject: Orientation Axis in ylz
Pair Style (ASPHERE Package)
Hi,
I’m working with the vesicle
example in the ASPHERE
package using the ylz
pair style, which runs smoothly.
The ellipsoids in the input data (read_data.vesicle1026
) have shapes:
1.000000 1.000000 1.010000
Since shapez
is slightly larger, I initially assumed that the interaction direction of the ylz
potential would follow the longest axis (i.e., shapez
).
However, looking into pair_ylz.cpp
, the interaction vectors are taken from the first row of the body-frame rotation matrix (converted from quaternions), as shown here:
ni1[0] = a1[0][0];
ni1[1] = a1[0][1];
ni1[2] = a1[0][2];
This suggests that the interaction direction follows the particle’s body x-axis, regardless of which axis is longest in shape. So even if shapez > shapex
, the direction used by ylz
for orientation-based interactions is tied to the x-axis in the body frame, as rotated into the lab frame by the quaternion.
Is this interpretation correct? If so, is there any particular reason the example uses shapez > shapex
, or is that just incidental?
Thanks!