Background
Currently, ABACUS set the default value of a parameter twice:
this->Default(); // before reading all parameters, set a fixed default value
bool success = this->Read(fn);
this->Default_2(); // after reading all parameters, force changing the value
Such logic cannot support a "flexible default value" like this:
- Usually, the default value of symmetry is 1.
- If calculation=nscf/istate/ienvelope, the default value of
symmetry should be 0.
- However, if it is set by user to 1, the final value should be 1.
That is, if read in, set by user; if not read in, set the default value depending on some other parameters.
Current Solution
Set a string-type variable to "default", if(=="default”)modify it in Default_2(), then use stod, stoi... to convert it later.
Future Solution
There may be a common and user-friendly (int-is-int, double-is-double) solution rather than using string with stoi/stod.
Since most of such parameters are exx-related, I will discuss it with @PeizeLin ;-)
Background
Currently, ABACUS set the default value of a parameter twice:
Such logic cannot support a "flexible default value" like this:
symmetryshould be 0.That is, if read in, set by user; if not read in, set the default value depending on some other parameters.
Current Solution
Set a string-type variable to "default", if(=="default”)modify it in
Default_2(), then usestod, stoi...to convert it later.Future Solution
There may be a common and user-friendly (int-is-int, double-is-double) solution rather than using string with stoi/stod.
Since most of such parameters are exx-related, I will discuss it with @PeizeLin ;-)