vesicle example lammps with pairstyle ylz

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!

Since any 3D rotation can be uniquely specified by three numbers (rotation angles about x, y, and z axes), it makes sense that these angles can be recovered from any three (suitably chosen) entries of a valid rotation matrix.

A quick check of Wikipedia shows that the matrix’s top row certainly seems to encode those three rotation angles uniquely (presumably besides the usual Euler instabilities etc etc).

Of course, I can’t tell you at first glance that the code is valid. But it should not be difficult to perform simple numerical experiments confirming that all three axes, not just x, contribute to this particular aspherical interaction (for example by changing the y or z aspects).