I think this question has been asked multiple times in the past, but I still have some confusion regarding this.
I'm trying to calculate MSD from my trajectory, but wasn't sure how openmm is reporting the coordinates with dcdreporter.
As I read the previous discussions, openmm does not wrap the molecule with the PBC unless one's using MCbarostat.
But from my recently generated nvt simulation in drudelangevinintegrator (my system has drude particles and customnbforce), the trajectory I got shows molecules to be always whole, but jumping across the periodic boundaries.
Any idea what could be the cause of the wrapped trajectory?
Thanks.
PBC and translation of molecules in openmm-dcdreporter
- CHANG YUN SON
- Posts: 27
- Joined: Wed Nov 05, 2014 1:18 pm
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: PBC and translation of molecules in openmm-dcdreporter
When you're simulating a periodic system, DCDReporter (and all other reporters) does wrap the coordinates to a single periodic box. But wrapping is always done at the level of whole molecules. It positions each molecule based on where its center is, but will never break a molecule in half.
Peter
Peter
- CHANG YUN SON
- Posts: 27
- Joined: Wed Nov 05, 2014 1:18 pm
Re: PBC and translation of molecules in openmm-dcdreporter
Thank you for clarifying it.
Does the reporters update the positions of the simulation.context too?
I'm curious if I can use unwrapped positions during the simulation, while using the reporters to record the wrapped positions.
If the reporters are updating the positions of the simulation object, I maybe have to unwrap it again to calculate diffusion or write my own reporter, I guess.
Does the reporters update the positions of the simulation.context too?
I'm curious if I can use unwrapped positions during the simulation, while using the reporters to record the wrapped positions.
If the reporters are updating the positions of the simulation object, I maybe have to unwrap it again to calculate diffusion or write my own reporter, I guess.
- Peter Eastman
- Posts: 2588
- Joined: Thu Aug 09, 2007 1:25 pm
Re: PBC and translation of molecules in openmm-dcdreporter
Reporters just report. They don't modify the context. All it's doing is specifying enforcePeriodicBox=True when it calls getState().
Peter
Peter