using a variable from an external file in LAMMPS

OK thank you so much for suggestion.

I am not familiar with Fourier analysis. Please let me have a look in detail;.

best regard,

Pankaj

Dear Axel,

I tried with next command. As I understood, next command change the variable name but simulation again starting from initial data file which I don’t want. here I am providing my input script to explain better. I guess I am not able to explain my problem.

dimension 3
units real
boundary p p p

kspace_style pppm/tip4p 1.0e-4
kspace_modify order 3
atom_style full
pair_style lj/cut/tip4p/long 1 2 1 1 0.1546 15.0
bond_style morse
angle_style harmonic
pair_modify mix arithmetic

read_data data.txt

neighbor 2.0 bin
neigh_modify every 1 delay 0 check yes page 100000

variable oscillate equal exp(-((step-500)^2)/(2*((150)^2)))

#here variable oscillate is time-dependent by using step in euqation.

#variable oscillate file field.txt

**#using ${**oscillate} reads only once, but not all steps.

#Here I want to read variable oscillate from the file field.txt at every time step rather than using euqation.

fix kick all efield 0.0 0.0 v_oscillate

#v_oscillate changes at every time-step.

fix 2 all nve
timestep 1.0

thermo 1
thermo_style custom step temp press vol pe ke etotal v_oscillate
restart 500 h2o.restart
dump 6 all custom 5 h2o-pos.dump id type x y z
dump 7 all custom 5 h2o-vel.dump id type vx vy vz
run 4000 start 0

I hope I am able to explain better. Hope for some solution.

Thank you so much

regards,

Pankaj

Dear Axel,

I tried with next command. As I understood, next command change the variable
name but simulation again starting from initial data file which I don't
want. here I am providing my input script to explain better. I guess I am
not able to explain my problem.

the next command will make the file variable advance to the next
value. for that to work during a run, you'll have to use it in an
"every" option of the run command.

axel.