plumed / plumed2

Development version of plumed 2
https://www.plumed.org
GNU Lesser General Public License v3.0
357 stars 284 forks source link

FIX - Changing the sign of the argument of the exponential in LOWER_WALLS #1109

Open Iximiel opened 3 weeks ago

Iximiel commented 3 weeks ago
Description

This should solve #1091, see the issue for the problem

I want to benchmark the (-x) version against the (abs(x)) version, but maybe that is a thing for another PR.

Shall we add a new test to check the sign in this and maybe other COLVARs?

Target release

I would like my code to appear in release XXXXX

Type of contribution
Copyright
Tests
GiovanniBussi commented 3 weeks ago

I think the abs(x) vs -x has no impact on performance. I would use the most robust one.

Something that instead might be relevant (if you have many of these biases) is that they construct a lot of actions. @gtribello is it necessary? Are you aware that you can define intermediate values in lepton?

A test for it is here though it is not very instructive. But you can do something like:

FUNC=7*a^n;a=(x-x0);x0=3;n=2

The only counterintuitive thing is that values are parsed from right to left, so that you first use quantities then define them.

The example above should do 7*(x-3)^2

The advantage is that: