Dear plumed developers and users,
I am experiencing a weird issue (possibly a bug) I don't fully understand. I am running a metadynamics in Lammps where I want the CV space to be limited using walls (see the plumed.dat file below):
UNITS LENGTH=A TIME=fs ENERGY=kcal/mol
cent: COM ATOMS=481-482
pos: POSITION SCALED_COMPONENTS ATOM=cent
cv1: CUSTOM ARG=pos.a VAR=a FUNC=18.413*a PERIODIC=0,18.413
cv2: CUSTOM ARG=pos.b VAR=b FUNC=18.413*b PERIODIC=0,18.413
cv3: CUSTOM ARG=pos.c VAR=c FUNC=18.413*c PERIODIC=0,18.413
METAD ...
ARG=cv1,cv2,cv3 PACE=2000 HEIGHT=0.25 SIGMA=0.5,0.5,0.5 FILE=HILLS TEMP=480.0 BIASFACTOR=20
GRID_MIN=0,0,0 GRID_MAX=18.413,18.413,18.413 GRID_BIN=200,200,200
LABEL=metad
... METAD
LOWER_WALLS ARG=cv1,cv2,cv3 AT=0.8,0.8,0.8 KAPPA=400.0,400.0,400.0 LABEL=wl
UPPER_WALLS ARG=cv1,cv2,cv3 AT=17.9,8.1,8.1 KAPPA=400.0,400.0,400.0 LABEL=wu
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,metad.bias FILE=COLVAR
PRINT STRIDE=2000 ARG=cv1,cv2,cv3,wl.bias,wu.bias FILE=WALLS
The output WALLS file (see below) indicates, that the upper wall was "active" even though it should not be (the CVs do not exceed the limits). I analyzed the issue and it seems the cv1 value printed in WALLS file and used by the UPPER_WALLS differs by a lattice vector a, the value for UPPER_WALLS thus ignoring the periodicity (cv1 value 3.48824+18.413 is outside the 0 to 18.413 range).
#! FIELDS time cv1 cv2 cv3 wl.bias wu.bias
#! SET min_cv1 0
#! SET max_cv1 18.413
#! SET min_cv2 0
#! SET max_cv2 18.413
#! SET min_cv3 0
#! SET max_cv3 18.413
0.000000 3.488247 4.939113 4.254889 0.000000 6403.990392
The problem seems to stem from the treatment of the periodic boundary conditions. I am using Lammps (3 Mar 2020) with Plumed (2.6.0). The unit cell is rhombohedral
0 18.4131 xlo xhi
0 18.3539 ylo yhi
0 18.2841 zlo zhi
-1.4759 -1.4759 -1.5993 xy xz yz
in other format
18.41312 0.00000 0.00000
-1.47588 18.35394 0.00000
-1.47588 -1.59927 18.28408
I observed the issue for both LOWER_WALLS and UPPER_WALLS, but only for the a lattice vector (cv1 variable).
In this moment, I do not know how to solve this. Any advice or suggestion will be appreciated. If needed, I may send the files necessary to replicate the issue by email.