|
4 | 4 | // NOTE : it is only used for nspin = 1 and 2, the nspin = 4 case is treated in v_xc |
5 | 5 | // 3. v_xc_meta : which takes rho and tau as input, and v_xc as output |
6 | 6 |
|
7 | | -#include "xc_functional.h" |
8 | 7 | #include "source_base/parallel_reduce.h" |
9 | 8 | #include "source_base/timer.h" |
10 | 9 | #include "source_io/module_parameter/parameter.h" |
| 10 | +#include "xc_functional.h" |
11 | 11 |
|
12 | 12 | #ifdef USE_LIBXC |
13 | 13 | #include "xc_functional_libxc.h" |
14 | 14 | #endif |
15 | 15 |
|
16 | 16 | // [etxc, vtxc, v] = XC_Functional::v_xc(...) |
17 | | -std::tuple<double,double,ModuleBase::matrix> XC_Functional::v_xc( |
18 | | - const int &nrxx, // number of real-space grid |
19 | | - const Charge* const chr, |
20 | | - const UnitCell *ucell) // core charge density |
| 17 | +std::tuple<double, double, ModuleBase::matrix> XC_Functional::v_xc(const int& nrxx, // number of real-space grid |
| 18 | + const Charge* const chr, |
| 19 | + const UnitCell* ucell) // core charge density |
21 | 20 | { |
22 | | - ModuleBase::TITLE("XC_Functional","v_xc"); |
23 | | - ModuleBase::timer::tick("XC_Functional","v_xc"); |
| 21 | + ModuleBase::TITLE("XC_Functional", "v_xc"); |
| 22 | + ModuleBase::timer::tick("XC_Functional", "v_xc"); |
24 | 23 |
|
25 | | - if(use_libxc) |
| 24 | + if (use_libxc) |
26 | 25 | { |
27 | 26 | #ifdef USE_LIBXC |
28 | | - return XC_Functional_Libxc::v_xc_libxc(XC_Functional::get_func_id(), nrxx, ucell->omega, ucell->tpiba, chr, &(scaling_factor_xc)); |
| 27 | + ModuleBase::timer::tick("XC_Functional", "v_xc"); |
| 28 | + return XC_Functional_Libxc::v_xc_libxc(XC_Functional::get_func_id(), |
| 29 | + nrxx, |
| 30 | + ucell->omega, |
| 31 | + ucell->tpiba, |
| 32 | + chr, |
| 33 | + &(scaling_factor_xc)); |
29 | 34 | #else |
30 | | - ModuleBase::WARNING_QUIT("v_xc","compile with LIBXC"); |
| 35 | + ModuleBase::WARNING_QUIT("v_xc", "compile with LIBXC"); |
31 | 36 | #endif |
32 | 37 | } |
33 | 38 |
|
@@ -134,7 +139,7 @@ std::tuple<double,double,ModuleBase::matrix> XC_Functional::v_xc( |
134 | 139 | double rhodw = arhox * (1.0-zeta) / 2.0; |
135 | 140 | XC_Functional_Libxc::xc_spin_libxc(XC_Functional::get_func_id(), rhoup, rhodw, exc, vxc[0], vxc[1]); |
136 | 141 | #else |
137 | | - ModuleBase::WARNING_QUIT("v_xc","compile with LIBXC"); |
| 142 | + ModuleBase::WARNING_QUIT("v_xc", "compile with LIBXC"); |
138 | 143 | #endif |
139 | 144 | } |
140 | 145 | else |
@@ -180,6 +185,6 @@ std::tuple<double,double,ModuleBase::matrix> XC_Functional::v_xc( |
180 | 185 | etxc *= ucell->omega / chr->rhopw->nxyz; |
181 | 186 | vtxc *= ucell->omega / chr->rhopw->nxyz; |
182 | 187 |
|
183 | | - ModuleBase::timer::tick("XC_Functional","v_xc"); |
| 188 | + ModuleBase::timer::tick("XC_Functional", "v_xc"); |
184 | 189 | return std::make_tuple(etxc, vtxc, std::move(v)); |
185 | 190 | } |
0 commit comments