Top Page > Browsing
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





メンテ
Page: [1]

Re: Error: Incorrect atoms position in the restart dat file ( No.1 )
Date: 2023/10/27 13:39
Name: T. Ozaki

Hi,

Thank you for your report.
Yes, you are right. rtv should be updated.
I have corrected the corresponding part, and it will be fixed in the next version.

Thank you again.

Best regards,

TO
メンテ

Page: [1]

Thread Title (must) Move the thread to the top
Your Name (must)
E-Mail (must)
URL
Password (used in modification of the submitted text)
Comment (must)

   Save Cookie