Handling of NPT trajectories
I have recently learnt (see e.g. this paper https://doi.org/10.1021/acs.jctc.3c00308 and references therein), that the handling of PBC in NPT simulations is far from trivial. Furthermore, different codes will use different wrapping/unwrapping schemes. While the effect should be null or negligible when simulating a solid or performing short simulations, this is no longer true for liquids simulated over very long time scales. The paper presents the effect on the m.s.d. and the self-diffusion coefficient, but any dynamical property would be affected.
I do not think that there is any simple solution, so for the moment I can only think of 3 possible actions:
- Do nothing and let the user with the full responsibility of how he/she uses MDANSE.
- Check (when converting or loading a trajectory) if we have an NPT trajectory (i.e. cell dimensions change) and if so, show a warning message preventing of the possible problems and citing this reference, so it is up to the user to decide what to do.
- Be strict and allow MDANSE to work only with constant-cell trajectories.
A 4th solution could be to agree that the TOR algorithm in the paper is the right way to do the wrapping and implement it, but I am afraid there are at least two difficulties:
- We need to handle many different types of trajectories (see discussion in the paper about Gromacs, NAMD and Lammps)
- The algorithm cannot be applied on individual atoms, but on centers of masses, and then the molecules reconstructed with the right dimensions.
I don't think that this will be an easy job, so my preference would go for the 2nd one. But this is open for discussion.