@@ -34,24 +34,37 @@ int XC_Functional::get_func_type()
3434{
3535 return func_type;
3636}
37+
3738void XC_Functional::set_xc_first_loop (const UnitCell& ucell)
3839{
40+ ModuleBase::TITLE (" XC_Functional" , " set_xc_first_loop" );
3941 /* * In the special "two-level" calculation case,
4042the first scf iteration only calculate the functional without exact
4143exchange. but in "nscf" calculation, there is no need of "two-level"
4244method. */
43- if (ucell.atoms [0 ].ncpp .xc_func == " HF" || ucell.atoms [0 ].ncpp .xc_func == " HSE"
44- || ucell.atoms [0 ].ncpp .xc_func == " PBE0" || ucell.atoms [0 ].ncpp .xc_func == " LC_PBE"
45- || ucell.atoms [0 ].ncpp .xc_func == " LC_WPBE" || ucell.atoms [0 ].ncpp .xc_func == " LRC_WPBEH"
46- || ucell.atoms [0 ].ncpp .xc_func == " CAM_PBEH" ) {
45+ if (ucell.atoms [0 ].ncpp .xc_func == " HF" || ucell.atoms [0 ].ncpp .xc_func == " PBE0" || ucell.atoms [0 ].ncpp .xc_func == " HSE" )
46+ {
4747 XC_Functional::set_xc_type (" pbe" );
4848 }
49- else if (ucell.atoms [0 ].ncpp .xc_func == " SCAN0" ) {
50- XC_Functional::set_xc_type (" scan" );
49+ else if ( ucell.atoms [0 ].ncpp .xc_func == " LC_PBE" || ucell.atoms [0 ].ncpp .xc_func == " LC_WPBE"
50+ || ucell.atoms [0 ].ncpp .xc_func == " LRC_WPBEH" || ucell.atoms [0 ].ncpp .xc_func == " CAM_PBEH" )
51+ {
52+ XC_Functional::set_xc_type (" pbe" );
5153 }
52- else if (ucell.atoms [0 ].ncpp .xc_func == " B3LYP" ) {
54+ // added by jghan, 2024-07-07
55+ else if ( ucell.atoms [0 ].ncpp .xc_func == " MULLER" || ucell.atoms [0 ].ncpp .xc_func == " POWER"
56+ || ucell.atoms [0 ].ncpp .xc_func == " WP22" || ucell.atoms [0 ].ncpp .xc_func == " CWP22" )
57+ {
58+ XC_Functional::set_xc_type (" pbe" );
59+ }
60+ else if (ucell.atoms [0 ].ncpp .xc_func == " B3LYP" )
61+ {
5362 XC_Functional::set_xc_type (" blyp" );
5463 }
64+ else if (ucell.atoms [0 ].ncpp .xc_func == " SCAN0" )
65+ {
66+ XC_Functional::set_xc_type (" scan" );
67+ }
5568}
5669
5770// The setting values of functional id according to the index in LIBXC
@@ -346,4 +359,44 @@ void XC_Functional::set_xc_type(const std::string xc_func_in)
346359 use_libxc = false ;
347360#endif
348361
362+ }
363+
364+
365+ std::string XC_Functional::output_info ()
366+ {
367+ #ifdef USE_LIBXC
368+ if (use_libxc)
369+ {
370+ std::stringstream ss;
371+ ss<<" Libxc v" <<xc_version_string ()<<std::endl;
372+ ss<<" \t " <<xc_reference ()<<std::endl;
373+
374+ std::vector<xc_func_type> funcs = XC_Functional_Libxc::init_func (func_id, XC_UNPOLARIZED);
375+ for (const auto &func : funcs)
376+ {
377+ const xc_func_info_type *info = xc_func_get_info (&func);
378+ ss<<" XC: " <<xc_func_info_get_name (info)<<std::endl;
379+ for (int i=0 ; i<XC_MAX_REFERENCES; ++i)
380+ {
381+ const func_reference_type *ref = xc_func_info_get_references (func.info , i);
382+ if (ref)
383+ ss<<" \t " <<xc_func_reference_get_ref (ref)<<std::endl;
384+ }
385+ }
386+ XC_Functional_Libxc::finish_func (funcs);
387+ return ss.str ();
388+ }
389+ else
390+ {
391+ std::string s = " XC:\t " ;
392+ for (const auto &id: func_id)
393+ s += std::string (xc_functional_get_name (id))+" \t " ;
394+ return s;
395+ }
396+ #else
397+ std::string s = " XC:\t " ;
398+ for (const auto &id: func_id)
399+ s += std::to_string (id)+" \t " ;
400+ return s;
401+ #endif
349402}
0 commit comments