我试着用C代码制作FCC 100和FCC 111晶格。
我已经配置了FCC 100点阵,我做得很好。然而,当我尝试制作FCC 111晶格时,它看起来与我预期的不同。
我使用参考FCC 111晶格(由另一个GUI程序“Amsterdam Density Functional”构建)来比较我的fcc111晶格(使用C代码)。
我的问题是,
我在代码中用来生成FCC(111)的参数是正确的吗?如果他们不正确,请帮助我建立FCC 111晶格。提前谢谢
/**** 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;
}
}
}
在这里,我还展示了代码中的引用结构和输出结构
最佳答案
如果有人能看一下用于制作具有矩形横截面的FCC(111)晶格的C代码,并建议在该代码中可以修改哪些内容,以便制作具有菱形横截面的FCC(111)晶格,这将非常有用,与本问题中提供的GUI-REF相同。
关于c - FCC 100和111点阵C代码,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33890638/