Page 1 of 1

Periodic BCs and output issue

Posted: Wed May 15, 2019 12:35 pm
by gideonsimpson
I am not sure if this is a genuine issue or not, but I ran some simple LJ cluster experiments with what I thought were periodic boundary conditions. The output, when viewed in Ovito, looks a bit more like shrink wrapped boundary conditions have been applied (i.e., the bounding box changes in size throughout the visualization). Perhaps this is just an artifact of how the PDB output data is pulled into Ovito.

I constructed my BCs with commands like:

Code: Select all

# other code
box_vectors = np.diag([box_edge/unit.angstrom for i in range(3)]) * unit.angstroms
system.setDefaultPeriodicBoxVectors(*box_vectors)
# other code
force = openmm.NonbondedForce()
force.setNonbondedMethod(openmm.NonbondedForce.CutoffPeriodic)
# other code
simulation.reporters.append(app.PDBReporter('output.pdb', 100,enforcePeriodicBox=True))
I'm not sure if I missed something.

Re: Periodic BCs and output issue

Posted: Wed May 15, 2019 2:34 pm
by peastman
I'm not sure what you mean by shrink wrapped boundary conditions. Does your simulation include a barostat? If so, the box will change size. Otherwise, it should stay fixed. Since you specified enforcePeriodicBox=True, the output should have all molecules translated into a single box. That is applied to the center of each molecule, so a molecule may still stick out beyond the edge of the box.

Re: Periodic BCs and output issue

Posted: Wed May 15, 2019 2:55 pm
by gideonsimpson
I'm attaching a screen capture from Ovito. Again, this may be purely an artifact of how Ovito is interpreting the PDB output, in which case it's not really a problem. But notice that the dimensions of the cell, which started off cubic, are no longer uniform and that the locations of the particles appear to be determining the limits of the computational cell.

Re: Periodic BCs and output issue

Posted: Wed May 15, 2019 4:54 pm
by peastman
That looks to me like the box it's drawing is the minimum box containing all the particles. Which is not the same as the periodic box used in the simulation.

Re: Periodic BCs and output issue

Posted: Wed May 15, 2019 7:13 pm
by gideonsimpson
So does that mean that I'm writing PDB data incorrectly, or should I ask the Ovito people about how to post process it in the way I had anticipated?

Re: Periodic BCs and output issue

Posted: Thu May 16, 2019 8:22 am
by peastman
Neither one. It just means you should ignore the box it's drawing around the atoms. It doesn't mean what you think it does.