@@ -11,23 +11,36 @@ void ReadInput::item_relax()
1111{
1212 {
1313 Input_Item item (" relax_method" );
14- item.annotation = " cg [param] ; bfgs [param]; ... " ;
14+ item.annotation = " cg; bfgs; sd; cg; cg_bfgs; " ;
1515 read_sync_string (input.relax_method );
1616 item.read_value = [](const Input_Item& item, Parameter& para) {
17- std::istringstream iss (para.input .relax_method );
18- iss >> para.input .relax_method_param .method ;
19- if (!(iss >> para.input .relax_method_param .param )) {
20- para.input .relax_method_param .param = 1 ;
17+ para.input .relax_method_param .method =item.str_values [0 ];
18+ para.input .relax_method = para.input .relax_method_param .method ;
19+ if (item.get_size ()==1 )
20+ {
21+ para.input .relax_method_param .param = " 1" ;
2122 }
23+ else
24+ {
25+ para.input .relax_method_param .param = item.str_values [1 ];
26+ }
27+
28+ // std::istringstream iss(item.str_values[0]);
29+ // iss >> para.input.relax_method_param.method;
30+ // if (!(iss >> para.input.relax_method_param.param)) {
31+ // std::cout << "No parameter provided for relax_method_param.param, default to 1" << std::endl;
32+ // para.input.relax_method_param.param = "1";
33+ // }
2234 };
2335 item.check_value = [](const Input_Item& item, const Parameter& para) {
24- const std::vector<std::string> relax_methods = {" cg" , " sd" ," bfgs_old " " cg_bfgs" ," bfgs" ," lbfgs" };
36+ const std::vector<std::string> relax_methods = {" cg" , " sd" , " cg_bfgs" ," bfgs" ," lbfgs" };
2537 if (std::find (relax_methods.begin (), relax_methods.end (), para.input .relax_method_param .method ) == relax_methods.end ()) {
2638 const std::string warningstr = nofound_str (relax_methods, " relax_method" );
2739 ModuleBase::WARNING_QUIT (" ReadInput" , warningstr);
2840 }
2941 };
3042 this ->add_item (item);
43+
3144 // Input_Item item("relax_method");
3245 // item.annotation = "cg; bfgs; sd; cg; cg_bfgs;";
3346 // read_sync_string(input.relax_method);
0 commit comments