Skip to content

Commit 180f748

Browse files
committed
fix bugs in pw outputs
1 parent 0b1025b commit 180f748

File tree

5 files changed

+25
-19
lines changed

5 files changed

+25
-19
lines changed

examples/relax/pw_output/INPUT

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ecutwfc 10
88
scf_nmax 20
99

1010
basis_type pw
11-
relax_nmax 5
11+
relax_nmax 4
1212

1313
cal_stress 1
1414
stress_thr 1e-6
@@ -25,18 +25,23 @@ relax_method lbfgs
2525
pseudo_dir ../../../tests/PP_ORB
2626
orbital_dir ../../../tests/PP_ORB
2727

28-
nspin 2
28+
nspin 4
29+
30+
out_freq_ion 1
31+
#out_freq_elec 0
32+
33+
out_chg 1 # chg.txt g
34+
out_pot 1 # pot.txt g
35+
out_wfc_pw 1 # wfkx_pw.txt g
36+
out_dos 1 # dos.txt g
37+
out_elf 1 # elf.txt
38+
out_band 1 # eig.txt
39+
out_stru 1 # g
40+
out_bandgap 1
2941

30-
out_chg 1
31-
out_pot 1
32-
out_wfc_pw 1
33-
out_dos 1
34-
out_stru 1
3542
out_app_flag 0
3643

37-
out_interval 1
38-
kpar 2
44+
kpar 1
3945
symmetry -1
4046

41-
#out_freq_elec 2
42-
#out_band 1
47+

examples/relax/pw_output/KPT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ K_POINTS
22
0
33
Gamma
44
2 2 2 0 0 0
5+

source/source_io/test/write_dos_pw_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ TEST_F(DosPWTest,Dos1)
9191
{
9292
#endif
9393
std::ifstream ifs;
94-
ifs.open("doss1_pw.txt");
94+
ifs.open("dos.txt");
9595
std::string str((std::istreambuf_iterator<char>(ifs)),std::istreambuf_iterator<char>());
9696
EXPECT_THAT(str, testing::HasSubstr("4801 # number of points"));
9797
EXPECT_THAT(str, testing::HasSubstr(" -4.6 0.25 0.28125 1.42515 0.159819"));
9898
EXPECT_THAT(str, testing::HasSubstr(" 18 0 16 0 16"));
9999
ifs.close();
100-
remove("doss1_pw.txt");
100+
remove("dos.txt");
101101
#ifdef __MPI
102102
}
103103
#endif
@@ -156,13 +156,13 @@ TEST_F(DosPWTest,Dos2)
156156
{
157157
#endif
158158
std::ifstream ifs;
159-
ifs.open("doss1_pw.txt");
159+
ifs.open("dos.txt");
160160
std::string str1((std::istreambuf_iterator<char>(ifs)),std::istreambuf_iterator<char>());
161161
EXPECT_THAT(str1, testing::HasSubstr("4532 # number of points"));
162162
EXPECT_THAT(str1, testing::HasSubstr(" -5.38811 0.03125 0.03125"));
163163
EXPECT_THAT(str1, testing::HasSubstr(" 3.07189 0.1875 5.46875"));
164164
ifs.close();
165-
remove("doss1_pw.txt");
165+
remove("dos.txt");
166166
#ifdef __MPI
167167
}
168168
#endif

source/source_io/test/write_eig_occ_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ TEST_F(IstateInfoTest, OutIstateInfoS1)
103103

104104
// check the output files
105105
std::ifstream ifs;
106-
ifs.open("eig.txt");
106+
ifs.open("eig_occ.txt");
107107
std::string str((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
108108
EXPECT_THAT(str, testing::HasSubstr("Electronic state energy (eV) and occupations"));
109109
EXPECT_THAT(str, testing::HasSubstr("spin=1 k-point=1/10 Cartesian=0.0000000 0.0000000 0.0000000 (299 plane wave)"));
110110
EXPECT_THAT(str, testing::HasSubstr("1 2.040854700000000 0.000000000000000"));
111111
ifs.close();
112-
remove("eig.txt");
112+
remove("eig_occ.txt");
113113
}
114114

115115
#ifdef __MPI

source/source_io/write_eig_occ.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ void ModuleIO::write_eig_file(const ModuleBase::matrix &ekb,
210210
#endif
211211

212212
// file name to store eigenvalues
213-
std::string filename = PARAM.globalv.global_out_dir + "eig_occ_";
213+
std::string filename = PARAM.globalv.global_out_dir + "eig_occ";
214214

215215
if(istep_in == -1)
216216
{
217217
// do nothing
218218
}
219219
else if(istep_in >= 0)
220220
{
221-
filename += "g" + std::to_string(istep_in+1);
221+
filename += "_g" + std::to_string(istep_in+1);
222222
}
223223

224224
filename += ".txt";

0 commit comments

Comments
 (0)