Skip to content

Commit

Permalink
feature: add the output of .cube file in LCAO out_chg calculation (#1310
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pxlxingliang committed Sep 26, 2022
1 parent 627e90d commit 6e5b8f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,9 +625,12 @@ void ESolver_KS_LCAO::eachiterfinish(int iter)
const int precision = 3;

std::stringstream ssc;
std::stringstream ss1;
ssc << GlobalV::global_out_dir << "tmp"
<< "_SPIN" << is + 1 << "_CHG";
GlobalC::CHR.write_rho(GlobalC::CHR.rho_save[is], is, iter, ssc.str(), precision); // mohan add 2007-10-17
ss1 << GlobalV::global_out_dir << "tmp" << "_SPIN" << is + 1 << "_CHG.cube";
GlobalC::CHR.write_rho_cube(GlobalC::CHR.rho_save[is], is, ss1.str(), 3);

std::stringstream ssd;

Expand Down Expand Up @@ -680,8 +683,11 @@ void ESolver_KS_LCAO::afterscf(const int istep)
const int precision = 3;

std::stringstream ssc;
std::stringstream ss1;
ssc << GlobalV::global_out_dir << "SPIN" << is + 1 << "_CHG";
ss1 << GlobalV::global_out_dir << "SPIN" << is + 1 << "_CHG.cube";
GlobalC::CHR.write_rho(GlobalC::CHR.rho_save[is], is, 0, ssc.str()); // mohan add 2007-10-17
GlobalC::CHR.write_rho_cube(GlobalC::CHR.rho_save[is], is, ss1.str(), 3);

std::stringstream ssd;
if (GlobalV::GAMMA_ONLY_LOCAL)
Expand Down
3 changes: 3 additions & 0 deletions source/module_esolver/esolver_ks_lcao_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,11 @@ void ESolver_KS_LCAO_TDDFT::afterscf(const int istep)
const int precision = 3;

std::stringstream ssc;
std::stringstream ss1;
ssc << GlobalV::global_out_dir << "SPIN" << is + 1 << "_CHG";
ss1 << GlobalV::global_out_dir << "SPIN" << is + 1 << "_CHG.cube";
GlobalC::CHR.write_rho(GlobalC::CHR.rho_save[is], is, 0, ssc.str()); // mohan add 2007-10-17
GlobalC::CHR.write_rho_cube(GlobalC::CHR.rho_save[is], is, ss1.str(), 3);

std::stringstream ssd;
if (GlobalV::GAMMA_ONLY_LOCAL)
Expand Down

0 comments on commit 6e5b8f1

Please sign in to comment.