NGX getting changed by VASP without adequate warning?

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
matthewkuner
Newbie
Newbie
Posts: 16
Joined: Wed Oct 12, 2022 8:17 pm

NGX getting changed by VASP without adequate warning?

#1 Post by matthewkuner » Thu Jul 06, 2023 11:57 pm

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!

fabien_tran1
Global Moderator
Global Moderator
Posts: 418
Joined: Mon Sep 13, 2021 11:02 am

Re: NGX getting changed by VASP without adequate warning?

#2 Post by fabien_tran1 » Fri Jul 07, 2023 11:18 am

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?

matthewkuner
Newbie
Newbie
Posts: 16
Joined: Wed Oct 12, 2022 8:17 pm

Re: NGX getting changed by VASP without adequate warning?

#3 Post by matthewkuner » Fri Jul 07, 2023 5:15 pm

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.

fabien_tran1
Global Moderator
Global Moderator
Posts: 418
Joined: Mon Sep 13, 2021 11:02 am

Re: NGX getting changed by VASP without adequate warning?

#4 Post by fabien_tran1 » Mon Jul 10, 2023 8:46 am

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.

matthewkuner
Newbie
Newbie
Posts: 16
Joined: Wed Oct 12, 2022 8:17 pm

Re: NGX getting changed by VASP without adequate warning?

#5 Post by matthewkuner » Mon Jul 10, 2023 7:39 pm

Hi Fabien,

Could you post the actual formula here in the meantime?

fabien_tran1
Global Moderator
Global Moderator
Posts: 418
Joined: Mon Sep 13, 2021 11:02 am

Re: NGX getting changed by VASP without adequate warning?

#6 Post by fabien_tran1 » Tue Jul 11, 2023 7:27 am

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)

matthewkuner
Newbie
Newbie
Posts: 16
Joined: Wed Oct 12, 2022 8:17 pm

Re: NGX getting changed by VASP without adequate warning?

#7 Post by matthewkuner » Fri Jul 14, 2023 7:10 pm

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

fabien_tran1
Global Moderator
Global Moderator
Posts: 418
Joined: Mon Sep 13, 2021 11:02 am

Re: NGX getting changed by VASP without adequate warning?

#8 Post by fabien_tran1 » Mon Jul 17, 2023 9:52 am

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.

matthewkuner
Newbie
Newbie
Posts: 16
Joined: Wed Oct 12, 2022 8:17 pm

Re: NGX getting changed by VASP without adequate warning?

#9 Post by matthewkuner » Thu Jul 20, 2023 8:29 pm

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

Post Reply