# Define looping variables variable loopcount loop 42 variable latticeconst index 4.737380 4.419958 4.223232 4.080300 3.967974 3.875429 3.796731 3.728270 3.667688 3.613356 3.564104 3.519064 3.477571 3.439107 3.403260 3.369696 3.338142 3.308371 3.280192 3.253442 3.227985 3.203701 3.180487 3.158252 3.143115 3.127184 3.110371 3.092572 3.073665 3.053503 3.031907 3.008657 2.983479 2.956024 2.925839 2.892319 2.854637 2.811609 2.761464 2.701373 2.626387 2.526600 # 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 95.94 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Shifted_GirifalcoWeizer_LowCutoff_Mo__MO_228581001644_001 pair_coeff * * Mo # 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