Skip to content

Commit

Permalink
add .dat and rename eband_separate_term as eband_terms
Browse files Browse the repository at this point in the history
  • Loading branch information
maki49 committed Jul 27, 2024
1 parent f044321 commit b436585
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
- [out\_mat\_t](#out_mat_t)
- [out\_mat\_dh](#out_mat_dh)
- [out\_mat\_xc](#out_mat_xc)
- [out\_eband\_separate\_term](#out_eband_separate_term)
- [out\_eband\_separate\_term](#out_eband_terms)
- [out\_hr\_npz/out\_dm\_npz](#out_hr_npzout_dm_npz)
- [dm\_to\_rho](#dm_to_rho)
- [out\_app\_flag](#out_app_flag)
Expand Down Expand Up @@ -1683,14 +1683,14 @@ These variables are used to control the output of properties.
- **Type**: Boolean
- **Availability**: Numerical atomic orbital (NAO) and NAO-in-PW basis
- **Description**: Whether to print the upper triangular part of the exchange-correlation matrices in **Kohn-Sham orbital representation** (unit: Ry): $\braket{\psi_i|V_\text{xc}^\text{(semi-)local}+V_\text{exx}+V_\text{DFTU}|\psi_j}$ for each k point into files in the directory `OUT.${suffix}`, which is useful for the subsequent GW calculation. (Note that currently DeePKS term is not included. ) The files are named `k-$k-Vxc`, the meaning of `$k`corresponding to k point and spin is same as [hs_matrix.md](../elec_properties/hs_matrix.md#out_mat_hs).
The band (KS orbital) energy for each (k-point, spin, band) will be printed in the file `OUT.${suffix}/vxc_out`. If EXX is calculated, the local and EXX part of band energy will also be printed in `OUT.${suffix}/vxc_local_out`and `OUT.${suffix}/vxc_exx_out`, respectively. All the `vxc*_out` files contains 3 integers (nk, nspin, nband) followed by nk\*nspin\*nband lines of energy Hartree and eV.
The band (KS orbital) energy for each (k-point, spin, band) will be printed in the file `OUT.${suffix}/vxc_out.dat`. If EXX is calculated, the local and EXX part of band energy will also be printed in `OUT.${suffix}/vxc_local_out.dat`and `OUT.${suffix}/vxc_exx_out.dat`, respectively. All the `vxc*_out.dat` files contains 3 integers (nk, nspin, nband) followed by nk\*nspin\*nband lines of energy Hartree and eV.
- **Default**: False

### out_eband_separate_term
### out_eband_terms

- **Type**: Boolean
- **Availability**: Numerical atomic orbital basis
- **Description**: Whether to print the band energy terms separately in the file `OUT.${suffix}/${term}_out`. The terms include the kinetic, pseudopotential (local + nonlocal), Hartree and exchange-correlation (including exact exchange if calculated).
- **Description**: Whether to print the band energy terms separately in the file `OUT.${suffix}/${term}_out.dat`. The terms include the kinetic, pseudopotential (local + nonlocal), Hartree and exchange-correlation (including exact exchange if calculated).
- **Default**: False

### out_hr_npz/out_dm_npz
Expand Down
6 changes: 3 additions & 3 deletions source/module_esolver/esolver_ks_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "module_io/to_qo.h"
#include "module_io/write_HS.h"
#include "module_io/write_Vxc.hpp"
#include "module_io/write_eband_separate_term.hpp"
#include "module_io/write_eband_terms.hpp"
#include "module_io/write_istate_info.h"
#include "module_io/write_proj_band_lcao.h"
#include "module_parameter/parameter.h"
Expand Down Expand Up @@ -522,9 +522,9 @@ void ESolver_KS_LCAO<TK, TR>::after_all_runners()
);
}

if (PARAM.inp.out_eband_separate_term)
if (PARAM.inp.out_eband_terms)
{
ModuleIO::write_eband_separate_term<TK, TR>(GlobalV::NSPIN,
ModuleIO::write_eband_terms<TK, TR>(GlobalV::NSPIN,
GlobalV::NLOCAL,
GlobalV::DRANK,
&this->ParaV,
Expand Down
4 changes: 2 additions & 2 deletions source/module_io/read_input_item_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ void ReadInput::item_output()
this->add_item(item);
}
{
Input_Item item("out_eband_separate_term");
Input_Item item("out_eband_terms");
item.annotation = "output the band energy terms separately";
read_sync_bool(input.out_eband_separate_term);
read_sync_bool(input.out_eband_terms);
this->add_item(item);
}
{
Expand Down
4 changes: 2 additions & 2 deletions source/module_io/test/read_input_ptest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ TEST_F(InputParaTest, ParaRead)
EXPECT_EQ(param.inp.out_mat_hs[0], 0);
EXPECT_EQ(param.inp.out_mat_hs[1], 8);
EXPECT_EQ(param.inp.out_mat_hs2, 0);
EXPECT_EQ(param.inp.out_mat_xc, 0);
EXPECT_EQ(param.inp.out_eband_separate_term, 0);
EXPECT_FALSE(param.inp.out_mat_xc);
EXPECT_FALSE(param.inp.out_eband_terms);
EXPECT_EQ(param.inp.out_interval, 1);
EXPECT_EQ(param.inp.out_app_flag, 0);
EXPECT_EQ(param.inp.out_mat_r, 0);
Expand Down
2 changes: 1 addition & 1 deletion source/module_io/write_Vxc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ inline void write_orb_energy(const K_Vectors& kv,
assert(e_orb.size() == kv.get_nks());
const int nk = kv.get_nks() / nspin0;
std::ofstream ofs;
ofs.open(GlobalV::global_out_dir + term + "_" + (label == "" ? "out" : label + "_out"),
ofs.open(GlobalV::global_out_dir + term + "_" + (label == "" ? "out.dat" : label + "_out.dat"),
app ? std::ios::app : std::ios::out);
ofs << nk << "\n" << nspin0 << "\n" << nbands << "\n";
ofs << std::scientific << std::setprecision(16);
Expand Down
2 changes: 1 addition & 1 deletion source/module_io/write_Vxc_lip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ namespace ModuleIO
assert(e_orb.size() == kv.get_nks());
const int nk = kv.get_nks() / nspin0;
std::ofstream ofs;
ofs.open(GlobalV::global_out_dir + "vxc_" + (label == "" ? "out" : label + "_out"),
ofs.open(GlobalV::global_out_dir + "vxc_" + (label == "" ? "out.dat" : label + "_out.dat"),
app ? std::ios::app : std::ios::out);
ofs << nk << "\n" << nspin0 << "\n" << nbands << "\n";
ofs << std::scientific << std::setprecision(16);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace ModuleIO
{
template <typename TK, typename TR>
void write_eband_separate_term(const int nspin,
void write_eband_terms(const int nspin,
const int nbasis,
const int drank,
const Parallel_Orbitals* pv,
Expand Down Expand Up @@ -71,7 +71,7 @@ namespace ModuleIO
}
write_orb_energy(kv, nspin0, nbands, e_orb_kinetic, "kinetic", "");
// ======test=======
std::cout << "e_kinetic:" << all_k_all_band_energy(e_orb_kinetic) << std::endl;
// std::cout << "e_kinetic:" << all_k_all_band_energy(e_orb_kinetic) << std::endl;
// ======test=======
}

Expand All @@ -95,7 +95,7 @@ namespace ModuleIO
}
write_orb_energy(kv, nspin0, nbands, e_orb_pp_local, "vpp_local", "");
// ======test=======
std::cout << "e_pp_local:" << all_k_all_band_energy(e_orb_pp_local) << std::endl;
// std::cout << "e_pp_local:" << all_k_all_band_energy(e_orb_pp_local) << std::endl;
// ======test=======
}

Expand Down Expand Up @@ -150,7 +150,7 @@ namespace ModuleIO
for (auto& op : v_hartree_op) { delete op; }
write_orb_energy(kv, nspin0, nbands, e_orb_hartree, "vhartree", "");
// ======test=======
std::cout << "e_hartree:" << all_k_all_band_energy(e_orb_hartree) << std::endl;
// std::cout << "e_hartree:" << all_k_all_band_energy(e_orb_hartree) << std::endl;
// ======test=======
}

Expand Down
2 changes: 1 addition & 1 deletion source/module_parameter/input_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ struct Input_para
bool out_mat_dh = false;
bool out_mat_xc = false; ///< output exchange-correlation matrix in
///< KS-orbital representation.
bool out_eband_separate_term; ///< output the band energy terms separately
bool out_eband_terms = false; ///< output the band energy terms separately
bool out_hr_npz = false; ///< output exchange-correlation matrix in
///< KS-orbital representation.
bool out_dm_npz = false;
Expand Down
2 changes: 1 addition & 1 deletion tests/integrate/207_NO_KP_OXC/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mixing_type broyden
mixing_beta 0.7

out_mat_xc 1
out_eband_separate_term 1
out_eband_terms 1
ks_solver scalapack_gvx

dft_functional hse
Expand Down
2 changes: 1 addition & 1 deletion tests/integrate/307_NO_GO_OXC/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ smearing_method gauss
smearing_sigma 0.002

out_mat_xc 1
out_eband_separate_term 1
out_eband_terms 1

#Parameters (5.Mixing)
mixing_type broyden
Expand Down
10 changes: 5 additions & 5 deletions tests/integrate/tools/catch_properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ if ! test -z "$has_xc" && [ $has_xc == 1 ]; then
xccal=OUT.autotest/k-1-Vxc
fi
oeref=vxc_out.ref
oecal=OUT.autotest/vxc_out
oecal=OUT.autotest/vxc_out.dat
python3 ../tools/CompareFile.py $xcref $xccal 4
echo "CompareVXC_pass $?" >>$1
python3 ../tools/CompareFile.py $oeref $oecal 5
Expand All @@ -249,19 +249,19 @@ fi

if ! test -z "$has_eband_separate" && [ $has_eband_separate == 1 ]; then
ekref=kinetic_out.ref
ekcal=OUT.autotest/kinetic_out
ekcal=OUT.autotest/kinetic_out.dat
python3 ../tools/CompareFile.py $ekref $ekcal 4
echo "CompareOrbKinetic_pass $?" >>$1
vlref=vpp_local_out.ref
vlcal=OUT.autotest/vpp_local_out
vlcal=OUT.autotest/vpp_local_out.dat
python3 ../tools/CompareFile.py $vlref $vlcal 4
echo "CompareOrbVL_pass $?" >>$1
vnlref=vpp_nonlocal_out.ref
vnlcal=OUT.autotest/vpp_nonlocal_out
vnlcal=OUT.autotest/vpp_nonlocal_out.dat
python3 ../tools/CompareFile.py $vnlref $vnlcal 4
echo "CompareOrbVNL_pass $?" >>$1
vhref=vhartree_out.ref
vhcal=OUT.autotest/vhartree_out
vhcal=OUT.autotest/vhartree_out.dat
python3 ../tools/CompareFile.py $vhref $vhcal 4
echo "CompareOrbVHartree_pass $?" >>$1
fi
Expand Down

0 comments on commit b436585

Please sign in to comment.