Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX-2.9 Now the forces from LWALLS should be correct #1111

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/bias/LWalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ The restraining potential starts acting on the system when the value of the CV i
minus an offset \f$o_i\f$ (OFFSET).
The expression for the bias due to the wall is given by:

for UPPER_WALLS:
\f$
\sum_i {k_i}((x_i-a_i+o_i)/s_i)^e_i
\f$

for LOWER_WALLS:
\f$
\sum_i {k_i}|(x_i-a_i-o_i)/s_i|^e_i
\f$

\f$k_i\f$ (KAPPA) is an energy constant in internal unit of the code, \f$s_i\f$ (EPS) a rescaling factor and
\f$e_i\f$ (EXP) the exponent determining the power law. By default: EXP = 2, EPS = 1.0, OFFSET = 0.

Expand Down Expand Up @@ -133,7 +139,7 @@ void LWalls::calculate() {
if( lscale < 0.) {
const double k=kappa[i];
const double exponent=exp[i];
double power = std::pow( lscale, exponent );
double power = std::pow( -lscale, exponent );
f = -( k / epsilon ) * exponent * power / lscale;
ene += k * power;
totf2 += f * f;
Expand Down
6 changes: 6 additions & 0 deletions src/bias/UWalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,16 @@ The restraining potential starts acting on the system when the value of the CV i
minus an offset \f$o_i\f$ (OFFSET).
The expression for the bias due to the wall is given by:

for UPPER_WALLS:
\f$
\sum_i {k_i}((x_i-a_i+o_i)/s_i)^e_i
\f$

for LOWER_WALLS:
\f$
\sum_i {k_i}|(x_i-a_i-o_i)/s_i|^e_i
\f$

\f$k_i\f$ (KAPPA) is an energy constant in internal unit of the code, \f$s_i\f$ (EPS) a rescaling factor and
\f$e_i\f$ (EXP) the exponent determining the power law. By default: EXP = 2, EPS = 1.0, OFFSET = 0.

Expand Down
Loading