Energy cutoff and FFT meshes: Difference between revisions

From VASP Wiki
No edit summary
No edit summary
Line 1: Line 1:
In general, the energy-cut-off must be chosen according to the pseudopotential.
The basis set and FFT mesh have a very large impact on the accuracy of a calculation.
All {{TAG|POTCAR}} files contain a default energy cut off.
They are determined by the energy cutoff {{TAG|ENCUT}}, which is one of the most important parameters
Use this energy cut-off, but please also
for the accuracy. {{TAG|ENCUT}} needs to be chosen large enough to ensure that the errors due to the basis-set
perform some bulk calculations with different energy cut-off
truncation and finite mesh size are below the required accuracy. Some indications on how to choose {{TAG|ENCUT}}
to find out whether the recommended setting is correct.
or other related tags like {{TAG|PREC}} are provided below.
The cut-off which is specified in the {{TAG|POTCAR}} file
will usually result in an error in the cohesive energy
which is less than 10 meV.


You should be aware of the difference between absolute and
= How to =
relative convergence. The absolute convergence
with respect to the energy cut off {{TAG|ENCUT}} is the convergence
speed of the '''total energy''',
whereas relative convergence is the convergence speed of '''energy differences'''
between different phases (e.g. energy of fcc minus energy of bcc structure).
Energy differences converge much faster than the total energy.
This is especially true if both situations are rather similar (e.g. hcp - fcc).
In this case the error due to the finite cut-off is
'transferable' from one situation to the other situation.
If two configurations differ strongly from each other
(different distribution of s p and d electrons, different hybridization)
absolute convergence gets more and more critical.


There are some rules of thumb, which you should check whenever
== Energy cutoff ==
making a calculation: For bulk materials the number of plane waves
per atom should be between 50-100. A smaller basis set might
result in serious errors. A larger basis set is rarely necessary,
and is a hint for a badly optimized pseudopotential.
If a large  vacuum is included the number of plane
waves will be larger (i.e. <math>50\%</math> of your super cell vacuum <math>\to</math>
number of plane waves increases by a factor of 2).


More problematic than {{TAG|ENCUT}} is the choice of the FFT mesh, because
The energy cutoff {{TAG|ENCUT}} should be chosen according to the pseudopotential ({{TAG|POTCAR}})
this error is '''not''' easily transferable from one situation to the next.
and required accuracy. The default value for {{TAG|ENCUT}} is the largest among the ENMAX values found
For an exact calculation
in the {{TAG|POTCAR}} file. This is the minimum value that should be used, since smaller values
the FFT mesh must contain all wave vectors up to <math>2 G_{\rm cut}</math> if
may possibly lead to large errors and must not be used. This default minimal value
<math>E_{\rm cut}=\frac{\hbar^{2}}{2m} G_{\rm cut}^2</math>, <math>E_{\rm cut}</math> being the used energy-cut-off.
should usually result in an error in the cohesive energy which is less than 10 meV.
Increasing the FFT-mesh from this value
{{NB|mind|The recommended and usual procedure for choosing {{TAG|ENCUT}} is to perform a series of calculations with different {{TAG|ENCUT}} values (larger than the default one) and to monitor the results for the property of interest.}}
does not change the results, except for a possibly very
small change due to the changed exchange-correlation potential.
The reasons for this behavior are explained in {{TAG|Wrap-around errors}}.


Nevertheless it is not always possible and necessary to use such a large
Regarding the convergence of the total energy with respect to {{TAG|ENCUT}},
FFT mesh. In general
the distinction between the '''total energy''' and the '''total energy difference'''
only 'high quality' calculations (as defined in {{TAG|Technical errors}}) require a mesh which avoids all wrap around errors.
(e.g., between different geometries during a structure relaxation or of two polymorphs) should be made.
For most calculations, and in particular for the
Usually, the total energy difference converges much faster than the total energies.
supplied pseudopotentials with the default cut off,  
This is especially true if both geometries are rather similar (e.g., structure relaxation),
it is sufficient to set {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}}
and in this case the errors due to the finite energy cutoff should to some extent cancel each other when
to <math>3/4</math> of the required values (set {{TAG|PREC}}=''Medium'' or {{TAG|PREC}}=Low in the {{TAG|INCAR}}
calculating the energies difference. However, if two configurations differ strongly from each other,
file before running the ''makeparam'' utility or VASP.4.X).
e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with
The values which strictly avoid any wrap-around errors are also written
respect to {{TAG|ENCUT}} may be quite slow.
to the {{TAG|OUTCAR}} file:
{{NB|important|
  WARNING: wrap around error must be expected
*We strongly recommend specifying the energy cutoff {{TAG|ENCUT}} always manually in the {{FILE|INCAR}} file to ensure the same accuracy between calculations. Otherwise, the default {{TAG|ENCUT}} may differ among the different calculations (e.g., for the calculation of the cohesive energy), with the consequence that the total energies, for instance, can not be compared.}}
          set NGX to  22
  WARNING: wrap around error must be expected
          set NGY to  22
  WARNING: wrap around error must be expected
          set NGZ to  22
