[gmx-users] C6-C12 table potential

Mark Abraham mark.j.abraham at gmail.com
Wed May 16 21:09:18 CEST 2018


Hi,

I would assume not, because it's more useful to be able to let a user
specify a table for an energy group and for that to contain different atom
types.

But your best friend is to test both your understanding and the code by
e.g. making a structure file with two such atoms 1nm apart and observing
what force you get from a suitable mdrun -rerun with various tables.

Mark

On Wed, May 16, 2018 at 8:59 PM Alex <alexanderwien2k at gmail.com> wrote:

> Hi,
> Suppose that the C6 and C12 for the nonbonded interaction between two beads
> of P4 and SNa in the Martini force fields are as following:
>                                     C6                   C12
> P4    SNda    1       0.17246E-00     0.18590E-02 ; semi attractive
>
> Now, I was wondering how I can generate a table potential
> (table_P4_SNda.xvg) using the above C6 and C12 parameters?
>
> I guess the general below C code provided in the gromacs tabulated
> potential does the job, but I am not sure if the columns of -1/r6(-1/r7)
> and 1/r12(1/r13) should be multiplied by the above C6 and C12 parameters!?
>
> #include <stdio.h>
> #include <math.h>
>
> main()
> {
>     FILE    *fout;
>     double  r;
>
>     fout = fopen("table_example.xvg", "w");
>     fprintf(fout, "#\n# Example LJ 6-12 Potential\n#\n");
>
>     for (r=0; r<=2.4; r+=0.002) {
>
>         double f = 1/r;
>         double fprime = 1/(pow(r,2));
>
>         double g = -1/(pow(r,6));
> /*   *C6   ? */
>         double gprime = -6/(pow(r,7));                                /*
> *C6   ? */
>
>         double h = 1/(pow(r,12));
> /*   *C12   ? */
>         double hprime = 12/(pow(r,13));                             /*
> *C12   ? */
>
>         /* print output */
>         if (r<0.001) {
>             fprintf(fout, "%12.10e   %12.10e %12.10e   %12.10e %12.10e
> %12.10e %12.10e\n", r,0.0,0.0,0.0,0.0,0.0,0.0);
>         } else {
>             fprintf(fout, "%12.10e   %12.10e %12.10e   %12.10e %12.10e
> %12.10e %12.10e\n", r,f,fprime,g,gprime,h,hprime);
>         }
>     }
>
>     fclose(fout);
>     return(0);
> }
>
> Regards,
> Alex
> --
> Gromacs Users mailing list
>
> * Please search the archive at
> http://www.gromacs.org/Support/Mailing_Lists/GMX-Users_List before
> posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.
>


More information about the gromacs.org_gmx-users mailing list