File tree Expand file tree Collapse file tree
source/source_estate/module_charge Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,6 +98,10 @@ void Charge_Mixing::mix_rho_recip(Charge* chr)
9898 {
9999 chr->rhog [0 ][ig] = 0.5 * (rhog_mag[ig] + rhog_mag[ig+npw]);
100100 chr->rhog [1 ][ig] = 0.5 * (rhog_mag[ig] - rhog_mag[ig+npw]);
101+ if (chr->rhog [1 ][ig] < 0.0 )
102+ {
103+ ModuleBase::WARNING_QUIT (" Charge_Mixing" , " Magnetism is larger than Charge at some grid, please try a smaller mixing_beta_mag!" );
104+ }
101105 }
102106 // delete
103107 delete[] rhog_mag;
@@ -391,6 +395,10 @@ void Charge_Mixing::mix_rho_real(Charge* chr)
391395 {
392396 chr->rho [0 ][ir] = 0.5 * (rho_mag[ir] + rho_mag[ir+nrxx]);
393397 chr->rho [1 ][ir] = 0.5 * (rho_mag[ir] - rho_mag[ir+nrxx]);
398+ if (chr->rho [1 ][ir] < 0.0 )
399+ {
400+ ModuleBase::WARNING_QUIT (" Charge_Mixing" , " Magnetism is larger than Charge at some grid, please try a smaller mixing_beta_mag!" );
401+ }
394402 }
395403 // delete
396404 delete[] rho_mag;
You can’t perform that action at this time.
0 commit comments