Just search for the string 'wrap'.
As a rule of thumb the <math>3/4</math> will result in FFT mesh,
which contain approximately 8x8x8=256 FFT points per atom (assuming
that there is no vacuum).


One  hint, that  the FFT mesh is sufficient, is given by the lines
== FFT mesh ==
  soft charge-density along one line
          0      1      2      3      4      5      6      7      8       
x    32.0000 -.7711 1.9743  .0141  .3397 -.0569 -.0162 -.0006  .0000
y    32.0000 6.7863  .0205  .2353  .1237 -.1729 -.0269 -.0006  .0000
z    32.0000 -.7057 -.7680 -.0557  .1610 -.2262 -.0042 -.0069  .0000


also written to the file {{TAG|OUTCAR}} (search for the string 'along'). These lines
=== Coarse mesh ===
contain the charge density in reciprocal space at the positions


:<math>
The size of the coarse FFT mesh ({{TAG|NGX}},{{TAG|NGY}},{{TAG|NGZ}}) is determined by {{TAG|ENCUT}} and {{TAG|PREC}}.
\mathbf{G} = 2 \pi m_x \mathbf{g}^{(x)} ,\quad  \mathbf{G} = 2 \pi  m_y \mathbf{g}^{(y)} ,\quad
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.
\mathbf{G} = 2 \pi m_z \mathbf{g}^{(z)}.
</math>


The last number will always be 0 (it is set explicitly by VASP),
In order to avoid {{TAG|Wrap-around errors}}
but as a rule of thumb the
the FFT mesh should contain all wave vectors up to <math>2G_{\rm cut}</math>, where <math>G_{\rm cut}</math> is defined by
previous value divided by the total number of electrons should be smaller than <math>10^{-4}</math>.
:<math>E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2</math>
To be more precise: Because of the wrap-around errors, certain parts
with <math>E_{\rm cut}</math>={{TAG|ENCUT}}.
of the charge density are wrapped to the other side of the grid,
Nevertheless, it is not always possible and necessary to use such a large FFT mesh.
and the size of the 'wrapped' charge density
Usually, only 'high quality' calculations (as defined in {{TAG|Technical errors}}) require a mesh that avoids
divided by the number of electrons should be less than <math>10^{-3}-10^{-4}</math>.
any wrap-around error. Such calculations can be done with {{TAG|PREC}}=Accurate.


Another important hint that the wrap around errors are too
For most calculations, and in particular with standard pseudopotentials with their default cutoff energies,
large is given by the forces. If there is a considerable drift in
it is sufficient to set {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} to <math>3/4</math> of the required values to
the forces, increase the FFT mesh.
avoid any wrap-around errors, i.e., to include only the wave vectors up to <math>(3/2)G_{\rm cut}</math>.
Search for the string 'total drift' in the {{TAG|OUTCAR}} file, it is located
This is the case when {{TAG|PREC}}=Normal, which is the default.
beneath the line ''TOTAL-FORCE'':
 
     total drift:               -.00273     -.01048      .03856
If {{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} are set manually to values that may lead to sizeable wrap-around errors,
then a warning will be printed in {{FILE|OUTCAR}} (search for the string 'wrap').
 
A hint that the wrap around errors may be too large is given by the forces.
If there is a considerable drift in the forces, the FFT mesh should be increased.
Search for the string 'total drift' in the {{TAG|OUTCAR}} file that is located beneath the line ''TOTAL-FORCE'':
     total drift:                               -0.002730     0.010480      0.038560
The drift should definitely not exceed the magnitude of the forces,
The drift should definitely not exceed the magnitude of the forces,
in general it should be smaller than the size of the
in general it should be smaller than the size of the
forces you are interested in (usually 0.1 eV/<math>\AA</math>).
forces you are interested in (usually 0.1 eV/Å).
 
=== Fine mesh ===


For the representation of the augmentation charges a second
For the representation of the augmentation charges a second finer FFT mesh
more accurate FFT mesh is used. Generally the time spent for the calculation
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}) is used.
on this mesh is relatively small, therefore there is no need
With {{TAG|PREC}}=Normal and Accurate, this fine grid has a size
to worry too much about the size of the
({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}})=<math>2\times</math>({{TAG|NGX}},{{TAG|NGY}},{{TAG|NGZ}}),
mesh, and relying on the defaults of the ''makeparam'' utility
twice larger than the coarse grid.
is in most cases safe.
{{TAG|NGX}}, {{TAG|NGY}} and {{TAG|NGZ}} can also be set manually.
In some rare cases like Cu, Fe<math>\_</math>pv
with extremely 'hard' augmentation charges,
it might be necessary to increase {{TAG|NGXF}} in comparison to the default
setting. This can be done either by hand (setting {{TAG|NGXF}}
in the param.inc file) or by giving a
value for {{TAG|ENAUG}} in the {{TAG|INCAR}} file.


