From: Axel Kohlmeyer (
Date: Wed Feb 16 2005 - 06:02:17 CST

On Tue, 15 Feb 2005, Xiongce Zhao wrote:

XZ> Hi, Dear All,
XZ> I simulate a system with Periodic Boundary. The NAMD seems to use the
XZ> infinite checkerboard for writing molecule positions in DCD file. It
XZ> doesnot matter for simulation, but makes the movie ugly. Any one knows
XZ> how to image the molecules back into the box ? Can this be done in VMD?

dear xiongce,

there is a pbcwrap script in the VMD script library that
does this. under:
you can find a modified version of it, that does not take the
unitcell information from an external file, but uses the information
internally available to VMD. if your trajectory file does not
provide this information, you have to set it for each time step.
for constant volume simulations, you can use the code from:


XZ> Thanks for your help.
XZ> Xiongce

Dr. Axel Kohlmeyer   e-mail:
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum
If you make something idiot-proof, the universe creates a better idiot.