How to apply 2D electric field as an external source in Lammps

Hello All,

I have a 2d electric field numerical data. I would like to apply this as an external electric field in Lammps. Please let me know a suitable procedure to implement this in Lammps.

Hello All,

I have a 2d electric field numerical data. I would like to apply this as an
external electric field in Lammps. Please let me know a suitable procedure
to implement this in Lammps.

there are 4 simple steps:

a) take a text editor
b) make a copy of fix_efield.cpp and fix_efield.h under a new name and
make the corresponding changes to the class/style name
c) follow the instructions here http://lammps.sandia.gov/doc/Section_modify.html
d) hack away.

axel.

If you can represent the field as a function of x,y then
you can define an atom-style variable and fix efield
will use the variable as an input. But if the values
in your file are more arbitrary, then as Axel said,
you’ll need to code up an option to fix efield that
reads your file, and interpolates the field to each
atom’s coords.

Steve