Commit ca65a72
dyzheng
Fix(PW DFT+U): add missing member variable assignments in init()
The develop branch refactored DFT+U to use explicit parameter passing,
but forgot to assign two member variables in the init() function:
1. this->npol was never set (defaulted to 1), causing incorrect Pauli
matrix component iteration for nspin=4 calculations in
cal_energy_correction().
2. this->device was never set (defaulted to empty string), causing the
CPU code path in cal_occ_pw() to be skipped entirely. This resulted
in the occupation matrix never being computed, leaving a zero/initial
locale which produced wildly different PW DFT+U energies (~12-24 eV).
After this fix, all enabled 17_DS_DFTU test cases produce results
identical to accel-old branch (within numerical precision).1 parent d3ad308 commit ca65a72
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
0 commit comments