Unit cell basis atoms

Hello

I try to create a custom (hcp) lattice with 2 basis atoms and 20x20x20 replication of the unit cell (using periodic boundary conditions). I am expecting to get a box of 2x20x20x20 = 16000 atoms but instead I get 32000 atoms. I guess it has to do with how lammps creates the unit cell.
Could you please give a hint why is this?

This is my log file:

lattice custom 3.19405 a1 1.0 0.0 0.0 a2 -0.5 1.1547 0.0 a3 0.0 0.0 1.624 basis 0.0 0.0 0.0 basis 0.666 0.333 0.5
Lattice spacing in x,y,z = 4.79107 3.68817 5.18714
dimension 3
region box block 0 1 0 1 0 1 units lattice
create_box 1 box
Created orthogonal box = (0 0 0) to (4.79107 3.68817 5.18714)
2 by 1 by 2 MPI processor grid
create_atoms 1 box
Created 4 atoms
replicate 20 20 20
orthogonal box = (0 0 0) to (95.8215 73.7634 103.743)
2 by 1 by 2 MPI processor grid
32000 atoms

Thanks
Alex

I think so too. If you check the log you got, LAMMPS already tells you that it created 4 atoms after the line “create_atoms 1 box”, rather than 2. Therefore, after replicating 20^3 times, you ended up with twice as many atoms. I do not know, however, what your expectations are based on nor why LAMMPS generates the lattice the way it does.

Hello

I try to create a custom (hcp) lattice with 2 basis atoms and 20x20x20
replication of the unit cell (using periodic boundary conditions). I am
expecting to get a box of 2x20x20x20 = 16000 atoms but instead I get 32000
atoms. I guess it has to do with how lammps creates the unit cell.
Could you please give a hint why is this?

very simple, while you set up a custom lattice with two atoms per unit
cell, you do generate an _orthorhombic_ box (via region block) to be
populated with atoms. the lattice is overlaid on the box and all atoms
that fit in will be included. just have a closer look at the output
where it tells what it does.

axel.

I think so too. If you check the log you got, LAMMPS already tells you that
it created 4 atoms after the line "create_atoms 1 box", rather than 2.
Therefore, after replicating 20^3 times, you ended up with twice as many
atoms. I do not know, however, what your expectations are based on nor why
LAMMPS generates the lattice the way it does.

the lattice is indeed created correctly. but you have to remember that
a lattice in LAMMPS is nothing more than a ruler or stencil that is
then used to provide lattice commensurate lengths and positions.
outside of that, there is no connection to the generation of the
simulation box (or regions in general).

axel.