Skip to content

Commit

Permalink
FIX-2.9 Now the forces from LWALLS should be correct (#1111)
Browse files Browse the repository at this point in the history
* Now the forces from LWALLS should be correct (and maybe also the energies)

* now the documentation reflects the code better
  • Loading branch information
Iximiel authored Oct 9, 2024
1 parent 941986b commit 78d27e9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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

1 comment on commit 78d27e9

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/a-masterclass-22-09.txt
Found broken examples in automatic/a-masterclass-22-11.txt
Found broken examples in automatic/a-masterclass-22-12.txt
Found broken examples in automatic/performance-optimization.txt
Found broken examples in automatic/a-trieste-6.txt
Found broken examples in automatic/munster.txt
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in MiscelaneousPP.md

Please sign in to comment.