|
63 | 63 |
|
64 | 64 | // test RDMFT |
65 | 65 | #include "source_lcao/module_rdmft/rdmft.h" |
66 | | - |
67 | 66 | #include "source_lcao/module_gint/temp_gint/gint_info.h" |
68 | 67 |
|
69 | | -#include <iostream> |
| 68 | +#include "source_estate/module_charge/chgmixing.h" // use charge mixing, mohan add 20251006 |
| 69 | + |
70 | 70 |
|
71 | 71 | namespace ModuleESolver |
72 | 72 | { |
@@ -526,52 +526,7 @@ void ESolver_KS_LCAO<TK, TR>::iter_init(UnitCell& ucell, const int istep, const |
526 | 526 | elecstate::DensityMatrix<TK, double>* dm |
527 | 527 | = dynamic_cast<const elecstate::ElecStateLCAO<TK>*>(this->pelec)->get_DM(); |
528 | 528 |
|
529 | | - if (iter == 1) |
530 | | - { |
531 | | - this->p_chgmix->mix_reset(); // init mixing |
532 | | - this->p_chgmix->mixing_restart_step = PARAM.inp.scf_nmax + 1; |
533 | | - this->p_chgmix->mixing_restart_count = 0; |
534 | | - // this output will be removed once the feeature is stable |
535 | | - if (GlobalC::dftu.uramping > 0.01) |
536 | | - { |
537 | | - std::cout << " U-Ramping! Current U = "; |
538 | | - for (int i = 0; i < GlobalC::dftu.U0.size(); i++) |
539 | | - { |
540 | | - std::cout << GlobalC::dftu.U[i] * ModuleBase::Ry_to_eV << " "; |
541 | | - } |
542 | | - std::cout << " eV " << std::endl; |
543 | | - } |
544 | | - } |
545 | | - |
546 | | - // for mixing restart |
547 | | - if (iter == this->p_chgmix->mixing_restart_step && PARAM.inp.mixing_restart > 0.0) |
548 | | - { |
549 | | - this->p_chgmix->init_mixing(); |
550 | | - this->p_chgmix->mixing_restart_count++; |
551 | | - if (PARAM.inp.dft_plus_u) |
552 | | - { |
553 | | - GlobalC::dftu.uramping_update(); // update U by uramping if uramping > 0.01 |
554 | | - if (GlobalC::dftu.uramping > 0.01) |
555 | | - { |
556 | | - std::cout << " U-Ramping! Current U = "; |
557 | | - for (int i = 0; i < GlobalC::dftu.U0.size(); i++) |
558 | | - { |
559 | | - std::cout << GlobalC::dftu.U[i] * ModuleBase::Ry_to_eV << " "; |
560 | | - } |
561 | | - std::cout << " eV " << std::endl; |
562 | | - } |
563 | | - if (GlobalC::dftu.uramping > 0.01 && !GlobalC::dftu.u_converged()) |
564 | | - { |
565 | | - this->p_chgmix->mixing_restart_step = PARAM.inp.scf_nmax + 1; |
566 | | - } |
567 | | - } |
568 | | - if (PARAM.inp.mixing_dmr) // for mixing_dmr |
569 | | - { |
570 | | - // allocate memory for dmr_mdata |
571 | | - int nnr_tmp = dm->get_DMR_pointer(1)->get_nnr(); |
572 | | - this->p_chgmix->allocate_mixing_dmr(nnr_tmp); |
573 | | - } |
574 | | - } |
| 529 | + module_charge::chgmixing_ks_lcao(iter, this->p_chgmix, dm->get_DMR_pointer(1)->get_nnr(), PARAM.inp); |
575 | 530 |
|
576 | 531 | // mohan update 2012-06-05 |
577 | 532 | this->pelec->f_en.deband_harris = this->pelec->cal_delta_eband(ucell); |
|
0 commit comments