Skip to content

Commit 6cc8863

Browse files
author
Kai Luo
committed
save
1 parent 49742a7 commit 6cc8863

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

source/source_esolver/directmin_problems/rdmft_lcao.cpp

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ RDMFT_LCAO<TK, TR>::RDMFT_LCAO(UnitCell& ucell, const Input_para& inp)
6363
// inp.rdmft_power_alpha);
6464
// call update_ion for rdmft_ptr;
6565
ESolver_KS_LCAO<TK, TR>::before_scf(ucell, 0);
66-
rdmft_ptr->update_ion(ucell, *(this->pw_rho), this->locpp.vloc, this->sf.strucFac);
66+
// rdmft_ptr->update_ion(ucell, *(this->pw_rho), this->locpp.vloc, this->sf.strucFac);
6767

68-
rdmft_ptr->cal_Energy();
68+
// rdmft_ptr->cal_Energy();
6969

70-
std::cout << "Called f() in RDMFT_LCAO, Etotal = " << this->rdmft_ptr->Etotal << std::endl;
71-
std::cout << "Called f() in RDMFT_LCAO, E[0] = " << this->rdmft_ptr->E_RDMFT[0] << std::endl;
72-
std::cout << "Called f() in RDMFT_LCAO, E[1] = " << this->rdmft_ptr->E_RDMFT[1] << std::endl;
73-
std::cout << "Called f() in RDMFT_LCAO, E[2] = " << this->rdmft_ptr->E_RDMFT[2] << std::endl;
74-
std::cout << "Called f() in RDMFT_LCAO, E[3] = " << this->rdmft_ptr->E_RDMFT[3] << std::endl;
70+
// std::cout << "Called f() in RDMFT_LCAO, Etotal = " << this->rdmft_ptr->Etotal << std::endl;
71+
// std::cout << "Called f() in RDMFT_LCAO, E[0] = " << this->rdmft_ptr->E_RDMFT[0] << std::endl;
72+
// std::cout << "Called f() in RDMFT_LCAO, E[1] = " << this->rdmft_ptr->E_RDMFT[1] << std::endl;
73+
// std::cout << "Called f() in RDMFT_LCAO, E[2] = " << this->rdmft_ptr->E_RDMFT[2] << std::endl;
74+
// std::cout << "Called f() in RDMFT_LCAO, E[3] = " << this->rdmft_ptr->E_RDMFT[3] << std::endl;
7575

7676
// const integer nbands = static_cast<integer>(inp.nbands > 0 ? inp.nbands : 1);
7777
// const integer stiefel_n = nbands;
@@ -121,6 +121,7 @@ RDMFT_LCAO<TK, TR>::RDMFT_LCAO(UnitCell& ucell, const Input_para& inp)
121121

122122
// this->mani->ChooseParamsSet4();
123123

124+
this->printInfo();
124125
}
125126

126127
// template <typename TK, typename TR>
@@ -192,7 +193,7 @@ realdp RDMFT_LCAO<TK, TR>::f(const Variable& x) const
192193
ModuleBase::WARNING("RDMFT_LCAO", "UnitCell reference is unavailable before calling update_elec");
193194
throw std::runtime_error("RDMFT_LCAO::f requires a valid UnitCell reference");
194195
}
195-
if(false)
196+
if(true)
196197
{
197198
std::cout << "before update_elec" << std::endl;
198199
std::cout << " nk_total = " << this->nk_total << ", nbands_total = " << this->nbands_total << std::endl;
@@ -459,6 +460,21 @@ void RDMFT_LCAO<TK, TR>::KSStateToVariable(const ModuleBase::matrix& occ_num,
459460
this->rdmft_ptr->update_elec(*this->ucell_ref_, occ_num, wfc);
460461
}
461462

463+
template <typename TK, typename TR>
464+
void RDMFT_LCAO<TK, TR>::printInfo()
465+
{
466+
std::cout << std::endl;
467+
std::cout << "----------------------------------------" << std::endl;
468+
std::cout << "RDMFT_LCAO Problem Info:" << std::endl;
469+
std::cout << " Number of spins: " << nspin << std::endl;
470+
std::cout << " Total k-points: " << nk_total << std::endl;
471+
std::cout << " Total bands: " << nbands_total << std::endl;
472+
std::cout << " Total basis functions: " << nbasis_total << std::endl;
473+
std::cout << "----------------------------------------" << std::endl;
474+
std::cout << std::endl;
475+
476+
}
477+
462478
// Explicit template instantiations for the typical scalar combinations used in ABACUS.
463479
template class RDMFT_LCAO<double, double>;
464480
template class RDMFT_LCAO<std::complex<double>, double>;

source/source_esolver/directmin_problems/rdmft_lcao.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class RDMFT_LCAO : public Problem, public ESolver_KS_LCAO<TK, TR>
9595
const psi::Psi<TK>& wfc,
9696
Variable& x) const;
9797

98+
void printInfo();
9899

99100
};
100101

source/source_esolver/esolver_rdmft_lcao.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void ESolver_RDMFT_LCAO<TK, TR>::before_all_runners(UnitCell& ucell, const Input
8686

8787

8888
// Call parent class method properly
89-
// this->ESolver_KS_LCAO<double, double>::before_all_runners(ucell, inp);
89+
ESolver_KS_LCAO<TK, TR>::before_all_runners(ucell, inp);
9090

9191
// Initialize the DirectMin solver based on the optimization approach
9292
this->initialize(ucell, inp);
@@ -757,7 +757,10 @@ void ESolver_RDMFT_LCAO<TK, TR>::setup_initial_guess(UnitCell& ucell, const Inpu
757757
{
758758
K_Vectors & kv = p_esolver->get_kv();
759759
occ_buffer[ib] = p_esolver->get_pelec()->wg(ik, ib) / kv.wk[ik];
760-
std::cout << "Initial occupation for k-point " << ik << ", band " << ib << ": " << occ_buffer[ib] << std::endl;
760+
if(false)
761+
{
762+
std::cout << "Initial occupation for k-point " << ik << ", band " << ib << ": " << occ_buffer[ib] << std::endl;
763+
}
761764
}
762765

763766
}

0 commit comments

Comments
 (0)