Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ void KEDF_vW::tau_vw(const double* const* prho, ModulePW::PW_Basis* pw_rho, doub
{
std::vector<std::vector<double>> nabla_rho(3, std::vector<double>(pw_rho->nrxx, 0.));

std::complex<double> *recip_rho = new std::complex<double>[pw_rho->npw];
std::complex<double> *recip_nabla_rho = new std::complex<double>[pw_rho->npw];
pw_rho->real2recip(prho[is], recip_rho);
std::vector<std::complex<double>> recip_rho(pw_rho->npw, 0.);
std::vector<std::complex<double>> recip_nabla_rho(pw_rho->npw, 0.);
pw_rho->real2recip(prho[is], recip_rho.data());

std::complex<double> img(0.0, 1.0);
for (int j = 0; j < 3; ++j)
Expand All @@ -141,7 +141,7 @@ void KEDF_vW::tau_vw(const double* const* prho, ModulePW::PW_Basis* pw_rho, doub
recip_nabla_rho[ip] = img * pw_rho->gcar[ip][j] * recip_rho[ip] * pw_rho->tpiba;
}

pw_rho->recip2real(recip_nabla_rho, nabla_rho[j].data());
pw_rho->recip2real(recip_nabla_rho.data(), nabla_rho[j].data());

for (int ir = 0; ir < pw_rho->nrxx; ++ir)
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_io/write_elf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void write_elf(
}

// 3) calculate the enhancement factor F = (tau_KS - tau_vw) / tau_TF, and then ELF = 1 / (1 + F^2)
double eps = 1.0e-5; // suppress the numerical instability in LCAO
double eps = 1.0e-5; // suppress the numerical instability in LCAO (Ref: Acta Phys. -Chim. Sin. 2011, 27(12), 2786-2792. doi: 10.3866/PKU.WHXB20112786)
for (int is = 0; is < nspin; ++is)
{
for (int ir = 0; ir < rho_basis->nrxx; ++ir)
Expand Down Expand Up @@ -112,7 +112,7 @@ void write_elf(
{
for (int is = 0; is < nspin; ++is)
{
std::string fn_temp = out_dir + "/ELF_SPIN" + std::to_string(is) + ".cube";
std::string fn_temp = out_dir + "/ELF_SPIN" + std::to_string(is + 1) + ".cube";
int ispin = is + 1;

ModuleIO::write_cube(
Expand Down
Loading