# Define unit set and class of atomic model units metal atom_style atomic # Periodic boundary conditions, z direction big enough so images don't interact boundary p p p # Create a hexagonal lattice with the lattice spacing and basis atoms supplied by the user # using a single primitive hexagonal unit cell. Insert a graphene-like # or a TMD basis. variable initLatConst equal sed_initial_lattice_constant_string lattice custom ${initLatConst} a1 1.0 0.0 0.0 a2 -0.5 0.866025403784439 0.0 a3 0.0 0.0 400.0 sed_basis_string spacing 1.0 0.866025403784439 400.0 region box prism 0 1 0 1 0.0 1.0 -0.5 0 0 units lattice create_box sed_number_species_string box create_atoms 1 box sed_basis_atoms_string mass * 1.0 # Specify which KIM Model to use, letting the model compute the virial/pressure pair_style kim KIMvirial sed_model_string pair_coeff * * sed_species1_string sed_species2_string # Set what information to write to dump file dump id all custom 100 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" # Set boundary conditions to be stress-free fix 1 all box/relax x 0.0 y 0.0 z 0.0 couple xy # fix atoms fix 2 all setforce 0.0 0.0 0.0 # For TMDs, need difference in z-position of layers sed_tmd_uncomm_string group transmetal type 1 sed_tmd_uncomm_string group chalcogen type 2 sed_tmd_uncomm_string compute upperZpos chalcogen reduce max z sed_tmd_uncomm_string compute middleZpos transmetal reduce max z # Consistent with the property definition, we are defining the z position in terms # of the 2D lattice constant sed_tmd_uncomm_string variable zpos equal "(c_upperZpos-c_middleZpos)/lx" # Set what thermodynamic information to print to log thermo_style custom step atoms lx pe press pxx pyy pxy sed_tmd_uncomm_string v_zpos thermo 100 # Print every 100 timesteps # Perform static minimization using the Polack-Ribiere conjugate gradient method. # Restart minimization after end with smaller allowed volume step size minimize 1e-12 1e-12 10000 50000 # Define auxiliary variables to contain cohesive energy and equilibrium lattice constant variable natoms equal "count(all)" variable ecohesive equal "-c_thermo_pe/v_natoms" variable surften equal "pxx*lz" variable a equal "lx" # Output cohesive energy and equilibrium lattice constant sed_tmd_uncomm_string print "Free z parameter in layer group = ${zpos} angstrom" print "Final surface pressure = ${surften} bar*angstrom" print "Cohesive energy = ${ecohesive} eV/atom" print "Equilibrium lattice constant = ${a} angstrom"