From 86af7fccd5fb85a5801c74952429f167fc751e91 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Fri, 15 Nov 2024 17:46:22 +0800 Subject: [PATCH 1/7] fix a bug of relax_nmax default --- source/module_io/read_input_item_relax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_relax.cpp b/source/module_io/read_input_item_relax.cpp index c9545576c2..cda6984411 100644 --- a/source/module_io/read_input_item_relax.cpp +++ b/source/module_io/read_input_item_relax.cpp @@ -58,7 +58,7 @@ void ReadInput::item_relax() } else if (calculation == "relax" || calculation == "cell-relax") { - if (!para.input.relax_nmax) + if (para.input.relax_nmax == 1) { para.input.relax_nmax = 50; } From 00409db767b0a78e9d4720374a65fe3e63d98f24 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:04:35 +0800 Subject: [PATCH 2/7] forbid relax_nmax=1 if relax --- tests/integrate/150_PW_15_CR_VDW3/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW2/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW3/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integrate/150_PW_15_CR_VDW3/INPUT b/tests/integrate/150_PW_15_CR_VDW3/INPUT index fd89158b41..11ff663e15 100644 --- a/tests/integrate/150_PW_15_CR_VDW3/INPUT +++ b/tests/integrate/150_PW_15_CR_VDW3/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation cell-relax +calculation scf cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW2/INPUT b/tests/integrate/250_NO_KP_CR_VDW2/INPUT index a66be66b03..87e6265116 100644 --- a/tests/integrate/250_NO_KP_CR_VDW2/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW2/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation cell-relax +calculation scf cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW3/INPUT b/tests/integrate/250_NO_KP_CR_VDW3/INPUT index 62b007f191..aeb169aa24 100644 --- a/tests/integrate/250_NO_KP_CR_VDW3/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW3/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation cell-relax +calculation scf cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT b/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT index a0753cdbc6..a38e44df49 100644 --- a/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation cell-relax +calculation scf cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB From ed2235da0a7e5edacfa9f039f957518536a8e590 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:09:55 +0800 Subject: [PATCH 3/7] Revert "forbid relax_nmax=0 if relax" This reverts commit 00409db767b0a78e9d4720374a65fe3e63d98f24. --- tests/integrate/150_PW_15_CR_VDW3/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW2/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW3/INPUT | 2 +- tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integrate/150_PW_15_CR_VDW3/INPUT b/tests/integrate/150_PW_15_CR_VDW3/INPUT index 11ff663e15..fd89158b41 100644 --- a/tests/integrate/150_PW_15_CR_VDW3/INPUT +++ b/tests/integrate/150_PW_15_CR_VDW3/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation scf +calculation cell-relax cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW2/INPUT b/tests/integrate/250_NO_KP_CR_VDW2/INPUT index 87e6265116..a66be66b03 100644 --- a/tests/integrate/250_NO_KP_CR_VDW2/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW2/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation scf +calculation cell-relax cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW3/INPUT b/tests/integrate/250_NO_KP_CR_VDW3/INPUT index aeb169aa24..62b007f191 100644 --- a/tests/integrate/250_NO_KP_CR_VDW3/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW3/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation scf +calculation cell-relax cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB diff --git a/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT b/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT index a38e44df49..a0753cdbc6 100644 --- a/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT +++ b/tests/integrate/250_NO_KP_CR_VDW3BJ/INPUT @@ -15,7 +15,7 @@ fixed_axes c force_thr_ev 0.005 stress_thr 0.1 suffix autotest -calculation scf +calculation cell-relax cal_force 1 cal_stress 1 pseudo_dir ../../PP_ORB From 109caff3a051ca0c850e20b10770068a4cf0a9e7 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:11:20 +0800 Subject: [PATCH 4/7] Revert "fix a bug of relax_nmax default" This reverts commit 86af7fccd5fb85a5801c74952429f167fc751e91. --- source/module_io/read_input_item_relax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_relax.cpp b/source/module_io/read_input_item_relax.cpp index cda6984411..c9545576c2 100644 --- a/source/module_io/read_input_item_relax.cpp +++ b/source/module_io/read_input_item_relax.cpp @@ -58,7 +58,7 @@ void ReadInput::item_relax() } else if (calculation == "relax" || calculation == "cell-relax") { - if (para.input.relax_nmax == 1) + if (!para.input.relax_nmax) { para.input.relax_nmax = 50; } From d233f324ea0cbd213f4cd44e6964363ec9ad7eb7 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:16:22 +0800 Subject: [PATCH 5/7] the default value of relax_nmax as 0 --- source/module_parameter/input_parameter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index bfd9ae91cb..db71d32b63 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -152,7 +152,7 @@ struct Input_para bool relax_new = true; bool relax = false; ///< allow relaxation along the specific direction double relax_scale_force = 0.5; - int relax_nmax = 1; ///< number of max ionic iter + int relax_nmax = 0; ///< number of max ionic iter double relax_cg_thr = 0.5; ///< threshold when cg to bfgs, pengfei add 2011-08-15 double force_thr = -1; ///< threshold of force in unit (Ry/Bohr) double force_thr_ev = -1; ///< threshold of force in unit (eV/Angstrom) From f1fa8ac10356f2f17476b28c538935bed602f5d3 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:16:45 +0800 Subject: [PATCH 6/7] add some comment --- source/module_io/read_input_item_relax.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_relax.cpp b/source/module_io/read_input_item_relax.cpp index f222b25ef9..e39abb57d0 100644 --- a/source/module_io/read_input_item_relax.cpp +++ b/source/module_io/read_input_item_relax.cpp @@ -58,7 +58,7 @@ void ReadInput::item_relax() } else if (calculation == "relax" || calculation == "cell-relax") { - if (!para.input.relax_nmax) + if (para.input.relax_nmax == 0) // default value { para.input.relax_nmax = 50; } From 980465aee71695da489065702ddba803a85df188 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Mon, 18 Nov 2024 17:17:06 +0800 Subject: [PATCH 7/7] docs --- docs/advanced/input_files/input-main.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 40edbf5538..d8491bbf71 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -1389,7 +1389,7 @@ These variables are used to control the geometry relaxation. - **Type**: Integer - **Description**: The maximal number of ionic iteration steps, the minimum value is 1. -- **Default**: 1 +- **Default**: 1 for SCF, 50 for relax and cell-relax calcualtions ### relax_cg_thr