Feature: output dkin
for metaGGA calculations
#3700
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3562 and #3146.
Why
In addition to charge density, kinetic density also needs to be considered in metaGGA calculations. Sometimes, the
drho
is very close to zero, while theEDIFF
is rather large, which confuse the user. The finiteEDIFF
comes from the kinetic density instead of charge density. To avoid similar confusion, it is necessary to output the kinetic density difference at each iteration.List of Changes
DKIN
intoprinthead()
dkin
intoprintetot()
,print_etot()
,printiter()
get_dkin()
, similar withget_drho()
Results
I take
abacus-develop/tests/integrate/216_NO_scan_Si2
as an example:Old:
DONE(0.358404 SEC) : INIT SCF ITER ETOT(eV) EDIFF(eV) DRHO TIME(s) GE1 -2.045033e+02 0.000000e+00 2.945e-01 4.466e-01 GE2 -2.034444e+02 1.058872e+00 1.150e-01 3.721e-01 GE3 -2.034414e+02 2.967687e-03 8.388e-03 3.721e-01 GE4 -2.034731e+02 -3.164552e-02 2.183e-03 3.735e-01 GE5 -2.034720e+02 1.056283e-03 1.013e-04 3.734e-01 GE6 -2.034726e+02 -6.129378e-04 1.181e-05 3.735e-01 GE7 -2.034727e+02 -1.090943e-05 3.115e-06 3.733e-01 GE8 -2.034727e+02 -3.161632e-07 2.331e-07 3.734e-01 GE9 -2.034727e+02 2.201660e-09 7.833e-08 3.741e-01 GE10 -2.034727e+02 1.750779e-08 6.904e-09 3.734e-01 GE11 -2.034727e+02 -8.487448e-09 7.649e-10 3.723e-01
New:
DONE(0.273942 SEC) : INIT SCF ITER ETOT(eV) EDIFF(eV) DRHO DKIN TIME(s) GE1 -2.045033e+02 0.000000e+00 2.945e-01 4.232e-01 4.448e-01 GE2 -2.034444e+02 1.058872e+00 1.150e-01 9.808e-03 3.772e-01 GE3 -2.034414e+02 2.967687e-03 8.388e-03 8.195e-03 3.763e-01 GE4 -2.034731e+02 -3.164552e-02 2.183e-03 4.036e-04 3.761e-01 GE5 -2.034720e+02 1.056283e-03 1.013e-04 1.573e-04 3.765e-01 GE6 -2.034726e+02 -6.129378e-04 1.181e-05 1.657e-05 3.747e-01 GE7 -2.034727e+02 -1.090943e-05 3.115e-06 4.633e-07 3.751e-01 GE8 -2.034727e+02 -3.161632e-07 2.331e-07 2.111e-07 3.745e-01 GE9 -2.034727e+02 2.201660e-09 7.833e-08 5.770e-08 3.763e-01 GE10 -2.034727e+02 1.750779e-08 6.904e-09 1.108e-08 3.773e-01 GE11 -2.034727e+02 -8.487448e-09 7.649e-10 1.270e-09 3.759e-01