<div dir="ltr">Dear CP2K Developers/Users,<br><br>There seems to be a wired situation when using CP2K  &CONSTRAINT&COLLECTIVE&RESTRAINT, which I wonder there might be a bug in the code...<br><br>I have done several tests to identify the problem, and the tests are listed as follows:<br><br>1) I used following commands to define the COLVAR, while I have turn off all the other interactions such as intra/inter molecular interactions<br>    &COLVAR<br>      &DISTANCE_POINT_PLANE<br>        &POINT<br>          ATOMS 4<br>          TYPE GEO_CENTER<br>        &END POINT<br>        ATOM_POINT 1<br>        &POINT<br>          ATOMS 1<br>        &END<br>        &POINT<br>          ATOMS 2<br>        &END<br>        &POINT<br>          ATOMS 3<br>        &END<br>        ATOMS_PLANE 2 3 4<br>        PBC TRUE<br>      &END DISTANCE_POINT_PLANE<br>    &END COLVAR<br><br>and the following lines to define the constraint:<br><br>  &CONSTRAINT<br>    &FIXED_ATOMS<br>      LIST 1..3<br>    &END FIXED_ATOMS<br>    &COLLECTIVE<br>      COLVAR               1<br>      INTERMOLECULAR  T<br>      TARGET  [angstrom] 0.<br>      &RESTRAINT<br>        K   1.<br>      &END RESTRAINT<br>    &END COLLECTIVE<br>  &END CONSTRAINT<br><br>The code can give very good results<br>i.e.<br>coordinates:<br>Pt      0.0     0.0     0.0<br>Pt      1.0     0.0     0.0<br>Pt      0.0     1.0     0.0<br>O       0.0     0.0     1.<br>forces:<br>       4<br> i =        0, time =        0.000, E =         3.5710648573<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br>  O         0.0000000000        0.0000000000       -3.7794522658<br>It is very clear that the force comes from -2*k*(distance between point and plane)<br> <br>However, the results become wired when I used two particles to define the point:<br>2)<br>    &COLVAR<br>      &DISTANCE_POINT_PLANE<br>        &POINT<br>          ATOMS 4 5<br>          TYPE GEO_CENTER<br>        &END POINT<br>        ATOM_POINT 1<br>        &POINT<br>          ATOMS 1<br>        &END<br>        &POINT<br>          ATOMS 2<br>        &END<br>        &POINT<br>          ATOMS 3<br>        &END<br>        ATOMS_PLANE 2 3 4<br>        PBC TRUE<br>      &END DISTANCE_POINT_PLANE<br>    &END COLVAR<br><br>same constraint<br>  &CONSTRAINT<br>    &FIXED_ATOMS<br>      LIST 1..3<br>    &END FIXED_ATOMS<br>    &COLLECTIVE<br>      COLVAR               1<br>      INTERMOLECULAR  T<br>      TARGET  [angstrom] 0.<br>      &RESTRAINT<br>        K   1.<br>      &END RESTRAINT<br>    &END COLLECTIVE<br>  &END CONSTRAINT<br><br>i.e.<br>coordinates:<br>Pt      0.0     0.0     0.0<br>Pt      1.0     0.0     0.0<br>Pt      0.0     1.0     0.0<br>O       0.0     0.0     1.<br>O       1.0     0.0     1.<br><br>forces:<br>       5<br> i =        0, time =        0.000, E =         3.5710648573<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br>  O         0.0000000000        0.0000000000        0.0000000000<br>  O         0.0000000000        0.0000000000       -3.7794522658<br><br>I expected the total force should be distributed equally onto the 4th and 5th atoms, while the code allocates all the force onto the 5th atom. In this case, at least the total force is correct, though the distribution of the total force is wired....<br><br>Then, I tried the third testing case:<br>3)<br>    &COLVAR<br>      &DISTANCE_POINT_PLANE<br>        &POINT<br>          ATOMS 4 5 6<br>          TYPE GEO_CENTER<br>        &END POINT<br>        ATOM_POINT 1<br>        &POINT<br>          ATOMS 1<br>        &END<br>        &POINT<br>          ATOMS 2<br>        &END<br>        &POINT<br>          ATOMS 3<br>        &END<br>        ATOMS_PLANE 2 3 4<br>        PBC TRUE<br>      &END DISTANCE_POINT_PLANE<br>    &END COLVAR<br><br>with the same constraint:<br>  &CONSTRAINT<br>    &FIXED_ATOMS<br>      LIST 1..3<br>    &END FIXED_ATOMS<br>    &COLLECTIVE<br>      COLVAR               1<br>      INTERMOLECULAR  T<br>      TARGET  [angstrom] 0.<br>      &RESTRAINT<br>        K   1.<br>      &END RESTRAINT<br>    &END COLLECTIVE<br>  &END CONSTRAINT<br><br>The output is hard to be understood...<br>coordinates:<br>Pt      0.0     0.0     0.0<br>Pt      1.0     0.0     0.0<br>Pt      0.0     1.0     0.0<br>O       0.0     0.0     1.<br>O       1.0     0.0     1.<br>O       0.0     1.0     1.<br>force:<br>       6<br> i =        0, time =        0.000, E =         3.5710648573<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br> PT         0.0000000000        0.0000000000        0.0000000000<br>  O         0.0000000000        0.0000000000        1.2598174219<br>  O         0.0000000000        0.0000000000        1.2598174219<br>  O         0.0000000000        0.0000000000       -3.7794522658<br><br>Though the code gives the exact same potential energy (E), the total force is wrong...<br><br><br>Can anyone give a hint what on earth happened: is this a bug of the code or there is something wrong with my input file?<br><br>Thank you in advance!<br><br>Best Regards,<br>Cao, Zhen<br></div>