Dear OpenMM developers:
I'm setting up a simulation with PBC, and find that there are two functions for defining the periodic box: topology.setPeriodicBoxVectors() and system.setDefaultPeriodicBoxVectors(). I'm wondering which one should be chosen and what's their differences? I'll really appreciate it if anyone could help me figure it out
Thanks for your attention
Xinyu
Setup PBC box
- Peter Eastman
- Posts: 2583
- Joined: Thu Aug 09, 2007 1:25 pm
Re: Setup PBC box
Topologies and Systems are different objects that represent different things. When you call forcefield.createSystem(topology, ...) to create a System from a Topology, that System has its default periodic box vectors set to the ones from the Topology.
There's also a third place where box vectors get stored: in the Context. The System specifies default box vectors, that is, the ones to use on newly created Contexts. If your simulation includes a barostat, the box vectors will change with time. The Context stores the current box vectors at a particular point during the simulation.
There's also a third place where box vectors get stored: in the Context. The System specifies default box vectors, that is, the ones to use on newly created Contexts. If your simulation includes a barostat, the box vectors will change with time. The Context stores the current box vectors at a particular point during the simulation.
Re: Setup PBC box
Thank you so much for your quick reply! It's pretty helpful!