Skip to content
Closed
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
4 changes: 2 additions & 2 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,8 @@ namespace ModuleESolver
this->p_hamilt->matrix(h_mat, s_mat);
if (hsolver::HSolverLCAO<TK>::out_mat_hs)
{
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK);
ModuleIO::save_mat(istep, s_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK);
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
ModuleIO::save_mat(istep, s_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/module_esolver/esolver_ks_lcao_tddft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ void ESolver_KS_LCAO_TDDFT::updatepot(const int istep, const int iter)
this->p_hamilt->matrix(h_mat, s_mat);
if (hsolver::HSolverLCAO<std::complex<double>>::out_mat_hs)
{
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK);
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK);
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
ModuleIO::save_mat(istep, h_mat.p, GlobalV::NLOCAL, bit, 1, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->LOWF.ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/hamilt_lcaodft/FORCE_gamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ void Force_LCAO_gamma::allocate_gamma(const Parallel_Orbitals& pv)
this->UHM->genH
.build_ST_new('S', cal_deri, GlobalC::ucell, this->UHM->genH.LM->Sloc.data(), INPUT.cal_syns, INPUT.dmax);
bool bit = false; // LiuXh, 2017-03-21
ModuleIO::save_mat(0, this->UHM->genH.LM->Hloc.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "H", "data-" + std::to_string(0), *this->ParaV, GlobalV::DRANK);
ModuleIO::save_mat(0, this->UHM->genH.LM->Sloc.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "S", "data-" + std::to_string(0), *this->ParaV, GlobalV::DRANK);
ModuleIO::save_mat(0, this->UHM->genH.LM->Hloc.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "H", "data-" + std::to_string(0), *this->ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
ModuleIO::save_mat(0, this->UHM->genH.LM->Sloc.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "S", "data-" + std::to_string(0), *this->ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
}

ModuleBase::timer::tick("Force_LCAO_gamma", "allocate_gamma");
Expand Down
4 changes: 2 additions & 2 deletions source/module_hamilt_lcao/hamilt_lcaodft/FORCE_k.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ void Force_LCAO_k::allocate_k(const Parallel_Orbitals& pv,
this->UHM->genH.LM->zeros_HSk('S');
this->UHM->genH.LM->folding_fixedH(ik, kvec_d, 1);
bool bit = false; // LiuXh, 2017-03-21
ModuleIO::save_mat(0, this->UHM->genH.LM->Hloc2.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->ParaV, GlobalV::DRANK);
ModuleIO::save_mat(0, this->UHM->genH.LM->Sloc2.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->ParaV, GlobalV::DRANK);
ModuleIO::save_mat(0, this->UHM->genH.LM->Hloc2.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "H", "data-" + std::to_string(ik), *this->ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
ModuleIO::save_mat(0, this->UHM->genH.LM->Sloc2.data(), GlobalV::NLOCAL, bit, 0, GlobalV::out_app_flag, "S", "data-" + std::to_string(ik), *this->ParaV, GlobalV::DRANK, GlobalV::out_ndigits);
}
}

Expand Down
3 changes: 2 additions & 1 deletion source/module_io/write_HS.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace ModuleIO
const std::string label,
const std::string& file_name,
const Parallel_2D& pv,
const int drank);
const int drank,
const int ndigits);

// comment out this function for not used
// void save_HSR_tr(const int current_spin, LCAO_Matrix& lm); // LiuXh add 2019-07-15
Expand Down
8 changes: 6 additions & 2 deletions source/module_io/write_HS.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "write_HS.h"

#include "module_base/formatter_contextfmt.h"
#include "module_base/parallel_reduce.h"
#include "module_base/timer.h"
#include "module_cell/module_neighbor/sltk_grid_driver.h"
Expand Down Expand Up @@ -94,12 +94,16 @@ void ModuleIO::save_mat(const int istep,
const std::string label,
const std::string& file_name,
const Parallel_2D& pv,
const int drank)
const int drank,
const int ndigits)
{
ModuleBase::TITLE("ModuleIO", "save_mat");
ModuleBase::timer::tick("ModuleIO", "save_mat");
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Dimension of " + label + " : ", dim);

formatter::PhysicalFmt physfmt;
physfmt.adjust_formatter_flexible(ndigits, -1, true);

std::stringstream ss;

if (bit)ss << GlobalV::global_out_dir << file_name + "-" + label + "-bit";
Expand Down
2 changes: 1 addition & 1 deletion source/module_io/write_Vxc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ namespace ModuleIO
// write
ModuleIO::save_mat(-1, vxc_k_mo.data(), nbands,
false/*binary*/, true/*triangle*/, false/*append*/,
"Vxc", "k-" + std::to_string(ik), p2d, drank);
"Vxc", "k-" + std::to_string(ik), p2d, drank, GlobalV::out_ndigits);
// ======test=======
// total_energy += all_band_energy(ik, vxc_k_mo, p2d, wg);
// ======test=======
Expand Down