Hello,
I am studying the implementation of fix rigid/npt/small and would like to understand the reasoning behind the box-remapping order.
Source version/commit: [version or commit]
In FixRigidNHSmall::initial_integrate(), the relevant sequence is:
if (pstat_flag) remap();
set_xv();
if (pstat_flag) {
remap();
if (kspace_flag) force->kspace->setup();
}
My understanding is that set_xv() reconstructs the atom positions from the body center of mass, orientation, and fixed body-frame displacements. However, the second remap() appears to rescale the constituent atom positions as well as the body centers of mass. final_integrate() subsequently calls set_v(), without reconstructing the positions again.
With dilate all, does this mean that the coordinates used for the subsequent force calculation have slightly different internal distances from the stored rigid-body geometry?
If this understanding is correct, what is the reason for this ordering? Is the resulting deviation required by the integration scheme or constraint-virial calculation, or is it a finite-timestep approximation accepted by the implementation? In particular, why is the geometry not reconstructed after the second remap, using the updated center of mass?
I have looked at the NPT equations in Kamberaj, Low, and Neal, J. Chem. Phys. 122, 224114 (2005), but I could not identify a step requiring the internal displacements to be rescaled. I may be missing a detail in how those equations correspond to the LAMMPS implementation.
I also found this earlier discussion:
https://matsci.org/t/fluctuating-bond-lengths-during-rigid-npt-fix/44411
It discusses the observed bond-length fluctuations, but I would appreciate clarification of the implementation rationale or a reference explaining it.
Thank you for your time.