As for the soft part of the charge density the
This denser mesh is used only in some parts of the code,
total charge density (which is the sum of augmentation charges and soft part)
such that the increase in the computational time should be only moderate.
is also written to the file {{TAG|OUTCAR}}:
  total charge-density along one line
          0      1      2      3      4      5      6      7      8       
x    32.0000 -.7711 1.9743  .0141  .3397 -.0569 -.0162 -.0006  .0000
y    32.0000 6.7863  .0205  .2353  .1237 -.1729 -.0269 -.0006  .0000
z    32.0000 -.7057 -.7680 -.0557  .1610 -.2262 -.0042 -.0069  .0000


The same criterion which holds for the soft part should hold for the
The drift in the forces, for instance, may also be reduced by increasing the number of points
total charge density. If the second mesh is too small the forces
of the fine mesh.
might also be wrong (leading to a  'total drift' in the forces).


'''Mind''': The second mesh is only used
Note that the {{TAG|ENAUG}} tag can also be used to set the size of the fine mesh,
in conjunction with US-pseudopotentials.
however this tag is '''deprecated''' and should not be used anymore.
For normconserving pseudopotentials neither the charge density
Furthermore, it is active only with the '''deprecated''' settings {{TAG|PREC}}=Low, Medium or High, otherwise it is ignored.
nor the local potentials are set on the fine mesh.
In this case set NG(X,Y,Z)F to NGX, Y, Z or simply to 1. Both settings result
in the same storage allocation.


'''Mind''': If very hard non-linear/partial core corrections are
=== Support grid ===
included the convergence of the exchange-correlation potential
with respect to the FFT grid might cause problems. All
supplied pseudopotentials have been tested in this respect and are safe.


== When to set ENCUT (and ENAUG) by hand ==
When {{TAG|ADDGRID}}=.TRUE., an additional 'support' grid is used for the evaluation of the augmentation charges.
This grid has a size of <math>2\times</math>({{TAG|NGXF}},{{TAG|NGYF}},{{TAG|NGZF}}), i.e., it has twice more points that the 'fine' grid along each lattice vector. The support grid often helps to reduce the noise in the forces, however as explained in more detail at {{TAG|ADDGRID}} it should be used with caution.


In most cases once can safely use the default values for
== Related tags and articles ==
{{TAG|ENCUT}} and {{TAG|ENAUG}}, which are read from the {{TAG|POTCAR}} file.
But there are some cases where this can results in small, easily avoidable
inaccuracies.


For instance, if you are interested in the energy difference between
{{TAG|ENCUT}},
bulk phases with different compositions (i.e. Co - CoSi - Si).
{{TAG|PREC}},
In this case the default {{TAG|ENCUT}} will be different for the calculations
{{TAG|ADDGRID}},
of pure Co and pure Si, but it is  preferable to use the same
{{TAG|ENAUG}},
cut off for all calculations.
{{TAG|NGX}},
In this case determine the maximal {{TAG|ENCUT}} and {{TAG|ENAUG}} from the {{TAG|POTCAR}} files
{{TAG|NGY}},
and use this value for all calculations.
{{TAG|NGZ}},
{{TAG|NGXF}},
{{TAG|NGYF}},
{{TAG|NGZF}},
[[Wrap-around errors|Wrap-around errors]]


Another example is the calculation of adsorption energies of molecules
on surfaces. To minimize (for instance) non-transferable wrap errors one
should calculate
the energy of an isolated molecule, of the surface only, and of
the adsorbate/surface complex in the same super cell, using the same cut off.
This usually requires to fix {{TAG|ENCUT}} and {{TAG|ENAUG}} by hand in the {{TAG|INCAR}} file.
If one also wants to use real space optimization ({{TAG|LREAL}}=''On''), it is recommended
to use {{TAG|LREAL}}=''On'' for all three calculations as well (the {{TAG|ROPT}} flag
should also be similar for all calculations).


----
----
[[Category:Howto]][[Category:Calculation_setup]]
[[Category:Howto]][[Category:Calculation_setup]]

Revision as of 12:25, 16 October 2025

The basis set and FFT mesh have a very large impact on the accuracy of a calculation. They are determined by the energy cutoff ENCUT, which is one of the most important parameters for the accuracy. ENCUT needs to be chosen large enough to ensure that the errors due to the basis-set truncation and finite mesh size are below the required accuracy. Some indications on how to choose ENCUT or other related tags like PREC are provided below.

