Skip to content

Commit 8c9e0da

Browse files
Fix: fix a bug of relax_nmax default (#5506)
* fix a bug of relax_nmax default * forbid relax_nmax=1 if relax * Revert "forbid relax_nmax=0 if relax" This reverts commit 00409db. * Revert "fix a bug of relax_nmax default" This reverts commit 86af7fc. * the default value of relax_nmax as 0 * add some comment * docs
1 parent 78497ca commit 8c9e0da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1389,7 +1389,7 @@ These variables are used to control the geometry relaxation.
13891389

13901390
- **Type**: Integer
13911391
- **Description**: The maximal number of ionic iteration steps, the minimum value is 1.
1392-
- **Default**: 1
1392+
- **Default**: 1 for SCF, 50 for relax and cell-relax calcualtions
13931393

13941394
### relax_cg_thr
13951395

source/module_io/read_input_item_relax.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void ReadInput::item_relax()
5858
}
5959
else if (calculation == "relax" || calculation == "cell-relax")
6060
{
61-
if (!para.input.relax_nmax)
61+
if (para.input.relax_nmax == 0) // default value
6262
{
6363
para.input.relax_nmax = 50;
6464
}

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct Input_para
152152
bool relax_new = true;
153153
bool relax = false; ///< allow relaxation along the specific direction
154154
double relax_scale_force = 0.5;
155-
int relax_nmax = 1; ///< number of max ionic iter
155+
int relax_nmax = 0; ///< number of max ionic iter
156156
double relax_cg_thr = 0.5; ///< threshold when cg to bfgs, pengfei add 2011-08-15
157157
double force_thr = -1; ///< threshold of force in unit (Ry/Bohr)
158158
double force_thr_ev = -1; ///< threshold of force in unit (eV/Angstrom)

0 commit comments

Comments
 (0)