Skip to content

Conversation

@WHUweiqingzhou
Copy link
Collaborator

Fix #6128
Fix #6086

Because the tolerance for negative values in numerical stability calculations is uncertain, I'm not sure whether to add a warning or a warningQuit here.

chr->rhog[1][ig] = 0.5 * (rhog_mag[ig] - rhog_mag[ig+npw]);
if (chr->rhog[1][ig] < 0.0)
{
ModuleBase::WARNING_QUIT("Charge_Mixing", "Magnetism is larger than Charge at some grid, please try a smaller mixing_beta_mag!");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to use "max(0.0, rhog[is][ig])" rather than if and warning_quit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Negative beta rho in DFT calculations outlying behavior when running with 2 cores for mixing kinetic energy density

2 participants