Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions source/module_hamilt_general/module_xc/xc_functional_libxc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,30 @@
#include <xc.h>

#include <vector>
bool xc_with_laplacian(const std::string& xc_func_in)
{
// see Pyscf: https://github.com/pyscf/pyscf/blob/master/pyscf/dft/libxc.py#L1062
// ABACUS issue: https://github.com/deepmodeling/abacus-develop/issues/5372
const std::vector<std::string> not_supported = {
"MGGA_XC_CC06", "MGGA_C_CS", "MGGA_X_BR89", "MGGA_X_MK00"};
for (const std::string& s : not_supported)
{
if (xc_func_in.find(s) != std::string::npos)
{
return true;
}
}
return false;
}

std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::string xc_func_in)
{
// determine the type (lda/gga/mgga)
if (xc_with_laplacian(xc_func_in))
{
ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc",
"XC Functional involving Laplacian of rho is not implemented.");
}
int func_type; //0:none, 1:lda, 2:gga, 3:mgga, 4:hybrid lda/gga, 5:hybrid mgga
func_type = 1;
if(xc_func_in.find("GGA") != std::string::npos) { func_type = 2; }
Expand Down
Loading