# Define looping variables variable loopcount loop 42 variable latticeconst index 4.474740 4.174916 3.989097 3.854090 3.747991 3.660577 3.586242 3.521577 3.464353 3.413034 3.366513 3.323969 3.284777 3.248445 3.214586 3.182883 3.153078 3.124958 3.098340 3.073074 3.049029 3.026091 3.004164 2.983161 2.968864 2.953816 2.937935 2.921123 2.903264 2.884220 2.863821 2.841861 2.818078 2.792146 2.763634 2.731973 2.696380 2.655737 2.608373 2.551613 2.480784 2.386530 # 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 sc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice sc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 20.1797 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Shifted_Glyde_Ne__MO_169434419764_001 pair_coeff * * Ne # 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