From 33d96d5fd5c40f361cbfd19748cc6b03bd58f2bb Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Fri, 1 Nov 2024 16:22:37 +0800 Subject: [PATCH 1/3] revalue ecutwfc by basis_type and add a check --- source/module_io/read_input_item_system.cpp | 18 ++++++++++++++++++ source/module_parameter/input_parameter.h | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp index 65a4727022..d831a4ca69 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){ + 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 From 391f67c5790fed0defd136c5e14d90b58d7bfe64 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Fri, 1 Nov 2024 16:24:44 +0800 Subject: [PATCH 2/3] add some comments --- source/module_io/read_input_item_system.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/module_io/read_input_item_system.cpp b/source/module_io/read_input_item_system.cpp index d831a4ca69..3828759674 100644 --- a/source/module_io/read_input_item_system.cpp +++ b/source/module_io/read_input_item_system.cpp @@ -263,7 +263,7 @@ void ReadInput::item_system() 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){ + if (para.input.ecutwfc == 0){ // 0 means no input value if (para.input.basis_type == "lcao") { para.input.ecutwfc = 100; From 718d210c017f91b7c770bae19120a965ea768a25 Mon Sep 17 00:00:00 2001 From: Weiqing Zhou Date: Fri, 1 Nov 2024 16:31:19 +0800 Subject: [PATCH 3/3] update the 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 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