Skip to content

Commit e28409d

Browse files
author
dyzheng
committed
Fix: nscf force calculation with DFT+U
1 parent f8db2b9 commit e28409d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/module_esolver/esolver_ks_lcao.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,10 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(UnitCell& ucell, const int istep, const
669669

670670
if (PARAM.inp.dft_plus_u)
671671
{
672-
if (istep != 0 || iter != 1)
672+
// set_dmr to calculate the onsite-matrix and the energy correction for DFT+U,
673+
// in SCF calculation, the DMR is updated from the second iteration
674+
// in NSCF calculation, the DMR is not updated, so always set_dmr here
675+
if (istep != 0 || iter != 1 || PARAM.inp.calculation == "nscf")
673676
{
674677
GlobalC::dftu.set_dmr(dynamic_cast<elecstate::ElecStateLCAO<TK>*>(this->pelec)->get_DM());
675678
}

0 commit comments

Comments
 (0)