Page 1 of 1

PBC and translation of molecules in openmm-dcdreporter

Posted: Thu Jul 14, 2016 1:20 pm
by scychon
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.

Re: PBC and translation of molecules in openmm-dcdreporter

Posted: Thu Jul 14, 2016 1:30 pm
by peastman
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

Re: PBC and translation of molecules in openmm-dcdreporter

Posted: Thu Jul 14, 2016 1:57 pm
by scychon
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.

Re: PBC and translation of molecules in openmm-dcdreporter

Posted: Thu Jul 14, 2016 2:06 pm
by peastman
Reporters just report. They don't modify the context. All it's doing is specifying enforcePeriodicBox=True when it calls getState().

Peter