diff --git a/docs/advanced/input_files/input-main.md b/docs/advanced/input_files/input-main.md index 1c355366d6..6acbd732b8 100644 --- a/docs/advanced/input_files/input-main.md +++ b/docs/advanced/input_files/input-main.md @@ -728,7 +728,7 @@ These variables are used to control the plane wave related parameters. - **Type**: Real - **Description**: Energy cutoff for plane wave functions, the unit is **Rydberg**. Note that even for localized orbitals basis, you still need to setup an energy cutoff for this system. Because our local pseudopotential parts and the related force are calculated from plane wave basis set, etc. Also, because our orbitals are generated by matching localized orbitals to a chosen set of wave functions from a certain energy cutoff, this set of localize orbitals is most accurate under this same plane wave energy cutoff. -- **Default**: 50 +- **Default**: 50 Ry (PW basis), 100 Ry (LCAO basis) ### ecutrho diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp index 65a4727022..3828759674 100644 --- a/source/module_io/read_input_item_system.cpp +++ b/source/module_io/read_input_item_system.cpp @@ -262,6 +262,24 @@ void ReadInput::item_system() Input_Item item("ecutwfc"); item.annotation = "energy cutoff for wave functions"; read_sync_double(input.ecutwfc); + item.reset_value = [](const Input_Item& item, Parameter& para) { + if (para.input.ecutwfc == 0){ // 0 means no input value + if (para.input.basis_type == "lcao") + { + para.input.ecutwfc = 100; + } + else + { + para.input.ecutwfc = 50; + } + } + }; + item.check_value = [](const Input_Item& item, const Parameter& para) { + if (para.input.ecutwfc <= 0) + { + ModuleBase::WARNING_QUIT("ReadInput", "ecutwfc should be positive"); + } + }; this->add_item(item); } { diff --git a/source/module_parameter/input_parameter.h b/source/module_parameter/input_parameter.h index 17284d4bb9..e637357c06 100644 --- a/source/module_parameter/input_parameter.h +++ b/source/module_parameter/input_parameter.h @@ -33,7 +33,7 @@ struct Input_para int kpar = 1; ///< ecch pool is for one k point int bndpar = 1; ///< parallel for stochastic/deterministic bands std::string latname = "none"; ///< lattice name - double ecutwfc = 50; ///< energy cutoff for wavefunctions + double ecutwfc = 0; ///< energy cutoff for wavefunctions double ecutrho = 0; ///< energy cutoff for charge/potential int nx = 0, ny = 0, nz = 0; ///< three dimension of FFT wavefunc