# Define looping variables variable loopcount loop 42 variable latticeconst index 8.892590 8.296753 7.927477 7.659178 7.448328 7.274611 7.126886 6.998378 6.884658 6.782671 6.690220 6.605674 6.527787 6.455586 6.388297 6.325295 6.266064 6.210180 6.157284 6.107073 6.059287 6.013704 5.970128 5.928390 5.899976 5.870071 5.838511 5.805101 5.769611 5.731765 5.691227 5.647584 5.600322 5.548786 5.492125 5.429205 5.358471 5.277703 5.183576 5.070778 4.930020 4.742710 # 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 diamond lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice diamond ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 238.02891 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_MEAM_PascuetFernandez_2015_AlU__SM_721930391003_000 pair_coeff * * U # 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