[gmx-users] source cord routines for electric fields

Makoto Yoneya makoto-yoneya at aist.go.jp
Fri Oct 3 16:28:02 CEST 2014


Dear David:

Sorry again.
I realized that it is much better than

> Modify the line in mdlib/sim_util.c (function calc_f_el) as in the
> followings,
>
>             if (Et[m].n == 3)
>             {
>                 t0 = Et[m].a[1];
>                 Ext[m] =
> cos(Et[m].a[0]*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(Et[m].a[2])));
>             }
>             else
>             {
> /*              Ext[m] = cos(Et[m].a[0]*t);                   original
> form */
>                 Ext[m] = cos(Et[m].a[0]*(t-Et[m].phi[0])); /* modified
> form with phase */
>             }
>
> add the phase term for the simple cos-wave field.
> Then, mdp file lines in the followings,
>
> ; Electric fields
> ; Format is number of terms (int) and for all terms an amplitude (real)
> ; and a phase angle (real)
> E-x                      = 1 1.0       0.0
> E-xt                     = 1 3.1415e-2 50.0
>
> makes cos-wave electric fields with omega=3.1415e-2 (1/ps, period=200ps)
> and phase=50ps, i.e. sin-wave.

to

Modify the line in mdlib/sim_util.c (function calc_f_el) as in the
followings,

            if (Et[m].n == 3)
            {
                t0 = Et[m].a[1];
                Ext[m]
=cos(Et[m].a[0]*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(Et[m].a[2])));
            }
            else
            {
/*              Ext[m] = cos(Et[m].a[0]*t);
original form */
                 Ext[m] = cos(Et[m].a[0]*t-Et[m].phi[0]); /* modified
form with phase */
            }

add the phase term for the simple cos-wave field.
Then, mdp file lines in the followings,

; Electric fields
; Format is number of terms (int) and for all terms an amplitude (real)
; and a phase angle (real)
E-x                      = 1 1.0             0.0
E-xt                     = 1 3.1415e-2  1.57075

makes cos-wave electric fields with omega=3.1415e-2 (1/ps, period=200ps)
and phase=1.57075=pi/2, i.e. sin-wave.

Makoto Yoneya, Dr.
AIST, Tsukuba
JAPAN


More information about the gromacs.org_gmx-users mailing list