[gmx-users] Implementation of time-dependent Electric Field

Erik Lindahl lindahl at sbc.su.se
Wed May 10 14:21:42 CEST 2006


Hi,

On May 10, 2006, at 1:24 PM, David van der Spoel wrote:

> Viswanadham Sridhara wrote:
>> Hi everyone,
>> This is regarding implementation of time-dependent electric field  
>> on the system.
>> I tried looking into the manual, and did a bit of survey in  
>> mailing lists. I still dont know how to implement E_zt in .mdp  
>> options.
>> As an example, can anyone tell me how to implement a 5ns E (V/nm)  
>> trapezoidal pulse (1ns rise and fall times with 3ns pulse on time).
> you can't.
>
> please check the source code, src/mdlib/sim_util.c

To clarify - the routine in question is called calc_f_el() and is  
_extremely_ simple, so you can probably implement it yourself with  
very little extra work.

The coordinates of particule i (counting starts from 0, since we're  
using C) are available in units of nm in

x[i][XX]
x[i][YY]
x[i][ZZ]

Similarly, the forces you want to alter are in units of kJ/mol/nm, in

f[i][XX]
f[i][YY]
f[i][ZZ]

... and the particle charge is charge[i], in electron charge units.

So, go through all particles, check e.g. the z-coordinate and assign  
a field in V/nm based on this. We need to convert it to MD units too,  
so the force correction will be

f[i][ZZ] += your_calculated_field_at_this_z_coordiate * FIELDFAC *  
charge[i].



Cheers,

Erik







More information about the gromacs.org_gmx-users mailing list