Error: Incorrect atoms position in the restart dat file |
- Date: 2023/10/11 11:12
- Name: kylin
<kylincaster@foxmail.com>
- Dear all,
I have recently conducted DFT calculations on Iron materials and unfortunately discovered that the automatically generated restart file, such as "Fe.dat#", is incorrect when using the "Atoms.SpeciesAndCoordinates.Unit FRAC" option for cell optimization.
It appears that OpenMX does not update the reciprocal cell after changes to the unit cell. Consequently, the output scaled coordinates of the atoms are incorrect.
I would like to share an update function that can be inserted into the "Make_InputFile_with_FinalCoord.c" file to address this issue:
c Copy code static void update_rtv() { // Update rtv and Cell_Volume Cross_Product(tv[2], tv[3], rtv[1]); Cross_Product(tv[3], tv[1], rtv[2]); Cross_Product(tv[1], tv[2], rtv[3]); Cell_Volume = fabs(Dot_Product(rtv[1], tv[1])); for (int i = 1; i <= 3; i++) { for (int al = 1; al <= 3; al++) { rtv[i][al] = rtv[i][al] / Cell_Volume * 2 * M_PI; } } }
void Make_InputFile_with_FinalCoord(char *file, int MD_iter) { if (coordinates_unit == 2) update_rtv();
if (Solver != 4) { // ... // code here // ... } } This update should help resolve the issue with the incorrect scaled coordinates of atoms in the restart file. Please integrate this code into your "Make_InputFile_with_FinalCoord.c" file as indicated.
Cheers, Kylin
| |