# Define looping variables variable loopcount loop 42 variable latticeconst index 14.676700 13.693308 13.083840 12.641030 12.293034 12.006325 11.762515 11.550420 11.362732 11.194408 11.041824 10.902286 10.773738 10.654575 10.543519 10.439537 10.341781 10.249547 10.162246 10.079376 10.000508 9.925275 9.853355 9.784470 9.737574 9.688219 9.636131 9.580990 9.522416 9.459953 9.393047 9.321018 9.243015 9.157958 9.064442 8.960597 8.843855 8.710553 8.555202 8.369035 8.136724 7.827580 # 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 85.4678 # Specify which KIM Model to use pair_style kim LJ_ElliottAkerson_2015_Universal__MO_959249795837_003 pair_coeff * * Rb # 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