Commit 41985fe
committed
fix(xc): restore func_type check in gradcorr stress path for mGGA
The previous commit (XC_FLAGS_NEEDS_LAPLACIAN) incorrectly replaced
'func_type == 3 || func_type == 5' with 'need_laplacian' in the stress
path of gradcorr(). This caused SCAN (func_type=3, need_laplacian=false)
to call gcxc_libxc instead of tau_xc, losing the tau-dependent v2xc
and making the GGA stress contribution zero.
Fix: use func_type check for selecting tau_xc vs gcxc_libxc (all mGGA
functionals need tau_xc), and need_laplacian only for Laplacian
computation and vlapl stress contribution.
SCAN PW stress FD: error reduced from 41.3% to 0.45%.1 parent c6f0d57 commit 41985fe
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
543 | | - | |
| 543 | + | |
544 | 544 | | |
545 | 545 | | |
546 | 546 | | |
| |||
0 commit comments