Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion source/module_hamilt_general/module_xc/xc_functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,11 @@ void XC_Functional::set_xc_type(const std::string xc_func_in)
func_id = std::get<1>(type_id);
use_libxc = true;
#else
ModuleBase::WARNING_QUIT("xc_functional.cpp","functional name not recognized!");
std::string message = "Unrecognized exchange-correlation functional '"+ xc_func +"'.\n"
" Possible source: Pseudopotential file or dft_functional parameter.\n"
" Please explicitly set dft_functional in INPUT,\n"
" or verify the functional name is supported.";
ModuleBase::WARNING_QUIT("xc_functional.cpp",message);
#endif
}

Expand Down
18 changes: 16 additions & 2 deletions source/module_hamilt_general/module_xc/xc_functional_libxc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,27 @@ std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::stri
token = xc_func_in.substr(0, pos);
int id = xc_functional_get_number(token.c_str());
std::cout << "func,id" << token << " " << id << std::endl;
if (id == -1) { ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc","functional name not recognized!"); }
if (id == -1)
{
std::string message = "Unrecognized exchange-correlation functional '"+ xc_func_in +"'.\n"
" Possible source: Pseudopotential file or dft_functional parameter.\n"
" Please explicitly set dft_functional in INPUT,\n"
" or verify the functional name is supported.";
ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc",message);
}
func_id.push_back(id);
xc_func_in.erase(0, pos + delimiter.length());
}
int id = xc_functional_get_number(xc_func_in.c_str());
std::cout << "func,id" << xc_func_in << " " << id << std::endl;
if (id == -1) { ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc","functional name not recognized!"); }
if (id == -1)
{
std::string message = "Unrecognized exchange-correlation functional '"+ xc_func_in +"'.\n"
" Possible source: Pseudopotential file or dft_functional parameter.\n"
" Please explicitly set dft_functional in INPUT,\n"
" or verify the functional name is supported.";
ModuleBase::WARNING_QUIT("XC_Functional::set_xc_type_libxc",message);
}
func_id.push_back(id);

return std::make_pair(func_type, func_id);
Expand Down
Loading