Skip to content

Commit

Permalink
Fix: fix a bug of relax_nmax default (#5506)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
WHUweiqingzhou authored Nov 19, 2024
1 parent 78497ca commit 8c9e0da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion source/module_io/read_input_item_relax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion source/module_parameter/input_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8c9e0da

Please sign in to comment.