Skip to content

Commit aabb29a

Browse files
committed
update output formats
1 parent 3a8b520 commit aabb29a

File tree

6 files changed

+25
-25
lines changed

6 files changed

+25
-25
lines changed

source/module_cell/klist.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void K_Vectors::set(const UnitCell& ucell,
5252
{
5353
ModuleBase::TITLE("K_Vectors", "set");
5454

55-
ofs << "\n\n\n\n";
55+
ofs << "\n\n";
5656
ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
5757
ofs << " | |" << std::endl;
5858
ofs << " | Setup K-points |" << std::endl;
@@ -61,7 +61,7 @@ void K_Vectors::set(const UnitCell& ucell,
6161
ofs << " | We treat the spin as another set of k-points. |" << std::endl;
6262
ofs << " | |" << std::endl;
6363
ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
64-
ofs << "\n\n\n\n";
64+
ofs << "\n\n";
6565

6666
ofs << "\n SETUP K-POINTS" << std::endl;
6767

source/module_cell/print_cell.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,15 @@ namespace unitcell
2323
bool direct = (Coordinate == "Direct");
2424
std::string table;
2525
table += direct? "DIRECT COORDINATES\n": FmtCore::format("CARTESIAN COORDINATES ( UNIT = %20.12f Bohr ).\n", lat0);
26-
const std::string redundant_header = direct? "taud_": "tauc_";
27-
table += FmtCore::format("%8s%20s%20s%20s%8s%20s%20s%20s\n", "atom", "x", "y", "z", "mag", "vx", "vy", "vz");
26+
table += FmtCore::format("%8s%10s%10s%10s%8s%8s%8s%8s\n", "atom", "x", "y", "z", "mag", "vx", "vy", "vz");
2827
for(int it = 0; it < ntype; it++)
2928
{
3029
for (int ia = 0; ia < atoms[it].na; ia++)
3130
{
3231
const double& x = direct? atoms[it].taud[ia].x: atoms[it].tau[ia].x;
3332
const double& y = direct? atoms[it].taud[ia].y: atoms[it].tau[ia].y;
3433
const double& z = direct? atoms[it].taud[ia].z: atoms[it].tau[ia].z;
35-
table += FmtCore::format("%5s%-s%-5d%20.10f%20.10f%20.10f%8.4f%20.10f%20.10f%20.10f\n", // I dont know why there must be a redundant "tau[c|d]_" in the output. So ugly, it should be removed!
36-
redundant_header,
34+
table += FmtCore::format(" %-s%-5d%10.3f%10.3f%10.3f%8.3f%8.3f%8.3f%8.3f\n",
3735
atoms[it].label,
3836
ia+1,
3937
x,
@@ -140,4 +138,4 @@ namespace unitcell
140138
ofs.close();
141139
return;
142140
}
143-
}
141+
}

source/module_cell/unitcell.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log) {
214214

215215
if (ok)
216216
{
217-
log << "\n\n\n\n";
217+
log << "\n\n";
218218
log << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
219219
">>>>>>>>>>>>"
220220
<< std::endl;
@@ -254,7 +254,7 @@ void UnitCell::setup_cell(const std::string& fn, std::ofstream& log) {
254254
log << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
255255
"<<<<<<<<<<<<"
256256
<< std::endl;
257-
log << "\n\n\n\n";
257+
log << "\n\n";
258258

259259
log << " READING UNITCELL INFORMATION" << std::endl;
260260
//========================
@@ -560,4 +560,4 @@ void UnitCell::compare_atom_labels(std::string label1, std::string label2) {
560560
}
561561
}
562562
}
563-
}
563+
}

source/module_elecstate/module_charge/charge_mixing.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,24 @@ void Charge_Mixing::set_mixing(const std::string& mixing_mode_in,
5858
}
5959

6060
// print into running.log
61-
GlobalV::ofs_running<<"\n----------- Double Check Mixing Parameters Begin ------------"<<std::endl;
62-
GlobalV::ofs_running<<"mixing_type: "<< this->mixing_mode <<std::endl;
63-
GlobalV::ofs_running<<"mixing_beta: "<< this->mixing_beta <<std::endl;
64-
GlobalV::ofs_running<<"mixing_gg0: "<< this->mixing_gg0 <<std::endl;
65-
GlobalV::ofs_running<<"mixing_gg0_min: "<< PARAM.inp.mixing_gg0_min <<std::endl;
61+
GlobalV::ofs_running<<"\n ----------- Charge Mixing Parameters ------------"<<std::endl;
62+
63+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_type", this->mixing_mode);
64+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_beta", this->mixing_beta);
65+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0", this->mixing_gg0);
66+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0_min", PARAM.inp.mixing_gg0_min);
67+
6668
if (PARAM.inp.nspin==2 || PARAM.inp.nspin==4)
6769
{
68-
GlobalV::ofs_running<<"mixing_beta_mag: "<< this->mixing_beta_mag <<std::endl;
69-
GlobalV::ofs_running<<"mixing_gg0_mag: "<< PARAM.inp.mixing_gg0_mag <<std::endl;
70+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_beta_mag", this->mixing_beta_mag);
71+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_gg0_mag", PARAM.inp.mixing_gg0_mag);
7072
}
7173
if (PARAM.inp.mixing_angle > 0)
7274
{
73-
GlobalV::ofs_running<<"mixing_angle: "<< PARAM.inp.mixing_angle <<std::endl;
75+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_angle", PARAM.inp.mixing_angle);
7476
}
75-
GlobalV::ofs_running<<"mixing_ndim: "<< this->mixing_ndim <<std::endl;
76-
GlobalV::ofs_running<<"----------- Double Check Mixing Parameters End ------------"<<std::endl;
77+
78+
ModuleBase::GlobalFunc::OUT(GlobalV::ofs_running, "mixing_ndim", this->mixing_ndim);
7779

7880
return;
7981
}
@@ -240,4 +242,4 @@ bool Charge_Mixing::if_scf_oscillate(const int iteration, const double drho, con
240242
}
241243

242244
return false;
243-
}
245+
}

source/module_elecstate/read_pseudo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace elecstate {
1212
void read_pseudo(std::ofstream& ofs, UnitCell& ucell) {
1313
// read in non-local pseudopotential and ouput the projectors.
14-
ofs << "\n\n\n\n";
14+
ofs << "\n\n";
1515
ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
1616
">>>>"
1717
<< std::endl;
@@ -54,7 +54,7 @@ void read_pseudo(std::ofstream& ofs, UnitCell& ucell) {
5454
ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
5555
"<<<<"
5656
<< std::endl;
57-
ofs << "\n\n\n\n";
57+
ofs << "\n\n";
5858

5959
read_cell_pseudopots(PARAM.inp.pseudo_dir, ofs, ucell);
6060

@@ -368,4 +368,4 @@ void print_unitcell_pseudo(const std::string& fn, UnitCell& ucell)
368368
return;
369369
}
370370

371-
}
371+
}

source/module_esolver/esolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ std::string determine_type()
9595
ModuleBase::WARNING_QUIT("ESolver", "No such esolver_type combined with basis_type");
9696
}
9797

98-
GlobalV::ofs_running << " The esolver type has been set to : " << esolver_type << std::endl;
98+
GlobalV::ofs_running << "\n The esolver type: " << esolver_type << std::endl;
9999

100100
auto device_info = PARAM.inp.device;
101101

0 commit comments

Comments
 (0)