Skip to content

Commit 7d47d0a

Browse files
committed
prepare for PR
2 parents d0b366c + b90f546 commit 7d47d0a

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

source/module_rdmft/rdmft.cpp

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ void RDMFT<TK, TR>::update_elec(const ModuleBase::matrix& occ_number_in, const p
270270
// update wfc
271271
TK* pwfc_in = &wfc_in(0, 0, 0);
272272
TK* pwfc = &wfc(0, 0, 0);
273-
for(int i=0; i<wfc.size(); ++i) pwfc[i] = pwfc_in[i];
273+
for(int i=0; i<wfc.size(); ++i) { pwfc[i] = pwfc_in[i];
274+
}
274275

275276
// update charge
276277
this->update_charge();
@@ -575,7 +576,8 @@ void RDMFT<TK, TR>::cal_V_XC()
575576

576577
std::vector< std::vector<TK> > DM_XC(nk_total, std::vector<TK>(ParaV->nloc));
577578
std::vector< const std::vector<TK>* > DM_XC_pointer(nk_total);
578-
for(int ik=0; ik<nk_total; ++ik) DM_XC_pointer[ik] = &DM_XC[ik];
579+
for(int ik=0; ik<nk_total; ++ik) { DM_XC_pointer[ik] = &DM_XC[ik];
580+
}
579581

580582
get_DM_XC(DM_XC);
581583

@@ -918,8 +920,32 @@ void RDMFT<TK, TR>::cal_Energy(const int cal_type)
918920
{
919921
GlobalV::ofs_running << "\n\nfrom class RDMFT: \nXC_fun: " << XC_func_rdmft << std::endl;
920922
#ifdef __EXX
923+
<<<<<<< HEAD
921924
if( GlobalC::exx_info.info_global.cal_exx ) GlobalV::ofs_running << "alpha_power: " << alpha_power << std::endl;
922925
#endif
926+
=======
927+
if( GlobalC::exx_info.info_global.cal_exx ) { std::cout << "alpha_power: " << alpha_power << std::endl;
928+
}
929+
#endif
930+
std::cout << std::fixed << std::setprecision(10)
931+
<< "******\nE(TV + Hartree + XC) by RDMFT: " << E_RDMFT[3]
932+
<< "\n\nE_TV_RDMFT: " << E_RDMFT[0]
933+
<< "\nE_hartree_RDMFT: " << E_RDMFT[1]
934+
<< "\nExc_" << XC_func_rdmft << "_RDMFT: " << E_RDMFT[2]
935+
<< "\nE_Ewald: " << E_Ewald
936+
<< "\nE_entropy(-TS): " << E_entropy
937+
<< "\nE_descf: " << E_descf
938+
<< "\n\nEtotal_RDMFT: " << Etotal
939+
<< "\n\nExc_ksdft: " << E_xc_KS
940+
<< "\nE_exx_ksdft: " << E_exx_KS
941+
<<"\n******\n\n" << std::endl;
942+
943+
std::cout << "\netxc: " << etxc << "\nvtxc: " << vtxc << "\n";
944+
std::cout << "\nE_deband_KS: " << E_deband_KS << "\nE_deband_harris_KS: " << E_deband_harris_KS << "\n\n" << std::endl;
945+
946+
if( true )
947+
{
948+
>>>>>>> b90f546a585302ec9060e3a318d10f80e069dd1e
923949
// GlobalV::ofs_running << std::setprecision(12);
924950
// GlobalV::ofs_running << std::setiosflags(std::ios::right);
925951
GlobalV::ofs_running << std::fixed << std::setprecision(10)
@@ -954,7 +980,8 @@ double RDMFT<TK, TR>::run(ModuleBase::matrix& E_gradient_occNum, psi::Psi<TK>& E
954980

955981
TK* pwfc = &occNum_HamiltWfc(0, 0, 0);
956982
TK* pwfc_out = &E_gradient_wfc(0, 0, 0);
957-
for(int i=0; i<wfc.size(); ++i) pwfc_out[i] = pwfc[i];
983+
for(int i=0; i<wfc.size(); ++i) { pwfc_out[i] = pwfc[i];
984+
}
958985

959986
// test
960987
// rdmft::printMatrix_pointer(E_gradient_occNum.nr, E_gradient_occNum.nc, &E_gradient_occNum(0, 0), "E_gradient_occNum");

source/module_rdmft/rdmft_tools.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ void printMatrix_pointer(int M, int N, const TK* matrixA, std::string nameA)
6060
{
6161
for(int j=0; j<N; ++j)
6262
{
63-
if( j%5 == 0 ) std::cout << "\n";
63+
if( j%5 == 0 ) { std::cout << "\n";
64+
}
6465
std::cout << *(matrixA+i*N+j) << " ";
6566
}
6667
std::cout << "\n";
@@ -77,7 +78,8 @@ void printMatrix_vector(int M, int N, const std::vector<TK>& matrixA, std::strin
7778
{
7879
for(int j=0; j<N; ++j)
7980
{
80-
if( j%5 == 0 ) std::cout << "\n";
81+
if( j%5 == 0 ) { std::cout << "\n";
82+
}
8183
std::cout << matrixA[i*N+j] << " ";
8284
}
8385
std::cout << "\n\n";
@@ -94,7 +96,8 @@ double occNum_func(double eta, int symbol = 0, const std::string XC_func_rdmft =
9496
template <typename TK>
9597
void set_zero_vector(std::vector<TK>& HK)
9698
{
97-
for(int i=0; i<HK.size(); ++i) HK[i] = 0.0;
99+
for(int i=0; i<HK.size(); ++i) { HK[i] = 0.0;
100+
}
98101
}
99102

100103

@@ -115,7 +118,8 @@ template <typename TK>
115118
void conj_psi(psi::Psi<TK>& wfc)
116119
{
117120
TK* pwfc = &wfc(0, 0, 0);
118-
for(int i=0; i<wfc.size(); ++i) pwfc[i] = std::conj( pwfc[i] );
121+
for(int i=0; i<wfc.size(); ++i) { pwfc[i] = std::conj( pwfc[i] );
122+
}
119123
}
120124

121125

0 commit comments

Comments
 (0)