# Lattice custom orient:confusion/bug

Dear Steve,

I’d like to do a simple test to calculate the cohesive energy of HCP-Mg for different directions. Using this command to create lattice

lattice custom 4 a1 1 0 0 a2 0 sqrt(3) 0 a3 0 0 sqrt(8/3) basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.83333333 0.5 basis 0.0 0.33333333 0.5 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1

I get: Cohesive energy per atom=-1.510114302, a= 3.202795516, and c/a=1.619608977 which seem to be right for me.

The problem rises when I want to find orguments of x, y, and z for orient command above for one of pyramidal slip systems; e.g. {1-101}<11-20>. Here is what I figured to do to find the directions for lammps:

1. I found another direction in {1-101} plane which is <-1102>.

2. I converted these two directions from [uvtw] format to [UVw] and then to cartesian coordinate system as a1=<100> and a2=<012> keeping in mind that unit vectors in cartesian coordinate system aren’t really unit from the definitions of a1, a2, and a3.

3. I calcuate a3=a1 cross a2=-2(c/4)/sqrt(3)j+sqrt(3)/(c/a). and found the closest integer number for this as <0 -7 4>

4. recalculated a2=a3 cross a1= <0 4 7>

Then I used the following commands:

variable facx equal sqrt((v_x1)^2+(v_x2v_ay)^2+(v_x3v_ca)^2)

variable facy equal sqrt((v_y1)^2+(v_y2v_ay)^2+(v_y3v_ca)^2)

variable facz equal sqrt((v_z1)^2+(v_z2v_ay)^2+(v_z3v_ca)^2)

variable latdisx equal “1v_latparamv_facx-0.05”

variable latdisy equal “1v_latparamv_facy-0.05”

variable latdisz equal “1v_latparamv_facz-0.05”

lattice custom 4 a1 1 0 0 a2 0 sqrt(3) 0 a3 0 0 sqrt(8/3) basis 0.0 0.0 0.0 basis 0.5 0.5 0.0 basis 0.5 0.83333333 0.5 basis 0.0 0.33333333 0.5 orient x 1 0 0 orient y 0 4 7 orient z 0 -7 4

region box block 0.05 {latdisx} 0.05 {latdisy} 0.05 \${latdisz} units box

and got Cohesive energy=-1.502639033

I am pretty much sure that I don’t have the periodic simulation box. I guess the problem is that the unit vectors are not actually unite in the lattice command (a1, a2, and a3).

Can you suggest my possible mistakes wrong?

Thanks,

Ebrahim

Post-Doctoral Research Fellow

Department of Materials Science & Engineering

Missouri University of Science & Technology

Office: (573) 341-6131

The only “solution” to these kinds of issues is
to generate a small system, dump the coords to
a file, viz it, and convince yourself that the “lattice
spacings” that LAMMPS is using are commensurate