1

I am trying to make FCC 100 and FCC 111 crystal lattice using C code. I have configured FCC 100 lattice and I made it correctly. However, when I tried to make FCC 111 lattice and it looks different from what I expect. I use the reference FCC 111 lattice (built by another GUI program “Amsterdam Density Functional”) to compare my FCC 111 lattice (using C code). My question is, The parameters that I used to make FCC (111) in my code are correct? If they are not correct, please help me to build FCC 111 lattice. Thanks in advance

/**** To create FCC 100 lattice*********/
for(i=0; i<Xatom; i++){            // Number of Atoms in the X direction
for(j=0; j<Yatom; j++){        // Number of Atoms in the Y direction
    for(k=0; k<nL; k++) {       // Number of layers in the Z direction

x[i]= I * a_lattice;   y[j]= j * a_lattice;   z[k]= k * a_lattice;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

x[i]= I * a_lattice;   y[j]= 0.5 * a_lattice +  j * a_lattice;    z[k]= 0.5 * a_lattice + k * a_lattice;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

x[i]= 0.5 * a_lattice + I * a_lattice;  y[j]= j * a_lattice;   z[k]= 0.5 * a_lattice + k *a_lattice;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

x[i]= 0.5 * a_lattice + i*a_lattice;  y[j] = 0.5 * a_lattice + j * a_lattice;   z[k]= k * a_lattice;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);
        }   
    }
}

/**** To create FCC 111 lattice*********/
ax = a_lattice * sqrt(2)/2;
ay = a_lattice * sqrt(6)/2;
az = a_lattice * sqrt(3);

x2 = sqrt(2)/4 * a_lattice;
y2 = sqrt(6)/4 * a_lattice;
y3 = sqrt(6)/6 * a_lattice;
y4 = sqrt(6)*5/12 * a_lattice;
y5 = sqrt(6)*2/6 * a_lattice;
y6 = sqrt(6)/12 * a_lattice;

for(i=0; i<Xatom; i++){
for(j=0; j<Yatom; j++){
  layer = 0;
for(k=0; k<nL; k++){

x[i] = I * ax;  y[j] = j * ay;  z[k]= layer/ 3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);


x[i] = x2 + I * ax;   y[j] = y2 + j * ay;   z[k] = layer/3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

layer = layer + 1;

x[i] = I * ax;  y[j] = y3 + j*ay;  z[k] = layer/3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

x[i] = x2 + I * ax;   y[j] = y4 + j * ay;   z[k]=layer/3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

layer = layer + 1;

x[i] = I * ax;  y[j] = y5 + j * ay;     z[k] = layer/3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);

x[i] = x2 + I * ax;   y[j] = y6 + j * ay;   z[k] = layer/3.0 * az;
fprintf(fpo," %s\t %lf\t %lf\t %lf\n", AtomName, x[i], y[j], z[k]);
layer = layer + 1; 
        }
    }
}

Here I have also shown the reference structure and my output structure from my code

enter image description here

Mars
  • 8,689
  • 2
  • 42
  • 70
veera
  • 11
  • 6
  • Both screenshots show same lattice with same relative particle placement. The only difference is the form of particle group. Is it your problem? – HolyBlackCat Nov 24 '15 at 12:08
  • Thanks for your reply. When we compare these two structures, top lattice has 10 atoms along both in X and Y direction, but the bottom one seems to have 20 atoms along Y direction (distance is quite large between two neighbouring atoms) and the X side is perfect. Moreover, I would like to achieve the diamond shape. I also changed some parameters in FCC 111 code, I could not find the perfect one. – veera Nov 24 '15 at 13:20

1 Answers1

0

It would be useful if somebody can take a look on the C code that is used to make this FCC (111) lattice with rectangular cross-section and suggest what can be modified in this code in order to make FCC (111) lattice with a diamond cross-section, which is the same like the GUI-REF provided in this question.

Ljanmi
  • 1
  • 1