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 @@ -96,12 +96,8 @@ void Charge_Mixing::mix_rho_recip(Charge* chr)
9696 }
9797 for (int ig = 0 ; ig < npw; ig++)
9898 {
99- chr->rhog [0 ][ig] = 0.5 * (rhog_mag[ig] + rhog_mag[ig+npw]);
100- 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- }
99+ chr->rhog [0 ][ig] = max (0.0 , 0.5 * (rhog_mag[ig] + rhog_mag[ig+npw]));
100+ chr->rhog [1 ][ig] = max (0.0 , 0.5 * (rhog_mag[ig] - rhog_mag[ig+npw]));
105101 }
106102 // delete
107103 delete[] rhog_mag;
@@ -393,12 +389,8 @@ void Charge_Mixing::mix_rho_real(Charge* chr)
393389 }
394390 for (int ir = 0 ; ir < nrxx; ir++)
395391 {
396- chr->rho [0 ][ir] = 0.5 * (rho_mag[ir] + rho_mag[ir+nrxx]);
397- 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- }
392+ chr->rho [0 ][ir] = max (0.0 , 0.5 * (rho_mag[ir] + rho_mag[ir+nrxx]));
393+ chr->rho [1 ][ir] = max (0.0 , 0.5 * (rho_mag[ir] - rho_mag[ir+nrxx]));
402394 }
403395 // delete
404396 delete[] rho_mag;
You can’t perform that action at this time.
0 commit comments