<span class="gI"> </span><span class="gI">Dear Gromacs developers or users:<br><br>I have a question about the implementation of the electrostatic field in Gromacs (gromacs-4.5.3)<br><br>On the menu of this version, it looks that the functionality of time-dependent has not been implemented yet.<br>
--------<br>E_x ; E_y ; E_z:<br>If you want to use an electric field in a direction, enter 3 numbers after the appropriate E_*,<br>the first number: the number of cosines, only 1 is implemented (with frequency 0) so enter<br>
1, the second number: the strength of the electric field in V nm-1, the third number: the<br>phase of the cosine, you can enter any number here since a cosine of frequency zero has no<br>phase.<br>E_xt; E_yt; E_zt:<br>not implemented yet<br>
---------<br>But in the source code of sim_util.c for the part of </span>calc_f_el <span class="gI"> :<br>I notice there is a parameter of Ext[m] as cos function of time together with exp part. I am so confused about it.<br>
Can anyone help explain this : </span><b><span class="gI">Ext[m] = cos(Et[m].a[0]*(t-t0))*<span style="color: rgb(255, 0, 0);">exp(-sqr(t-t0)/(2.0*sqr(Et[m].a[2]))</span>)<br>What is meaning of the Ext[m] and its part of <span style="color: rgb(255, 0, 0);">exp</span> part?<br>
I am want to make sure whether </span><span class="gI">gromacs-4.5.3 support the time-dependent E field calculation?</span></b><br>And how to control these parameters in mdp file if it supports?<br><b><span class="gI"><br>
</span></b><span class="gI">------------------------<br></span><span class="gI">        if (Et[m].n &gt; 0)<br>
        {<br>
            if (Et[m].n == 3)<br>
            {<br>
                t0 = Et[m].a[1];<br>
                Ext[m] = cos(Et[m].a[0]*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(Et[m].a[2])));<br>
            }<br>
            else<br>
            {<br>
                Ext[m] = cos(Et[m].a[0]*t);<br>
            }<br>
        }</span><br><span class="gI"><br>-----------------------------<br><br>Thanks,<br><br>Tom,<br><br>PS: the source code of </span><span class="gI">of sim_util.c for the part of </span>calc_f_el is attached here:<br>
<br><span class="gI"> * calc_f_el calculates forces due to an electric field.<br> *<br> * force is kJ mol^-1 nm^-1 = e * kJ mol^-1 nm^-1 / e<br> *<br> * Et[] contains the parameters for the time dependent<br> * part of the field (not yet used).<br>
 * Ex[] contains the parameters for<br> * the spatial dependent part of the field. You can have cool periodic<br> * fields in principle, but only a constant field is supported<br> * now.<br> * The function should return the energy due to the electric field<br>
 * (if any) but for now returns 0.<br> *<br> * WARNING:<br> * There can be problems with the virial.<br> * Since the field is not self-consistent this is unavoidable.<br> * For neutral molecules the virial is correct within this approximation.<br>
 * For neutral systems with many charged molecules the error is small.<br> * But for systems with a net charge or a few charged molecules<br> * the error can be significant when the field is high.<br> * Solution: implement a self-consitent electric field into PME.<br>
 */<br>static void calc_f_el(FILE *fp,int  start,int homenr,<br>                      real charge[],rvec x[],rvec f[],<br>                      t_cosines Ex[],t_cosines Et[],double t)<br>{<br>    rvec Ext;<br>    real t0;<br>
    int  i,m;<br><br>    for(m=0; (m&lt;DIM); m++)<br>    {<br>        if (Et[m].n &gt; 0)<br>        {<br>            if (Et[m].n == 3)<br>            {<br>                t0 = Et[m].a[1];<br>                Ext[m] = cos(Et[m].a[0]*(t-t0))*exp(-sqr(t-t0)/(2.0*sqr(Et[m].a[2])));<br>
            }<br>            else<br>            {<br>                Ext[m] = cos(Et[m].a[0]*t);<br>            }<br>        }<br>  else<br>        {<br>            Ext[m] = 1.0;<br>        }<br>        if (Ex[m].n &gt; 0)<br>
        {<br>            /* Convert the field strength from V/nm to MD-units */<br>            Ext[m] *= Ex[m].a[0]*FIELDFAC;<br>            for(i=start; (i&lt;start+homenr); i++)<br>                f[i][m] += charge[i]*Ext[m];<br>
        }<br>        else<br>        {<br>            Ext[m] = 0;<br>        }<br>    }<br>    if (fp != NULL)<br>    {<br>        fprintf(fp,&quot;%10g  %10g  %10g  %10g #FIELD\n&quot;,t,<br>                Ext[XX]/FIELDFAC,Ext[YY]/FIELDFAC,Ext[ZZ]/FIELDFAC);<br>
    }<br>}<br><br></span>