Files
lammps/examples/snap/in.grid.pair
Aidan Thompson 4a7f726395 Minor tweak
2021-12-23 17:40:59 -07:00

91 lines
2.0 KiB
Plaintext

# Demonstrate pair style base on sna/grid
# Test energy conservation
# Choose dtfac in the range [0.01,Infinity]
# Large dtfac means small timestep, while
# keeping trajectory output interval fixed
# Variable etotdelta measures change in (PE+KE)/natoms
# Initialize simulation
variable dtfac index 1
variable dt equal 0.5e-3/${dtfac}
variable nthermo equal 1000*${dtfac}
variable nsteps equal 1000*${dtfac}
variable nrep index 3
variable a index 3.0
variable ngrid index 2
variable t index 300
variable del index 0.1
units metal
atom_modify map yes
# generate the box and atom positions using a BCC lattice
variable nx equal ${nrep}
variable ny equal ${nrep}
variable nz equal ${nrep}
boundary p p p
lattice custom $a &
a1 1 0 0 &
a2 0 1 0 &
a3 0 0 1 &
basis 0 0 0 &
basis 0.5 0.5 0.5 &
# origin 0.25 0.25 0.25
# origin 0.25e-3 0.25e-3 0.25e-3
region box block 0 ${nx} 0 ${ny} 0 ${nz}
create_box 1 box
create_atoms 1 box
mass 1 180.88
displace_atoms all random ${del} ${del} ${del} 12345
velocity all create $t 4928459 loop geom
write_dump all custom test.dump id type x y z
# define grid compute and atom compute
group snapgroup type 1
variable twojmax equal 2
variable rcutfac equal 4.67637
variable rfac0 equal 0.99363
variable rmin0 equal 0
variable wj equal 1
variable radelem equal 0.5
variable bzero equal 0
variable quad equal 0
variable switch equal 1
pair_style sna/grid grid ${ngrid} ${ngrid} ${ngrid} &
${rcutfac} ${rfac0} ${twojmax} ${radelem} &
${wj} rmin0 ${rmin0} bzeroflag ${bzero} &
quadraticflag ${quad} switchflag ${switch}
pair_coeff * * Al
thermo ${nthermo}
thermo_modify norm yes
run 0
variable etot0 equal etotal
variable etotdelta equal abs(etotal-${etot0})/atoms
fix avede all ave/time 1 ${nthermo} ${nthermo} v_etotdelta
thermo_style custom step temp epair ke etotal press v_etotdelta f_avede
thermo ${nthermo}
thermo_modify norm yes
# Set up NVE run
timestep ${dt}
neighbor 1.0 bin
neigh_modify once no every 1 delay 0 check yes
# Run MD
fix mynve all nve
run ${nsteps}