Skip to content

Commit d33c34f

Browse files
Fix: use correct \psi for GPU in cal_tau for ELF (#7378)
* Fix: use correct PSI for GPU in cal_tau for ELF * Refactor: split long cast into readable lines in after_scf
1 parent 71f3524 commit d33c34f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/source_esolver/esolver_ks_pw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ void ESolver_KS_PW<T, Device>::after_scf(UnitCell& ucell, const int istep, const
279279
// Calculate kinetic energy density tau for ELF if needed
280280
if (PARAM.inp.out_elf[0] > 0)
281281
{
282-
this->pelec->cal_tau(*(this->stp.psi_cpu));
282+
auto* elec_pw = static_cast<elecstate::ElecStatePW<T, Device>*>(this->pelec);
283+
auto& psi = *this->stp.template get_psi_t<T, Device>();
284+
elec_pw->cal_tau(psi);
283285
}
284286

285287
ESolver_KS::after_scf(ucell, istep, conv_esolver);

0 commit comments

Comments
 (0)