[lammps-users] Help on atom-missing in triclinic cells

Hello LAMMPS users,

I'd like to construct a slightly distorted diamond structured cell, which is subject to periodic boundary conditions to meet an infinite solid.
For example, I wanted to construct a silicon unitcell with a lattice parameter of
lx 0 0
xy ly 0
xz yz lz

==> a1 5.433861210814275 0.000000000000000 0.000000000000000
                a2 -0.000003436513164 5.433861208476357 0.000000000000000
                a3 -0.000015233109878 -0.000030477124184 5.433861180528157
and basis atoms at (0 0 0) (0.5 0.5 0) (0.5 0 0.5) (0 0.5 0.5) (0.25 0.25 0.25) (0.75 0.75 0.25) (0.75 0.25 0.75) and (0.25 0.75 0.75).
And I planned to expand the cell by 2x2x2 using 'replicate' command.

Below is part of my input file.

boundary p p p
lattice custom 1 &
        a1 5.433861210814275 0.000000000000000 0.000000000000000 &
        a2 -0.000003436513164 5.433861208476357 0.000000000000000 &
        a3 -0.000015233109878 -0.000030477124184 5.433861180528157 &
         basis 0.000 0.000 0.000 &
         basis 0.000 0.500 0.500 &
         basis 0.500 0.000 0.500 &
         basis 0.500 0.500 0.000 &
         basis 0.250 0.250 0.250 &
         basis 0.750 0.750 0.250 &
         basis 0.750 0.250 0.750 &
         basis 0.250 0.750 0.750 &
        spacing 5.433861210814275 5.433861208476357 5.433861180528157

region r1 prism 0 5.433861210814275 0 5.433861208476357 0 5.433861180528157 -0.000003436513164 -0.000015233109878 -0.000030477124
184 units box
create_box 1 r1
create_atoms 1 region r1

replicate 2 2 2

But it gives only 7 atoms not 8 atoms in a unitcell, and thus 7*8=56 atoms in total as shown below.

Created triclinic box = (0 0 0) to (5.43386 5.43386 5.43386) with tilt (-3.43651e-06 -1.52331e-05 -3.04771e-05)
  2 by 2 by 2 processor grid
create_atoms 1 region r1
Created 7 atoms

replicate 2 2 2
  triclinic box = (0 0 0) to (10.8677 10.8677 10.8677) with tilt (-6.87303e-06 -3.04662e-05 -6.09542e-05)
  2 by 2 by 2 processor grid
  56 atoms

Is there something wrong in my settings of lattice, region, or box? I tried several combinations, e.g. 'spacing' in the lattice command to [lx, sqrt(ly^2+xy^2), sqrt(lz^2+xz^2+yz^2)] instead of [lx, ly, lz], but all failed.

I'd look forward to seeing any help. Thank you in advance.

My guess for why you get 7 instead of 8 atoms
in the initial create_atoms would be roundoff
errors near the faces of the simulation cell.

Steve

I think your problem is this command:

create_atoms 1 region r1

If you use instead:

create_atoms 1 box

then I get 8 atoms created instead of 7.

The doc page for create_atoms discusses this:

Also note that if your region is the same size as a periodic
simulation box (in some dimension), LAMMPS does not implement the same
logic as with the box style, to insure exactly one atom at the
boundary. if this is what you desire, you should either use the box
style, or tweak the region size to get precisely the atoms you want.

Also, I note that your a1,a2,a3 values for 5.43... are not
exactly the same. I don't know if this is intentional,
but these values are the untilted box dimension, so they
should be exactly equal if your unit cell is meant to be a tilted
cube. I.e. they are not edge lengths, they are untilted
lengths.

Steve