Open Iximiel opened 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:
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
COPYRIGHT
file with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulename
in order to make sure the headers of the module are correct.Tests