NGX getting changed by VASP without adequate warning?
Moderators: Global Moderator, Moderator
-
- Newbie
- Posts: 16
- Joined: Wed Oct 12, 2022 8:17 pm
NGX getting changed by VASP without adequate warning?
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!
-
- Global Moderator
- Posts: 418
- Joined: Mon Sep 13, 2021 11:02 am
Re: NGX getting changed by VASP without adequate warning?
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?
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?
-
- Newbie
- Posts: 16
- Joined: Wed Oct 12, 2022 8:17 pm
Re: NGX getting changed by VASP without adequate warning?
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.
-
- Global Moderator
- Posts: 418
- Joined: Mon Sep 13, 2021 11:02 am
Re: NGX getting changed by VASP without adequate warning?
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.
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.
-
- Newbie
- Posts: 16
- Joined: Wed Oct 12, 2022 8:17 pm
Re: NGX getting changed by VASP without adequate warning?
Hi Fabien,
Could you post the actual formula here in the meantime?
Could you post the actual formula here in the meantime?
-
- Global Moderator
- Posts: 418
- Joined: Mon Sep 13, 2021 11:02 am
Re: NGX getting changed by VASP without adequate warning?
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):
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)
-
- Newbie
- Posts: 16
- Joined: Wed Oct 12, 2022 8:17 pm
Re: NGX getting changed by VASP without adequate warning?
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
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
-
- Global Moderator
- Posts: 418
- Joined: Mon Sep 13, 2021 11:02 am
Re: NGX getting changed by VASP without adequate warning?
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.
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.
-
- Newbie
- Posts: 16
- Joined: Wed Oct 12, 2022 8:17 pm
Re: NGX getting changed by VASP without adequate warning?
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
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