From d6657ece886329d636f9e68f620ada661aec0c9a Mon Sep 17 00:00:00 2001 From: Liang Sun <50293369+sunliang98@users.noreply.github.com> Date: Fri, 27 Sep 2024 20:35:34 +0800 Subject: [PATCH] Feature: Calculate and output electron localization function (ELF) with KSDFT and OFDFT (#5139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Feature: Calculate and output electron localization function (ELF) with KSDFT in both PW and LCAO basis. * Feature: Calculate and output ELF with OFDFT * Test: Add three integrate tests for out_elf 119_PW_out_elf, 219_NO_out_elf, 919_OF_out_elf * Test: Update tools/catch_properties.sh * Feature: Support ELF in SPIN2 case. * Doc: Update the document of input parameters * Fix: Update Makefile.Objects * [pre-commit.ci lite] apply automatic fixes * Fix: Fix the bug caused by check_value * Fix: Update the name of several parameters, fix a memory leak * Feature: support user defined precision of elf * Doc: Update document of out_elf * Doc/Test: Update the doc and test * Test: Update unit test * Refactor: Remove GlobalV::NPSIN from source/module_hamilt_pw/hamilt_ofdft/ * [pre-commit.ci lite] apply automatic fixes * Fix: Add a small number (1e-5) onto the numerator of chi to suppress the numerical instability caused by LCAO basis, as suggested by 卢天, 陈飞武. 电子定域化函数的含义与函数形式[J]. 物理化学学报, 2011, 27(12): 2786-2792. * Test: Update 119_PW_out_elf and 919_OF_out_elf * Test: Correct the reference of 119_PW_out_elf * Test: Update 219_LCAO_out_elf * Refactor: Move cal_tau to new files. * [pre-commit.ci lite] apply automatic fixes * Test: Update abacus-develop/source/module_elecstate/test/CMakeLists.txt --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Mohan Chen --- docs/advanced/input_files/input-main.md | 20 +- source/Makefile.Objects | 3 + source/module_elecstate/CMakeLists.txt | 2 + source/module_elecstate/elecstate.h | 8 + source/module_elecstate/elecstate_lcao.cpp | 14 +- source/module_elecstate/elecstate_lcao.h | 1 + .../elecstate_lcao_cal_tau.cpp | 41 +++ source/module_elecstate/elecstate_pw.cpp | 6 +- source/module_elecstate/elecstate_pw.h | 1 + .../module_elecstate/elecstate_pw_cal_tau.cpp | 68 ++++ .../module_elecstate/module_charge/charge.cpp | 10 +- .../module_elecstate/module_charge/charge.h | 1 + .../module_charge/charge_mpi.cpp | 2 +- .../module_charge/symmetry_rho.cpp | 2 +- source/module_elecstate/test/CMakeLists.txt | 1 + source/module_esolver/esolver_fp.cpp | 28 ++ source/module_esolver/esolver_ks_lcao.cpp | 15 +- source/module_esolver/esolver_ks_pw.cpp | 10 +- source/module_esolver/esolver_of.cpp | 8 +- source/module_esolver/esolver_of.h | 1 + .../module_esolver/esolver_of_interface.cpp | 34 ++ .../hamilt_ofdft/kedf_lkt.cpp | 44 ++- .../module_hamilt_pw/hamilt_ofdft/kedf_lkt.h | 5 +- .../module_hamilt_pw/hamilt_ofdft/kedf_tf.cpp | 28 ++ .../module_hamilt_pw/hamilt_ofdft/kedf_tf.h | 1 + .../module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp | 45 ++- .../module_hamilt_pw/hamilt_ofdft/kedf_vw.h | 5 +- .../module_hamilt_pw/hamilt_ofdft/kedf_wt.cpp | 67 +++- .../module_hamilt_pw/hamilt_ofdft/kedf_wt.h | 5 +- source/module_io/CMakeLists.txt | 1 + source/module_io/read_input_item_output.cpp | 20 ++ source/module_io/test/read_input_ptest.cpp | 2 + source/module_io/write_elf.cpp | 169 ++++++++++ source/module_io/write_elf.h | 25 ++ source/module_parameter/input_parameter.h | 1 + tests/integrate/119_PW_out_elf/INPUT | 27 ++ tests/integrate/119_PW_out_elf/KPT | 4 + tests/integrate/119_PW_out_elf/STRU | 19 ++ tests/integrate/119_PW_out_elf/jd | 1 + tests/integrate/119_PW_out_elf/refELF.cube | 296 ++++++++++++++++++ tests/integrate/119_PW_out_elf/result.ref | 7 + tests/integrate/219_NO_out_elf/INPUT | 27 ++ tests/integrate/219_NO_out_elf/KPT | 4 + tests/integrate/219_NO_out_elf/STRU | 22 ++ tests/integrate/219_NO_out_elf/jd | 1 + tests/integrate/219_NO_out_elf/refELF.cube | 296 ++++++++++++++++++ tests/integrate/219_NO_out_elf/result.ref | 7 + tests/integrate/919_OF_out_elf/INPUT | 25 ++ tests/integrate/919_OF_out_elf/KPT | 4 + tests/integrate/919_OF_out_elf/STRU | 18 ++ tests/integrate/919_OF_out_elf/jd | 1 + tests/integrate/919_OF_out_elf/refELF.cube | 135 ++++++++ tests/integrate/919_OF_out_elf/result.ref | 7 + tests/integrate/CASES_CPU.txt | 3 + tests/integrate/tools/catch_properties.sh | 9 + 55 files changed, 1551 insertions(+), 56 deletions(-) create mode 100644 source/module_elecstate/elecstate_lcao_cal_tau.cpp create mode 100644 source/module_elecstate/elecstate_pw_cal_tau.cpp create mode 100644 source/module_io/write_elf.cpp create mode 100644 source/module_io/write_elf.h create mode 100644 tests/integrate/119_PW_out_elf/INPUT create mode 100644 tests/integrate/119_PW_out_elf/KPT create mode 100644 tests/integrate/119_PW_out_elf/STRU create mode 100644 tests/integrate/119_PW_out_elf/jd create mode 100644 tests/integrate/119_PW_out_elf/refELF.cube create mode 100644 tests/integrate/119_PW_out_elf/result.ref create mode 100644 tests/integrate/219_NO_out_elf/INPUT create mode 100644 tests/integrate/219_NO_out_elf/KPT create mode 100644 tests/integrate/219_NO_out_elf/STRU create mode 100644 tests/integrate/219_NO_out_elf/jd create mode 100644 tests/integrate/219_NO_out_elf/refELF.cube create mode 100644 tests/integrate/219_NO_out_elf/result.ref create mode 100644 tests/integrate/919_OF_out_elf/INPUT create mode 100644 tests/integrate/919_OF_out_elf/KPT create mode 100644 tests/integrate/919_OF_out_elf/STRU create mode 100644 tests/integrate/919_OF_out_elf/jd create mode 100644 tests/integrate/919_OF_out_elf/refELF.cube create mode 100644 tests/integrate/919_OF_out_elf/result.ref diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 7ab8c685a0..352339f739 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -161,6 +161,7 @@ - [nbands\_istate](#nbands_istate) - [bands\_to\_print](#bands_to_print) - [if\_separate\_k](#if_separate_k) + - [out\_elf](#out_elf) - [Density of states](#density-of-states) - [dos\_edelta\_ev](#dos_edelta_ev) - [dos\_sigma](#dos_sigma) @@ -1521,7 +1522,7 @@ These variables are used to control the output of properties. - **Type**: Integer \[Integer\](optional) - **Description**: The first integer controls whether to output the charge density on real space grids: - - 1. Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as: + - 1: Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as: - nspin = 1: SPIN1_CHG.cube; - nspin = 2: SPIN1_CHG.cube, and SPIN2_CHG.cube; - nspin = 4: SPIN1_CHG.cube, SPIN2_CHG.cube, SPIN3_CHG.cube, and SPIN4_CHG.cube. @@ -1801,6 +1802,23 @@ The band (KS orbital) energy for each (k-point, spin, band) will be printed in t - **Description**: Specifies whether to write the partial charge densities for all k-points to individual files or merge them. **Warning**: Enabling symmetry may produce incorrect results due to incorrect k-point weights. Therefore, when calculating partial charge densities, it is strongly recommended to set `symmetry = -1`. - **Default**: false +### out_elf + +- **Type**: Integer \[Integer\](optional) +- **Availability**: Only for Kohn-Sham DFT and Orbital Free DFT. +- **Description**: Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as + - nspin = 1: + - ELF.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$; + - nspin = 2: + - ELF_SPIN1.cube, ELF_SPIN2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$; + - ELF.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$; + + The second integer controls the precision of the kinetic energy density output, if not given, will use `3` as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use `10`. + + --- + In molecular dynamics calculations, the output frequency is controlled by [out_interval](#out_interval). +- **Default**: 0 3 + [back to top](#full-list-of-input-keywords) ## Density of states diff --git a/source/Makefile.Objects b/source/Makefile.Objects index 55ec7e7dbf..5ea326ee34 100644 --- a/source/Makefile.Objects +++ b/source/Makefile.Objects @@ -213,6 +213,7 @@ OBJS_ELECSTAT=elecstate.o\ elecstate_print.o\ elecstate_pw.o\ elecstate_pw_sdft.o\ + elecstate_pw_cal_tau.o\ elecstate_op.o\ efield.o\ gatefield.o\ @@ -226,6 +227,7 @@ OBJS_ELECSTAT=elecstate.o\ OBJS_ELECSTAT_LCAO=elecstate_lcao.o\ elecstate_lcao_tddft.o\ + elecstate_lcao_cal_tau.o\ density_matrix.o\ cal_dm_psi.o\ @@ -496,6 +498,7 @@ OBJS_IO=input_conv.o\ winput.o\ write_cube.o\ write_elecstat_pot.o\ + write_elf.o\ write_dipole.o\ td_current_io.o\ write_wfc_r.o\ diff --git a/source/module_elecstate/CMakeLists.txt b/source/module_elecstate/CMakeLists.txt index 5f24e9db5d..40b43a7b99 100644 --- a/source/module_elecstate/CMakeLists.txt +++ b/source/module_elecstate/CMakeLists.txt @@ -7,6 +7,7 @@ list(APPEND objects elecstate_print.cpp elecstate_pw.cpp elecstate_pw_sdft.cpp + elecstate_pw_cal_tau.cpp potentials/gatefield.cpp potentials/efield.cpp potentials/H_Hartree_pw.cpp @@ -31,6 +32,7 @@ if(ENABLE_LCAO) list(APPEND objects elecstate_lcao.cpp elecstate_lcao_tddft.cpp + elecstate_lcao_cal_tau.cpp potentials/H_TDDFT_pw.cpp module_dm/density_matrix.cpp module_dm/cal_dm_psi.cpp diff --git a/source/module_elecstate/elecstate.h b/source/module_elecstate/elecstate.h index a9fc79ff7c..4f1d74683d 100644 --- a/source/module_elecstate/elecstate.h +++ b/source/module_elecstate/elecstate.h @@ -53,6 +53,14 @@ class ElecState } // virtual void updateRhoK(const psi::Psi> &psi) = 0; // virtual void updateRhoK(const psi::Psi &psi)=0 + virtual void cal_tau(const psi::Psi>& psi) + { + return; + } + virtual void cal_tau(const psi::Psi& psi) + { + return; + } // update charge density for next scf step // in this function, 1. input rho for construct Hamilt and 2. calculated rho from Psi will mix to 3. new charge diff --git a/source/module_elecstate/elecstate_lcao.cpp b/source/module_elecstate/elecstate_lcao.cpp index 0650af2ecf..0d11153183 100644 --- a/source/module_elecstate/elecstate_lcao.cpp +++ b/source/module_elecstate/elecstate_lcao.cpp @@ -67,12 +67,7 @@ void ElecStateLCAO>::psiToRho(const psi::Psicharge->kin_r[is], this->charge->nrxx); - } - Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau); - this->gint_k->cal_gint(&inout1); + this->cal_tau(psi); } this->charge->renormalize_rho(); @@ -124,12 +119,7 @@ void ElecStateLCAO::psiToRho(const psi::Psi& psi) if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) { - for (int is = 0; is < PARAM.inp.nspin; is++) - { - ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); - } - Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau); - this->gint_gamma->cal_gint(&inout1); + this->cal_tau(psi); } this->charge->renormalize_rho(); diff --git a/source/module_elecstate/elecstate_lcao.h b/source/module_elecstate/elecstate_lcao.h index ad7cf64c95..e0fcf6affe 100644 --- a/source/module_elecstate/elecstate_lcao.h +++ b/source/module_elecstate/elecstate_lcao.h @@ -46,6 +46,7 @@ class ElecStateLCAO : public ElecState // virtual void psiToRho(const psi::Psi& psi) override; // return current electronic density rho, as a input for constructing Hamiltonian // const double* getRho(int spin) const override; + virtual void cal_tau(const psi::Psi& psi) override; // update charge density for next scf step // void getNewRho() override; diff --git a/source/module_elecstate/elecstate_lcao_cal_tau.cpp b/source/module_elecstate/elecstate_lcao_cal_tau.cpp new file mode 100644 index 0000000000..01ee54f03f --- /dev/null +++ b/source/module_elecstate/elecstate_lcao_cal_tau.cpp @@ -0,0 +1,41 @@ +#include "elecstate_lcao.h" + +#include "module_base/timer.h" + +namespace elecstate +{ + +// calculate the kinetic energy density tau, multi-k case +template <> +void ElecStateLCAO>::cal_tau(const psi::Psi>& psi) +{ + ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); + + for (int is = 0; is < PARAM.inp.nspin; is++) + { + ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); + } + Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau); + this->gint_k->cal_gint(&inout1); + + ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); + return; +} + +// calculate the kinetic energy density tau, gamma-only case +template <> +void ElecStateLCAO::cal_tau(const psi::Psi& psi) +{ + ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); + + for (int is = 0; is < PARAM.inp.nspin; is++) + { + ModuleBase::GlobalFunc::ZEROS(this->charge->kin_r[is], this->charge->nrxx); + } + Gint_inout inout1(this->charge->kin_r, Gint_Tools::job_type::tau); + this->gint_gamma->cal_gint(&inout1); + + ModuleBase::timer::tick("ElecStateLCAO", "cal_tau"); + return; +} +} \ No newline at end of file diff --git a/source/module_elecstate/elecstate_pw.cpp b/source/module_elecstate/elecstate_pw.cpp index 8fa5ee74b7..24d87f5a8f 100644 --- a/source/module_elecstate/elecstate_pw.cpp +++ b/source/module_elecstate/elecstate_pw.cpp @@ -34,7 +34,7 @@ ElecStatePW::~ElecStatePW() if (base_device::get_device_type(this->ctx) == base_device::GpuDevice) { delmem_var_op()(this->ctx, this->rho_data); - if (get_xc_func_type() == 3) + if (get_xc_func_type() == 3 || PARAM.inp.out_elf[0] > 0) { delmem_var_op()(this->ctx, this->kin_r_data); } @@ -53,7 +53,7 @@ void ElecStatePW::init_rho_data() for (int ii = 0; ii < this->charge->nspin; ii++) { this->rho[ii] = this->rho_data + ii * this->charge->nrxx; } - if (get_xc_func_type() == 3) + if (get_xc_func_type() == 3 || PARAM.inp.out_elf[0] > 0) { this->kin_r = new Real*[this->charge->nspin]; resmem_var_op()(this->ctx, this->kin_r_data, this->charge->nspin * this->charge->nrxx); @@ -64,7 +64,7 @@ void ElecStatePW::init_rho_data() } else { this->rho = reinterpret_cast(this->charge->rho); - if (get_xc_func_type() == 3) + if (get_xc_func_type() == 3 || PARAM.inp.out_elf[0] > 0) { this->kin_r = reinterpret_cast(this->charge->kin_r); } diff --git a/source/module_elecstate/elecstate_pw.h b/source/module_elecstate/elecstate_pw.h index bdf85597cd..73cf6c91a2 100644 --- a/source/module_elecstate/elecstate_pw.h +++ b/source/module_elecstate/elecstate_pw.h @@ -33,6 +33,7 @@ class ElecStatePW : public ElecState virtual void psiToRho(const psi::Psi& psi); // return current electronic density rho, as a input for constructing Hamiltonian // const double* getRho(int spin) const override; + virtual void cal_tau(const psi::Psi& psi); // update charge density for next scf step // void getNewRho() override; diff --git a/source/module_elecstate/elecstate_pw_cal_tau.cpp b/source/module_elecstate/elecstate_pw_cal_tau.cpp new file mode 100644 index 0000000000..a354fda48b --- /dev/null +++ b/source/module_elecstate/elecstate_pw_cal_tau.cpp @@ -0,0 +1,68 @@ +#include "elecstate_pw.h" +#include "elecstate_getters.h" + +namespace elecstate { + +template +void ElecStatePW::cal_tau(const psi::Psi& psi) +{ + ModuleBase::TITLE("ElecStatePW", "cal_tau"); + for(int is=0; isctx, this->kin_r[is], 0, this->charge->nrxx); + } + + for (int ik = 0; ik < psi.get_nk(); ++ik) + { + psi.fix_k(ik); + int npw = psi.get_current_nbas(); + int current_spin = 0; + if (PARAM.inp.nspin == 2) + { + current_spin = this->klist->isk[ik]; + } + int nbands = psi.get_nbands(); + for (int ibnd = 0; ibnd < nbands; ibnd++) + { + this->basis->recip_to_real(this->ctx, &psi(ibnd,0), this->wfcr, ik); + + const auto w1 = static_cast(this->wg(ik, ibnd) / get_ucell_omega()); + + // kinetic energy density + for (int j = 0; j < 3; j++) + { + setmem_complex_op()(this->ctx, this->wfcr, 0, this->charge->nrxx); + + meta_op()(this->ctx, + ik, + j, + npw, + this->basis->npwk_max, + static_cast(get_ucell_tpiba()), + this->basis->template get_gcar_data(), + this->basis->template get_kvec_c_data(), + &psi(ibnd, 0), + this->wfcr); + + this->basis->recip_to_real(this->ctx, this->wfcr, this->wfcr, ik); + + elecstate_pw_op()(this->ctx, current_spin, this->charge->nrxx, w1, this->kin_r, this->wfcr); + } + } + } + if (GlobalV::device_flag == "gpu" || PARAM.inp.precision == "single") { + for (int ii = 0; ii < PARAM.inp.nspin; ii++) { + castmem_var_d2h_op()(cpu_ctx, this->ctx, this->charge->kin_r[ii], this->kin_r[ii], this->charge->nrxx); + } + } + this->parallelK(); + ModuleBase::TITLE("ElecStatePW", "cal_tau"); +} + +template class ElecStatePW, base_device::DEVICE_CPU>; +template class ElecStatePW, base_device::DEVICE_CPU>; +#if ((defined __CUDA) || (defined __ROCM)) +template class ElecStatePW, base_device::DEVICE_GPU>; +template class ElecStatePW, base_device::DEVICE_GPU>; +#endif +} // namespace elecstate diff --git a/source/module_elecstate/module_charge/charge.cpp b/source/module_elecstate/module_charge/charge.cpp index f24d55e96d..51c60b8ca7 100644 --- a/source/module_elecstate/module_charge/charge.cpp +++ b/source/module_elecstate/module_charge/charge.cpp @@ -80,7 +80,7 @@ void Charge::destroy() delete[] _space_rhog_save; delete[] _space_kin_r; delete[] _space_kin_r_save; - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { delete[] kin_r; delete[] kin_r_save; @@ -121,7 +121,7 @@ void Charge::allocate(const int& nspin_in) _space_rho_save = new double[nspin * nrxx]; _space_rhog = new std::complex[nspin * ngmc]; _space_rhog_save = new std::complex[nspin * ngmc]; - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { _space_kin_r = new double[nspin * nrxx]; _space_kin_r_save = new double[nspin * nrxx]; @@ -130,7 +130,7 @@ void Charge::allocate(const int& nspin_in) rhog = new std::complex*[nspin]; rho_save = new double*[nspin]; rhog_save = new std::complex*[nspin]; - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { kin_r = new double*[nspin]; kin_r_save = new double*[nspin]; @@ -151,7 +151,7 @@ void Charge::allocate(const int& nspin_in) ModuleBase::GlobalFunc::ZEROS(rhog[is], ngmc); ModuleBase::GlobalFunc::ZEROS(rho_save[is], nrxx); ModuleBase::GlobalFunc::ZEROS(rhog_save[is], ngmc); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { kin_r[is] = _space_kin_r + is * nrxx; ModuleBase::GlobalFunc::ZEROS(kin_r[is], nrxx); @@ -171,7 +171,7 @@ void Charge::allocate(const int& nspin_in) ModuleBase::Memory::record("Chg::rho_save", sizeof(double) * nspin * nrxx); ModuleBase::Memory::record("Chg::rhog", sizeof(double) * nspin * ngmc); ModuleBase::Memory::record("Chg::rhog_save", sizeof(double) * nspin * ngmc); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { ModuleBase::Memory::record("Chg::kin_r", sizeof(double) * nspin * ngmc); ModuleBase::Memory::record("Chg::kin_r_save", sizeof(double) * nspin * ngmc); diff --git a/source/module_elecstate/module_charge/charge.h b/source/module_elecstate/module_charge/charge.h index 6ea9ac5a20..1593c9fa47 100644 --- a/source/module_elecstate/module_charge/charge.h +++ b/source/module_elecstate/module_charge/charge.h @@ -138,6 +138,7 @@ class Charge int ngmc; // number of g vectors in this processor int nspin; // number of spins ModulePW::PW_Basis* rhopw = nullptr;// When double_grid is used, rhopw = rhodpw (dense grid) + bool cal_elf = false; // whether to calculate electron localization function (ELF) private: void destroy(); // free arrays liuyu 2023-03-12 diff --git a/source/module_elecstate/module_charge/charge_mpi.cpp b/source/module_elecstate/module_charge/charge_mpi.cpp index 70aae3d9b2..76646b7895 100644 --- a/source/module_elecstate/module_charge/charge_mpi.cpp +++ b/source/module_elecstate/module_charge/charge_mpi.cpp @@ -132,7 +132,7 @@ void Charge::rho_mpi() for (int is = 0; is < PARAM.inp.nspin; ++is) { reduce_diff_pools(this->rho[is]); - if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5) + if (elecstate::get_xc_func_type() == 3 || elecstate::get_xc_func_type() == 5 || PARAM.inp.out_elf[0] > 0) { reduce_diff_pools(this->kin_r[is]); } diff --git a/source/module_elecstate/module_charge/symmetry_rho.cpp b/source/module_elecstate/module_charge/symmetry_rho.cpp index d5afdbd4c3..3635fd1d51 100644 --- a/source/module_elecstate/module_charge/symmetry_rho.cpp +++ b/source/module_elecstate/module_charge/symmetry_rho.cpp @@ -33,7 +33,7 @@ void Symmetry_rho::begin(const int& spin_now, psymmg(CHR.rhog[spin_now], rho_basis, symm); // need to modify rho_basis->recip2real(CHR.rhog[spin_now], CHR.rho[spin_now]); - if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5) + if (XC_Functional::get_func_type() == 3 || XC_Functional::get_func_type() == 5 || CHR.cal_elf) { // Use std::vector to manage kin_g instead of raw pointer std::vector> kin_g(CHR.ngmc); diff --git a/source/module_elecstate/test/CMakeLists.txt b/source/module_elecstate/test/CMakeLists.txt index db0f194d39..98d07d7195 100644 --- a/source/module_elecstate/test/CMakeLists.txt +++ b/source/module_elecstate/test/CMakeLists.txt @@ -53,6 +53,7 @@ AddTest( LIBS parameter ${math_libs} planewave_serial base device SOURCES elecstate_pw_test.cpp ../elecstate_pw.cpp + ../elecstate_pw_cal_tau.cpp ../elecstate.cpp ../occupy.cpp ../../module_psi/psi.cpp diff --git a/source/module_esolver/esolver_fp.cpp b/source/module_esolver/esolver_fp.cpp index ae66c34f9e..be9b260285 100644 --- a/source/module_esolver/esolver_fp.cpp +++ b/source/module_esolver/esolver_fp.cpp @@ -5,9 +5,11 @@ #include "module_io/cube_io.h" #include "module_io/output_log.h" #include "module_io/write_elecstat_pot.h" +#include "module_io/write_elf.h" #include "module_parameter/parameter.h" #include "module_io/rhog_io.h" #include "module_io/cif_io.h" +#include "module_elecstate/module_charge/symmetry_rho.h" namespace ModuleESolver { @@ -261,6 +263,32 @@ void ESolver_FP::after_scf(const int istep) &(GlobalC::ucell), this->pelec->pot->get_fixed_v()); } + + // 5) write ELF + if (PARAM.inp.out_elf[0] > 0) + { + this->pelec->charge->cal_elf = true; + Symmetry_rho srho; + for (int is = 0; is < PARAM.inp.nspin; is++) + { + srho.begin(is, *(this->pelec->charge), this->pw_rhod, GlobalC::ucell.symm); + } + + std::string out_dir =PARAM.globalv.global_out_dir; + ModuleIO::write_elf( +#ifdef __MPI + this->pw_big->bz, + this->pw_big->nbz, +#endif + out_dir, + istep, + PARAM.inp.nspin, + this->pelec->charge->rho, + this->pelec->charge->kin_r, + this->pw_rhod, + &(GlobalC::ucell), + PARAM.inp.out_elf[1]); + } } } diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index eb8bb63c2c..217f14e89d 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -1106,11 +1106,16 @@ template void ESolver_KS_LCAO::after_scf(const int istep) { ModuleBase::TITLE("ESolver_KS_LCAO", "after_scf"); - - // 1) call after_scf() of ESolver_KS + // 1) calculate the kinetic energy density tau, sunliang 2024-09-18 + if (PARAM.inp.out_elf[0] > 0) + { + this->pelec->cal_tau(*(this->psi)); + } + + // 2) call after_scf() of ESolver_KS ESolver_KS::after_scf(istep); - // 2) write density matrix for sparse matrix + // 3) write density matrix for sparse matrix ModuleIO::write_dmr(dynamic_cast*>(this->pelec)->get_DM()->get_DMR_vector(), this->pv, PARAM.inp.out_dm1, @@ -1118,7 +1123,7 @@ void ESolver_KS_LCAO::after_scf(const int istep) PARAM.inp.out_app_flag, istep); - // 3) write density matrix + // 4) write density matrix if (PARAM.inp.out_dm) { std::vector efermis(PARAM.inp.nspin == 2 ? 2 : 1); @@ -1135,7 +1140,7 @@ void ESolver_KS_LCAO::after_scf(const int istep) } #ifdef __EXX - // 4) write Hexx matrix for NSCF (see `out_chg` in docs/advanced/input_files/input-main.md) + // 5) write Hexx matrix for NSCF (see `out_chg` in docs/advanced/input_files/input-main.md) if (GlobalC::exx_info.info_global.cal_exx && PARAM.inp.out_chg[0] && istep % PARAM.inp.out_interval == 0) // Peize Lin add if 2022.11.14 { diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index 17c34b47b2..af75d8175f 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -538,10 +538,16 @@ void ESolver_KS_PW::iter_finish(int& iter) template void ESolver_KS_PW::after_scf(const int istep) { - // 1) call after_scf() of ESolver_KS + // 1) calculate the kinetic energy density tau, sunliang 2024-09-18 + if (PARAM.inp.out_elf[0] > 0) + { + this->pelec->cal_tau(*(this->psi)); + } + + // 2) call after_scf() of ESolver_KS ESolver_KS::after_scf(istep); - // 2) output wavefunctions + // 3) output wavefunctions if (this->wf.out_wfc_pw == 1 || this->wf.out_wfc_pw == 2) { std::stringstream ssw; diff --git a/source/module_esolver/esolver_of.cpp b/source/module_esolver/esolver_of.cpp index 49edcb90b2..f125f1098e 100644 --- a/source/module_esolver/esolver_of.cpp +++ b/source/module_esolver/esolver_of.cpp @@ -509,7 +509,13 @@ bool ESolver_OF::check_exit() */ void ESolver_OF::after_opt(const int istep, UnitCell& ucell) { - // 1) call after_scf() of ESolver_FP + // 1) calculate the kinetic energy density + if (PARAM.inp.out_elf[0] > 0) + { + this->kinetic_energy_density(this->pelec->charge->rho, this->pphi_, this->pelec->charge->kin_r); + } + + // 2) call after_scf() of ESolver_FP ESolver_FP::after_scf(istep); } diff --git a/source/module_esolver/esolver_of.h b/source/module_esolver/esolver_of.h index 46f2aa21ab..ed5bff3c35 100644 --- a/source/module_esolver/esolver_of.h +++ b/source/module_esolver/esolver_of.h @@ -125,6 +125,7 @@ class ESolver_OF : public ESolver_FP void init_kedf(const Input_para& inp); void kinetic_potential(double** prho, double** pphi, ModuleBase::matrix& rpot); double kinetic_energy(); + void kinetic_energy_density(double** prho, double** pphi, double** rtau); void kinetic_stress(ModuleBase::matrix& kinetic_stress); // ---------------------- interfaces to optimization methods -------- diff --git a/source/module_esolver/esolver_of_interface.cpp b/source/module_esolver/esolver_of_interface.cpp index d5d76d9236..118168a2a3 100644 --- a/source/module_esolver/esolver_of_interface.cpp +++ b/source/module_esolver/esolver_of_interface.cpp @@ -137,6 +137,40 @@ double ESolver_OF::kinetic_energy() return kinetic_energy; } +/** + * @brief [Interface to kedf] + * Calculated the kinetic energy density, ONLY SPIN=1 SUPPORTED + * + * @param [in] prho charge density + * @param [in] pphi phi^2 = rho + * @param [out] rtau kinetic energy density + */ +void ESolver_OF::kinetic_energy_density(double** prho, double** pphi, double** rtau) +{ + for (int ir = 0; ir < this->pw_rho->nrxx; ++ir) + { + rtau[0][ir] = 0.0; + } + + if (this->of_kinetic_ == "tf" || this->of_kinetic_ == "tf+" || this->of_kinetic_ == "wt") + { + this->tf_->tau_tf(prho, rtau[0]); + } + if (this->of_kinetic_ == "vw" || this->of_kinetic_ == "tf+" || this->of_kinetic_ == "wt" + || this->of_kinetic_ == "lkt") + { + this->vw_->tau_vw(prho, this->pw_rho, rtau[0]); + } + if (this->of_kinetic_ == "wt") + { + this->wt_->tau_wt(prho, this->pw_rho, rtau[0]); + } + if (this->of_kinetic_ == "lkt") + { + this->lkt_->tau_lkt(prho, this->pw_rho, rtau[0]); + } +} + /** * @brief [Interface to kedf] * Calculate the stress of kedf diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.cpp b/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.cpp index 7ee5d17236..06f253c55c 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.cpp +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.cpp @@ -47,8 +47,9 @@ double KEDF_LKT::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rh Parallel_Reduce::reduce_all(this->lkt_energy); delete[] as; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { delete[] nabla_rho[i]; +} delete[] nabla_rho; return energy; @@ -79,13 +80,46 @@ double KEDF_LKT::get_energy_density(const double* const* prho, int is, int ir, M energy_den = this->c_tf_ * pow(prho[is][ir], 5. / 3.) / std::cosh(as[ir]); delete[] as; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { delete[] nabla_rho[i]; +} delete[] nabla_rho; return energy_den; } +void KEDF_LKT::tau_lkt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_lkt) +{ + double* as = new double[pw_rho->nrxx]; // a*s + double** nabla_rho = new double*[3]; + for (int i = 0; i < 3; ++i) + { + nabla_rho[i] = new double[pw_rho->nrxx]; + } + + if (PARAM.inp.nspin == 1) + { + this->nabla(prho[0], pw_rho, nabla_rho); + this->get_as(prho[0], nabla_rho, pw_rho->nrxx, as); + + for (int ir = 0; ir < pw_rho->nrxx; ++ir) + { + double coshas = std::cosh(as[ir]); + rtau_lkt[ir] += std::pow(prho[0][ir], 5. / 3.) / coshas * this->c_tf_; + } + } + else if (PARAM.inp.nspin == 2) + { + // Waiting for update + } + + delete[] as; + for (int i = 0; i < 3; ++i) { + delete[] nabla_rho[i]; +} + delete[] nabla_rho; +} + /** * @brief Get the potential of LKT KEDF, and add it into rpotential, * and the LKT energy will be calculated and stored in this->lkt_energy @@ -153,8 +187,9 @@ void KEDF_LKT::lkt_potential(const double* const* prho, ModulePW::PW_Basis* pw_r } delete[] as; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { delete[] nabla_rho[i]; +} delete[] nabla_rho; delete[] nabla_term; @@ -227,8 +262,9 @@ void KEDF_LKT::get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho) } delete[] as; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { delete[] nabla_rho[i]; +} delete[] nabla_rho; delete[] nabla_term; } diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.h b/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.h index 8ad7c3349e..6df93bfb33 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.h +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_lkt.h @@ -1,7 +1,7 @@ #ifndef KEDF_LKT_H #define KEDF_LKT_H -#include -#include +#include +#include #include "module_base/global_function.h" #include "module_base/global_variable.h" @@ -29,6 +29,7 @@ class KEDF_LKT double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho); double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho); + void tau_lkt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_lkt); void lkt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential); void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho); diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.cpp b/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.cpp index fa39db5920..97c0f65f2f 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.cpp +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.cpp @@ -62,6 +62,34 @@ double KEDF_TF::get_energy_density(const double* const* prho, int is, int ir) return energyDen; } +/** + * @brief Get the kinetic energy of TF KEDF, and add it onto rtau_tf + * \f[ \tau_{TF} = c_{TF} * \prho^{5/3} \f] + * + * @param prho charge density + * @param rtau_tf rtau_tf => rtau_tf + tau_tf + */ +void KEDF_TF::tau_tf(const double* const* prho, double* rtau_tf) +{ + if (PARAM.inp.nspin == 1) + { + for (int ir = 0; ir < this->nx_; ++ir) + { + rtau_tf[ir] += this->c_tf_ * std::pow(prho[0][ir], 5.0 / 3.0); + } + } + else if (PARAM.inp.nspin == 2) + { + for (int is = 0; is < PARAM.inp.nspin; ++is) + { + for (int ir = 0; ir < this->nx_; ++ir) + { + rtau_tf[ir] += 0.5 * this->c_tf_ * std::pow(2.0 * prho[is][ir], 5.0 / 3.0); + } + } + } +} + /** * @brief Get the potential of TF KEDF, and add it into rpotential, * and the TF energy will be calculated and stored in this->tf_energy diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.h b/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.h index a73af4d3cd..b9c247cecc 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.h +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_tf.h @@ -29,6 +29,7 @@ class KEDF_TF double get_energy(const double* const* prho); double get_energy_density(const double* const* prho, int is, int ir); + void tau_tf(const double* const* prho, double* rtau_tf); void tf_potential(const double* const* prho, ModuleBase::matrix& rpotential); void get_stress(double cell_vol); diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp b/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp index cc37c73a7c..aee88f0dbd 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.cpp @@ -33,8 +33,9 @@ double KEDF_vW::get_energy(double** pphi, ModulePW::PW_Basis* pw_rho) } double** LapPhi = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { LapPhi[is] = new double[pw_rho->nrxx]; +} this->laplacian_phi(tempPhi, LapPhi, pw_rho); double energy = 0.; // in Ry @@ -95,8 +96,9 @@ double KEDF_vW::get_energy_density(double** pphi, int is, int ir, ModulePW::PW_B } double** LapPhi = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { LapPhi[is] = new double[pw_rho->nrxx]; +} this->laplacian_phi(tempPhi, LapPhi, pw_rho); double energyDen = 0.; // in Ry @@ -113,6 +115,42 @@ double KEDF_vW::get_energy_density(double** pphi, int is, int ir, ModulePW::PW_B return energyDen; } +/** + * @brief Get the positive definite energy density of vW KEDF + * \f[ \tau_{vW} = |\nabla \rho|^2 / (8 \rho) \f] + * + * @param prho charge density + * @param pw_rho pw basis + * @param rtau_vw rtau_vw => rtau_vw + tau_vw + */ +void KEDF_vW::tau_vw(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_vw) +{ + for (int is = 0; is < PARAM.inp.nspin; ++is) + { + std::vector> nabla_rho(3, std::vector(pw_rho->nrxx, 0.)); + + std::complex *recip_rho = new std::complex[pw_rho->npw]; + std::complex *recip_nabla_rho = new std::complex[pw_rho->npw]; + pw_rho->real2recip(prho[is], recip_rho); + + std::complex img(0.0, 1.0); + for (int j = 0; j < 3; ++j) + { + for (int ip = 0; ip < pw_rho->npw; ++ip) + { + recip_nabla_rho[ip] = img * pw_rho->gcar[ip][j] * recip_rho[ip] * pw_rho->tpiba; + } + + pw_rho->recip2real(recip_nabla_rho, nabla_rho[j].data()); + + for (int ir = 0; ir < pw_rho->nrxx; ++ir) + { + rtau_vw[ir] += nabla_rho[j][ir] * nabla_rho[j][ir] / (8. * prho[is][ir]) * 2.0; // convert Ha to Ry. + } + } + } +} + /** * @brief Get the potential of vW KEDF, and add it into rpotential, * and the vW energy will be calculated and stored in this->vw_energy @@ -141,8 +179,9 @@ void KEDF_vW::vw_potential(const double* const* pphi, ModulePW::PW_Basis* pw_rho // calculate the minus \nabla^2 sqrt(rho) double** LapPhi = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { LapPhi[is] = new double[pw_rho->nrxx]; +} this->laplacian_phi(tempPhi, LapPhi, pw_rho); // calculate potential diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.h b/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.h index cb386512e6..6c883f7e53 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.h +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_vw.h @@ -1,7 +1,7 @@ #ifndef KEDF_vW_H #define KEDF_vW_H -#include -#include +#include +#include #include "module_base/global_function.h" #include "module_base/global_variable.h" @@ -29,6 +29,7 @@ class KEDF_vW double get_energy(double** pphi, ModulePW::PW_Basis* pw_rho); double get_energy_density(double** pphi, int is, int ir, ModulePW::PW_Basis* pw_rho); + void tau_vw(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_vw); void vw_potential(const double* const* pphi, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential); void get_stress(const double* const* pphi, ModulePW::PW_Basis* pw_rho); diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.cpp b/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.cpp index 2af9e78623..312d4a2890 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.cpp +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.cpp @@ -58,11 +58,12 @@ void KEDF_WT::set_para(double dV, delete[] this->kernel_; this->kernel_ = new double[pw_rho->npw]; - if (read_kernel) + if (read_kernel) { this->read_kernel(kernel_file, pw_rho); - else + } else { this->fill_kernel(tf_weight, vw_weight, pw_rho); } +} /** * @brief Get the energy of WT KEDF @@ -75,8 +76,9 @@ void KEDF_WT::set_para(double dV, double KEDF_WT::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho) { double** kernelRhoBeta = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { kernelRhoBeta[is] = new double[pw_rho->nrxx]; +} this->multi_kernel(prho, kernelRhoBeta, this->beta_, pw_rho); double energy = 0.; // in Ry @@ -124,8 +126,9 @@ double KEDF_WT::get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho double KEDF_WT::get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho) { double** kernelRhoBeta = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { kernelRhoBeta[is] = new double[pw_rho->nrxx]; +} this->multi_kernel(prho, kernelRhoBeta, this->beta_, pw_rho); double result = this->c_tf_ * std::pow(prho[is][ir], this->alpha_) * kernelRhoBeta[is][ir]; @@ -138,6 +141,41 @@ double KEDF_WT::get_energy_density(const double* const* prho, int is, int ir, Mo return result; } +/** + * @brief Get the kinetic energy of WT KEDF, and add it onto rtau_wt + * \f[ \tau_{WT} = c_{TF} * \rho^\alpha * \int{W(r - r') * \rho^\beta dr'} \f] + * + * @param prho charge density + * @param pw_rho pw basis + * @param rtau_wt rtau_wt => rtau_wt + tau_wt + */ +void KEDF_WT::tau_wt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_wt) +{ + double** kernelRhoBeta = new double*[PARAM.inp.nspin]; + for (int is = 0; is < PARAM.inp.nspin; ++is) { + kernelRhoBeta[is] = new double[pw_rho->nrxx]; +} + this->multi_kernel(prho, kernelRhoBeta, this->beta_, pw_rho); + + if (PARAM.inp.nspin == 1) + { + for (int ir = 0; ir < pw_rho->nrxx; ++ir) + { + rtau_wt[ir] += std::pow(prho[0][ir], this->alpha_) * kernelRhoBeta[0][ir] * this->c_tf_; + } + } + else if (PARAM.inp.nspin == 2) + { + // Waiting for update + } + + for (int is = 0; is < PARAM.inp.nspin; ++is) + { + delete[] kernelRhoBeta[is]; + } + delete[] kernelRhoBeta; +} + /** * @brief Get the potential of WT KEDF, and add it into rpotential, * and the WT energy will be calculated and stored in this->wt_energy @@ -153,13 +191,15 @@ void KEDF_WT::wt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho ModuleBase::timer::tick("KEDF_WT", "wt_potential"); double** kernelRhoBeta = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { kernelRhoBeta[is] = new double[pw_rho->nrxx]; +} this->multi_kernel(prho, kernelRhoBeta, this->beta_, pw_rho); double** kernelRhoAlpha = new double*[PARAM.inp.nspin]; - for (int is = 0; is < PARAM.inp.nspin; ++is) + for (int is = 0; is < PARAM.inp.nspin; ++is) { kernelRhoAlpha[is] = new double[pw_rho->nrxx]; +} this->multi_kernel(prho, kernelRhoAlpha, this->alpha_, pw_rho); for (int is = 0; is < PARAM.inp.nspin; ++is) @@ -271,8 +311,9 @@ void KEDF_WT::get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, else { this->stress(a, b) += -diff * pw_rho->gcar[ip][a] * pw_rho->gcar[ip][b] / pw_rho->gg[ip]; - if (a == b) + if (a == b) { this->stress(a, b) += diff * coef; +} } } } @@ -468,8 +509,9 @@ void KEDF_WT::read_kernel(std::string file_name, ModulePW::PW_Basis* pw_rho) std::ifstream ifs(file_name.c_str(), std::ios::in); GlobalV::ofs_running << "Read WT kernel from " << file_name << std::endl; - if (!ifs) + if (!ifs) { ModuleBase::WARNING_QUIT("kedf_wt.cpp", "The kernel file of WT KEDF not found"); +} int kineType = 0; double kF_in = 0.; @@ -504,11 +546,11 @@ void KEDF_WT::read_kernel(std::string file_name, ModulePW::PW_Basis* pw_rho) eta = sqrt(pw_rho->gg[ig]) * pw_rho->tpiba / this->tkf_; maxEta = std::max(eta, maxEta); - if (eta <= eta_in[0]) + if (eta <= eta_in[0]) { this->kernel_[ig] = w0_in[0]; - else if (eta > maxEta_in) + } else if (eta > maxEta_in) { this->kernel_[ig] = w0_in[nq_in - 1]; - else + } else { ind1 = 1; ind2 = nq_in; @@ -531,8 +573,9 @@ void KEDF_WT::read_kernel(std::string file_name, ModulePW::PW_Basis* pw_rho) } } - if (maxEta > maxEta_in) + if (maxEta > maxEta_in) { ModuleBase::WARNING("kedf_wt.cpp", "Please increase the maximal eta value in KEDF kernel file"); +} delete[] eta_in; delete[] w0_in; diff --git a/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.h b/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.h index dc37399726..a08f08c05e 100644 --- a/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.h +++ b/source/module_hamilt_pw/hamilt_ofdft/kedf_wt.h @@ -1,7 +1,7 @@ #ifndef KEDF_WT_H #define KEDF_WT_H -#include -#include +#include +#include #include "module_base/global_function.h" #include "module_base/global_variable.h" @@ -40,6 +40,7 @@ class KEDF_WT double get_energy(const double* const* prho, ModulePW::PW_Basis* pw_rho); double get_energy_density(const double* const* prho, int is, int ir, ModulePW::PW_Basis* pw_rho); + void tau_wt(const double* const* prho, ModulePW::PW_Basis* pw_rho, double* rtau_wt); void wt_potential(const double* const* prho, ModulePW::PW_Basis* pw_rho, ModuleBase::matrix& rpotential); void get_stress(const double* const* prho, ModulePW::PW_Basis* pw_rho, double vw_weight); double wt_energy = 0.; diff --git a/source/module_io/CMakeLists.txt b/source/module_io/CMakeLists.txt index 3ef65941eb..4014fb0c95 100644 --- a/source/module_io/CMakeLists.txt +++ b/source/module_io/CMakeLists.txt @@ -23,6 +23,7 @@ list(APPEND objects write_wfc_pw.cpp write_cube.cpp write_elecstat_pot.cpp + write_elf.cpp write_dipole.cpp td_current_io.cpp write_wfc_r.cpp diff --git a/source/module_io/read_input_item_output.cpp b/source/module_io/read_input_item_output.cpp index d67f0af38a..7f0651299f 100644 --- a/source/module_io/read_input_item_output.cpp +++ b/source/module_io/read_input_item_output.cpp @@ -492,5 +492,25 @@ void ReadInput::item_output() read_sync_bool(input.if_separate_k); this->add_item(item); } + { + Input_Item item("out_elf"); + item.annotation = "> 0 output electron localization function (ELF) for selected electron steps" + ", second parameter controls the precision, default is 3."; + item.read_value = [](const Input_Item& item, Parameter& para) { + size_t count = item.get_size(); + std::vector out_elf(count); // create a placeholder vector + std::transform(item.str_values.begin(), item.str_values.end(), out_elf.begin(), [](std::string s) { return std::stoi(s); }); + // assign non-negative values to para.input.out_elf + std::copy(out_elf.begin(), out_elf.end(), para.input.out_elf.begin()); + }; + item.check_value = [](const Input_Item& item, const Parameter& para) { + if (para.input.out_elf[0] > 0 && para.input.esolver_type != "ksdft" && para.input.esolver_type != "ofdft") + { + ModuleBase::WARNING_QUIT("ReadInput", "ELF is only aviailable for ksdft and ofdft"); + } + }; + sync_intvec(input.out_elf, 2, 0); + this->add_item(item); + } } } // namespace ModuleIO diff --git a/source/module_io/test/read_input_ptest.cpp b/source/module_io/test/read_input_ptest.cpp index af8125696d..23efe87072 100644 --- a/source/module_io/test/read_input_ptest.cpp +++ b/source/module_io/test/read_input_ptest.cpp @@ -180,6 +180,8 @@ TEST_F(InputParaTest, ParaRead) EXPECT_EQ(param.inp.out_freq_ion, 0); EXPECT_EQ(param.inp.out_chg[0], 0); EXPECT_EQ(param.inp.out_chg[1], 3); + EXPECT_EQ(param.inp.out_elf[0], 0); + EXPECT_EQ(param.inp.out_elf[1], 3); EXPECT_EQ(param.inp.out_dm, 0); EXPECT_EQ(param.inp.out_dm1, 0); EXPECT_EQ(param.inp.deepks_out_labels, 0); diff --git a/source/module_io/write_elf.cpp b/source/module_io/write_elf.cpp new file mode 100644 index 0000000000..0bd2f72927 --- /dev/null +++ b/source/module_io/write_elf.cpp @@ -0,0 +1,169 @@ +#include "write_elf.h" +#include "module_io/cube_io.h" + +namespace ModuleIO +{ +void write_elf( +#ifdef __MPI + const int& bz, + const int& nbz, +#endif + const std::string& out_dir, + const int& istep, + const int& nspin, + const double* const* rho, + const double* const* tau, + ModulePW::PW_Basis* rho_basis, + const UnitCell* ucell_, + const int& precision) +{ + std::vector> elf(nspin, std::vector(rho_basis->nrxx, 0.)); + // 1) calculate the kinetic energy density of vW KEDF + std::vector> tau_vw(nspin, std::vector(rho_basis->nrxx, 0.)); + for (int is = 0; is < nspin; ++is) + { + std::vector> gradient_rho(3, std::vector(rho_basis->nrxx, 0.)); + + std::vector> recip_rho(rho_basis->npw, 0.0); + std::vector> recip_gradient_rho(rho_basis->npw, 0.0); + rho_basis->real2recip(rho[is], recip_rho.data()); + + std::complex img(0.0, 1.0); + for (int j = 0; j < 3; ++j) + { + for (int ip = 0; ip < rho_basis->npw; ++ip) + { + recip_gradient_rho[ip] = img * rho_basis->gcar[ip][j] * recip_rho[ip] * rho_basis->tpiba; + } + + rho_basis->recip2real(recip_gradient_rho.data(), gradient_rho[j].data()); + + for (int ir = 0; ir < rho_basis->nrxx; ++ir) + { + tau_vw[is][ir] += gradient_rho[j][ir] * gradient_rho[j][ir] / (8. * rho[is][ir]) * 2.0; // convert Ha to Ry. + } + } + } + + // 2) calculate the kinetic energy density of TF KEDF + std::vector> tau_TF(nspin, std::vector(rho_basis->nrxx, 0.)); + const double c_tf + = 3.0 / 10.0 * std::pow(3 * std::pow(M_PI, 2.0), 2.0 / 3.0) + * 2.0; // 10/3*(3*pi^2)^{2/3}, multiply by 2 to convert unit from Hartree to Ry, finally in Ry*Bohr^(-2) + if (nspin == 1) + { + for (int ir = 0; ir < rho_basis->nrxx; ++ir) + { + tau_TF[0][ir] = c_tf * std::pow(rho[0][ir], 5.0 / 3.0); + } + } + else if (nspin == 2) + { + for (int is = 0; is < nspin; ++is) + { + for (int ir = 0; ir < rho_basis->nrxx; ++ir) + { + tau_TF[is][ir] = 0.5 * c_tf * std::pow(2.0 * rho[is][ir], 5.0 / 3.0); + } + } + } + + // 3) calculate the enhancement factor F = (tau_KS - tau_vw) / tau_TF, and then ELF = 1 / (1 + F^2) + double eps = 1.0e-5; // suppress the numerical instability in LCAO + for (int is = 0; is < nspin; ++is) + { + for (int ir = 0; ir < rho_basis->nrxx; ++ir) + { + elf[is][ir] = (tau[is][ir] - tau_vw[is][ir] + eps) / tau_TF[is][ir]; + elf[is][ir] = 1. / (1. + elf[is][ir] * elf[is][ir]); + } + } + + // 4) output the ELF = 1 / (1 + F^2) to cube file + double ef_tmp = 0.0; + int out_fermi = 0; + + if (nspin == 1) + { + std::string fn = out_dir + "/ELF.cube"; + + int is = -1; + ModuleIO::write_cube( + #ifdef __MPI + bz, + nbz, + rho_basis->nplane, + rho_basis->startz_current, + #endif + elf[0].data(), + is, + nspin, + istep, + fn, + rho_basis->nx, + rho_basis->ny, + rho_basis->nz, + ef_tmp, + ucell_, + precision, + out_fermi); + } + else if (nspin == 2) + { + for (int is = 0; is < nspin; ++is) + { + std::string fn_temp = out_dir + "/ELF_SPIN" + std::to_string(is) + ".cube"; + int ispin = is + 1; + + ModuleIO::write_cube( + #ifdef __MPI + bz, + nbz, + rho_basis->nplane, + rho_basis->startz_current, + #endif + elf[is].data(), + ispin, + nspin, + istep, + fn_temp, + rho_basis->nx, + rho_basis->ny, + rho_basis->nz, + ef_tmp, + ucell_, + precision, + out_fermi); + } + + std::vector elf_tot(rho_basis->nrxx, 0.0); + for (int ir = 0; ir < rho_basis->nrxx; ++ir) + { + elf_tot[ir] = (tau[0][ir] + tau[1][ir] - tau_vw[0][ir] - tau_vw[1][ir]) / (tau_TF[0][ir] + tau_TF[1][ir]); + elf_tot[ir] = 1. / (1. + elf_tot[ir] * elf_tot[ir]); + } + std::string fn = out_dir + "/ELF.cube"; + + int is = -1; + ModuleIO::write_cube( + #ifdef __MPI + bz, + nbz, + rho_basis->nplane, + rho_basis->startz_current, + #endif + elf_tot.data(), + is, + nspin, + istep, + fn, + rho_basis->nx, + rho_basis->ny, + rho_basis->nz, + ef_tmp, + ucell_, + precision, + out_fermi); + } +} +} \ No newline at end of file diff --git a/source/module_io/write_elf.h b/source/module_io/write_elf.h new file mode 100644 index 0000000000..d122e4e700 --- /dev/null +++ b/source/module_io/write_elf.h @@ -0,0 +1,25 @@ +#ifndef WRITE_ELF_H +#define WRITE_ELF_H +#include +#include "module_cell/unitcell.h" +#include "module_basis/module_pw/pw_basis.h" +#include "module_elecstate/module_charge/charge.h" + +namespace ModuleIO +{ +void write_elf( +#ifdef __MPI + const int& bz, + const int& nbz, +#endif + const std::string& out_dir, + const int& istep, + const int& nspin, + const double* const* rho, + const double* const* tau, + ModulePW::PW_Basis* rho_basis, + const UnitCell* ucell_, + const int& precision); +} + +#endif \ No newline at end of file diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 29f00705b1..c1a15fdebe 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -356,6 +356,7 @@ struct Input_para int nbands_istate = 5; ///< number of bands around fermi level for get_pchg calculation. std::vector bands_to_print = {}; ///< specify the bands to be calculated in the get_pchg bool if_separate_k = false; ///< whether to write partial charge for all k-points to individual files or merge them + std::vector out_elf = {0, 3}; ///< output the electron localization function (ELF). 0: no; 1: yes // ============== #Parameters (12.Postprocess) =========================== double dos_emin_ev = -15.0; diff --git a/tests/integrate/119_PW_out_elf/INPUT b/tests/integrate/119_PW_out_elf/INPUT new file mode 100644 index 0000000000..cdf99b9343 --- /dev/null +++ b/tests/integrate/119_PW_out_elf/INPUT @@ -0,0 +1,27 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix autotest +calculation scf + +nbands 6 +symmetry 1 +pseudo_dir ../../PP_ORB + +#Parameters (2.Iteration) +ecutwfc 5 +scf_thr 1e-9 +scf_nmax 100 + + +#Parameters (3.Basis) +basis_type pw + +#Parameters (4.Smearing) +smearing_method gauss +smearing_sigma 0.002 + +#Parameters (5.Mixing) +mixing_type broyden +mixing_beta 0.7 + +out_elf 1 diff --git a/tests/integrate/119_PW_out_elf/KPT b/tests/integrate/119_PW_out_elf/KPT new file mode 100644 index 0000000000..c289c0158a --- /dev/null +++ b/tests/integrate/119_PW_out_elf/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/integrate/119_PW_out_elf/STRU b/tests/integrate/119_PW_out_elf/STRU new file mode 100644 index 0000000000..7c8bbf9908 --- /dev/null +++ b/tests/integrate/119_PW_out_elf/STRU @@ -0,0 +1,19 @@ +ATOMIC_SPECIES +Si 14 Si_ONCV_PBE-1.0.upf upf201 + +LATTICE_CONSTANT +10.2 // add lattice constant + +LATTICE_VECTORS +0.5 0.5 0.0 +0.5 0.0 0.5 +0.0 0.5 0.5 + +ATOMIC_POSITIONS +Direct + +Si // Element type +0.0 // magnetism +2 +0.00 0.00 0.00 1 1 1 +0.25 0.25 0.25 1 1 1 diff --git a/tests/integrate/119_PW_out_elf/jd b/tests/integrate/119_PW_out_elf/jd new file mode 100644 index 0000000000..d58bf23e16 --- /dev/null +++ b/tests/integrate/119_PW_out_elf/jd @@ -0,0 +1 @@ +test out_elf in PW KSDFT. symmetry = on.; test init_chg=auto, and no chg file (will use atomic chg). diff --git a/tests/integrate/119_PW_out_elf/refELF.cube b/tests/integrate/119_PW_out_elf/refELF.cube new file mode 100644 index 0000000000..8fb31f75b4 --- /dev/null +++ b/tests/integrate/119_PW_out_elf/refELF.cube @@ -0,0 +1,296 @@ +STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +1 (nspin) +2 0.0 0.0 0.0 +12 0.425000 0.425000 0.000000 +12 0.425000 0.000000 0.425000 +12 0.000000 0.425000 0.425000 + 14 4.000000 0.000000 0.000000 0.000000 + 14 4.000000 2.550000 2.550000 2.550000 + 1.318e-04 1.477e-02 3.999e-01 8.349e-01 8.631e-01 5.225e-01 + 2.341e-01 5.225e-01 8.631e-01 8.349e-01 3.999e-01 1.477e-02 + 1.477e-02 5.423e-01 9.580e-01 9.857e-01 9.151e-01 4.414e-01 + 4.414e-01 9.151e-01 9.857e-01 9.580e-01 5.423e-01 1.477e-02 + 3.999e-01 9.580e-01 9.955e-01 9.857e-01 7.214e-01 2.780e-01 + 7.214e-01 9.857e-01 9.955e-01 9.580e-01 3.999e-01 5.220e-02 + 8.349e-01 9.857e-01 9.857e-01 8.349e-01 1.969e-01 1.969e-01 + 8.349e-01 9.857e-01 9.857e-01 8.349e-01 1.969e-01 1.969e-01 + 8.631e-01 9.151e-01 7.214e-01 1.969e-01 5.231e-02 1.969e-01 + 7.214e-01 9.151e-01 8.631e-01 3.711e-01 1.042e-01 3.711e-01 + 5.225e-01 4.414e-01 2.780e-01 1.969e-01 1.969e-01 2.780e-01 + 4.414e-01 5.225e-01 3.057e-01 6.999e-02 6.999e-02 3.057e-01 + 2.341e-01 4.414e-01 7.214e-01 8.349e-01 7.214e-01 4.414e-01 + 2.341e-01 1.279e-01 5.464e-02 3.021e-02 5.464e-02 1.279e-01 + 5.225e-01 9.151e-01 9.857e-01 9.857e-01 9.151e-01 5.225e-01 + 1.279e-01 5.248e-02 7.128e-02 7.128e-02 5.248e-02 1.279e-01 + 8.631e-01 9.857e-01 9.955e-01 9.857e-01 8.631e-01 3.057e-01 + 5.464e-02 7.128e-02 3.826e-01 7.128e-02 5.464e-02 3.057e-01 + 8.349e-01 9.580e-01 9.580e-01 8.349e-01 3.711e-01 6.999e-02 + 3.021e-02 7.128e-02 7.128e-02 3.021e-02 6.999e-02 3.711e-01 + 3.999e-01 5.423e-01 3.999e-01 1.969e-01 1.042e-01 6.999e-02 + 5.464e-02 5.248e-02 5.464e-02 6.999e-02 1.042e-01 1.969e-01 + 1.477e-02 1.477e-02 5.220e-02 1.969e-01 3.711e-01 3.057e-01 + 1.279e-01 1.279e-01 3.057e-01 3.711e-01 1.969e-01 5.220e-02 + 1.477e-02 5.423e-01 9.580e-01 9.857e-01 9.151e-01 4.414e-01 + 4.414e-01 9.151e-01 9.857e-01 9.580e-01 5.423e-01 1.477e-02 + 5.423e-01 9.878e-01 9.996e-01 9.955e-01 8.135e-01 3.655e-01 + 8.135e-01 9.955e-01 9.996e-01 9.878e-01 5.423e-01 5.705e-02 + 9.580e-01 9.996e-01 9.996e-01 9.580e-01 3.553e-01 3.553e-01 + 9.580e-01 9.996e-01 9.996e-01 9.580e-01 3.553e-01 3.553e-01 + 9.857e-01 9.955e-01 9.580e-01 3.999e-01 5.220e-02 3.999e-01 + 9.580e-01 9.955e-01 9.857e-01 7.214e-01 2.780e-01 7.214e-01 + 9.151e-01 8.135e-01 3.553e-01 5.220e-02 5.220e-02 3.553e-01 + 8.135e-01 9.151e-01 7.660e-01 2.624e-01 2.624e-01 7.660e-01 + 4.414e-01 3.655e-01 3.553e-01 3.999e-01 3.553e-01 3.655e-01 + 4.414e-01 4.227e-01 1.940e-01 8.700e-02 1.940e-01 4.227e-01 + 4.414e-01 8.135e-01 9.580e-01 9.580e-01 8.135e-01 4.414e-01 + 1.842e-01 9.824e-02 7.331e-02 7.331e-02 9.824e-02 1.842e-01 + 9.151e-01 9.955e-01 9.996e-01 9.955e-01 9.151e-01 4.227e-01 + 9.824e-02 1.101e-01 4.486e-01 1.101e-01 9.824e-02 4.227e-01 + 9.857e-01 9.996e-01 9.996e-01 9.857e-01 7.660e-01 1.940e-01 + 7.331e-02 4.486e-01 4.486e-01 7.331e-02 1.940e-01 7.660e-01 + 9.580e-01 9.878e-01 9.580e-01 7.214e-01 2.624e-01 8.700e-02 + 7.331e-02 1.101e-01 7.331e-02 8.700e-02 2.624e-01 7.214e-01 + 5.423e-01 5.423e-01 3.553e-01 2.780e-01 2.624e-01 1.940e-01 + 9.824e-02 9.824e-02 1.940e-01 2.624e-01 2.780e-01 3.553e-01 + 1.477e-02 5.705e-02 3.553e-01 7.214e-01 7.660e-01 4.227e-01 + 1.842e-01 4.227e-01 7.660e-01 7.214e-01 3.553e-01 5.705e-02 + 3.999e-01 9.580e-01 9.955e-01 9.857e-01 7.214e-01 2.780e-01 + 7.214e-01 9.857e-01 9.955e-01 9.580e-01 3.999e-01 5.220e-02 + 9.580e-01 9.996e-01 9.996e-01 9.580e-01 3.553e-01 3.553e-01 + 9.580e-01 9.996e-01 9.996e-01 9.580e-01 3.553e-01 3.553e-01 + 9.955e-01 9.996e-01 9.878e-01 5.423e-01 5.705e-02 5.423e-01 + 9.878e-01 9.996e-01 9.955e-01 8.135e-01 3.655e-01 8.135e-01 + 9.857e-01 9.580e-01 5.423e-01 1.477e-02 1.477e-02 5.423e-01 + 9.580e-01 9.857e-01 9.151e-01 4.414e-01 4.414e-01 9.151e-01 + 7.214e-01 3.553e-01 5.705e-02 1.477e-02 5.705e-02 3.553e-01 + 7.214e-01 7.660e-01 4.227e-01 1.842e-01 4.227e-01 7.660e-01 + 2.780e-01 3.553e-01 5.423e-01 5.423e-01 3.553e-01 2.780e-01 + 2.624e-01 1.940e-01 9.824e-02 9.824e-02 1.940e-01 2.624e-01 + 7.214e-01 9.580e-01 9.878e-01 9.580e-01 7.214e-01 2.624e-01 + 8.700e-02 7.331e-02 1.101e-01 7.331e-02 8.700e-02 2.624e-01 + 9.857e-01 9.996e-01 9.996e-01 9.857e-01 7.660e-01 1.940e-01 + 7.331e-02 4.486e-01 4.486e-01 7.331e-02 1.940e-01 7.660e-01 + 9.955e-01 9.996e-01 9.955e-01 9.151e-01 4.227e-01 9.824e-02 + 1.101e-01 4.486e-01 1.101e-01 9.824e-02 4.227e-01 9.151e-01 + 9.580e-01 9.580e-01 8.135e-01 4.414e-01 1.842e-01 9.824e-02 + 7.331e-02 7.331e-02 9.824e-02 1.842e-01 4.414e-01 8.135e-01 + 3.999e-01 3.553e-01 3.655e-01 4.414e-01 4.227e-01 1.940e-01 + 8.700e-02 1.940e-01 4.227e-01 4.414e-01 3.655e-01 3.553e-01 + 5.220e-02 3.553e-01 8.135e-01 9.151e-01 7.660e-01 2.624e-01 + 2.624e-01 7.660e-01 9.151e-01 8.135e-01 3.553e-01 5.220e-02 + 8.349e-01 9.857e-01 9.857e-01 8.349e-01 1.969e-01 1.969e-01 + 8.349e-01 9.857e-01 9.857e-01 8.349e-01 1.969e-01 1.969e-01 + 9.857e-01 9.955e-01 9.580e-01 3.999e-01 5.220e-02 3.999e-01 + 9.580e-01 9.955e-01 9.857e-01 7.214e-01 2.780e-01 7.214e-01 + 9.857e-01 9.580e-01 5.423e-01 1.477e-02 1.477e-02 5.423e-01 + 9.580e-01 9.857e-01 9.151e-01 4.414e-01 4.414e-01 9.151e-01 + 8.349e-01 3.999e-01 1.477e-02 1.318e-04 1.477e-02 3.999e-01 + 8.349e-01 8.631e-01 5.225e-01 2.341e-01 5.225e-01 8.631e-01 + 1.969e-01 5.220e-02 1.477e-02 1.477e-02 5.220e-02 1.969e-01 + 3.711e-01 3.057e-01 1.279e-01 1.279e-01 3.057e-01 3.711e-01 + 1.969e-01 3.999e-01 5.423e-01 3.999e-01 1.969e-01 1.042e-01 + 6.999e-02 5.464e-02 5.248e-02 5.464e-02 6.999e-02 1.042e-01 + 8.349e-01 9.580e-01 9.580e-01 8.349e-01 3.711e-01 6.999e-02 + 3.021e-02 7.128e-02 7.128e-02 3.021e-02 6.999e-02 3.711e-01 + 9.857e-01 9.955e-01 9.857e-01 8.631e-01 3.057e-01 5.464e-02 + 7.128e-02 3.826e-01 7.128e-02 5.464e-02 3.057e-01 8.631e-01 + 9.857e-01 9.857e-01 9.151e-01 5.225e-01 1.279e-01 5.248e-02 + 7.128e-02 7.128e-02 5.248e-02 1.279e-01 5.225e-01 9.151e-01 + 8.349e-01 7.214e-01 4.414e-01 2.341e-01 1.279e-01 5.464e-02 + 3.021e-02 5.464e-02 1.279e-01 2.341e-01 4.414e-01 7.214e-01 + 1.969e-01 2.780e-01 4.414e-01 5.225e-01 3.057e-01 6.999e-02 + 6.999e-02 3.057e-01 5.225e-01 4.414e-01 2.780e-01 1.969e-01 + 1.969e-01 7.214e-01 9.151e-01 8.631e-01 3.711e-01 1.042e-01 + 3.711e-01 8.631e-01 9.151e-01 7.214e-01 1.969e-01 5.231e-02 + 8.631e-01 9.151e-01 7.214e-01 1.969e-01 5.231e-02 1.969e-01 + 7.214e-01 9.151e-01 8.631e-01 3.711e-01 1.042e-01 3.711e-01 + 9.151e-01 8.135e-01 3.553e-01 5.220e-02 5.220e-02 3.553e-01 + 8.135e-01 9.151e-01 7.660e-01 2.624e-01 2.624e-01 7.660e-01 + 7.214e-01 3.553e-01 5.705e-02 1.477e-02 5.705e-02 3.553e-01 + 7.214e-01 7.660e-01 4.227e-01 1.842e-01 4.227e-01 7.660e-01 + 1.969e-01 5.220e-02 1.477e-02 1.477e-02 5.220e-02 1.969e-01 + 3.711e-01 3.057e-01 1.279e-01 1.279e-01 3.057e-01 3.711e-01 + 5.231e-02 5.220e-02 5.705e-02 5.220e-02 5.231e-02 6.226e-02 + 6.587e-02 5.089e-02 4.361e-02 5.089e-02 6.587e-02 6.226e-02 + 1.969e-01 3.553e-01 3.553e-01 1.969e-01 6.226e-02 1.893e-02 + 1.293e-02 2.418e-02 2.418e-02 1.293e-02 1.893e-02 6.226e-02 + 7.214e-01 8.135e-01 7.214e-01 3.711e-01 6.587e-02 1.293e-02 + 1.983e-02 6.035e-02 1.983e-02 1.293e-02 6.587e-02 3.711e-01 + 9.151e-01 9.151e-01 7.660e-01 3.057e-01 5.089e-02 2.418e-02 + 6.035e-02 6.035e-02 2.418e-02 5.089e-02 3.057e-01 7.660e-01 + 8.631e-01 7.660e-01 4.227e-01 1.279e-01 4.361e-02 2.418e-02 + 1.983e-02 2.418e-02 4.361e-02 1.279e-01 4.227e-01 7.660e-01 + 3.711e-01 2.624e-01 1.842e-01 1.279e-01 5.089e-02 1.293e-02 + 1.293e-02 5.089e-02 1.279e-01 1.842e-01 2.624e-01 3.711e-01 + 1.042e-01 2.624e-01 4.227e-01 3.057e-01 6.587e-02 1.893e-02 + 6.587e-02 3.057e-01 4.227e-01 2.624e-01 1.042e-01 6.226e-02 + 3.711e-01 7.660e-01 7.660e-01 3.711e-01 6.226e-02 6.226e-02 + 3.711e-01 7.660e-01 7.660e-01 3.711e-01 6.226e-02 6.226e-02 + 5.225e-01 4.414e-01 2.780e-01 1.969e-01 1.969e-01 2.780e-01 + 4.414e-01 5.225e-01 3.057e-01 6.999e-02 6.999e-02 3.057e-01 + 4.414e-01 3.655e-01 3.553e-01 3.999e-01 3.553e-01 3.655e-01 + 4.414e-01 4.227e-01 1.940e-01 8.700e-02 1.940e-01 4.227e-01 + 2.780e-01 3.553e-01 5.423e-01 5.423e-01 3.553e-01 2.780e-01 + 2.624e-01 1.940e-01 9.824e-02 9.824e-02 1.940e-01 2.624e-01 + 1.969e-01 3.999e-01 5.423e-01 3.999e-01 1.969e-01 1.042e-01 + 6.999e-02 5.464e-02 5.248e-02 5.464e-02 6.999e-02 1.042e-01 + 1.969e-01 3.553e-01 3.553e-01 1.969e-01 6.226e-02 1.893e-02 + 1.293e-02 2.418e-02 2.418e-02 1.293e-02 1.893e-02 6.226e-02 + 2.780e-01 3.655e-01 2.780e-01 1.042e-01 1.893e-02 5.255e-03 + 1.113e-02 3.301e-02 1.113e-02 5.255e-03 1.893e-02 1.042e-01 + 4.414e-01 4.414e-01 2.624e-01 6.999e-02 1.293e-02 1.113e-02 + 4.867e-02 4.867e-02 1.113e-02 1.293e-02 6.999e-02 2.624e-01 + 5.225e-01 4.227e-01 1.940e-01 5.464e-02 2.418e-02 3.301e-02 + 4.867e-02 3.301e-02 2.418e-02 5.464e-02 1.940e-01 4.227e-01 + 3.057e-01 1.940e-01 9.824e-02 5.248e-02 2.418e-02 1.113e-02 + 1.113e-02 2.418e-02 5.248e-02 9.824e-02 1.940e-01 3.057e-01 + 6.999e-02 8.700e-02 9.824e-02 5.464e-02 1.293e-02 5.255e-03 + 1.293e-02 5.464e-02 9.824e-02 8.700e-02 6.999e-02 6.587e-02 + 6.999e-02 1.940e-01 1.940e-01 6.999e-02 1.893e-02 1.893e-02 + 6.999e-02 1.940e-01 1.940e-01 6.999e-02 1.893e-02 1.893e-02 + 3.057e-01 4.227e-01 2.624e-01 1.042e-01 6.226e-02 1.042e-01 + 2.624e-01 4.227e-01 3.057e-01 6.587e-02 1.893e-02 6.587e-02 + 2.341e-01 4.414e-01 7.214e-01 8.349e-01 7.214e-01 4.414e-01 + 2.341e-01 1.279e-01 5.464e-02 3.021e-02 5.464e-02 1.279e-01 + 4.414e-01 8.135e-01 9.580e-01 9.580e-01 8.135e-01 4.414e-01 + 1.842e-01 9.824e-02 7.331e-02 7.331e-02 9.824e-02 1.842e-01 + 7.214e-01 9.580e-01 9.878e-01 9.580e-01 7.214e-01 2.624e-01 + 8.700e-02 7.331e-02 1.101e-01 7.331e-02 8.700e-02 2.624e-01 + 8.349e-01 9.580e-01 9.580e-01 8.349e-01 3.711e-01 6.999e-02 + 3.021e-02 7.128e-02 7.128e-02 3.021e-02 6.999e-02 3.711e-01 + 7.214e-01 8.135e-01 7.214e-01 3.711e-01 6.587e-02 1.293e-02 + 1.983e-02 6.035e-02 1.983e-02 1.293e-02 6.587e-02 3.711e-01 + 4.414e-01 4.414e-01 2.624e-01 6.999e-02 1.293e-02 1.113e-02 + 4.867e-02 4.867e-02 1.113e-02 1.293e-02 6.999e-02 2.624e-01 + 2.341e-01 1.842e-01 8.700e-02 3.021e-02 1.983e-02 4.867e-02 + 9.658e-02 4.867e-02 1.983e-02 3.021e-02 8.700e-02 1.842e-01 + 1.279e-01 9.824e-02 7.331e-02 7.128e-02 6.035e-02 4.867e-02 + 4.867e-02 6.035e-02 7.128e-02 7.331e-02 9.824e-02 1.279e-01 + 5.464e-02 7.331e-02 1.101e-01 7.128e-02 1.983e-02 1.113e-02 + 1.983e-02 7.128e-02 1.101e-01 7.331e-02 5.464e-02 5.089e-02 + 3.021e-02 7.331e-02 7.331e-02 3.021e-02 1.293e-02 1.293e-02 + 3.021e-02 7.331e-02 7.331e-02 3.021e-02 1.293e-02 1.293e-02 + 5.464e-02 9.824e-02 8.700e-02 6.999e-02 6.587e-02 6.999e-02 + 8.700e-02 9.824e-02 5.464e-02 1.293e-02 5.255e-03 1.293e-02 + 1.279e-01 1.842e-01 2.624e-01 3.711e-01 3.711e-01 2.624e-01 + 1.842e-01 1.279e-01 5.089e-02 1.293e-02 1.293e-02 5.089e-02 + 5.225e-01 9.151e-01 9.857e-01 9.857e-01 9.151e-01 5.225e-01 + 1.279e-01 5.248e-02 7.128e-02 7.128e-02 5.248e-02 1.279e-01 + 9.151e-01 9.955e-01 9.996e-01 9.955e-01 9.151e-01 4.227e-01 + 9.824e-02 1.101e-01 4.486e-01 1.101e-01 9.824e-02 4.227e-01 + 9.857e-01 9.996e-01 9.996e-01 9.857e-01 7.660e-01 1.940e-01 + 7.331e-02 4.486e-01 4.486e-01 7.331e-02 1.940e-01 7.660e-01 + 9.857e-01 9.955e-01 9.857e-01 8.631e-01 3.057e-01 5.464e-02 + 7.128e-02 3.826e-01 7.128e-02 5.464e-02 3.057e-01 8.631e-01 + 9.151e-01 9.151e-01 7.660e-01 3.057e-01 5.089e-02 2.418e-02 + 6.035e-02 6.035e-02 2.418e-02 5.089e-02 3.057e-01 7.660e-01 + 5.225e-01 4.227e-01 1.940e-01 5.464e-02 2.418e-02 3.301e-02 + 4.867e-02 3.301e-02 2.418e-02 5.464e-02 1.940e-01 4.227e-01 + 1.279e-01 9.824e-02 7.331e-02 7.128e-02 6.035e-02 4.867e-02 + 4.867e-02 6.035e-02 7.128e-02 7.331e-02 9.824e-02 1.279e-01 + 5.248e-02 1.101e-01 4.486e-01 3.826e-01 6.035e-02 3.301e-02 + 6.035e-02 3.826e-01 4.486e-01 1.101e-01 5.248e-02 4.361e-02 + 7.128e-02 4.486e-01 4.486e-01 7.128e-02 2.418e-02 2.418e-02 + 7.128e-02 4.486e-01 4.486e-01 7.128e-02 2.418e-02 2.418e-02 + 7.128e-02 1.101e-01 7.331e-02 5.464e-02 5.089e-02 5.464e-02 + 7.331e-02 1.101e-01 7.128e-02 1.983e-02 1.113e-02 1.983e-02 + 5.248e-02 9.824e-02 1.940e-01 3.057e-01 3.057e-01 1.940e-01 + 9.824e-02 5.248e-02 2.418e-02 1.113e-02 1.113e-02 2.418e-02 + 1.279e-01 4.227e-01 7.660e-01 8.631e-01 7.660e-01 4.227e-01 + 1.279e-01 4.361e-02 2.418e-02 1.983e-02 2.418e-02 4.361e-02 + 8.631e-01 9.857e-01 9.955e-01 9.857e-01 8.631e-01 3.057e-01 + 5.464e-02 7.128e-02 3.826e-01 7.128e-02 5.464e-02 3.057e-01 + 9.857e-01 9.996e-01 9.996e-01 9.857e-01 7.660e-01 1.940e-01 + 7.331e-02 4.486e-01 4.486e-01 7.331e-02 1.940e-01 7.660e-01 + 9.955e-01 9.996e-01 9.955e-01 9.151e-01 4.227e-01 9.824e-02 + 1.101e-01 4.486e-01 1.101e-01 9.824e-02 4.227e-01 9.151e-01 + 9.857e-01 9.857e-01 9.151e-01 5.225e-01 1.279e-01 5.248e-02 + 7.128e-02 7.128e-02 5.248e-02 1.279e-01 5.225e-01 9.151e-01 + 8.631e-01 7.660e-01 4.227e-01 1.279e-01 4.361e-02 2.418e-02 + 1.983e-02 2.418e-02 4.361e-02 1.279e-01 4.227e-01 7.660e-01 + 3.057e-01 1.940e-01 9.824e-02 5.248e-02 2.418e-02 1.113e-02 + 1.113e-02 2.418e-02 5.248e-02 9.824e-02 1.940e-01 3.057e-01 + 5.464e-02 7.331e-02 1.101e-01 7.128e-02 1.983e-02 1.113e-02 + 1.983e-02 7.128e-02 1.101e-01 7.331e-02 5.464e-02 5.089e-02 + 7.128e-02 4.486e-01 4.486e-01 7.128e-02 2.418e-02 2.418e-02 + 7.128e-02 4.486e-01 4.486e-01 7.128e-02 2.418e-02 2.418e-02 + 3.826e-01 4.486e-01 1.101e-01 5.248e-02 4.361e-02 5.248e-02 + 1.101e-01 4.486e-01 3.826e-01 6.035e-02 3.301e-02 6.035e-02 + 7.128e-02 7.331e-02 9.824e-02 1.279e-01 1.279e-01 9.824e-02 + 7.331e-02 7.128e-02 6.035e-02 4.867e-02 4.867e-02 6.035e-02 + 5.464e-02 1.940e-01 4.227e-01 5.225e-01 4.227e-01 1.940e-01 + 5.464e-02 2.418e-02 3.301e-02 4.867e-02 3.301e-02 2.418e-02 + 3.057e-01 7.660e-01 9.151e-01 9.151e-01 7.660e-01 3.057e-01 + 5.089e-02 2.418e-02 6.035e-02 6.035e-02 2.418e-02 5.089e-02 + 8.349e-01 9.580e-01 9.580e-01 8.349e-01 3.711e-01 6.999e-02 + 3.021e-02 7.128e-02 7.128e-02 3.021e-02 6.999e-02 3.711e-01 + 9.580e-01 9.878e-01 9.580e-01 7.214e-01 2.624e-01 8.700e-02 + 7.331e-02 1.101e-01 7.331e-02 8.700e-02 2.624e-01 7.214e-01 + 9.580e-01 9.580e-01 8.135e-01 4.414e-01 1.842e-01 9.824e-02 + 7.331e-02 7.331e-02 9.824e-02 1.842e-01 4.414e-01 8.135e-01 + 8.349e-01 7.214e-01 4.414e-01 2.341e-01 1.279e-01 5.464e-02 + 3.021e-02 5.464e-02 1.279e-01 2.341e-01 4.414e-01 7.214e-01 + 3.711e-01 2.624e-01 1.842e-01 1.279e-01 5.089e-02 1.293e-02 + 1.293e-02 5.089e-02 1.279e-01 1.842e-01 2.624e-01 3.711e-01 + 6.999e-02 8.700e-02 9.824e-02 5.464e-02 1.293e-02 5.255e-03 + 1.293e-02 5.464e-02 9.824e-02 8.700e-02 6.999e-02 6.587e-02 + 3.021e-02 7.331e-02 7.331e-02 3.021e-02 1.293e-02 1.293e-02 + 3.021e-02 7.331e-02 7.331e-02 3.021e-02 1.293e-02 1.293e-02 + 7.128e-02 1.101e-01 7.331e-02 5.464e-02 5.089e-02 5.464e-02 + 7.331e-02 1.101e-01 7.128e-02 1.983e-02 1.113e-02 1.983e-02 + 7.128e-02 7.331e-02 9.824e-02 1.279e-01 1.279e-01 9.824e-02 + 7.331e-02 7.128e-02 6.035e-02 4.867e-02 4.867e-02 6.035e-02 + 3.021e-02 8.700e-02 1.842e-01 2.341e-01 1.842e-01 8.700e-02 + 3.021e-02 1.983e-02 4.867e-02 9.658e-02 4.867e-02 1.983e-02 + 6.999e-02 2.624e-01 4.414e-01 4.414e-01 2.624e-01 6.999e-02 + 1.293e-02 1.113e-02 4.867e-02 4.867e-02 1.113e-02 1.293e-02 + 3.711e-01 7.214e-01 8.135e-01 7.214e-01 3.711e-01 6.587e-02 + 1.293e-02 1.983e-02 6.035e-02 1.983e-02 1.293e-02 6.587e-02 + 3.999e-01 5.423e-01 3.999e-01 1.969e-01 1.042e-01 6.999e-02 + 5.464e-02 5.248e-02 5.464e-02 6.999e-02 1.042e-01 1.969e-01 + 5.423e-01 5.423e-01 3.553e-01 2.780e-01 2.624e-01 1.940e-01 + 9.824e-02 9.824e-02 1.940e-01 2.624e-01 2.780e-01 3.553e-01 + 3.999e-01 3.553e-01 3.655e-01 4.414e-01 4.227e-01 1.940e-01 + 8.700e-02 1.940e-01 4.227e-01 4.414e-01 3.655e-01 3.553e-01 + 1.969e-01 2.780e-01 4.414e-01 5.225e-01 3.057e-01 6.999e-02 + 6.999e-02 3.057e-01 5.225e-01 4.414e-01 2.780e-01 1.969e-01 + 1.042e-01 2.624e-01 4.227e-01 3.057e-01 6.587e-02 1.893e-02 + 6.587e-02 3.057e-01 4.227e-01 2.624e-01 1.042e-01 6.226e-02 + 6.999e-02 1.940e-01 1.940e-01 6.999e-02 1.893e-02 1.893e-02 + 6.999e-02 1.940e-01 1.940e-01 6.999e-02 1.893e-02 1.893e-02 + 5.464e-02 9.824e-02 8.700e-02 6.999e-02 6.587e-02 6.999e-02 + 8.700e-02 9.824e-02 5.464e-02 1.293e-02 5.255e-03 1.293e-02 + 5.248e-02 9.824e-02 1.940e-01 3.057e-01 3.057e-01 1.940e-01 + 9.824e-02 5.248e-02 2.418e-02 1.113e-02 1.113e-02 2.418e-02 + 5.464e-02 1.940e-01 4.227e-01 5.225e-01 4.227e-01 1.940e-01 + 5.464e-02 2.418e-02 3.301e-02 4.867e-02 3.301e-02 2.418e-02 + 6.999e-02 2.624e-01 4.414e-01 4.414e-01 2.624e-01 6.999e-02 + 1.293e-02 1.113e-02 4.867e-02 4.867e-02 1.113e-02 1.293e-02 + 1.042e-01 2.780e-01 3.655e-01 2.780e-01 1.042e-01 1.893e-02 + 5.255e-03 1.113e-02 3.301e-02 1.113e-02 5.255e-03 1.893e-02 + 1.969e-01 3.553e-01 3.553e-01 1.969e-01 6.226e-02 1.893e-02 + 1.293e-02 2.418e-02 2.418e-02 1.293e-02 1.893e-02 6.226e-02 + 1.477e-02 1.477e-02 5.220e-02 1.969e-01 3.711e-01 3.057e-01 + 1.279e-01 1.279e-01 3.057e-01 3.711e-01 1.969e-01 5.220e-02 + 1.477e-02 5.705e-02 3.553e-01 7.214e-01 7.660e-01 4.227e-01 + 1.842e-01 4.227e-01 7.660e-01 7.214e-01 3.553e-01 5.705e-02 + 5.220e-02 3.553e-01 8.135e-01 9.151e-01 7.660e-01 2.624e-01 + 2.624e-01 7.660e-01 9.151e-01 8.135e-01 3.553e-01 5.220e-02 + 1.969e-01 7.214e-01 9.151e-01 8.631e-01 3.711e-01 1.042e-01 + 3.711e-01 8.631e-01 9.151e-01 7.214e-01 1.969e-01 5.231e-02 + 3.711e-01 7.660e-01 7.660e-01 3.711e-01 6.226e-02 6.226e-02 + 3.711e-01 7.660e-01 7.660e-01 3.711e-01 6.226e-02 6.226e-02 + 3.057e-01 4.227e-01 2.624e-01 1.042e-01 6.226e-02 1.042e-01 + 2.624e-01 4.227e-01 3.057e-01 6.587e-02 1.893e-02 6.587e-02 + 1.279e-01 1.842e-01 2.624e-01 3.711e-01 3.711e-01 2.624e-01 + 1.842e-01 1.279e-01 5.089e-02 1.293e-02 1.293e-02 5.089e-02 + 1.279e-01 4.227e-01 7.660e-01 8.631e-01 7.660e-01 4.227e-01 + 1.279e-01 4.361e-02 2.418e-02 1.983e-02 2.418e-02 4.361e-02 + 3.057e-01 7.660e-01 9.151e-01 9.151e-01 7.660e-01 3.057e-01 + 5.089e-02 2.418e-02 6.035e-02 6.035e-02 2.418e-02 5.089e-02 + 3.711e-01 7.214e-01 8.135e-01 7.214e-01 3.711e-01 6.587e-02 + 1.293e-02 1.983e-02 6.035e-02 1.983e-02 1.293e-02 6.587e-02 + 1.969e-01 3.553e-01 3.553e-01 1.969e-01 6.226e-02 1.893e-02 + 1.293e-02 2.418e-02 2.418e-02 1.293e-02 1.893e-02 6.226e-02 + 5.220e-02 5.705e-02 5.220e-02 5.231e-02 6.226e-02 6.587e-02 + 5.089e-02 4.361e-02 5.089e-02 6.587e-02 6.226e-02 5.231e-02 diff --git a/tests/integrate/119_PW_out_elf/result.ref b/tests/integrate/119_PW_out_elf/result.ref new file mode 100644 index 0000000000..83d024030f --- /dev/null +++ b/tests/integrate/119_PW_out_elf/result.ref @@ -0,0 +1,7 @@ +etotref -194.6234112615314 +etotperatomref -97.3117056308 +ComparePot1_pass 0 +pointgroupref T_d +spacegroupref O_h +nksibzref 1 +totaltimeref 0.25 diff --git a/tests/integrate/219_NO_out_elf/INPUT b/tests/integrate/219_NO_out_elf/INPUT new file mode 100644 index 0000000000..6d9116e9a4 --- /dev/null +++ b/tests/integrate/219_NO_out_elf/INPUT @@ -0,0 +1,27 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix autotest +calculation scf + +nbands 6 +symmetry 1 +pseudo_dir ../../PP_ORB +orbital_dir ../../PP_ORB +out_elf 1 + +#Parameters (2.Iteration) +ecutwfc 5 +scf_thr 1e-6 +scf_nmax 100 + + +#Parameters (3.Basis) +basis_type lcao + +#Parameters (4.Smearing) +smearing_method gauss +smearing_sigma 0.002 + +#Parameters (5.Mixing) +mixing_type broyden +mixing_beta 0.3 diff --git a/tests/integrate/219_NO_out_elf/KPT b/tests/integrate/219_NO_out_elf/KPT new file mode 100644 index 0000000000..c289c0158a --- /dev/null +++ b/tests/integrate/219_NO_out_elf/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/integrate/219_NO_out_elf/STRU b/tests/integrate/219_NO_out_elf/STRU new file mode 100644 index 0000000000..37d6597727 --- /dev/null +++ b/tests/integrate/219_NO_out_elf/STRU @@ -0,0 +1,22 @@ +ATOMIC_SPECIES +Si 14 Si_ONCV_PBE-1.0.upf upf201 + +NUMERICAL_ORBITAL +Si_gga_8au_60Ry_2s2p1d.orb + +LATTICE_CONSTANT +10.2 // add lattice constant + +LATTICE_VECTORS +0.5 0.5 0.0 +0.5 0.0 0.5 +0.0 0.5 0.5 + +ATOMIC_POSITIONS +Direct + +Si // Element type +0.0 // magnetism +2 +0.00 0.00 0.00 1 1 1 +0.25 0.25 0.25 1 1 1 diff --git a/tests/integrate/219_NO_out_elf/jd b/tests/integrate/219_NO_out_elf/jd new file mode 100644 index 0000000000..1a48d127fe --- /dev/null +++ b/tests/integrate/219_NO_out_elf/jd @@ -0,0 +1 @@ +test out_elf with LCAO basis, symmetry=on diff --git a/tests/integrate/219_NO_out_elf/refELF.cube b/tests/integrate/219_NO_out_elf/refELF.cube new file mode 100644 index 0000000000..6224358b65 --- /dev/null +++ b/tests/integrate/219_NO_out_elf/refELF.cube @@ -0,0 +1,296 @@ +STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +1 (nspin) +2 0.0 0.0 0.0 +12 0.425000 0.425000 0.000000 +12 0.425000 0.000000 0.425000 +12 0.000000 0.425000 0.425000 + 14 4.000000 0.000000 0.000000 0.000000 + 14 4.000000 2.550000 2.550000 2.550000 + 8.615e-08 1.569e-02 5.651e-01 9.171e-01 8.578e-01 5.075e-01 + 1.971e-01 5.075e-01 8.578e-01 9.171e-01 5.651e-01 1.569e-02 + 1.569e-02 8.013e-01 9.904e-01 9.851e-01 9.062e-01 4.158e-01 + 4.158e-01 9.062e-01 9.851e-01 9.904e-01 8.013e-01 1.569e-02 + 5.651e-01 9.904e-01 9.950e-01 9.851e-01 7.810e-01 2.180e-01 + 7.810e-01 9.851e-01 9.950e-01 9.904e-01 5.651e-01 2.953e-02 + 9.171e-01 9.851e-01 9.851e-01 9.171e-01 1.676e-01 1.676e-01 + 9.171e-01 9.851e-01 9.851e-01 9.171e-01 1.676e-01 1.676e-01 + 8.578e-01 9.062e-01 7.810e-01 1.676e-01 2.299e-02 1.676e-01 + 7.810e-01 9.062e-01 8.578e-01 4.400e-01 9.647e-02 4.400e-01 + 5.075e-01 4.158e-01 2.180e-01 1.676e-01 1.676e-01 2.180e-01 + 4.158e-01 5.075e-01 3.249e-01 9.283e-02 9.283e-02 3.249e-01 + 1.971e-01 4.158e-01 7.810e-01 9.171e-01 7.810e-01 4.158e-01 + 1.971e-01 7.344e-02 3.301e-02 2.092e-02 3.301e-02 7.344e-02 + 5.075e-01 9.062e-01 9.851e-01 9.851e-01 9.062e-01 5.075e-01 + 7.344e-02 1.720e-02 3.073e-02 3.073e-02 1.720e-02 7.344e-02 + 8.578e-01 9.851e-01 9.950e-01 9.851e-01 8.578e-01 3.249e-01 + 3.301e-02 3.073e-02 2.156e-02 3.073e-02 3.301e-02 3.249e-01 + 9.171e-01 9.904e-01 9.904e-01 9.171e-01 4.400e-01 9.283e-02 + 2.092e-02 3.073e-02 3.073e-02 2.092e-02 9.283e-02 4.400e-01 + 5.651e-01 8.013e-01 5.651e-01 1.676e-01 9.647e-02 9.283e-02 + 3.301e-02 1.720e-02 3.301e-02 9.283e-02 9.647e-02 1.676e-01 + 1.569e-02 1.569e-02 2.953e-02 1.676e-01 4.400e-01 3.249e-01 + 7.344e-02 7.344e-02 3.249e-01 4.400e-01 1.676e-01 2.953e-02 + 1.569e-02 8.013e-01 9.904e-01 9.851e-01 9.062e-01 4.158e-01 + 4.158e-01 9.062e-01 9.851e-01 9.904e-01 8.013e-01 1.569e-02 + 8.013e-01 9.994e-01 9.992e-01 9.950e-01 8.668e-01 3.073e-01 + 8.668e-01 9.950e-01 9.992e-01 9.994e-01 8.013e-01 5.039e-02 + 9.904e-01 9.992e-01 9.992e-01 9.904e-01 3.749e-01 3.749e-01 + 9.904e-01 9.992e-01 9.992e-01 9.904e-01 3.749e-01 3.749e-01 + 9.851e-01 9.950e-01 9.904e-01 5.651e-01 2.953e-02 5.651e-01 + 9.904e-01 9.950e-01 9.851e-01 7.810e-01 2.180e-01 7.810e-01 + 9.062e-01 8.668e-01 3.749e-01 2.953e-02 2.953e-02 3.749e-01 + 8.668e-01 9.062e-01 7.469e-01 2.401e-01 2.401e-01 7.469e-01 + 4.158e-01 3.073e-01 3.749e-01 5.651e-01 3.749e-01 3.073e-01 + 4.158e-01 3.862e-01 1.660e-01 6.436e-02 1.660e-01 3.862e-01 + 4.158e-01 8.668e-01 9.904e-01 9.904e-01 8.668e-01 4.158e-01 + 1.367e-01 5.357e-02 5.197e-02 5.197e-02 5.357e-02 1.367e-01 + 9.062e-01 9.950e-01 9.992e-01 9.950e-01 9.062e-01 3.862e-01 + 5.357e-02 7.662e-02 4.157e-01 7.662e-02 5.357e-02 3.862e-01 + 9.851e-01 9.992e-01 9.992e-01 9.851e-01 7.469e-01 1.660e-01 + 5.197e-02 4.157e-01 4.157e-01 5.197e-02 1.660e-01 7.469e-01 + 9.904e-01 9.994e-01 9.904e-01 7.810e-01 2.401e-01 6.436e-02 + 5.197e-02 7.662e-02 5.197e-02 6.436e-02 2.401e-01 7.810e-01 + 8.013e-01 8.013e-01 3.749e-01 2.180e-01 2.401e-01 1.660e-01 + 5.357e-02 5.357e-02 1.660e-01 2.401e-01 2.180e-01 3.749e-01 + 1.569e-02 5.039e-02 3.749e-01 7.810e-01 7.469e-01 3.862e-01 + 1.367e-01 3.862e-01 7.469e-01 7.810e-01 3.749e-01 5.039e-02 + 5.651e-01 9.904e-01 9.950e-01 9.851e-01 7.810e-01 2.180e-01 + 7.810e-01 9.851e-01 9.950e-01 9.904e-01 5.651e-01 2.953e-02 + 9.904e-01 9.992e-01 9.992e-01 9.904e-01 3.749e-01 3.749e-01 + 9.904e-01 9.992e-01 9.992e-01 9.904e-01 3.749e-01 3.749e-01 + 9.950e-01 9.992e-01 9.994e-01 8.013e-01 5.039e-02 8.013e-01 + 9.994e-01 9.992e-01 9.950e-01 8.668e-01 3.073e-01 8.668e-01 + 9.851e-01 9.904e-01 8.013e-01 1.569e-02 1.569e-02 8.013e-01 + 9.904e-01 9.851e-01 9.062e-01 4.158e-01 4.158e-01 9.062e-01 + 7.810e-01 3.749e-01 5.039e-02 1.569e-02 5.039e-02 3.749e-01 + 7.810e-01 7.469e-01 3.862e-01 1.367e-01 3.862e-01 7.469e-01 + 2.180e-01 3.749e-01 8.013e-01 8.013e-01 3.749e-01 2.180e-01 + 2.401e-01 1.660e-01 5.357e-02 5.357e-02 1.660e-01 2.401e-01 + 7.810e-01 9.904e-01 9.994e-01 9.904e-01 7.810e-01 2.401e-01 + 6.436e-02 5.197e-02 7.662e-02 5.197e-02 6.436e-02 2.401e-01 + 9.851e-01 9.992e-01 9.992e-01 9.851e-01 7.469e-01 1.660e-01 + 5.197e-02 4.157e-01 4.157e-01 5.197e-02 1.660e-01 7.469e-01 + 9.950e-01 9.992e-01 9.950e-01 9.062e-01 3.862e-01 5.357e-02 + 7.662e-02 4.157e-01 7.662e-02 5.357e-02 3.862e-01 9.062e-01 + 9.904e-01 9.904e-01 8.668e-01 4.158e-01 1.367e-01 5.357e-02 + 5.197e-02 5.197e-02 5.357e-02 1.367e-01 4.158e-01 8.668e-01 + 5.651e-01 3.749e-01 3.073e-01 4.158e-01 3.862e-01 1.660e-01 + 6.436e-02 1.660e-01 3.862e-01 4.158e-01 3.073e-01 3.749e-01 + 2.953e-02 3.749e-01 8.668e-01 9.062e-01 7.469e-01 2.401e-01 + 2.401e-01 7.469e-01 9.062e-01 8.668e-01 3.749e-01 2.953e-02 + 9.171e-01 9.851e-01 9.851e-01 9.171e-01 1.676e-01 1.676e-01 + 9.171e-01 9.851e-01 9.851e-01 9.171e-01 1.676e-01 1.676e-01 + 9.851e-01 9.950e-01 9.904e-01 5.651e-01 2.953e-02 5.651e-01 + 9.904e-01 9.950e-01 9.851e-01 7.810e-01 2.180e-01 7.810e-01 + 9.851e-01 9.904e-01 8.013e-01 1.569e-02 1.569e-02 8.013e-01 + 9.904e-01 9.851e-01 9.062e-01 4.158e-01 4.158e-01 9.062e-01 + 9.171e-01 5.651e-01 1.569e-02 8.615e-08 1.569e-02 5.651e-01 + 9.171e-01 8.578e-01 5.075e-01 1.971e-01 5.075e-01 8.578e-01 + 1.676e-01 2.953e-02 1.569e-02 1.569e-02 2.953e-02 1.676e-01 + 4.400e-01 3.249e-01 7.344e-02 7.344e-02 3.249e-01 4.400e-01 + 1.676e-01 5.651e-01 8.013e-01 5.651e-01 1.676e-01 9.647e-02 + 9.283e-02 3.301e-02 1.720e-02 3.301e-02 9.283e-02 9.647e-02 + 9.171e-01 9.904e-01 9.904e-01 9.171e-01 4.400e-01 9.283e-02 + 2.092e-02 3.073e-02 3.073e-02 2.092e-02 9.283e-02 4.400e-01 + 9.851e-01 9.950e-01 9.851e-01 8.578e-01 3.249e-01 3.301e-02 + 3.073e-02 2.156e-02 3.073e-02 3.301e-02 3.249e-01 8.578e-01 + 9.851e-01 9.851e-01 9.062e-01 5.075e-01 7.344e-02 1.720e-02 + 3.073e-02 3.073e-02 1.720e-02 7.344e-02 5.075e-01 9.062e-01 + 9.171e-01 7.810e-01 4.158e-01 1.971e-01 7.344e-02 3.301e-02 + 2.092e-02 3.301e-02 7.344e-02 1.971e-01 4.158e-01 7.810e-01 + 1.676e-01 2.180e-01 4.158e-01 5.075e-01 3.249e-01 9.283e-02 + 9.283e-02 3.249e-01 5.075e-01 4.158e-01 2.180e-01 1.676e-01 + 1.676e-01 7.810e-01 9.062e-01 8.578e-01 4.400e-01 9.647e-02 + 4.400e-01 8.578e-01 9.062e-01 7.810e-01 1.676e-01 2.299e-02 + 8.578e-01 9.062e-01 7.810e-01 1.676e-01 2.299e-02 1.676e-01 + 7.810e-01 9.062e-01 8.578e-01 4.400e-01 9.647e-02 4.400e-01 + 9.062e-01 8.668e-01 3.749e-01 2.953e-02 2.953e-02 3.749e-01 + 8.668e-01 9.062e-01 7.469e-01 2.401e-01 2.401e-01 7.469e-01 + 7.810e-01 3.749e-01 5.039e-02 1.569e-02 5.039e-02 3.749e-01 + 7.810e-01 7.469e-01 3.862e-01 1.367e-01 3.862e-01 7.469e-01 + 1.676e-01 2.953e-02 1.569e-02 1.569e-02 2.953e-02 1.676e-01 + 4.400e-01 3.249e-01 7.344e-02 7.344e-02 3.249e-01 4.400e-01 + 2.299e-02 2.953e-02 5.039e-02 2.953e-02 2.299e-02 6.631e-02 + 1.298e-01 3.236e-02 1.488e-02 3.236e-02 1.298e-01 6.631e-02 + 1.676e-01 3.749e-01 3.749e-01 1.676e-01 6.631e-02 4.807e-02 + 1.143e-02 3.344e-02 3.344e-02 1.143e-02 4.807e-02 6.631e-02 + 7.810e-01 8.668e-01 7.810e-01 4.400e-01 1.298e-01 1.143e-02 + 1.031e-02 1.406e-01 1.031e-02 1.143e-02 1.298e-01 4.400e-01 + 9.062e-01 9.062e-01 7.469e-01 3.249e-01 3.236e-02 3.344e-02 + 1.406e-01 1.406e-01 3.344e-02 3.236e-02 3.249e-01 7.469e-01 + 8.578e-01 7.469e-01 3.862e-01 7.344e-02 1.488e-02 3.344e-02 + 1.031e-02 3.344e-02 1.488e-02 7.344e-02 3.862e-01 7.469e-01 + 4.400e-01 2.401e-01 1.367e-01 7.344e-02 3.236e-02 1.143e-02 + 1.143e-02 3.236e-02 7.344e-02 1.367e-01 2.401e-01 4.400e-01 + 9.647e-02 2.401e-01 3.862e-01 3.249e-01 1.298e-01 4.807e-02 + 1.298e-01 3.249e-01 3.862e-01 2.401e-01 9.647e-02 6.631e-02 + 4.400e-01 7.469e-01 7.469e-01 4.400e-01 6.631e-02 6.631e-02 + 4.400e-01 7.469e-01 7.469e-01 4.400e-01 6.631e-02 6.631e-02 + 5.075e-01 4.158e-01 2.180e-01 1.676e-01 1.676e-01 2.180e-01 + 4.158e-01 5.075e-01 3.249e-01 9.283e-02 9.283e-02 3.249e-01 + 4.158e-01 3.073e-01 3.749e-01 5.651e-01 3.749e-01 3.073e-01 + 4.158e-01 3.862e-01 1.660e-01 6.436e-02 1.660e-01 3.862e-01 + 2.180e-01 3.749e-01 8.013e-01 8.013e-01 3.749e-01 2.180e-01 + 2.401e-01 1.660e-01 5.357e-02 5.357e-02 1.660e-01 2.401e-01 + 1.676e-01 5.651e-01 8.013e-01 5.651e-01 1.676e-01 9.647e-02 + 9.283e-02 3.301e-02 1.720e-02 3.301e-02 9.283e-02 9.647e-02 + 1.676e-01 3.749e-01 3.749e-01 1.676e-01 6.631e-02 4.807e-02 + 1.143e-02 3.344e-02 3.344e-02 1.143e-02 4.807e-02 6.631e-02 + 2.180e-01 3.073e-01 2.180e-01 9.647e-02 4.807e-02 4.638e-03 + 6.778e-03 5.676e-02 6.778e-03 4.638e-03 4.807e-02 9.647e-02 + 4.158e-01 4.158e-01 2.401e-01 9.283e-02 1.143e-02 6.778e-03 + 6.601e-02 6.601e-02 6.778e-03 1.143e-02 9.283e-02 2.401e-01 + 5.075e-01 3.862e-01 1.660e-01 3.301e-02 3.344e-02 5.676e-02 + 6.601e-02 5.676e-02 3.344e-02 3.301e-02 1.660e-01 3.862e-01 + 3.249e-01 1.660e-01 5.357e-02 1.720e-02 3.344e-02 6.778e-03 + 6.778e-03 3.344e-02 1.720e-02 5.357e-02 1.660e-01 3.249e-01 + 9.283e-02 6.436e-02 5.357e-02 3.301e-02 1.143e-02 4.638e-03 + 1.143e-02 3.301e-02 5.357e-02 6.436e-02 9.283e-02 1.298e-01 + 9.283e-02 1.660e-01 1.660e-01 9.283e-02 4.807e-02 4.807e-02 + 9.283e-02 1.660e-01 1.660e-01 9.283e-02 4.807e-02 4.807e-02 + 3.249e-01 3.862e-01 2.401e-01 9.647e-02 6.631e-02 9.647e-02 + 2.401e-01 3.862e-01 3.249e-01 1.298e-01 4.807e-02 1.298e-01 + 1.971e-01 4.158e-01 7.810e-01 9.171e-01 7.810e-01 4.158e-01 + 1.971e-01 7.344e-02 3.301e-02 2.092e-02 3.301e-02 7.344e-02 + 4.158e-01 8.668e-01 9.904e-01 9.904e-01 8.668e-01 4.158e-01 + 1.367e-01 5.357e-02 5.197e-02 5.197e-02 5.357e-02 1.367e-01 + 7.810e-01 9.904e-01 9.994e-01 9.904e-01 7.810e-01 2.401e-01 + 6.436e-02 5.197e-02 7.662e-02 5.197e-02 6.436e-02 2.401e-01 + 9.171e-01 9.904e-01 9.904e-01 9.171e-01 4.400e-01 9.283e-02 + 2.092e-02 3.073e-02 3.073e-02 2.092e-02 9.283e-02 4.400e-01 + 7.810e-01 8.668e-01 7.810e-01 4.400e-01 1.298e-01 1.143e-02 + 1.031e-02 1.406e-01 1.031e-02 1.143e-02 1.298e-01 4.400e-01 + 4.158e-01 4.158e-01 2.401e-01 9.283e-02 1.143e-02 6.778e-03 + 6.601e-02 6.601e-02 6.778e-03 1.143e-02 9.283e-02 2.401e-01 + 1.971e-01 1.367e-01 6.436e-02 2.092e-02 1.031e-02 6.601e-02 + 8.923e-05 6.601e-02 1.031e-02 2.092e-02 6.436e-02 1.367e-01 + 7.344e-02 5.357e-02 5.197e-02 3.073e-02 1.406e-01 6.601e-02 + 6.601e-02 1.406e-01 3.073e-02 5.197e-02 5.357e-02 7.344e-02 + 3.301e-02 5.197e-02 7.662e-02 3.073e-02 1.031e-02 6.778e-03 + 1.031e-02 3.073e-02 7.662e-02 5.197e-02 3.301e-02 3.236e-02 + 2.092e-02 5.197e-02 5.197e-02 2.092e-02 1.143e-02 1.143e-02 + 2.092e-02 5.197e-02 5.197e-02 2.092e-02 1.143e-02 1.143e-02 + 3.301e-02 5.357e-02 6.436e-02 9.283e-02 1.298e-01 9.283e-02 + 6.436e-02 5.357e-02 3.301e-02 1.143e-02 4.638e-03 1.143e-02 + 7.344e-02 1.367e-01 2.401e-01 4.400e-01 4.400e-01 2.401e-01 + 1.367e-01 7.344e-02 3.236e-02 1.143e-02 1.143e-02 3.236e-02 + 5.075e-01 9.062e-01 9.851e-01 9.851e-01 9.062e-01 5.075e-01 + 7.344e-02 1.720e-02 3.073e-02 3.073e-02 1.720e-02 7.344e-02 + 9.062e-01 9.950e-01 9.992e-01 9.950e-01 9.062e-01 3.862e-01 + 5.357e-02 7.662e-02 4.157e-01 7.662e-02 5.357e-02 3.862e-01 + 9.851e-01 9.992e-01 9.992e-01 9.851e-01 7.469e-01 1.660e-01 + 5.197e-02 4.157e-01 4.157e-01 5.197e-02 1.660e-01 7.469e-01 + 9.851e-01 9.950e-01 9.851e-01 8.578e-01 3.249e-01 3.301e-02 + 3.073e-02 2.156e-02 3.073e-02 3.301e-02 3.249e-01 8.578e-01 + 9.062e-01 9.062e-01 7.469e-01 3.249e-01 3.236e-02 3.344e-02 + 1.406e-01 1.406e-01 3.344e-02 3.236e-02 3.249e-01 7.469e-01 + 5.075e-01 3.862e-01 1.660e-01 3.301e-02 3.344e-02 5.676e-02 + 6.601e-02 5.676e-02 3.344e-02 3.301e-02 1.660e-01 3.862e-01 + 7.344e-02 5.357e-02 5.197e-02 3.073e-02 1.406e-01 6.601e-02 + 6.601e-02 1.406e-01 3.073e-02 5.197e-02 5.357e-02 7.344e-02 + 1.720e-02 7.662e-02 4.157e-01 2.156e-02 1.406e-01 5.676e-02 + 1.406e-01 2.156e-02 4.157e-01 7.662e-02 1.720e-02 1.488e-02 + 3.073e-02 4.157e-01 4.157e-01 3.073e-02 3.344e-02 3.344e-02 + 3.073e-02 4.157e-01 4.157e-01 3.073e-02 3.344e-02 3.344e-02 + 3.073e-02 7.662e-02 5.197e-02 3.301e-02 3.236e-02 3.301e-02 + 5.197e-02 7.662e-02 3.073e-02 1.031e-02 6.778e-03 1.031e-02 + 1.720e-02 5.357e-02 1.660e-01 3.249e-01 3.249e-01 1.660e-01 + 5.357e-02 1.720e-02 3.344e-02 6.778e-03 6.778e-03 3.344e-02 + 7.344e-02 3.862e-01 7.469e-01 8.578e-01 7.469e-01 3.862e-01 + 7.344e-02 1.488e-02 3.344e-02 1.031e-02 3.344e-02 1.488e-02 + 8.578e-01 9.851e-01 9.950e-01 9.851e-01 8.578e-01 3.249e-01 + 3.301e-02 3.073e-02 2.156e-02 3.073e-02 3.301e-02 3.249e-01 + 9.851e-01 9.992e-01 9.992e-01 9.851e-01 7.469e-01 1.660e-01 + 5.197e-02 4.157e-01 4.157e-01 5.197e-02 1.660e-01 7.469e-01 + 9.950e-01 9.992e-01 9.950e-01 9.062e-01 3.862e-01 5.357e-02 + 7.662e-02 4.157e-01 7.662e-02 5.357e-02 3.862e-01 9.062e-01 + 9.851e-01 9.851e-01 9.062e-01 5.075e-01 7.344e-02 1.720e-02 + 3.073e-02 3.073e-02 1.720e-02 7.344e-02 5.075e-01 9.062e-01 + 8.578e-01 7.469e-01 3.862e-01 7.344e-02 1.488e-02 3.344e-02 + 1.031e-02 3.344e-02 1.488e-02 7.344e-02 3.862e-01 7.469e-01 + 3.249e-01 1.660e-01 5.357e-02 1.720e-02 3.344e-02 6.778e-03 + 6.778e-03 3.344e-02 1.720e-02 5.357e-02 1.660e-01 3.249e-01 + 3.301e-02 5.197e-02 7.662e-02 3.073e-02 1.031e-02 6.778e-03 + 1.031e-02 3.073e-02 7.662e-02 5.197e-02 3.301e-02 3.236e-02 + 3.073e-02 4.157e-01 4.157e-01 3.073e-02 3.344e-02 3.344e-02 + 3.073e-02 4.157e-01 4.157e-01 3.073e-02 3.344e-02 3.344e-02 + 2.156e-02 4.157e-01 7.662e-02 1.720e-02 1.488e-02 1.720e-02 + 7.662e-02 4.157e-01 2.156e-02 1.406e-01 5.676e-02 1.406e-01 + 3.073e-02 5.197e-02 5.357e-02 7.344e-02 7.344e-02 5.357e-02 + 5.197e-02 3.073e-02 1.406e-01 6.601e-02 6.601e-02 1.406e-01 + 3.301e-02 1.660e-01 3.862e-01 5.075e-01 3.862e-01 1.660e-01 + 3.301e-02 3.344e-02 5.676e-02 6.601e-02 5.676e-02 3.344e-02 + 3.249e-01 7.469e-01 9.062e-01 9.062e-01 7.469e-01 3.249e-01 + 3.236e-02 3.344e-02 1.406e-01 1.406e-01 3.344e-02 3.236e-02 + 9.171e-01 9.904e-01 9.904e-01 9.171e-01 4.400e-01 9.283e-02 + 2.092e-02 3.073e-02 3.073e-02 2.092e-02 9.283e-02 4.400e-01 + 9.904e-01 9.994e-01 9.904e-01 7.810e-01 2.401e-01 6.436e-02 + 5.197e-02 7.662e-02 5.197e-02 6.436e-02 2.401e-01 7.810e-01 + 9.904e-01 9.904e-01 8.668e-01 4.158e-01 1.367e-01 5.357e-02 + 5.197e-02 5.197e-02 5.357e-02 1.367e-01 4.158e-01 8.668e-01 + 9.171e-01 7.810e-01 4.158e-01 1.971e-01 7.344e-02 3.301e-02 + 2.092e-02 3.301e-02 7.344e-02 1.971e-01 4.158e-01 7.810e-01 + 4.400e-01 2.401e-01 1.367e-01 7.344e-02 3.236e-02 1.143e-02 + 1.143e-02 3.236e-02 7.344e-02 1.367e-01 2.401e-01 4.400e-01 + 9.283e-02 6.436e-02 5.357e-02 3.301e-02 1.143e-02 4.638e-03 + 1.143e-02 3.301e-02 5.357e-02 6.436e-02 9.283e-02 1.298e-01 + 2.092e-02 5.197e-02 5.197e-02 2.092e-02 1.143e-02 1.143e-02 + 2.092e-02 5.197e-02 5.197e-02 2.092e-02 1.143e-02 1.143e-02 + 3.073e-02 7.662e-02 5.197e-02 3.301e-02 3.236e-02 3.301e-02 + 5.197e-02 7.662e-02 3.073e-02 1.031e-02 6.778e-03 1.031e-02 + 3.073e-02 5.197e-02 5.357e-02 7.344e-02 7.344e-02 5.357e-02 + 5.197e-02 3.073e-02 1.406e-01 6.601e-02 6.601e-02 1.406e-01 + 2.092e-02 6.436e-02 1.367e-01 1.971e-01 1.367e-01 6.436e-02 + 2.092e-02 1.031e-02 6.601e-02 8.923e-05 6.601e-02 1.031e-02 + 9.283e-02 2.401e-01 4.158e-01 4.158e-01 2.401e-01 9.283e-02 + 1.143e-02 6.778e-03 6.601e-02 6.601e-02 6.778e-03 1.143e-02 + 4.400e-01 7.810e-01 8.668e-01 7.810e-01 4.400e-01 1.298e-01 + 1.143e-02 1.031e-02 1.406e-01 1.031e-02 1.143e-02 1.298e-01 + 5.651e-01 8.013e-01 5.651e-01 1.676e-01 9.647e-02 9.283e-02 + 3.301e-02 1.720e-02 3.301e-02 9.283e-02 9.647e-02 1.676e-01 + 8.013e-01 8.013e-01 3.749e-01 2.180e-01 2.401e-01 1.660e-01 + 5.357e-02 5.357e-02 1.660e-01 2.401e-01 2.180e-01 3.749e-01 + 5.651e-01 3.749e-01 3.073e-01 4.158e-01 3.862e-01 1.660e-01 + 6.436e-02 1.660e-01 3.862e-01 4.158e-01 3.073e-01 3.749e-01 + 1.676e-01 2.180e-01 4.158e-01 5.075e-01 3.249e-01 9.283e-02 + 9.283e-02 3.249e-01 5.075e-01 4.158e-01 2.180e-01 1.676e-01 + 9.647e-02 2.401e-01 3.862e-01 3.249e-01 1.298e-01 4.807e-02 + 1.298e-01 3.249e-01 3.862e-01 2.401e-01 9.647e-02 6.631e-02 + 9.283e-02 1.660e-01 1.660e-01 9.283e-02 4.807e-02 4.807e-02 + 9.283e-02 1.660e-01 1.660e-01 9.283e-02 4.807e-02 4.807e-02 + 3.301e-02 5.357e-02 6.436e-02 9.283e-02 1.298e-01 9.283e-02 + 6.436e-02 5.357e-02 3.301e-02 1.143e-02 4.638e-03 1.143e-02 + 1.720e-02 5.357e-02 1.660e-01 3.249e-01 3.249e-01 1.660e-01 + 5.357e-02 1.720e-02 3.344e-02 6.778e-03 6.778e-03 3.344e-02 + 3.301e-02 1.660e-01 3.862e-01 5.075e-01 3.862e-01 1.660e-01 + 3.301e-02 3.344e-02 5.676e-02 6.601e-02 5.676e-02 3.344e-02 + 9.283e-02 2.401e-01 4.158e-01 4.158e-01 2.401e-01 9.283e-02 + 1.143e-02 6.778e-03 6.601e-02 6.601e-02 6.778e-03 1.143e-02 + 9.647e-02 2.180e-01 3.073e-01 2.180e-01 9.647e-02 4.807e-02 + 4.638e-03 6.778e-03 5.676e-02 6.778e-03 4.638e-03 4.807e-02 + 1.676e-01 3.749e-01 3.749e-01 1.676e-01 6.631e-02 4.807e-02 + 1.143e-02 3.344e-02 3.344e-02 1.143e-02 4.807e-02 6.631e-02 + 1.569e-02 1.569e-02 2.953e-02 1.676e-01 4.400e-01 3.249e-01 + 7.344e-02 7.344e-02 3.249e-01 4.400e-01 1.676e-01 2.953e-02 + 1.569e-02 5.039e-02 3.749e-01 7.810e-01 7.469e-01 3.862e-01 + 1.367e-01 3.862e-01 7.469e-01 7.810e-01 3.749e-01 5.039e-02 + 2.953e-02 3.749e-01 8.668e-01 9.062e-01 7.469e-01 2.401e-01 + 2.401e-01 7.469e-01 9.062e-01 8.668e-01 3.749e-01 2.953e-02 + 1.676e-01 7.810e-01 9.062e-01 8.578e-01 4.400e-01 9.647e-02 + 4.400e-01 8.578e-01 9.062e-01 7.810e-01 1.676e-01 2.299e-02 + 4.400e-01 7.469e-01 7.469e-01 4.400e-01 6.631e-02 6.631e-02 + 4.400e-01 7.469e-01 7.469e-01 4.400e-01 6.631e-02 6.631e-02 + 3.249e-01 3.862e-01 2.401e-01 9.647e-02 6.631e-02 9.647e-02 + 2.401e-01 3.862e-01 3.249e-01 1.298e-01 4.807e-02 1.298e-01 + 7.344e-02 1.367e-01 2.401e-01 4.400e-01 4.400e-01 2.401e-01 + 1.367e-01 7.344e-02 3.236e-02 1.143e-02 1.143e-02 3.236e-02 + 7.344e-02 3.862e-01 7.469e-01 8.578e-01 7.469e-01 3.862e-01 + 7.344e-02 1.488e-02 3.344e-02 1.031e-02 3.344e-02 1.488e-02 + 3.249e-01 7.469e-01 9.062e-01 9.062e-01 7.469e-01 3.249e-01 + 3.236e-02 3.344e-02 1.406e-01 1.406e-01 3.344e-02 3.236e-02 + 4.400e-01 7.810e-01 8.668e-01 7.810e-01 4.400e-01 1.298e-01 + 1.143e-02 1.031e-02 1.406e-01 1.031e-02 1.143e-02 1.298e-01 + 1.676e-01 3.749e-01 3.749e-01 1.676e-01 6.631e-02 4.807e-02 + 1.143e-02 3.344e-02 3.344e-02 1.143e-02 4.807e-02 6.631e-02 + 2.953e-02 5.039e-02 2.953e-02 2.299e-02 6.631e-02 1.298e-01 + 3.236e-02 1.488e-02 3.236e-02 1.298e-01 6.631e-02 2.299e-02 diff --git a/tests/integrate/219_NO_out_elf/result.ref b/tests/integrate/219_NO_out_elf/result.ref new file mode 100644 index 0000000000..a63c46c8f3 --- /dev/null +++ b/tests/integrate/219_NO_out_elf/result.ref @@ -0,0 +1,7 @@ +etotref -196.6254053459516 +etotperatomref -98.3127026730 +ComparePot1_pass 0 +pointgroupref T_d +spacegroupref O_h +nksibzref 1 +totaltimeref 1.14 diff --git a/tests/integrate/919_OF_out_elf/INPUT b/tests/integrate/919_OF_out_elf/INPUT new file mode 100644 index 0000000000..2cb3133409 --- /dev/null +++ b/tests/integrate/919_OF_out_elf/INPUT @@ -0,0 +1,25 @@ +INPUT_PARAMETERS +#Parameters (1.General) +suffix autotest +calculation scf +esolver_type ofdft + +symmetry 1 +pseudo_dir ../../PP_ORB/ +pseudo_rcut 16 +nspin 1 + +#Parameters (2.Iteration) +ecutwfc 5 +scf_nmax 50 + +#OFDFT +of_kinetic wt +of_method tn +of_conv energy +of_tole 2e-6 + +#Parameters (3.Basis) +basis_type pw + +out_elf 1 diff --git a/tests/integrate/919_OF_out_elf/KPT b/tests/integrate/919_OF_out_elf/KPT new file mode 100644 index 0000000000..c289c0158a --- /dev/null +++ b/tests/integrate/919_OF_out_elf/KPT @@ -0,0 +1,4 @@ +K_POINTS +0 +Gamma +1 1 1 0 0 0 diff --git a/tests/integrate/919_OF_out_elf/STRU b/tests/integrate/919_OF_out_elf/STRU new file mode 100644 index 0000000000..e797c06432 --- /dev/null +++ b/tests/integrate/919_OF_out_elf/STRU @@ -0,0 +1,18 @@ +ATOMIC_SPECIES +Al 26.98 al.lda.lps blps + +LATTICE_CONSTANT +7.50241114482312 // add lattice constant + +LATTICE_VECTORS +0.000000000000 0.500000000000 0.500000000000 +0.500000000000 0.000000000000 0.500000000000 +0.500000000000 0.500000000000 0.000000000000 + +ATOMIC_POSITIONS +Direct + +Al +0 +1 + 0.000000000000 0.000000000000 0.000000000000 1 1 1 diff --git a/tests/integrate/919_OF_out_elf/jd b/tests/integrate/919_OF_out_elf/jd new file mode 100644 index 0000000000..4cd07ce898 --- /dev/null +++ b/tests/integrate/919_OF_out_elf/jd @@ -0,0 +1 @@ +Test out_elf in OFDFT, symmetry=on diff --git a/tests/integrate/919_OF_out_elf/refELF.cube b/tests/integrate/919_OF_out_elf/refELF.cube new file mode 100644 index 0000000000..9988ee52d7 --- /dev/null +++ b/tests/integrate/919_OF_out_elf/refELF.cube @@ -0,0 +1,135 @@ +STEP: 0 Cubefile created from ABACUS. Inner loop is z, followed by y and x +1 (nspin) +1 0.0 0.0 0.0 +8 0.000000 0.468901 0.468901 +8 0.468901 0.000000 0.468901 +8 0.468901 0.468901 0.000000 + 13 3.000000 0.000000 0.000000 0.000000 + 2.328e-02 8.303e-02 4.696e-01 5.990e-01 5.706e-01 5.990e-01 + 4.696e-01 8.303e-02 + 8.303e-02 3.513e-01 5.887e-01 5.674e-01 5.687e-01 5.904e-01 + 3.507e-01 1.488e-01 + 4.696e-01 5.887e-01 5.600e-01 5.238e-01 5.598e-01 5.855e-01 + 4.756e-01 3.507e-01 + 5.990e-01 5.674e-01 5.238e-01 5.239e-01 5.638e-01 5.991e-01 + 5.855e-01 5.904e-01 + 5.706e-01 5.687e-01 5.598e-01 5.638e-01 5.706e-01 5.638e-01 + 5.598e-01 5.687e-01 + 5.990e-01 5.904e-01 5.855e-01 5.991e-01 5.638e-01 5.239e-01 + 5.238e-01 5.674e-01 + 4.696e-01 3.507e-01 4.756e-01 5.855e-01 5.598e-01 5.238e-01 + 5.600e-01 5.887e-01 + 8.303e-02 1.488e-01 3.507e-01 5.904e-01 5.687e-01 5.674e-01 + 5.887e-01 3.513e-01 + 8.303e-02 3.513e-01 5.887e-01 5.674e-01 5.687e-01 5.904e-01 + 3.507e-01 1.488e-01 + 3.513e-01 5.751e-01 5.857e-01 5.521e-01 5.860e-01 5.751e-01 + 4.141e-01 2.344e-01 + 5.887e-01 5.857e-01 5.445e-01 5.445e-01 5.854e-01 5.848e-01 + 5.180e-01 5.199e-01 + 5.674e-01 5.521e-01 5.445e-01 5.521e-01 5.636e-01 5.614e-01 + 5.509e-01 5.617e-01 + 5.687e-01 5.860e-01 5.854e-01 5.636e-01 5.237e-01 4.874e-01 + 4.880e-01 5.241e-01 + 5.904e-01 5.751e-01 5.848e-01 5.614e-01 4.874e-01 4.510e-01 + 4.885e-01 5.617e-01 + 3.507e-01 4.141e-01 5.180e-01 5.509e-01 4.880e-01 4.885e-01 + 5.495e-01 5.199e-01 + 1.488e-01 2.344e-01 5.199e-01 5.617e-01 5.241e-01 5.617e-01 + 5.199e-01 2.344e-01 + 4.696e-01 5.887e-01 5.600e-01 5.238e-01 5.598e-01 5.855e-01 + 4.756e-01 3.507e-01 + 5.887e-01 5.857e-01 5.445e-01 5.445e-01 5.854e-01 5.848e-01 + 5.180e-01 5.199e-01 + 5.600e-01 5.445e-01 5.346e-01 5.444e-01 5.594e-01 5.517e-01 + 5.365e-01 5.495e-01 + 5.238e-01 5.445e-01 5.444e-01 5.239e-01 4.872e-01 4.563e-01 + 4.565e-01 4.885e-01 + 5.598e-01 5.854e-01 5.594e-01 4.872e-01 4.089e-01 3.755e-01 + 4.089e-01 4.880e-01 + 5.855e-01 5.848e-01 5.517e-01 4.563e-01 3.755e-01 3.751e-01 + 4.565e-01 5.509e-01 + 4.756e-01 5.180e-01 5.365e-01 4.565e-01 4.089e-01 4.565e-01 + 5.365e-01 5.180e-01 + 3.507e-01 5.199e-01 5.495e-01 4.885e-01 4.880e-01 5.509e-01 + 5.180e-01 4.141e-01 + 5.990e-01 5.674e-01 5.238e-01 5.239e-01 5.638e-01 5.991e-01 + 5.855e-01 5.904e-01 + 5.674e-01 5.521e-01 5.445e-01 5.521e-01 5.636e-01 5.614e-01 + 5.509e-01 5.617e-01 + 5.238e-01 5.445e-01 5.444e-01 5.239e-01 4.872e-01 4.563e-01 + 4.565e-01 4.885e-01 + 5.239e-01 5.521e-01 5.239e-01 4.510e-01 3.756e-01 3.441e-01 + 3.751e-01 4.510e-01 + 5.638e-01 5.636e-01 4.872e-01 3.756e-01 2.999e-01 2.998e-01 + 3.755e-01 4.874e-01 + 5.991e-01 5.614e-01 4.563e-01 3.441e-01 2.998e-01 3.441e-01 + 4.563e-01 5.614e-01 + 5.855e-01 5.509e-01 4.565e-01 3.751e-01 3.755e-01 4.563e-01 + 5.517e-01 5.848e-01 + 5.904e-01 5.617e-01 4.885e-01 4.510e-01 4.874e-01 5.614e-01 + 5.848e-01 5.751e-01 + 5.706e-01 5.687e-01 5.598e-01 5.638e-01 5.706e-01 5.638e-01 + 5.598e-01 5.687e-01 + 5.687e-01 5.860e-01 5.854e-01 5.636e-01 5.237e-01 4.874e-01 + 4.880e-01 5.241e-01 + 5.598e-01 5.854e-01 5.594e-01 4.872e-01 4.089e-01 3.755e-01 + 4.089e-01 4.880e-01 + 5.638e-01 5.636e-01 4.872e-01 3.756e-01 2.999e-01 2.998e-01 + 3.755e-01 4.874e-01 + 5.706e-01 5.237e-01 4.089e-01 2.999e-01 2.587e-01 2.999e-01 + 4.089e-01 5.237e-01 + 5.638e-01 4.874e-01 3.755e-01 2.998e-01 2.999e-01 3.756e-01 + 4.872e-01 5.636e-01 + 5.598e-01 4.880e-01 4.089e-01 3.755e-01 4.089e-01 4.872e-01 + 5.594e-01 5.854e-01 + 5.687e-01 5.241e-01 4.880e-01 4.874e-01 5.237e-01 5.636e-01 + 5.854e-01 5.860e-01 + 5.990e-01 5.904e-01 5.855e-01 5.991e-01 5.638e-01 5.239e-01 + 5.238e-01 5.674e-01 + 5.904e-01 5.751e-01 5.848e-01 5.614e-01 4.874e-01 4.510e-01 + 4.885e-01 5.617e-01 + 5.855e-01 5.848e-01 5.517e-01 4.563e-01 3.755e-01 3.751e-01 + 4.565e-01 5.509e-01 + 5.991e-01 5.614e-01 4.563e-01 3.441e-01 2.998e-01 3.441e-01 + 4.563e-01 5.614e-01 + 5.638e-01 4.874e-01 3.755e-01 2.998e-01 2.999e-01 3.756e-01 + 4.872e-01 5.636e-01 + 5.239e-01 4.510e-01 3.751e-01 3.441e-01 3.756e-01 4.510e-01 + 5.239e-01 5.521e-01 + 5.238e-01 4.885e-01 4.565e-01 4.563e-01 4.872e-01 5.239e-01 + 5.444e-01 5.445e-01 + 5.674e-01 5.617e-01 5.509e-01 5.614e-01 5.636e-01 5.521e-01 + 5.445e-01 5.521e-01 + 4.696e-01 3.507e-01 4.756e-01 5.855e-01 5.598e-01 5.238e-01 + 5.600e-01 5.887e-01 + 3.507e-01 4.141e-01 5.180e-01 5.509e-01 4.880e-01 4.885e-01 + 5.495e-01 5.199e-01 + 4.756e-01 5.180e-01 5.365e-01 4.565e-01 4.089e-01 4.565e-01 + 5.365e-01 5.180e-01 + 5.855e-01 5.509e-01 4.565e-01 3.751e-01 3.755e-01 4.563e-01 + 5.517e-01 5.848e-01 + 5.598e-01 4.880e-01 4.089e-01 3.755e-01 4.089e-01 4.872e-01 + 5.594e-01 5.854e-01 + 5.238e-01 4.885e-01 4.565e-01 4.563e-01 4.872e-01 5.239e-01 + 5.444e-01 5.445e-01 + 5.600e-01 5.495e-01 5.365e-01 5.517e-01 5.594e-01 5.444e-01 + 5.346e-01 5.445e-01 + 5.887e-01 5.199e-01 5.180e-01 5.848e-01 5.854e-01 5.445e-01 + 5.445e-01 5.857e-01 + 8.303e-02 1.488e-01 3.507e-01 5.904e-01 5.687e-01 5.674e-01 + 5.887e-01 3.513e-01 + 1.488e-01 2.344e-01 5.199e-01 5.617e-01 5.241e-01 5.617e-01 + 5.199e-01 2.344e-01 + 3.507e-01 5.199e-01 5.495e-01 4.885e-01 4.880e-01 5.509e-01 + 5.180e-01 4.141e-01 + 5.904e-01 5.617e-01 4.885e-01 4.510e-01 4.874e-01 5.614e-01 + 5.848e-01 5.751e-01 + 5.687e-01 5.241e-01 4.880e-01 4.874e-01 5.237e-01 5.636e-01 + 5.854e-01 5.860e-01 + 5.674e-01 5.617e-01 5.509e-01 5.614e-01 5.636e-01 5.521e-01 + 5.445e-01 5.521e-01 + 5.887e-01 5.199e-01 5.180e-01 5.848e-01 5.854e-01 5.445e-01 + 5.445e-01 5.857e-01 + 3.513e-01 2.344e-01 4.141e-01 5.751e-01 5.860e-01 5.521e-01 + 5.857e-01 5.751e-01 diff --git a/tests/integrate/919_OF_out_elf/result.ref b/tests/integrate/919_OF_out_elf/result.ref new file mode 100644 index 0000000000..f7761f4215 --- /dev/null +++ b/tests/integrate/919_OF_out_elf/result.ref @@ -0,0 +1,7 @@ +etotref -57.93099111619954 +etotperatomref -57.9309911162 +ComparePot1_pass 0 +pointgroupref O_h +spacegroupref O_h +nksibzref 1 +totaltimeref 0.27 diff --git a/tests/integrate/CASES_CPU.txt b/tests/integrate/CASES_CPU.txt index 16b58bfee1..96c12234e0 100644 --- a/tests/integrate/CASES_CPU.txt +++ b/tests/integrate/CASES_CPU.txt @@ -90,6 +90,7 @@ 117_PW_out_pot_nscf 118_PW_CHG_BINARY 118_PW_WFC_BINARY +119_PW_out_elf 120_PW_KP_MD_MSST #120_PW_KP_MD_MSST_level2 120_PW_KP_MD_NPT @@ -178,6 +179,7 @@ 216_NO_scan_Si2 217_NO_out_pot 217_NO_out_pot_nscf +219_NO_out_elf 220_NO_KP_MD_MSST #220_NO_KP_MD_MSST_level2 220_NO_KP_MD_NVT @@ -345,6 +347,7 @@ 905_OF_FFT_fullpw_off 906_OF_LibxcPBE 907_OF_LPS +919_OF_out_elf 920_OF_MD_LDA 920_OF_MD_LibxcPBE 921_OF_CR_LDA diff --git a/tests/integrate/tools/catch_properties.sh b/tests/integrate/tools/catch_properties.sh index e064ec61e3..403330ad98 100755 --- a/tests/integrate/tools/catch_properties.sh +++ b/tests/integrate/tools/catch_properties.sh @@ -58,6 +58,7 @@ gamma_only=$(get_input_key_value "gamma_only" "INPUT") imp_sol=$(get_input_key_value "imp_sol" "INPUT") run_rpa=$(get_input_key_value "rpa" "INPUT") out_pot=$(get_input_key_value "out_pot" "INPUT") +out_elf=$(get_input_key_value "out_elf" "INPUT") out_dm1=$(get_input_key_value "out_dm1" "INPUT") get_s=$(get_input_key_value "calculation" "INPUT") out_pband=$(get_input_key_value "out_proj_band" "INPUT") @@ -165,6 +166,14 @@ if ! test -z "$out_pot" && [ $out_pot == 2 ]; then echo "ComparePot_pass $?" >>$1 fi +#echo $out_elf +if ! test -z "$out_elf" && [ $out_elf == 1 ]; then + elf1ref=refELF.cube + elf1cal=OUT.autotest/ELF.cube + python3 ../tools/CompareFile.py $elf1ref $elf1cal 3 + echo "ComparePot1_pass $?" >>$1 +fi + #echo $get_s if ! test -z "$get_s" && [ $get_s == "get_S" ]; then sref=refSR.csr