gpt4 book ai didi

c - FCC 100 和 111 点阵 C 代码

转载 作者:太空宇宙 更新时间:2023-11-04 04:32:59 26 4
gpt4 key购买 nike

我正在尝试使用 C 代码制作 FCC 100 和 FCC 111 晶格。我已经配置了 FCC 100 点阵,并且配置正确。然而,当我尝试制作 FCC 111 晶格时,它看起来与我预期的不同。我使用引用 FCC 111 晶格(由另一个 GUI 程序“Amsterdam Density Functional”构建)来比较我的 FCC 111 晶格(使用 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;
}
}
}

这里我还展示了代码的引用结构和输出结构

enter image description here

最佳答案

如果有人可以查看用于制作具有矩形横截面的 FCC (111) 晶格的 C 代码,并建议可以在此代码中修改哪些内容以制作 FCC (111),这将很有用横截面为菱形的晶格,与本题提供的GUI-REF相同。

关于c - FCC 100 和 111 点阵 C 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33890638/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com