File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments