|
9 | 9 | #endif |
10 | 10 |
|
11 | 11 | #include <xc.h> |
12 | | - |
13 | 12 | #include <vector> |
14 | 13 |
|
15 | | -std::string uppercase(const std::string& str) |
| 14 | +std::string _uppercase(const std::string& str) |
16 | 15 | { |
17 | 16 | std::string result = str; |
18 | 17 | std::transform(result.begin(), result.end(), result.begin(), ::toupper); |
19 | 18 | return result; |
20 | 19 | } |
21 | 20 |
|
22 | | -bool XC_Functional_Libxc::xc_with_nonlocal_vdw(const std::string& xc_func_in) |
| 21 | +bool not_supported_xc_with_nonlocal_vdw(const std::string& xc_func_in) |
23 | 22 | { |
24 | | - const std::string xc_func = uppercase(xc_func_in); |
| 23 | + const std::string xc_func = _uppercase(xc_func_in); |
25 | 24 | if(xc_func.find("VDW") != std::string::npos) { return true; } |
26 | | - if(xc_func.find("RVV10") != std::string::npos) { return true; } |
27 | | - const std::vector<std::string> not_supported = {"C09X", "VCML"}; |
| 25 | + /* known excluded: GGA_X_OPTB86B_VDW, GGA_X_OPTB88_VDW, GGA_X_OPTPBE_VDW, GGA_X_PBEK1_VDW */ |
| 26 | + |
| 27 | + if(xc_func.find("VV10") != std::string::npos) { return true; } |
| 28 | + /* known excluded: GGA_XC_VV10, HYB_GGA_XC_LC_VV10, MGGA_C_REVSCAN_VV10, MGGA_C_SCAN_VV10, |
| 29 | + MGGA_C_SCANL_VV10, MGGA_XC_VCML_RVV10 */ |
| 30 | + |
| 31 | + const std::vector<std::string> not_supported = {"C09X", "VCML", "HYB_MGGA_XC_WB97M_V", "MGGA_XC_B97M_V"}; |
28 | 32 | for(const std::string& str : not_supported) |
29 | 33 | { |
30 | 34 | if(xc_func.find(str) != std::string::npos) { return true; } |
31 | 35 | } |
| 36 | + /* known excluded: GGA_X_C09X, MGGA_X_VCML, HYB_MGGA_XC_WB97M_V, MGGA_XC_B97M_V */ |
| 37 | + |
| 38 | + /* There is also a functional not quite sure: HYB_GGA_XC_WB97X_V */ |
| 39 | + if(xc_func.find("HYB_GGA_XC_WB97X_V") != std::string::npos) |
| 40 | + { |
| 41 | + std::cout << " WARNING: range-seperated XC omega-B97 family with nonlocal correction term is used.\n" |
| 42 | + << " if you are not planning to use these functionals like wB97X-D3BJ that:\n" |
| 43 | + << " XC_GGA_XC_WB97X_V with specified D3BJ DFT-D3 parameters, this is not what\n" |
| 44 | + << " you want." << std::endl; |
| 45 | + } |
32 | 46 | return false; |
33 | 47 | } |
34 | 48 |
|
35 | 49 | std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::string xc_func_in) |
36 | 50 | { |
37 | 51 | // determine the type (lda/gga/mgga) |
38 | 52 | int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga |
39 | | - if(XC_Functional_Libxc::xc_with_nonlocal_vdw(xc_func_in)) |
| 53 | + if(not_supported_xc_with_nonlocal_vdw(xc_func_in)) |
40 | 54 | { ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc","functionals with non-local dispersion are not supported."); } |
41 | 55 | func_type = 1; |
42 | 56 | if(xc_func_in.find("GGA") != std::string::npos) { func_type = 2; } |
|
0 commit comments