Skip to content

Commit 59dcecb

Browse files
committed
add warning_quit in pw basis for PDOS calculations, add doscs for ploting Fermi surface in LCAO basis, add Fermi surface plot function in PW basis when out_dos=3
1 parent 30aa13d commit 59dcecb

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,8 @@ These variables are used to control the output of properties.
17051705
- **Description**: Whether to output the density of states (DOS). For more information, refer to the [dos.md](../elec_properties/dos.md).
17061706
- 0: no output
17071707
- 1: output the density of states (DOS)
1708-
- 2: (lcao-only) output the density of states (DOS) and the projected density of states (PDOS)
1708+
- 2: (LCAO) output the density of states (DOS) and the projected density of states (PDOS)
1709+
- 3: output the Fermi surface file (fermi.bxsf) in BXSF format that can be visualized by XCrySDen
17091710
- **Default**: 0
17101711

17111712
### out_ldos

source/module_io/nscf_fermi_surf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ void ModuleIO::nscf_fermi_surface(const std::string &out_band_dir,
1515
ModuleBase::timer::tick("ModuleIO", "nscf_fermi_surface");
1616
#ifdef __MPI
1717

18-
int start = 1;
19-
int end = PARAM.inp.nbands;
18+
const int start = 1;
19+
const int end = PARAM.inp.nbands;
2020

2121
std::ofstream ofs;
2222
if(GlobalV::MY_RANK==0)

source/module_io/write_dos_pw.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,21 @@ void ModuleIO::write_dos_pw(const ModuleBase::matrix& ekb,
5858
wg);
5959
}
6060

61+
62+
if (PARAM.inp.out_dos == 2)
63+
{
64+
WARNING_QUIT("ModuleIO::write_dos_pw","PW basis do not support PDOS calculations yet.");
65+
}
66+
67+
if(PARAM.inp.out_dos == 3)
68+
{
69+
for (int is = 0; is < nspin0; is++)
70+
{
71+
std::stringstream ss3;
72+
ss3 << PARAM.globalv.global_out_dir << "fermi" << is << ".bxsf";
73+
nscf_fermi_surface(ss3.str(), nbands, energy_fermi.ef, kv, ucell, ekb);
74+
}
75+
}
76+
6177
ofs_running << " DOS CALCULATIONS ENDS." << std::endl;
6278
}

0 commit comments

Comments
 (0)