[CP2K:8958] test of a new collective variable coded into CP2K

Dorothea Golze dorothe... at googlemail.com
Fri Apr 21 11:49:06 UTC 2017


Hi Sun,

I implemented a few colvars last year. I tested the derivatives simply my
finite differences. I wrote a subroutine for testing, that shifts each atom
(for each direction) by plus/minus a small delta. For each of the shifted
positions you can calculate your colvar. Do something like this:
    dx=0.0001_dp
    DO iparticle=1,SIZE(my_particles)
       dsdr_numerical = 0._dp
       DO dir=1,3
          DO shift=1,2
            std_value = my_particles(iparticle)%r(dir)
            my_particles(iparticle)%r(dir) = std_value - (-1.0_dp)**shift*dx
            Calculate colvar(shift)=....
             my_particles(iparticle)%r(dir)=std_value
          ENDDO
           dsdr_numerical =0.5_dp*(colvar(1) - colvar(2))/dx
       ENDDO
    ENDDO

dsdr_numerical should correspond to what you calculated analytically.

Best regards,
Dorothea

2017-04-20 17:56 GMT+03:00 Sun Tao <taosun... at gmail.com>:

> Dear CP2K users/developers:
>
> I have coded a new collective variable into CP2K, in order to do some
> umbrella sampling. I have implemented the calculation of the CV's value and
> its derivative. The value is already tested and gives correct results.
> However, I am wondering how to test the correctness of the derivative,
> since this is essential if I want to do umbrella sampling simulations.
>
> If you have some experience in implementing CV's in CP2K, I would like to
> know how you tested the correctness of your implementation. I would
> appreciate if you could help me.
>
> Thanks ~
>
> Tao
>
> --
> You received this message because you are subscribed to the Google Groups
> "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cp2k+uns... at googlegroups.com.
> To post to this group, send email to cp... at googlegroups.com.
> Visit this group at https://groups.google.com/group/cp2k.
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20170421/3fd8f893/attachment.htm>


More information about the CP2K-user mailing list