# Set up logging log output/lammps.log # Set the OpenKIM model and units that will be used kim init ${modelname} metal # Query for the fcc lattice constant kim query lattice_constant get_lattice_constant_cubic crystal=["fcc"] species=["Ar"] units=["angstrom"] # Periodic boundary conditions along all three dimensions boundary p p p # Create an FCC lattice with the lattice spacing # using a single conventional (orthogonal) unit cell lattice fcc ${lattice_constant} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 39.948 # Specify the KIM interactions kim interactions Ar # Compute total potential energy run 0 # Compute cohesive energy (and make positive to conform to sign convention in # property definition 'cohesive-potential-energy-cubic-crystal') variable natoms equal "count(all)" variable ecohesive equal "-pe/v_natoms" # Create a property instance kim property create 1 cohesive-potential-energy-cubic-crystal # Set all the key-value pairs for this property instance kim property modify 1 key short-name source-value 1 fcc & key species source-value 1 Ar & key a source-value ${lattice_constant} & source-unit angstrom & key basis-atom-coordinates source-value 1 1:3 0.0 0.0 0.0 & source-value 2 1:3 0.0 0.5 0.5 & source-value 3 1:3 0.5 0.0 0.5 & source-value 4 1:3 0.5 0.5 0.0 & key space-group source-value Fm-3m & key cohesive-potential-energy source-value ${ecohesive} & source-unit eV # Dump the results in a file kim property dump "output/results.edn" # Print cohesive energy and equilibrium lattice constant print "Cohesive energy = ${ecohesive} eV/atom"