-
Notifications
You must be signed in to change notification settings - Fork 145
Adding an input keyword to set density thresholds in DFT calculations #5659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| double XC_Functional::dens_threshold = 1.0e-10; | ||
| double XC_Functional::zeta_threshold = dens_threshold; | ||
| double XC_Functional::grho_threshold = dens_threshold; | ||
| double XC_Functional::tau_threshold = dens_threshold; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, I have on major and two minor comments here.
the major one is, your change indicate all these four thresholds are correlated. Is this always true? if not, you can use the "dens_threshold" as default for the latter three.
the other two minor are:
- for you abbreviate the "density" as "dens", you can also use "thr" instead of the full name "threshold". The use of "thr" can refer to QE, like conv_thr, force_thr, etc.
- you name variables with some inconsistency. You denote the density as "dens" but use physical symbol name like "tau", "zeta", "grho" in the following. For it is under the context of "XC", so it is okay to use "rho" instead, say, "rho_thr", "grho_thr", "zeta_thr" and "tau_thr".
| void XC_Functional::set_xc_ingred_thrs(double _thr_in) | ||
| { | ||
| hybrid_alpha = alpha_in; | ||
| XC_Functional::dens_threshold = _thr_in; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| void XC_Functional::set_xc_ingred_thrs(double _thr_in) | |
| { | |
| hybrid_alpha = alpha_in; | |
| XC_Functional::dens_threshold = _thr_in; | |
| void XC_Functional::set_xc_ingred_thrs(const double& thr) | |
| { | |
| XC_Functional::dens_threshold = thr; |
| this->add_item(item); | ||
| } | ||
| { | ||
| Input_Item item("xc_dens_thr"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can check if there is similar design in other codes. For cp2k, I find these:
- https://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html#CP2K_INPUT.FORCE_EVAL.DFT.QS.EPS_RHO
- https://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html#CP2K_INPUT.FORCE_EVAL.DFT.QS.EPS_RHO_GSPACE
- https://manual.cp2k.org/trunk/CP2K_INPUT/FORCE_EVAL/DFT/QS.html#CP2K_INPUT.FORCE_EVAL.DFT.QS.EPS_RHO_RSPACE
| bool gamma_only = false; ///< for plane wave. | ||
| int scf_nmax = 100; ///< number of max elec iter | ||
| double scf_thr = -1.0; ///< \sum |rhog_out - rhog_in |^2 | ||
| double xc_dens_thr = 1.0e-10; ///< threshold for density and other DFT ingredients to toss away in DFT calculation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will xc_rho_thr be better?
|
Reopen it if needed |
Reminder
Linked Issue
Fix #5594
Unit Tests and/or Case Tests for my changes
What's changed?
This PR adds a new input keyword to set the thresholds of DFT ingredients.
This is a work in progress as the unit tests are not checked yet. I will finalize this PR after all necessary unit tests are done.
Any changes of core modules? (ignore if not applicable)