openmm / openmm-plumed

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

Implement setTemperature and getTemperature #28

Closed raimis closed 4 years ago

raimis commented 4 years ago

PLUMED allows to pass kT value via its API (https://www.plumed.org/doc-v2.6/developer-doc/html/_how_to_plumed_your_m_d.html):

plumed_cmd(plumedmain, "setKbT", &kT);

This PR implements a corresponding functionality for OpenMM-PLUMED API:

void PlumedForce::setTemperature(double temperature);
double PlumedForce::getTemperature() const;
raimis commented 4 years ago

This should be the last PR from the getter/setter series.

peastman commented 4 years ago

How about instead having the user set the temperature? That's much more friendly, and also more consistent with everything else in OpenMM. Boltzmann's constant with units of kJ/(mol*K) is defined in SimTKOpenMMRealType.h with the name BOLTZ.

raimis commented 4 years ago

OK! I'll change to temperature.

peastman commented 4 years ago

Can you also add tests for the new feature? Verify that the new property gets serialized correctly, and that PLUMED is using it correctly.

raimis commented 4 years ago

I have added the serialization tests. PLUMED prints the temperature (kT) to its log, but I need to think how to test it more properly.

raimis commented 4 years ago

I have added a fest for setTemperature. I reproduce WT-MTD results, which needs correct temperature to work.

peastman commented 4 years ago

Looks good! Is this ready to merge?

raimis commented 4 years ago

Yes! It is ready to be merged.