Skip to content

Commit b90f546

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 600abc0 commit b90f546

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

source/module_rdmft/rdmft.cpp

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

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

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

579581
get_DM_XC(DM_XC);
580582

@@ -895,7 +897,8 @@ void RDMFT<TK, TR>::cal_Energy(const int cal_type)
895897
// print results
896898
std::cout << "\n\nfrom class RDMFT: \nXC_fun: " << XC_func_rdmft << std::endl;
897899
#ifdef __EXX
898-
if( GlobalC::exx_info.info_global.cal_exx ) std::cout << "alpha_power: " << alpha_power << std::endl;
900+
if( GlobalC::exx_info.info_global.cal_exx ) { std::cout << "alpha_power: " << alpha_power << std::endl;
901+
}
899902
#endif
900903
std::cout << std::fixed << std::setprecision(10)
901904
<< "******\nE(TV + Hartree + XC) by RDMFT: " << E_RDMFT[3]
@@ -913,7 +916,7 @@ void RDMFT<TK, TR>::cal_Energy(const int cal_type)
913916
std::cout << "\netxc: " << etxc << "\nvtxc: " << vtxc << "\n";
914917
std::cout << "\nE_deband_KS: " << E_deband_KS << "\nE_deband_harris_KS: " << E_deband_harris_KS << "\n\n" << std::endl;
915918

916-
if( 1 )
919+
if( true )
917920
{
918921
// GlobalV::ofs_running << std::setprecision(12);
919922
// GlobalV::ofs_running << std::setiosflags(std::ios::right);
@@ -950,7 +953,8 @@ double RDMFT<TK, TR>::run(ModuleBase::matrix& E_gradient_occNum, psi::Psi<TK>& E
950953

951954
TK* pwfc = &occNum_HamiltWfc(0, 0, 0);
952955
TK* pwfc_out = &E_gradient_wfc(0, 0, 0);
953-
for(int i=0; i<wfc.size(); ++i) pwfc_out[i] = pwfc[i];
956+
for(int i=0; i<wfc.size(); ++i) { pwfc_out[i] = pwfc[i];
957+
}
954958

955959
// test
956960
// 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)