# Define looping variables variable loopcount loop 42 variable latticeconst index 6.288850 5.867474 5.606321 5.416580 5.267467 5.144614 5.040143 4.949262 4.868839 4.796713 4.731332 4.671541 4.616460 4.565399 4.517812 4.473257 4.431369 4.391847 4.354439 4.318930 4.285136 4.252899 4.222082 4.192565 4.172471 4.151322 4.129003 4.105375 4.080277 4.053512 4.024843 3.993979 3.960555 3.924109 3.884038 3.839541 3.789518 3.732398 3.665832 3.586060 3.486516 3.354050 # 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 bcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice bcc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 39.948 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Sigmoid_Jelinek_Ar__MO_071460865933_000 pair_coeff * * Ar # 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