How to

Energy cutoff

The energy cutoff ENCUT should be chosen according to the pseudopotential (POTCAR) and required accuracy. The default value for ENCUT is the largest among the ENMAX values found in the POTCAR file. This is the minimum value that should be used, since smaller values may possibly lead to large errors and must not be used. This default minimal value should usually result in an error in the cohesive energy which is less than 10 meV.

Mind: The recommended and usual procedure for choosing ENCUT is to perform a series of calculations with different ENCUT values (larger than the default one) and to monitor the results for the property of interest.

Regarding the convergence of the total energy with respect to ENCUT, the distinction between the total energy and the total energy difference (e.g., between different geometries during a structure relaxation or of two polymorphs) should be made. Usually, the total energy difference converges much faster than the total energies. This is especially true if both geometries are rather similar (e.g., structure relaxation), and in this case the errors due to the finite energy cutoff should to some extent cancel each other when calculating the energies difference. However, if two configurations differ strongly from each other, e.g. for the calculation of the cohesive energy (bulk versus atom), the convergence of the energies difference with respect to ENCUT may be quite slow.

Important:
  • We strongly recommend specifying the energy cutoff ENCUT always manually in the INCAR file to ensure the same accuracy between calculations. Otherwise, the default ENCUT may differ among the different calculations (e.g., for the calculation of the cohesive energy), with the consequence that the total energies, for instance, can not be compared.

FFT mesh

Coarse mesh

The size of the coarse FFT mesh (NGX,NGY,NGZ) is determined by ENCUT and PREC. NGX, NGY and NGZ can also be set manually.

In order to avoid Wrap-around errors the FFT mesh should contain all wave vectors up to [math]\displaystyle{ 2G_{\rm cut} }[/math], where [math]\displaystyle{ G_{\rm cut} }[/math] is defined by

[math]\displaystyle{ E_{\rm cut}=\frac{\hbar^2}{2m_e}G_{\rm cut}^2 }[/math]

with [math]\displaystyle{ E_{\rm cut} }[/math]=ENCUT. Nevertheless, it is not always possible and necessary to use such a large FFT mesh. Usually, only 'high quality' calculations (as defined in Technical errors) require a mesh that avoids any wrap-around error. Such calculations can be done with PREC=Accurate.

For most calculations, and in particular with standard pseudopotentials with their default cutoff energies, it is sufficient to set NGX, NGY and NGZ to [math]\displaystyle{ 3/4 }[/math] of the required values to avoid any wrap-around errors, i.e., to include only the wave vectors up to [math]\displaystyle{ (3/2)G_{\rm cut} }[/math]. This is the case when PREC=Normal, which is the default.

If NGX, NGY and NGZ are set manually to values that may lead to sizeable wrap-around errors, then a warning will be printed in OUTCAR (search for the string 'wrap').

A hint that the wrap around errors may be too large is given by the forces. If there is a considerable drift in the forces, the FFT mesh should be increased. Search for the string 'total drift' in the OUTCAR file that is located beneath the line TOTAL-FORCE:

    total drift:                               -0.002730      0.010480      0.038560

The drift should definitely not exceed the magnitude of the forces, in general it should be smaller than the size of the forces you are interested in (usually 0.1 eV/Å).

Fine mesh

For the representation of the augmentation charges a second finer FFT mesh (NGXF,NGYF,NGZF) is used. With PREC=Normal and Accurate, this fine grid has a size (NGXF,NGYF,NGZF)=[math]\displaystyle{ 2\times }[/math](NGX,NGY,NGZ), twice larger than the coarse grid. NGX, NGY and NGZ can also be set manually.

This denser mesh is used only in some parts of the code, such that the increase in the computational time should be only moderate.

The drift in the forces, for instance, may also be reduced by increasing the number of points of the fine mesh.

Note that the ENAUG tag can also be used to set the size of the fine mesh, however this tag is deprecated and should not be used anymore. Furthermore, it is active only with the deprecated settings PREC=Low, Medium or High, otherwise it is ignored.

Support grid

When ADDGRID=.TRUE., an additional 'support' grid is used for the evaluation of the augmentation charges. This grid has a size of [math]\displaystyle{ 2\times }[/math](NGXF,NGYF,NGZF), i.e., it has twice more points that the 'fine' grid along each lattice vector. The support grid often helps to reduce the noise in the forces, however as explained in more detail at ADDGRID it should be used with caution.

Related tags and articles

ENCUT, PREC, ADDGRID, ENAUG, NGX, NGY, NGZ, NGXF, NGYF, NGZF, Wrap-around errors