LAMMPS energy calculation with atoms on non-periodic boundary
I am trying to get an energy out of the following minimal code
from ase import Atoms
from ase.calculators.kim import KIM
d = 2.9
L = 10.0
atoms = Atoms('SiO',
positions=[[0, L, 0], [0, 0, 0]],
cell=[d, L, L],
pbc=[1, 0, 0],
calculator=KIM("Sim_LAMMPS_Vashishta_VashishtaKaliaRino_1990_SiO__SM_887826436433_000"))
print(atoms.get_potential_energy())
This calls lammpslib.py in calculators (after going through the KIM calculator, sorry for the contrived minimal working example) and works with the lammps python library to do the calculation. Putting the atom on the boundary ([0, L, 0]) fails and the lammps log looks like
LAMMPS (2 Aug 2023)
units metal
kim init Sim_LAMMPS_Vashishta_VashishtaKaliaRino_1990_SiO__SM_887826436433_000 metal
#=== KIM is looking for 'Portable Models' in these directories ===
# 1: .
# 2: [...]
# 3: [...]
# 4: [...]
#=== KIM is looking for 'Simulator Models' in these directories ===
# 1: .
# 2: [...]
# 3: [...]
# 4: [...]
#=== BEGIN kim init ==========================================
# Using KIM Simulator Model : Sim_LAMMPS_Vashishta_VashishtaKaliaRino_1990_SiO__SM_887826436433_000
# For Simulator : LAMMPS 22 Sep 2017
# Running on : LAMMPS 2 Aug 2023
#
units metal
neighbor 2.0 bin # Angstroms
timestep 1.0e-3 # picoseconds
#=== END kim init ============================================
atom_modify map array sort 0 0
boundary p f f
box tilt large
The 'box' command has been removed and will be ignored
region cell prism 0 2.9 0 10.0 0 10.0 0.0 0.0 0.0 units box
create_box 2 cell
Created triclinic box = (0 0 0) to (2.9 10 10) with tilt (0 0 0)
1 by 1 by 1 MPI processor grid
echo none
Created 2 atoms
using lattice units in triclinic box = (0 0 0) to (2.9 10 10) with tilt (0 0 0)
create_atoms CPU = 0.000 seconds
Setting atom values ...
1 settings made for type
Setting atom values ...
1 settings made for type
kim interactions O Si
#=== BEGIN kim interactions ==================================
variable kim_update equal 0
variable kim_periodic equal 2
pair_style vashishta
pair_coeff * * /var/tmp/kim-shared-library-parameter-file-directory-801yduvt0brz/SiO.1990.vashishta O Si
Reading vashishta potential file /var/tmp/kim-shared-library-parameter-file-directory-801yduvt0brz/SiO.1990.vashishta with DATE: 2015-10-14
#=== END kim interactions ====================================
mass 1 15.998999995884348734875857189763
mass 2 28.084999992775294685998233035207
variable pxx equal pxx
variable pyy equal pyy
variable pzz equal pzz
variable pxy equal pxy
variable pxz equal pxz
variable pyz equal pyz
thermo_style custom pe pxx emol ecoul
variable fx atom fx
variable fy atom fy
variable fz atom fz
variable pe equal pe
neigh_modify delay 0 every 1 check yes
echo none
run 0
WARNING: No fixes with time integration, atoms won't move (src/verlet.cpp:60)
Neighbor list info ...
update: every = 1 steps, delay = 0 steps, check = yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 12
ghost atom cutoff = 12
binsize = 6, bins = 1 2 2
1 neighbor lists, perpetual/occasional/extra = 1 0 0
(1) pair vashishta, perpetual
attributes: full, newton on
pair build: full/bin/atomonly
stencil: full/bin/3d
bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.957 | 2.957 | 2.957 Mbytes
PotEng Pxx E_mol E_coul
ERROR: Lost atoms: original 2 current 1 (src/thermo.cpp:488)
Last command: run 0
Notice that this contains the changes I made in !3026 . I am trying to understand whether the fact that an atom is lost during calculation (I suppose it goes out of the simulation box) is expected, an error in the ASE input to lammps or an error in the lammps lib. This problem is easily fixed in ase by increasing the cell to L+1 or similar extensions of the non periodic boundaries. Does somebody maybe know whether I am using this library wrong or how to debug this? Ideally I would get an input file for lammps directly, but it seems that that is not created going through lammpslib (?) as all the commands are passed by lmp.command or lmp.atoms_scatter etc, i.e. directly invoking the library.