# Define looping variables variable loopcount loop 42 variable latticeconst index 9.498030 8.861627 8.467210 8.180645 7.955439 7.769895 7.612113 7.474856 7.353393 7.244462 7.145717 7.055416 6.972226 6.895109 6.823239 6.755947 6.692684 6.632995 6.576498 6.522868 6.471829 6.423142 6.376599 6.332020 6.301672 6.269731 6.236022 6.200338 6.162432 6.122009 6.078711 6.032097 5.981618 5.926573 5.866054 5.798851 5.723302 5.637035 5.536500 5.416022 5.265682 5.065620 # 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 137.327 # Specify which KIM Model to use pair_style kim Morse_Shifted_GirifalcoWeizer_1959HighCutoff_Ba__MO_676977998912_003 pair_coeff * * Ba # 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