Skip to content

Commit d266914

Browse files
authored
Feature: multi-k case support for out_dm=1 (#6181)
* Add WARNING_QUIT when Hexx files not exist in hse restart calculations. * Add support of multi-k case for out_dm=1. * Update test and docs. * Update test.
1 parent eee7c2b commit d266914

File tree

7 files changed

+377
-138
lines changed

7 files changed

+377
-138
lines changed

docs/advanced/input_files/input-main.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1645,10 +1645,13 @@ These variables are used to control the output of properties.
16451645
### out_dm
16461646

16471647
- **Type**: Boolean
1648-
- **Availability**: Numerical atomic orbital basis (gamma-only algorithm)
1648+
- **Availability**: Numerical atomic orbital basis
16491649
- **Description**: Whether to output the density matrix of localized orbitals into files in the folder `OUT.${suffix}`. The files are named as:
1650-
- nspin = 1: SPIN1_DM;
1651-
- nspin = 2: SPIN1_DM, and SPIN2_DM.
1650+
- For gamma only case:
1651+
- nspin = 1: SPIN1_DM;
1652+
- nspin = 2: SPIN1_DM, and SPIN2_DM.
1653+
- For multi-k points case:
1654+
- SPIN\*_K\*_DM, where \* stands for index of spin and kpoints;
16521655
- **Default**: False
16531656

16541657
### out_dm1

source/module_hamilt_lcao/hamilt_lcaodft/operator_lcao/op_exx_lcao.hpp

+5
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ OperatorEXX<OperatorLCAO<TK, TR>>::OperatorEXX(HS_Matrix_K<TK>* hsk_in,
136136
{
137137
// Read HexxR in binary format (old version)
138138
const std::string file_name_exx_cereal = PARAM.globalv.global_readin_dir + "HexxR_" + std::to_string(GlobalV::MY_RANK);
139+
std::ifstream ifs(file_name_exx_cereal, std::ios::binary);
140+
if (!ifs)
141+
{
142+
ModuleBase::WARNING_QUIT("OperatorEXX", "Can't open EXX file < " + file_name_exx_cereal + " >.");
143+
}
139144
if (GlobalC::exx_info.info_ri.real_number)
140145
{
141146
ModuleIO::read_Hexxs_cereal(file_name_exx_cereal, *Hexxd);

0 commit comments

Comments
 (0)