What's wrong with command "lattice custom" while modeling ?

Dear lammps_users,

As described in the topic. The log file shows : ERROR: Illegal lattice command (…/lattice.cpp:223)

My input script is as blew:

units metal
boundary p p p
dimension 3
atom_style atomic

#-----------BN armchair
lattice custom 4.35 a1 1 0 0 a2 0 0.57735 0 a3 0 0 10 &
basis 0.166667 0.25 0.5 &
basis 0.333333 0.75 0.5 &
basis 0.666667 0.75 0.5 &
basis 0.833333 0.25 0.5

region totalbox block 0 46 0 18 0 1
region BN block 0 46 0 18 0.5 0.7

create_box 4 totalbox
create_atoms 2 region BN basis 1 3 basis 2 4 basis 3 3 basis 4 4

region hot block 6 7 0 18 0 1
region cold block 44 45 0 18 0 0.5

#------------Al2O3
lattice custom 5.12 &
a1 1 0.0 0.0 &
a2 1 3.171271 0.0 &
a3 0.0 0.0 10 &
basis 0.105 0.0 0.0105 &
basis 0.605 0.0 0.0605 &
basis -0.105 0.0 -0.0105 &
basis 0.395 0.0 0.0395 &
basis 0.0 0.095545 -0.0303 &
basis 0.303 -0.191091 0.0 &
basis -0.303 0.095545 0.0303 &
basis 0.197 0.191091 0.05 &
basis 0.5 -0.095545 0.0803 &
basis 0.803 -0.095545 0.0197

region alo block 0 25 0 6 4 7
create_atoms 2 region alo &
basis 1 4 &
basis 2 4 &
basis 3 4 &
basis 4 4 &
basis 5 3 &
basis 6 3 &
basis 7 3 &
basis 8 3 &
basis 9 3 &
basis 10 3

mass 3 10.811
mass 4 14.0067
mass 1 15.9994
mass 2 26.9815386

From the lattice doc page:

A lattice of style {custom} allows you to specify a1, a2, a3, and a
list of basis atoms to put in the unit cell. By default, a1 and a2
and a3 are 3 orthogonal unit vectors (edges of a unit cube). But you
can specify them to be of any length and non-orthogonal to each other,
so that they describe a tilted parallelepiped. Via the {basis}
keyword you add atoms, one at a time, to the unit cell. Its arguments
are fractional coordinates (0.0 <= x,y,z < 1.0). The position vector
x of a basis atom within the unit cell is thus a linear combination of
the the unit cell’s 3 edge vectors, i.e. x = bx a1 + by a2 + bz a3,
where bx,by,bz are the 3 values specified for the {basis} keyword.

So you need to add 1.0 to your negative basis numbers to put

them between 0.0 to 1.0.

Steve

Dear lammps-users,

Thanks a lot for Steve Plimpton’s kind help. This problem has been successfully solved.

But I have a new problem. I want to establish α-Al2O3 structure. While it has two lattice constants. a=4.757 & c=12.9887. I don’t know how to describe this kind of structure using lattice custom command. Because we use this command when the crystal usually has one lattice constant. Thanks a lot.
Best wishes.
Shuting Wang

When you use lattice custom, you define the size and shape

of the unit cell. So it could by a x c, as you list it. And you

populate a rectangular cell with atoms via the basis keywords.

If you can’t do it with lattice custom, then you’ll have to write

out a data file using whatever means you wish, and have LAMMPS

read in your atom coords.

Steve