How can I access the original xlo/xhi box bounds from a LAMMPS dump file in MDAnalysis? #5026
Replies: 2 comments 1 reply
-
I have encountered a related issue in MDAnalysis ≥2.4 due to the following change: “Changed in version 2.4.0: Now imports velocities and forces, translates the box to the origin, and optionally unwraps trajectories with image flags upon loading.” In my simulations, I use LAMMPS with the fix recenter command to manually center the polymer within the simulation box, resulting in the polymer’s center of mass located at (0, 0, 0). In LAMMPS, particle positions are within the range [-0.5L_i, 0.5L_i] in each dimension, where L_i is the box length along direction i. The automatic box translation in MDAnalysis 2.4.0+ unfortunately overrides this, shifting all particle coordinates to the range [0, L_i] and disrupting the default LAMMPS behavior and any intended recentring operation. It would be helpful to make this translation optional by default (or easier to disable), so users who manually recenter their systems in LAMMPS do not encounter this issue. |
Beta Was this translation helpful? Give feedback.
-
The detailed box information is not stored in MDAnalysis. In MDAnalysis the convention is that the unitcell's front lower left corner is at the origin (0,0,0), the first box vector is along [1,0,0] (x-axis), the second box vector in the x-y plane, and the third one forms a right-handed coordinate system with the first and second one.
Please open an issue for the feature. This sounds do-able. Code contributions are welcome, especially from LAMMPS users — we do not have many on the core developer team and could really do with some expert input. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working with a LAMMPS trajectory in MDAnalysis using the default LAMMPSDUMP format, like this:
In my LAMMPS dump file, the box bounds are written explicitly and do not start at '0', for example:
However, when I access
u.trajectory.ts.dimensions
, I only get the box lengths,332.43378, 332.43378, 332.43378, 90. , 90. , 90.
MDAnalysis assumes that the box starts at zero and is giving me the length along X,Y and Z. This causes issues when I'm trying to re-center atoms. Is there a way to access the actual xlo, xhi, etc. values from within MDAnalysis (e.g., something like
u.trajectory.ts.xlo
)? Or do I have to manually parse the dump file to retrieve these values?Thanks !
Beta Was this translation helpful? Give feedback.
All reactions