Skip to content

Commit eb57368

Browse files
Fix: get_potential
1 parent ba2b651 commit eb57368

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ void OperatorEXXPW<T, Device>::get_potential() const
572572
double tpiba2 = tpiba * tpiba;
573573
pot_cpu = new Real[npw * wfcpw->nks * wfcpw->nks];
574574
// fill zero
575-
575+
setmem_real_cpu_op()(pot_cpu, 0, npw * nks * nks);
576576

577577
// calculate Fock pot
578578
auto param_fock = GlobalC::exx_info.info_global.coulomb_param[Conv_Coulomb_Pot_K::Coulomb_Type::Fock];
@@ -986,9 +986,7 @@ double OperatorEXXPW<T, Device>::cal_exx_energy_op(psi::Psi<T, Device> *ppsi_) c
986986
setmem_complex_op()(density_real, 0, rhopw_dev->nrxx);
987987
setmem_complex_op()(density_recip, 0, rhopw_dev->npw);
988988

989-
double Eexx = Eexx_ik_real;
990-
std::cout << Eexx << std::endl;
991-
return Eexx;
989+
return Eexx_ik_real;
992990
}
993991

994992
template <>

source/source_pw/module_pwdft/operator_pw/op_exx_pw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class OperatorEXXPW : public OperatorPW<T, Device>
143143
using ct_Device = typename ct::PsiToContainer<Device>::type;
144144
using setmem_complex_op = base_device::memory::set_memory_op<T, Device>;
145145
using setmem_real_op = base_device::memory::set_memory_op<Real, Device>;
146+
using setmem_real_cpu_op = base_device::memory::set_memory_op<Real, base_device::DEVICE_CPU>;
146147
using resmem_complex_op = base_device::memory::resize_memory_op<T, Device>;
147148
using delmem_complex_op = base_device::memory::delete_memory_op<T, Device>;
148149
using syncmem_complex_op = base_device::memory::synchronize_memory_op<T, Device, Device>;

0 commit comments

Comments
 (0)