Some LAMMPS potentials must be reinitalized when the simulation box is changed during a run. Such potentials are now supported through the KIM simulator model (SM) interface. An example is the Buckingham potential that requires changes to
kspace commands whenever the simulation box size or periodicity are modified by a
change_box command. To support this requirement, box information is tracked by the KIM interface in LAMMPS and used to determine suitable behavior by the SM. The user must simply add a
kim_interactions command after any occurrence of
change_box command. The first additions to the system using this functionality are multiple Buckingham potential SMs for various oxide systems submitted by Evangelos Voyiatzis.
Below is an example LAMMPS input script using a Buckingham potential where the simulation box changes from fully periodic to having one non-periodic direction.
# Initialize KIM model kim_init Sim_LAMMPS_Buckingham_FisherMatsubara_2005_NiO__SM_337243826931_000 metal # First, we create a rock salt (B1) NiO crystal and relax the structure boundary p p p lattice custom 4.16 & a1 1.0 0.0 0.0 & a2 0.0 1.0 0.0 & a3 0.0 0.0 1.0 & basis 0.0 0.0 0.0 & basis 0.5 0.0 0.0 & basis 0.0 0.5 0.5 & basis 0.5 0.5 0.5 & basis 0.5 0.0 0.5 & basis 0.0 0.0 0.5 & basis 0.5 0.5 0.0 & basis 0.0 0.5 0.0 region myreg block 0 1 0 1 0 1 create_box 2 myreg create_atoms 1 box & basis 2 2 & basis 4 2 & basis 6 2 & basis 8 2 mass 1 58.6934 mass 2 15.999 kim_interactions Ni O fix 1 all box/relax iso 0.0 minimize 1e-6 1e-6 5000 10000 # Change the box to be aperiodic in the z direction and create a vacuum # on both sides so as to create a single-unit-layer-thick slab change_box all boundary p p f z final -20.0 20.0 # Always reissue kim_interactions after any changes to the simulation box # (The change in periodicity requires changes to the kspace command that # is part of the definition of Buckingham potentials. This is # automatically managed by KIM for the Buckingham simulator model.) kim_interactions Ni O run 0