# Define variables
# Starting temperature:
variable T equal 1
# Number of particles:
variable N equal 1024
# Density:
variable rho equal 0.01
# Length of sides of cubic box
variable L equal ($N/${rho})^(1/3)

# Use Lennard-Jones units, periodic boundaries and atomic model
units lj
boundary p p p
atom_style atomic

# Define the space and put atoms in
dimension 3
region simbox block 0 $L 0 $L 0 $L
create_box 1 simbox

# Define properties of the atoms
lattice fcc ${rho}
create_atoms 1 box
#create_atoms 1 random $N 12345 simbox
mass 1 1.0
velocity all create $T 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5


#make sure no explosion happens
minimize 1e-4 1e-4 100 100

# Speed up simulation with neighbour lists
neighbor 0.3 bin
neigh_modify every 20 delay 0 check yes

# Define thermodynamic ensemble for thermalization
fix nvt all nvt temp $T $T 1

#Thermalization run
run 10000

# Define thermodynamic ensemble for long run
unfix nvt
fix nve all nve

#Define frequency of thermodynamic output and trajectory dump and start production run
thermo 100
dump 1 all custom 100 dump.lammpstrj id type x y z vx vy vz
run 10000
