Skip to content

Commit c9ef5b8

Browse files
kirk0830Fisherd99
authored andcommitted
disable four rarely used functionals which involves the laplacian of rho (deepmodeling#5392)
1 parent 8e7a342 commit c9ef5b8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

source/module_hamilt_general/module_xc/xc_functional_libxc.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,30 @@
1111
#include <xc.h>
1212

1313
#include <vector>
14+
bool xc_with_laplacian(const std::string& xc_func_in)
15+
{
16+
// see Pyscf: https://github.com/pyscf/pyscf/blob/master/pyscf/dft/libxc.py#L1062
17+
// ABACUS issue: https://github.com/deepmodeling/abacus-develop/issues/5372
18+
const std::vector<std::string> not_supported = {
19+
"MGGA_XC_CC06", "MGGA_C_CS", "MGGA_X_BR89", "MGGA_X_MK00"};
20+
for (const std::string& s : not_supported)
21+
{
22+
if (xc_func_in.find(s) != std::string::npos)
23+
{
24+
return true;
25+
}
26+
}
27+
return false;
28+
}
1429

1530
std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::string xc_func_in)
1631
{
1732
// determine the type (lda/gga/mgga)
33+
if (xc_with_laplacian(xc_func_in))
34+
{
35+
ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc",
36+
"XC Functional involving Laplacian of rho is not implemented.");
37+
}
1838
int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga
1939
func_type = 1;
2040
if(xc_func_in.find("GGA") != std::string::npos) { func_type = 2; }

0 commit comments

Comments
 (0)