openmm / openmm-plumed

OpenMM plugin to interface with PLUMED
59 stars 23 forks source link

Can add PlumedForce() but no COLVAR or HILLS file is written. #48

Closed mdpoleto closed 3 years ago

mdpoleto commented 3 years ago

Hi,

I am using OpenMM 7.5 and just successfully installed openmm-plumed through conda. My "conda list" output is:

openmm                    7.5.0            py37h7adb4fe_4    conda-forge
openmm-plumed             1.0              py37h49e701d_3    conda-forge
plumed                    2.7.0                h1ff6a10_0    conda-forge

I can successfully build my system and add a PlumedForce using the lines below:

#atom1 = 1798 in PDB count
#atom2 = 2438 in PDB count
script = """
d: DISTANCE ATOMS=1797,2437
METAD ARG=d SIGMA=0.2 HEIGHT=0.3 PACE=500 FILE=HILLS
PRINT STRIDE=1 ARG=* FILE=COLVAR"""
system.addForce(PlumedForce(script))

The simulation runs smoothly, but no COLVAR or HILLS files are written, nor visible bias is observed between atoms 1797 and 2437. Is this a normal behavior?

raimis commented 3 years ago

Could you share a complete script with all the necessary files to reproduce the issue.

mdpoleto commented 3 years ago

Just found out what was wrong (a complete rookie mistake): I added the PlumedForce() after setting the simulation context, so the simulation ran without the bias.

If I place the PlumedForce() section before setting the simulation context and everything worked out just fine. Sorry for the inconvenience!

ps: it might be a good idea to have some complete examples of openMM scripts using the openmmplumed package here. I could not find one anywhere.

raimis commented 3 years ago

It is good hear that you found a solution.

I close this issue, meanwhile, I have made a separate issue regarding the tutorial.