@@ -82,13 +82,27 @@ std::pair<int,std::vector<int>> XC_Functional_Libxc::set_xc_type_libxc(std::stri
8282 token = xc_func_in.substr (0 , pos);
8383 int id = xc_functional_get_number (token.c_str ());
8484 std::cout << " func,id" << token << " " << id << std::endl;
85- if (id == -1 ) { ModuleBase::WARNING_QUIT (" XC_Functional::set_xc_type_libxc" ," functional name not recognized!" ); }
85+ if (id == -1 )
86+ {
87+ std::string message = " Unrecognized exchange-correlation functional '" + xc_func_in +" '.\n "
88+ " Possible source: Pseudopotential file or dft_functional parameter.\n "
89+ " Please explicitly set dft_functional in INPUT,\n "
90+ " or verify the functional name is supported." ;
91+ ModuleBase::WARNING_QUIT (" XC_Functional::set_xc_type_libxc" ,message);
92+ }
8693 func_id.push_back (id);
8794 xc_func_in.erase (0 , pos + delimiter.length ());
8895 }
8996 int id = xc_functional_get_number (xc_func_in.c_str ());
9097 std::cout << " func,id" << xc_func_in << " " << id << std::endl;
91- if (id == -1 ) { ModuleBase::WARNING_QUIT (" XC_Functional::set_xc_type_libxc" ," functional name not recognized!" ); }
98+ if (id == -1 )
99+ {
100+ std::string message = " Unrecognized exchange-correlation functional '" + xc_func_in +" '.\n "
101+ " Possible source: Pseudopotential file or dft_functional parameter.\n "
102+ " Please explicitly set dft_functional in INPUT,\n "
103+ " or verify the functional name is supported." ;
104+ ModuleBase::WARNING_QUIT (" XC_Functional::set_xc_type_libxc" ,message);
105+ }
92106 func_id.push_back (id);
93107
94108 return std::make_pair (func_type, func_id);
0 commit comments