Truncated octahedron : Problems in PBC when reading a dcd file with NAMD

From: Panel Nicolas (M.) (
Date: Mon Mar 16 2015 - 11:18:00 CDT

Dear All,

I did some NPT FEP simulations with NAMD 2.10 and I would like to read my produced dcd with NAMD to recalculate energies at each time step of my trajectories.
I prepared my systems with CHARMM, CHARMM-GUI more precisely, in a truncated octahedron water box. According to some informations found in the NAMD mail-listing and to be
consistent with CHARMM, I set the cell parameters as following in my NAMD input file:

set cell 78
set cell1 [ expr ($cell)/(3*sqrt(3)) ]
set cell2 [ expr 5*$cell1 ]
cellBasisVector1 $cell2 -$cell1 -$cell1
cellBasisVector2 -$cell1 $cell2 -$cell1
cellBasisVector3 -$cell1 -$cell1 $cell2
wrapAll on
wrapWater on
wrapNearest on

With these parameters, the shape of my water box is preserved during MD and there is no problem with the energies.
But when I read my trajectory frame by frame in a TCL loop with NAMD (see attachment ) I have very high energies (9999999999.9999) for VdW, kinetic, temp, potential and Pressure.
I think this problem comes from the PBC defined in the dcd file becaue when I desable the "dcdunitcell" option and use the PBC conditions defined in the .xst file to compute energies for a giving frame,
I get the same energies as during the simulation. In addition, for a frame, the cell vectors are completly different between .xst and .dcd files. For example, for a given frame I obtain:


cellBasisVector1 73.8717 -14.7743 -14.7743
cellBasisVector2 -14.7743 73.8717 -14.7743
cellBasisVector3 -14.7743 -14.7743 73.8717


cellBasisVector1 76.7698 0 0
cellBasisVector2 -25.5899 72.3792 0
cellBasisVector2 -25.5899 -36.1897 62.6822

I don't know if these two definitions are equivalent but I don't think so according with my results.

The only way I found to solve my problem is to make a NAMD input file for each simulation frames with the corresponding xsc file extracted from the xst file. But it is very slow compare to run NAMD only once and loop over the trajectory. I can't afford this waste of computation time because I work on a supercomputer.

I have 3 questions about that:
1) Are the PBC contained in the dcd false in my case?
2) Is it possible to read an xst file in NAMD to update the PBC at each frames when I'm reading a trajectory ( I have found nothing in the sourcecode)?
3) Probably easier, is it possible to update the PBC in a tcl loop in NAMD?

Thank you in anticipation

Nicolas Panel 
PhD student 
École Polytechnique Palaiseau 
Laboratoire de Biochimie, BIOC 

This archive was generated by hypermail 2.1.6 : Thu Dec 31 2015 - 23:21:44 CST