Skip to content

Commit 33d96d5

Browse files
revalue ecutwfc by basis_type and add a check
1 parent 3984296 commit 33d96d5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

source/module_io/read_input_item_system.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,24 @@ void ReadInput::item_system()
262262
Input_Item item("ecutwfc");
263263
item.annotation = "energy cutoff for wave functions";
264264
read_sync_double(input.ecutwfc);
265+
item.reset_value = [](const Input_Item& item, Parameter& para) {
266+
if (para.input.ecutwfc == 0){
267+
if (para.input.basis_type == "lcao")
268+
{
269+
para.input.ecutwfc = 100;
270+
}
271+
else
272+
{
273+
para.input.ecutwfc = 50;
274+
}
275+
}
276+
};
277+
item.check_value = [](const Input_Item& item, const Parameter& para) {
278+
if (para.input.ecutwfc <= 0)
279+
{
280+
ModuleBase::WARNING_QUIT("ReadInput", "ecutwfc should be positive");
281+
}
282+
};
265283
this->add_item(item);
266284
}
267285
{

source/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct Input_para
3333
int kpar = 1; ///< ecch pool is for one k point
3434
int bndpar = 1; ///< parallel for stochastic/deterministic bands
3535
std::string latname = "none"; ///< lattice name
36-
double ecutwfc = 50; ///< energy cutoff for wavefunctions
36+
double ecutwfc = 0; ///< energy cutoff for wavefunctions
3737
double ecutrho = 0; ///< energy cutoff for charge/potential
3838

3939
int nx = 0, ny = 0, nz = 0; ///< three dimension of FFT wavefunc

0 commit comments

Comments
 (0)