Skip to content

Commit 8fb0495

Browse files
committed
print out the information for H(R), S(R), H(k) and S(k)
1 parent 9917ded commit 8fb0495

File tree

8 files changed

+41
-10
lines changed

8 files changed

+41
-10
lines changed

source/module_esolver/lcao_after_scf.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ void ESolver_KS_LCAO<TK, TR>::after_scf(UnitCell& ucell, const int istep, const
142142
this->pv,
143143
PARAM.globalv.gamma_only_local,
144144
PARAM.inp.out_app_flag,
145-
istep);
145+
istep,
146+
GlobalV::ofs_running);
146147
}
147148
}
148149

source/module_io/write_HS.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ namespace ModuleIO
2424
const Parallel_Orbitals &pv,
2525
const bool gamma_only,
2626
const bool out_app_flag,
27-
const int istep);
27+
const int istep,
28+
std::ofstream &ofs_running);
2829

2930
/// @brief save a square matrix, such as H(k) and S(k)
3031
/// @param[in] istep : the step of the calculation

source/module_io/write_HS.hpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,22 @@ void ModuleIO::write_hsk(
2020
const Parallel_Orbitals &pv,
2121
const bool gamma_only,
2222
const bool out_app_flag,
23-
const int istep)
23+
const int istep,
24+
std::ofstream &ofs_running)
2425
{
26+
27+
ofs_running << "\n WRITE H(k) OR S(k) BEGINS" << std::endl;
28+
ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
29+
">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
30+
ofs_running << " | "
31+
" |" << std::endl;
32+
ofs_running << " | Write Hamiltonian matrix H(k) or overlap matrix S(k) in numerical |" << std::endl;
33+
ofs_running << " | atomic orbitals at each k-point. |" << std::endl;
34+
ofs_running << " | "
35+
" |" << std::endl;
36+
ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
37+
">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
38+
2539
for (int ik = 0; ik < nks; ++ik)
2640
{
2741
p_hamilt->updateHk(ik);
@@ -40,8 +54,6 @@ void ModuleIO::write_hsk(
4054
"hk","nao",ik,ik2iktot,nspin,nkstot,
4155
out_label,out_app_flag,gamma_only,istep);
4256

43-
std::cout << "the filename is " << h_fn << std::endl;
44-
4557
ModuleIO::save_mat(istep,
4658
h_mat.p,
4759
PARAM.globalv.nlocal,
@@ -62,12 +74,11 @@ void ModuleIO::write_hsk(
6274
continue;
6375
}
6476

65-
6677
std::string s_fn = ModuleIO::filename_output(global_out_dir,
6778
"sk","nao",ik,ik2iktot,nspin,nkstot,
6879
out_label,out_app_flag,gamma_only,istep);
6980

70-
std::cout << "the filename is " << s_fn << std::endl;
81+
ofs_running << " The output filename is " << s_fn << std::endl;
7182

7283
ModuleIO::save_mat(istep,
7384
s_mat.p,
@@ -99,7 +110,6 @@ void ModuleIO::save_mat(const int istep,
99110
{
100111
ModuleBase::TITLE("ModuleIO", "save_mat");
101112
ModuleBase::timer::tick("ModuleIO", "save_mat");
102-
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "Dimension: ", dim);
103113

104114
// print out .dat file
105115
if (bit)

source/module_io/write_HS_R.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,24 @@ void ModuleIO::output_HSR(const UnitCell& ucell,
2828
const std::string& HR_filename_up,
2929
const std::string HR_filename_down,
3030
const bool& binary,
31-
const double& sparse_thr) {
31+
const double& sparse_thr)
32+
{
33+
3234
ModuleBase::TITLE("ModuleIO", "output_HSR");
3335
ModuleBase::timer::tick("ModuleIO", "output_HSR");
3436

37+
GlobalV::ofs_running << "\n WRITE H(R) OR S(R) BEGINS" << std::endl;
38+
GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
39+
">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
40+
GlobalV::ofs_running << " | "
41+
" |" << std::endl;
42+
GlobalV::ofs_running << " | Write Hamiltonian matrix H(R) or overlap matrix S(R) in numerical |" << std::endl;
43+
GlobalV::ofs_running << " | atomic orbitals, where R is the Bravis lattice vector. |" << std::endl;
44+
GlobalV::ofs_running << " | "
45+
" |" << std::endl;
46+
GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
47+
">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
48+
3549
const int nspin = PARAM.inp.nspin;
3650

3751
if (nspin == 1 || nspin == 4) {

source/module_io/write_HS_sparse.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ void ModuleIO::save_HSR_sparse(const int& istep,
127127
ssh[1] << PARAM.globalv.global_out_dir << HR_filename_down;
128128
sss << PARAM.globalv.global_out_dir << SR_filename;
129129
}
130+
131+
GlobalV::ofs_running << " The output filename is " << ssh[0].str() << std::endl;
132+
GlobalV::ofs_running << " The output filename is " << ssh[1].str() << std::endl;
133+
GlobalV::ofs_running << " The output filename is " << sss.str() << std::endl;
134+
130135
std::ofstream g1[2];
131136
std::ofstream g2;
132137

@@ -806,4 +811,4 @@ template void ModuleIO::save_sparse<std::complex<double>>(
806811
const Parallel_Orbitals&,
807812
const std::string&,
808813
const int&,
809-
const bool&);
814+
const bool&);

0 commit comments

Comments
 (0)