# Define looping variables variable loopcount loop 42 variable latticeconst index 8.015020 7.477983 7.145150 6.903328 6.713286 6.556712 6.423566 6.307739 6.205242 6.113319 6.029992 5.953790 5.883589 5.818513 5.757865 5.701079 5.647694 5.597325 5.549649 5.504393 5.461323 5.420238 5.380962 5.343343 5.317733 5.290780 5.262334 5.232221 5.200234 5.166122 5.129584 5.090248 5.047650 5.001200 4.950130 4.893420 4.829666 4.756869 4.672030 4.570363 4.443496 4.274670 # 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 63.546 # Specify which KIM Model to use pair_style kim LAMMPSvirial EAM_Dynamo_Foiles_Baskes_Universal3_Cu__MO_666348409573_003 pair_coeff * * Cu # 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