Re: [MetaD; namd 2.9] Pmf output file problem once the CV boundaries are reached, even using "expandBoundaries on"

From: Giacomo Fiorin (
Date: Tue Nov 20 2012 - 18:41:02 CST

Hi, yes, I believe that there is a small issue there with the output of the
pmf, but not with the state file. So the feature works for continuing a
simulation, the problem comes out when generating a PMF for plotting
purposes. I'm currently investigating this issue, but first I wanted to
reply to the other questions.

Yes, it is a very good practice to set wide boundaries, and no, there is no
noticeable additional cost at runtime. So always pad each boundary with
some extra margin, at the very least the size of one or two gaussians in
each direction (i.e. add or subtract 2*width to the respective boundary).

The state files get bigger, but may be zipped to a tiny size.

Also, you may want to artificially confine the variable by setting suitable
values for lowerWall and upperWall, to guarantee that the variable never
goes near lowerBoundary or upperBoundary (the grid boundaries).


On Sun, Nov 18, 2012 at 4:53 PM, Robert Elder <> wrote:

> Hello again NAMD users,
> I am experiencing the same problem that Salvatore Cosseddu describes
> below: using NAMD 2.9 for metadynamics with expandBoundaries on, the
> program correctly expands the boundaries of the metadynamics bias (in the
> .state file) but does not expand the boundaries of the PMF it generates
> from the bias. I've looked through the source code and can't determine why
> this is the case. At first, I thought this might be related to my use of
> replica-exchange combined with metadynamics, but since it also occurred in
> the case below I don't think that's the case.
> It's easy enough to rebuild the PMF from the bias energy recorded in the
> state file, but I'm hoping there's an even easier patch I can apply to the
> code! :)
> As a small piece of advice for others, you might consider making your
> specified grid much larger than the values you expect your collective
> variable(s) to explore. That way, you won't have to worry about the grid
> changing size. There isn't a significant cost for doing so (right?) and it
> will simplify the use of the output later, for plotting etc. And it serves
> as a quick fix for the problem I've described here. Additionally, don't
> forget (like I did) that the hills will extend beyond the boundaries even
> if their centers are located within the boundaries, e.g. even for
> quantities like end-to-end distance that cannot go below zero, there will
> be energy recorded for negative values.
> Best regards, and thanks very much for your help,
> Robert Elder
> PhD Student, Chemical and Biological Engineering
> University of Colorado-Boulder
> On Fri, Sep 7, 2012 at 10:38 AM, Giacomo Fiorin <>wrote:
>> Hello Salvatore, what is your configuration file? Send it off list if
>> you'd like to.
>> Giacomo
>> On Fri, Sep 7, 2012 at 8:49 AM, Salvatore Mario Cosseddu <
>>> wrote:
>>> Dear all,
>>> I'm using namd2.9 colvar module for metaD calculations.
>>> Once the colvars exceed the boundaries set in the input file, the output
>>> file does not adjust the grid size, even using "expandBoundaries on"
>>> Everything worked fine using version 2.8, the problem started with
>>> version 2.9. I'm attaching an example of PMF and the trajectories of che
>>> CVs (in that case well-tempered MetaD, the boundaries are:
>>> CV1: 2.1-15
>>> CV2: 0.5 - 7.1 exceeded to over 8)
>>> I'm thinking to rebuild the PMF from the gaussian trajectories, but I'd
>>> like to let you know this problem in advance, in order to avoid wasting
>>> time in the case of a deeper problem.
>>> Regards, and thanks again for your work and help
>>> Salvatore
>>> --
>>> Salvatore Cosseddu
>>> PhD student
>>> Centre for Scientific Computing and School of Engineering
>>> University of Warwick
>>> Coventry CV4 7AL
>>> United Kingdom
>>> email:

This archive was generated by hypermail 2.1.6 : Mon Dec 31 2012 - 23:22:17 CST