openmm / openmm-plumed

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

UNITS not taken into account #32

Closed tonigi closed 3 years ago

tonigi commented 4 years ago

It looks like UNITS statements don't have an effect - this is easily seen for LENGTH in this test case but I suspect it affects energies etc.

I have seen that conversion factors are properly set in the code, so I can't really figure out the underlying cause. Posting it here for future reference.

GiovanniBussi commented 4 years ago

@tonigi I think I know the reason. UNITS should be set before PLUMED initialization, whereas OpenMM pushes the lines one by one after initialization. So I would say this is a bug within PLUMED, but it might be difficult to solve since changing units after initialization might be dangerous.

I would rather solve it by raising an error when users try to do that. What do you think?

raimis commented 3 years ago

@tonigi do you know if this is already fixed with the PLUMED 2.7 release?

GiovanniBussi commented 3 years ago

@raimis this should be fixed in 2.4.8/2.5.5/2.6.1/2.7.0 but please let us know if you find problems with one of those (or later) versions

raimis commented 3 years ago

OK! I confirm, the problem with the parse has been fixed.