Skip to content

Commit 704f0b8

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 34ba409 commit 704f0b8

File tree

2 files changed

+78
-43
lines changed

2 files changed

+78
-43
lines changed

source/module_ri/Matrix_Orbs21.cpp

Lines changed: 70 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,29 @@ void Matrix_Orbs21::init_radial(const std::vector<std::vector<std::vector<Numeri
6262
ModuleBase::TITLE("Matrix_Orbs21", "init_radial");
6363
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial");
6464
assert(orb_A1.size() == orb_A2.size());
65-
for (size_t TA = 0; TA != orb_A1.size(); ++TA)
66-
for (size_t TB = 0; TB != orb_B.size(); ++TB)
67-
for (int LA1 = 0; LA1 != orb_A1[TA].size(); ++LA1)
68-
for (size_t NA1 = 0; NA1 != orb_A1[TA][LA1].size(); ++NA1)
69-
for (int LA2 = 0; LA2 != orb_A2[TA].size(); ++LA2)
70-
for (size_t NA2 = 0; NA2 != orb_A2[TA][LA2].size(); ++NA2)
71-
for (int LB = 0; LB != orb_B[TB].size(); ++LB)
72-
for (size_t NB = 0; NB != orb_B[TB][LB].size(); ++NB)
65+
for (size_t TA = 0; TA != orb_A1.size(); ++TA) {
66+
for (size_t TB = 0; TB != orb_B.size(); ++TB) {
67+
for (int LA1 = 0; LA1 != orb_A1[TA].size(); ++LA1) {
68+
for (size_t NA1 = 0; NA1 != orb_A1[TA][LA1].size(); ++NA1) {
69+
for (int LA2 = 0; LA2 != orb_A2[TA].size(); ++LA2) {
70+
for (size_t NA2 = 0; NA2 != orb_A2[TA][LA2].size(); ++NA2) {
71+
for (int LB = 0; LB != orb_B[TB].size(); ++LB) {
72+
for (size_t NB = 0; NB != orb_B[TB][LB].size(); ++NB) {
7373
center2_orb21_s[TA][TB][LA1][NA1][LA2][NA2][LB].insert(
7474
std::make_pair(NB,
7575
Center2_Orb::Orb21(orb_A1[TA][LA1][NA1],
7676
orb_A2[TA][LA2][NA2],
7777
orb_B[TB][LB][NB],
7878
psb_,
79-
this->MGT)));
79+
this->MGT)));
80+
}
81+
}
82+
}
83+
}
84+
}
85+
}
86+
}
87+
}
8088
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial");
8189
}
8290

@@ -87,45 +95,61 @@ void Matrix_Orbs21::init_radial(const std::vector<std::vector<std::vector<Numeri
8795
ModuleBase::TITLE("Matrix_Orbs21", "init_radial");
8896
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial");
8997
assert(orb_A1.size() == orb_A2.get_ntype());
90-
for (size_t TA = 0; TA != orb_A1.size(); ++TA)
91-
for (size_t TB = 0; TB != orb_B.get_ntype(); ++TB)
92-
for (int LA1 = 0; LA1 != orb_A1[TA].size(); ++LA1)
93-
for (size_t NA1 = 0; NA1 != orb_A1[TA][LA1].size(); ++NA1)
94-
for (int LA2 = 0; LA2 <= orb_A2.Phi[TA].getLmax(); ++LA2)
95-
for (size_t NA2 = 0; NA2 != orb_A2.Phi[TA].getNchi(LA2); ++NA2)
96-
for (int LB = 0; LB <= orb_B.Phi[TB].getLmax(); ++LB)
97-
for (size_t NB = 0; NB != orb_B.Phi[TB].getNchi(LB); ++NB)
98+
for (size_t TA = 0; TA != orb_A1.size(); ++TA) {
99+
for (size_t TB = 0; TB != orb_B.get_ntype(); ++TB) {
100+
for (int LA1 = 0; LA1 != orb_A1[TA].size(); ++LA1) {
101+
for (size_t NA1 = 0; NA1 != orb_A1[TA][LA1].size(); ++NA1) {
102+
for (int LA2 = 0; LA2 <= orb_A2.Phi[TA].getLmax(); ++LA2) {
103+
for (size_t NA2 = 0; NA2 != orb_A2.Phi[TA].getNchi(LA2); ++NA2) {
104+
for (int LB = 0; LB <= orb_B.Phi[TB].getLmax(); ++LB) {
105+
for (size_t NB = 0; NB != orb_B.Phi[TB].getNchi(LB); ++NB) {
98106
center2_orb21_s[TA][TB][LA1][NA1][LA2][NA2][LB].insert(
99107
std::make_pair(NB,
100108
Center2_Orb::Orb21(orb_A1[TA][LA1][NA1],
101109
orb_A2.Phi[TA].PhiLN(LA2, NA2),
102110
orb_B.Phi[TB].PhiLN(LB, NB),
103111
psb_,
104-
this->MGT)));
112+
this->MGT)));
113+
}
114+
}
115+
}
116+
}
117+
}
118+
}
119+
}
120+
}
105121
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial");
106122
}
107123

