# Define looping variables variable loopcount loop 42 variable latticeconst index 4.590640 4.283050 4.092417 3.953913 3.845065 3.755387 3.679127 3.612787 3.554081 3.501432 3.453706 3.410060 3.369853 3.332580 3.297843 3.265319 3.234743 3.205893 3.178587 3.152666 3.127998 3.104466 3.081971 3.060424 3.045756 3.030318 3.014026 2.996779 2.978458 2.958920 2.937993 2.915464 2.891066 2.864461 2.835211 2.802730 2.766215 2.724520 2.675929 2.617699 2.545035 2.448340 # Define unit set and class of atomic model units metal atom_style atomic # Periodic boundary conditions along all three dimensions boundary p p p # Create a fcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice fcc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 14.0067 # Specify which KIM Model to use pair_style kim LAMMPSvirial Tersoff_LAMMPS_Nord_Albe_Erhart_Nordlund_GaN__MO_612061685362_001 pair_coeff * * N # Set what thermodynamic information to print to log thermo_style custom step atoms xlo xhi ylo yhi zlo zhi pe press pxx pyy pzz pxy pxz pyz thermo 10 # Print every 10 steps # Set what information to write to dump file dump id all custom 10 output/lammps.dump id type x y z fx fy fz dump_modify id format line "%d %d %16.7f %16.7f %16.7f %16.7f %16.7f %16.7f" # Compute the energy and forces for this lattice spacing run 0 # Define auxiliary variables to contain cohesive energy and equilibrium lattice constant variable poteng equal "c_thermo_pe" variable natoms equal "count(all)" variable ecohesive equal "v_poteng/v_natoms" # Output cohesive energy and equilibrium lattice constant print "Cohesive energy = ${ecohesive} eV/atom" # Queue next loop clear # Clear existing atoms, variables, and allocated memory next latticeconst # Increment latticeconst to next value next loopcount # Increment loopcount to next value jump SELF # Reload this input script with the new variable values