Page 1 of 1

NGX getting changed by VASP without adequate warning?

Posted: Thu Jul 06, 2023 11:57 pm
by matthewkuner
I have run many VASP calculations with an ENCUT of 700 eV and PREC = Accurate. From my calculations, this should result in NGX = NGY = NGZ ~= 108. However, the values for NGX/Y/Z are all changed to half of this. What could be the cause of this? Perhaps the ISYM being set to 2? Any help is much appreciated!

Re: NGX getting changed by VASP without adequate warning?

Posted: Fri Jul 07, 2023 11:18 am
by fabien_tran1
Hi,

Without providing more information it is difficult to give an answer. Did you change some settings in INCAR (e.g. ISYM) for the new calculation? Did you switch to a more recent version of VASP?

Re: NGX getting changed by VASP without adequate warning?

Posted: Fri Jul 07, 2023 5:15 pm
by matthewkuner
Hi Fabien, sorry for the confusion. I haven't run the same calculation multiple times with different INCARs. Rather, I used the formula on the NGX page from the VASP wiki (https://www.vasp.at/wiki/index.php/NGX) to calculate what NGX/Y/Z should have been. However, my values were all about half of what I calculated using the formula on that page. This was for VASP 5.4.4. Let me know if that clarifies this.

Re: NGX getting changed by VASP without adequate warning?

Posted: Mon Jul 10, 2023 8:46 am
by fabien_tran1
Hi,

Actually, the relations between Gcut and NGX/Y/Z that are in the tables at NGX and PREC are misleading or even wrong. The cell size does not matter when choosing ENCUT (except for computational time), while NGX/Y/Z increase proportionally with respect to the lattice constants in their respective directions. The way NGX/Y/Z are calculated from ENCUT in the source code is a bit complicated, but roughly speaking there should be also a multiplication by the lattice constants in the formulas NGX/Y/Z=X*Gcut.

The factor 3/2 or 2 multiplies the minimal values of NGX/Y/Z calculated from ENCUT and the lattice constants.

We will modify the wiki pages for NGX/Y/Z and PREC to make this more correct.

Re: NGX getting changed by VASP without adequate warning?

Posted: Mon Jul 10, 2023 7:39 pm
by matthewkuner
Hi Fabien,

Could you post the actual formula here in the meantime?

Re: NGX getting changed by VASP without adequate warning?

Posted: Tue Jul 11, 2023 7:27 am
by fabien_tran1
Hi,

There is no closed-form formula for NGX/Y/Z. You should have a look at what is done in main.F from line 992 to 1057 (VASP 5.4.4):

Code: Select all

      XCUTOF =SQRT(INFO%ENMAX /RYTOEV)/(2*PI/(LATT_CUR%ANORM(1)/AUTOA))
      .
      .
      .
      NGXC= GRIDC%NGPTAR(1); NGYC= GRIDC%NGPTAR(2); NGZC= GRIDC%NGPTAR(3)

Re: NGX getting changed by VASP without adequate warning?

Posted: Fri Jul 14, 2023 7:10 pm
by matthewkuner
Hi Fabien,

Given that you plan to update the wiki docs anyway to show the correct formula, is it okay if I transcribe the ~10-15 lines of code from the VASP source code (regarding how to calculate NGX/Y/Z, NGXF/YF/ZF) into my own open-source repo?

Best,
Matthew

Re: NGX getting changed by VASP without adequate warning?

Posted: Mon Jul 17, 2023 9:52 am
by fabien_tran1
Hi,

It would be too lengthy and unnecessary to show the formula on the VASP wiki, and finally no change on the wiki will be made (I have discussed with a colleague). In fact, the meaning of "3/2" in "3/2×Gcut" in the tables is a factor multiplying the radius Gcut of the sphere in the reciprocal space that has to be encompassed by the grid NGX/Y/Z. I think this is what we can more or less understand from the explanations below "FFT grids" in PREC. Thus, my previous claim that the relations between Gcut and NGX/Y/Z are misleading is not true.

In your open-source repo you can have some sketch of how NGX/Y/Z are calculated, but not a simple copy-and-paste of the VASP source code.

Re: NGX getting changed by VASP without adequate warning?

Posted: Thu Jul 20, 2023 8:29 pm
by matthewkuner
Hi Fabien,

Great! Here is a link to a github PR for code we are implementing that is relevant: https://github.com/materialsproject/pymatgen/pull/3149

Let us know if there are any issues.

Best,
Matthew