108124
void Matrix_Orbs21::init_radial_table()
109125
{
110126
ModuleBase::TITLE("Matrix_Orbs21", "init_radial");
111127
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial_table");
112-
for (auto& coA: center2_orb21_s)
113-
for (auto& coB: coA.second)
114-
for (auto& coC: coB.second)
115-
for (auto& coD: coC.second)
116-
for (auto& coE: coD.second)
117-
for (auto& coF: coE.second)
118-
for (auto& coG: coF.second)
119-
for (auto& coH: coG.second)
120-
coH.second.init_radial_table();
128+
for (auto& coA: center2_orb21_s) {
129+
for (auto& coB: coA.second) {
130+
for (auto& coC: coB.second) {
131+
for (auto& coD: coC.second) {
132+
for (auto& coE: coD.second) {
133+
for (auto& coF: coE.second) {
134+
for (auto& coG: coF.second) {
135+
for (auto& coH: coG.second) {
136+
coH.second.init_radial_table();
137+
}
138+
}
139+
}
140+
}
141+
}
142+
}
143+
}
144+
}
121145
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial_table");
122146
}
123147

124148
void Matrix_Orbs21::init_radial_table(const std::map<size_t, std::map<size_t, std::set<double>>>& Rs)
125149
{
126150
ModuleBase::TITLE("Matrix_Orbs21", "init_radial_table_Rs");
127151
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial_table");
128-
for (const auto& RsA: Rs)
152+
for (const auto& RsA: Rs) {
129153
for (const auto& RsB: RsA.second)
130154
{
131155
if (auto* const center2_orb21_sAB = static_cast<std::map<
@@ -140,17 +164,25 @@ void Matrix_Orbs21::init_radial_table(const std::map<size_t, std::map<size_t, st
140164
{
141165
const double position = R * lat0 / lcao_dr_;
142166
const size_t iq = static_cast<size_t>(position);
143-
for (size_t i = 0; i != 4; ++i)
144-
radials.insert(iq + i);
167+
for (size_t i = 0; i != 4; ++i) {
168+
radials.insert(iq + i);
169+
}
145170
}
146-
for (auto& coC: *center2_orb21_sAB)
147-
for (auto& coD: coC.second)
148-
for (auto& coE: coD.second)
149-
for (auto& coF: coE.second)
150-
for (auto& coG: coF.second)
151-
for (auto& coH: coG.second)
152-
coH.second.init_radial_table(radials);
171+
for (auto& coC: *center2_orb21_sAB) {
172+
for (auto& coD: coC.second) {
173+
for (auto& coE: coD.second) {
174+
for (auto& coF: coE.second) {
175+
for (auto& coG: coF.second) {
176+
for (auto& coH: coG.second) {
177+
coH.second.init_radial_table(radials);
178+
}
179+
}
180+
}
181+
}
182+
}
183+
}
153184
}
154-
}
185+
}
186+
}
155187
ModuleBase::timer::tick("Matrix_Orbs21", "init_radial_table");
156188
}

source/module_ri/exx_opt_orb-print.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ void Exx_Opt_Orb::print_matrix(
6565
// this parameter determine the total number of jlq.
6666
ofs << Exx_Abfs::Jle::Ecut_exx << " ecutwfc_jlq" << std::endl;//mohan modify 2009-09-08
6767

68-
if(TA==TB)
68+
if(TA==TB) {
6969
ofs << orb_cutoff[TA] << " rcut_Jlq" << std::endl;
70-
else
70+
} else {
7171
ofs << orb_cutoff[TA] << " " << orb_cutoff[TB] << " rcut_Jlq" << std::endl;
72+
}
7273

7374
// mohan add 'smooth' and 'smearing_sigma' 2009-08-28
7475
ofs << 0 << " smooth" << std::endl;
@@ -85,19 +86,21 @@ void Exx_Opt_Orb::print_matrix(
8586
auto cal_sum_M = [&range_jles](size_t T) -> size_t
8687
{
8788
size_t sum_M = 0;
88-
for( size_t L = 0; L!=range_jles[T].size(); ++L )
89+
for( size_t L = 0; L!=range_jles[T].size(); ++L ) {
8990
sum_M += range_jles[T][L].M;
91+
}
9092
return sum_M;
9193
};
9294
const size_t nwfc = (TA==TB && IA==IB) ? cal_sum_M(TA) : cal_sum_M(TA)+cal_sum_M(TB);
9395
ofs << nwfc << " nwfc" << std::endl;
9496

9597
const size_t ecut_numberA = static_cast<size_t>( sqrt( Exx_Abfs::Jle::Ecut_exx ) * orb_cutoff[TA] / ModuleBase::PI ); // Rydberg Unit
9698
const size_t ecut_numberB = static_cast<size_t>( sqrt( Exx_Abfs::Jle::Ecut_exx ) * orb_cutoff[TB] / ModuleBase::PI ); // Rydberg Unit
97-
if(TA==TB)
99+
if(TA==TB) {
98100
ofs << ecut_numberA << " ne" << std::endl;
99-
else
101+
} else {
100102
ofs << ecut_numberA << " " << ecut_numberB << " ne" << std::endl;
103+
}
101104

102105
ofs << "<WEIGHT_OF_KPOINTS>" << std::endl;
103106
for( int ik=0; ik!=kv.get_nkstot(); ++ik )

0 commit comments

Comments
 (0)