From 5f761c7611bfbbea3769a6731f7df10361fab5cf Mon Sep 17 00:00:00 2001 From: linpz Date: Mon, 17 Nov 2025 01:17:38 +0800 Subject: [PATCH] Feature: add xc output info --- source/module_esolver/esolver_ks.cpp | 1 + .../module_xc/xc_functional.cpp | 67 +++++++++++++++++-- .../module_xc/xc_functional.h | 1 + source/module_ri/Exx_LRI_interface.hpp | 15 +---- 4 files changed, 63 insertions(+), 21 deletions(-) diff --git a/source/module_esolver/esolver_ks.cpp b/source/module_esolver/esolver_ks.cpp index 5a8ec9a4d8..8afefa70df 100644 --- a/source/module_esolver/esolver_ks.cpp +++ b/source/module_esolver/esolver_ks.cpp @@ -185,6 +185,7 @@ void ESolver_KS::before_all_runners(UnitCell& ucell, const Input_para { XC_Functional::set_xc_type(ucell.atoms[0].ncpp.xc_func); } + GlobalV::ofs_running< funcs = XC_Functional_Libxc::init_func(func_id, XC_UNPOLARIZED); + for(const auto &func : funcs) + { + const xc_func_info_type *info = xc_func_get_info(&func); + ss<<" XC: "< get_func_id() { return func_id; } + static std::string output_info(); //------------------- // xc_functional_wrapper_xc.cpp diff --git a/source/module_ri/Exx_LRI_interface.hpp b/source/module_ri/Exx_LRI_interface.hpp index 724835d997..0605c7e687 100644 --- a/source/module_ri/Exx_LRI_interface.hpp +++ b/source/module_ri/Exx_LRI_interface.hpp @@ -147,20 +147,7 @@ void Exx_LRI_Interface::exx_beforescf(const int istep, } else { - if (ucell.atoms[0].ncpp.xc_func == "HF" || ucell.atoms[0].ncpp.xc_func == "PBE0" || ucell.atoms[0].ncpp.xc_func == "HSE") - { - XC_Functional::set_xc_type("pbe"); - } - else if (ucell.atoms[0].ncpp.xc_func == "SCAN0") - { - XC_Functional::set_xc_type("scan"); - } - // added by jghan, 2024-07-07 - else if ( ucell.atoms[0].ncpp.xc_func == "MULLER" || ucell.atoms[0].ncpp.xc_func == "POWER" - || ucell.atoms[0].ncpp.xc_func == "WP22" || ucell.atoms[0].ncpp.xc_func == "CWP22" ) - { - XC_Functional::set_xc_type("pbe"); - } + XC_Functional::set_xc_first_loop(ucell); } this->cal_exx_ions(ucell,PARAM.inp.out_ri_cv);