Skip to content

Commit 377091c

Browse files
committed
Refactor: Remove the input parameter out_bandgap
1 parent 9072dcf commit 377091c

File tree

12 files changed

+16
-49
lines changed

12 files changed

+16
-49
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
- [out\_band](#out_band)
148148
- [out\_proj\_band](#out_proj_band)
149149
- [out\_stru](#out_stru)
150-
- [out\_bandgap](#out_bandgap)
151150
- [out\_level](#out_level)
152151
- [out\_alllog](#out_alllog)
153152
- [out\_mat\_hs](#out_mat_hs)
@@ -1827,14 +1826,6 @@ These variables are used to control the output of properties.
18271826
- **Description**: Whether to output structure files per ionic step in geometry relaxation calculations into `OUT.${suffix}/STRU_ION${istep}_D`, where `${istep}` is the ionic step.
18281827
- **Default**: False
18291828

1830-
### out_bandgap
1831-
1832-
- **Type**: Boolean
1833-
- **Description**: Whether to print the bandgap per electronic iteration into `OUT.${suffix}/running_${calculation}.log`. The value of bandgaps can be obtained by searching for the keyword:
1834-
- [nupdown](#nupdown) > 0: `E_bandgap_up` and `E_bandgap_dw`
1835-
- [nupdown](#nupdown) = 0: `E_bandgap`
1836-
- **Default**: False
1837-
18381829
### out_level
18391830

18401831
- **Type**: String

docs/advanced/interface/TB2J.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ out_mul 1
6666
#Parameters (4.Relaxation)
6767
ks_solver genelpa
6868
scf_nmax 200
69-
out_bandgap 0
7069
7170
#Parameters (5.LCAO)
7271
basis_type lcao

examples/03_spin_polarized/ATOM/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ cal_force 1
4646
cal_stress 1
4747
out_stru 1 # print STRU in OUT
4848
out_chg 0 # print CHG or not
49-
out_bandgap 1 # if bandgap and mul out, chg will out
5049
out_mul 1 # print Mulliken charge and mag of atom in mulliken.txt
5150
# out_wfc_lcao 1
5251
# out_interval 1

examples/19_dftu/NiO/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ dft_plus_u 1
2828
orbital_corr 2 2 -1
2929
hubbard_u 5.0 5.0 0.0
3030

31-
out_bandgap 1
3231
out_chg 1
3332
out_mul 1
3433

examples/relax/pw_output/INPUT

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ out_dos 1 # dos.txt g
3737
out_elf 1 # elf.txt
3838
out_band 1 # eig.txt
3939
out_stru 1 # g
40-
out_bandgap 1
4140

4241
out_app_flag 0
4342

source/source_esolver/esolver_ks.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,13 @@ void ESolver_KS<T, Device>::iter_finish(UnitCell& ucell, const int istep, int& i
311311
//----------------------------------------------------------------
312312
// 1) print out band gap
313313
//----------------------------------------------------------------
314-
if (PARAM.inp.out_bandgap)
314+
if (!PARAM.globalv.two_fermi)
315315
{
316-
if (!PARAM.globalv.two_fermi)
317-
{
318-
this->pelec->cal_bandgap();
319-
}
320-
else
321-
{
322-
this->pelec->cal_bandgap_updw();
323-
}
316+
this->pelec->cal_bandgap();
317+
}
318+
else
319+
{
320+
this->pelec->cal_bandgap_updw();
324321
}
325322

326323
if(iter % PARAM.inp.out_freq_elec == 0)

source/source_estate/elecstate_print.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,17 @@ void print_etot(const Magnetism& magnet,
276276
}
277277

278278
// print out the band gap if needed
279-
if (PARAM.inp.out_bandgap)
279+
if (!PARAM.globalv.two_fermi)
280280
{
281-
if (!PARAM.globalv.two_fermi)
282-
{
283-
titles.push_back("E_bandgap");
284-
energies_Ry.push_back(elec.bandgap);
285-
}
286-
else
287-
{
288-
titles.push_back("E_bandgap_up");
289-
energies_Ry.push_back(elec.bandgap_up);
290-
titles.push_back("E_bandgap_dw");
291-
energies_Ry.push_back(elec.bandgap_dw);
292-
}
281+
titles.push_back("E_bandgap");
282+
energies_Ry.push_back(elec.bandgap);
283+
}
284+
else
285+
{
286+
titles.push_back("E_bandgap_up");
287+
energies_Ry.push_back(elec.bandgap_up);
288+
titles.push_back("E_bandgap_dw");
289+
energies_Ry.push_back(elec.bandgap_dw);
293290
}
294291
energies_eV.resize(energies_Ry.size());
295292
std::transform(energies_Ry.begin(), energies_Ry.end(), energies_eV.begin(), [](double ener) {

source/source_estate/test/elecstate_print_test.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ TEST_F(ElecStatePrintTest, PrintEtot)
135135
PARAM.input.efield_flag = true;
136136
PARAM.input.gate_flag = true;
137137
PARAM.sys.two_fermi = true;
138-
PARAM.input.out_bandgap = true;
139138
GlobalV::MY_RANK = 0;
140139
PARAM.input.basis_type = "pw";
141140
PARAM.input.nspin = 2;
@@ -221,7 +220,6 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS2)
221220
PARAM.input.efield_flag = true;
222221
PARAM.input.gate_flag = true;
223222
PARAM.sys.two_fermi = true;
224-
PARAM.input.out_bandgap = true;
225223
PARAM.input.nspin = 2;
226224
GlobalV::MY_RANK = 0;
227225

@@ -251,7 +249,6 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS4)
251249
PARAM.input.efield_flag = true;
252250
PARAM.input.gate_flag = true;
253251
PARAM.sys.two_fermi = true;
254-
PARAM.input.out_bandgap = true;
255252
PARAM.input.nspin = 4;
256253
PARAM.input.noncolin = true;
257254
GlobalV::MY_RANK = 0;

source/source_io/module_parameter/input_parameter.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@ struct Input_para
379379
std::string out_level = "ie"; ///< control the output information.
380380
std::vector<int> out_dmr = {0, 8}; ///< output density matrix in real space DM(R)
381381
std::vector<int> out_dmk = {0, 8}; ///< output density matrix in reciprocal space DM(k)
382-
bool out_bandgap = false; ///< QO added for bandgap printing
383382
std::vector<int> out_mat_hs = {0, 8}; ///< output H matrix and S matrix in local basis.
384383
std::vector<int> out_mat_tk = {0, 8}; ///< output T(k) matrix in local basis.
385384
std::vector<int> out_mat_l = {0, 8}; ///< output L matrix in local basis.

source/source_io/read_input_item_output.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,6 @@ void ReadInput::item_output()
235235
sync_intvec(input.out_dmr, 2, 0);
236236
this->add_item(item);
237237
}
238-
{
239-
Input_Item item("out_bandgap");
240-
item.annotation = "if true, print out bandgap";
241-
read_sync_bool(input.out_bandgap);
242-
this->add_item(item);
243-
}
244238
{
245239
Input_Item item("out_mat_hs");
246240
item.annotation = "output H and S matrix (with precision 8)";

0 commit comments

Comments
 (0)