Skip to content

Commit 1255ad2

Browse files
author
Fei Yang
committed
change input parameters
1 parent 4d73760 commit 1255ad2

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

source/source_io/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct Input_para
154154

155155
// ============== #Parameters (4.Relaxation) ===========================
156156
std::string relax_method = "cg"; ///< methods to move_ion: sd, bfgs, cg...
157-
RelaxMethodParam relax_method_param;
157+
RelaxMethodParam relax_method_param={"cg","1"};
158158
bool relax_new = true;
159159
bool relax = false; ///< allow relaxation along the specific direction
160160
double relax_scale_force = 0.5;

source/source_io/read_input_item_relax.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ void ReadInput::item_relax()
1414
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-
if(item.get_size()==0)
18-
{
19-
para.input.relax_method_param.method="cg";
20-
para.input.relax_method = para.input.relax_method_param.method;
21-
para.input.relax_method_param.param = "1";
22-
}
23-
else if(item.get_size()==1)
17+
if(item.get_size()==1)
2418
{
2519
para.input.relax_method_param.method=item.str_values[0];
2620
para.input.relax_method = para.input.relax_method_param.method;
@@ -33,7 +27,7 @@ void ReadInput::item_relax()
3327
para.input.relax_method_param.param = item.str_values[1];
3428
}
3529
};
36-
item.check_value = [](const Input_Item& item, const Parameter& para) {
30+
item.check_value = [](const Input_Item& item, const Parameter& para) {
3731
const std::vector<std::string> relax_methods = {"cg", "sd", "cg_bfgs","bfgs","lbfgs"};
3832
if (std::find(relax_methods.begin(), relax_methods.end(), para.input.relax_method_param.method) == relax_methods.end()) {
3933
const std::string warningstr = nofound_str(relax_methods, "relax_method");

0 commit comments

Comments
 (0)