# sample LAMMPS input script for diffusion of 2d LJ liquid
# mean-squared displacement via compute msd

# settings

variable	x equal 40
variable	y equal 40

variable	rho equal 0.6
variable        t equal 1.0
variable	rc equal 2.5

# problem setup

units		lj
dimension	2
atom_style	atomic
neigh_modify	delay 0 every 1

lattice         sq2 ${rho}
region          simbox block 0 $x 0 $y -0.1 0.1
create_box      1 simbox
create_atoms    1 box

pair_style      lj/cut ${rc}
pair_coeff      * * 1 1

mass            * 1.0
velocity        all create $t 97287

fix             1 all nve
fix	        2 all langevin $t $t 0.1 498094
fix	        3 all enforce2d

# equilibration run

thermo          1000
run	        5000

unfix		2

# data gathering run

reset_timestep  0

compute         vacf all vacf
fix             4 all ave/time 1 1 1 c_vacf[4] #file tmp.vacf

# factor of 0.5 is for 2d

fix             5 all vector 1 c_vacf[4]
variable        vacf equal 0.5*dt*trap(f_5)

thermo_style	custom step temp c_vacf[4] v_vacf

# only need to run for 10K steps to make a good 100-frame movie

#dump	        1 all custom 1 tmp.dump id type vx vy vz

#dump		2 all image 100 image.*.jpg type type zoom 1.6 adiam 1.2

thermo          1000
run	        100000
