Skip to content

Commit 088428c

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 9237bd2 commit 088428c

File tree

3 files changed

+53
-40
lines changed

3 files changed

+53
-40
lines changed

source/module_cell/klist.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,8 @@ void K_Vectors::ibz_kpoint(const ModuleSymmetry::Symmetry& symm,
947947
break;
948948
}
949949
}
950-
if (exist_number != -1) break;
950+
if (exist_number != -1) { break;
951+
}
951952
}
952953
this->kstars[exist_number].insert(std::make_pair(isym, kvec_d[i]));
953954
}

source/module_hamilt_pw/hamilt_stodft/sto_func.cpp

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -24,45 +24,49 @@ template <typename REAL>
2424
REAL Sto_Func<REAL>::root_fd(REAL e)
2525
{
2626
REAL e_mu = (e - mu) / this->tem;
27-
if (e_mu > 72)
27+
if (e_mu > 72) {
2828
return 0;
29-
else
29+
} else {
3030
return 1 / sqrt(1 + exp(e_mu));
3131
}
32+
}
3233

3334
template <typename REAL>
3435
REAL Sto_Func<REAL>::nroot_fd(REAL e)
3536
{
3637
REAL Ebar = (*Emin + *Emax) / 2;
3738
REAL DeltaE = (*Emax - *Emin) / 2;
3839
REAL ne_mu = (e * DeltaE + Ebar - mu) / this->tem;
39-
if (ne_mu > 72)
40+
if (ne_mu > 72) {
4041
return 0;
41-
else
42+
} else {
4243
return 1 / sqrt(1 + exp(ne_mu));
4344
}
45+
}
4446

4547
template <typename REAL>
4648
REAL Sto_Func<REAL>::fd(REAL e)
4749
{
4850
REAL e_mu = (e - mu) / this->tem;
49-
if (e_mu > 36)
51+
if (e_mu > 36) {
5052
return 0;
51-
else
53+
} else {
5254
return 1 / (1 + exp(e_mu));
5355
}
56+
}
5457

5558
template <typename REAL>
5659
REAL Sto_Func<REAL>::nfd(REAL e)
5760
{
5861
REAL Ebar = (*Emin + *Emax) / 2;
5962
REAL DeltaE = (*Emax - *Emin) / 2;
6063
REAL ne_mu = (e * DeltaE + Ebar - mu) / this->tem;
61-
if (ne_mu > 36)
64+
if (ne_mu > 36) {
6265
return 0;
63-
else
66+
} else {
6467
return 1 / (1 + exp(ne_mu));
6568
}
69+
}
6670

6771
template <typename REAL>
6872
REAL Sto_Func<REAL>::nxfd(REAL rawe)
@@ -71,27 +75,29 @@ REAL Sto_Func<REAL>::nxfd(REAL rawe)
7175
REAL DeltaE = (*Emax - *Emin) / 2;
7276
REAL e = rawe * DeltaE + Ebar;
7377
REAL ne_mu = (e - mu) / this->tem;
74-
if (ne_mu > 36)
78+
if (ne_mu > 36) {
7579
return 0;
76-
else
80+
} else {
7781
return e / (1 + exp(ne_mu));
7882
}
83+
}
7984

8085
template <typename REAL>
8186
REAL Sto_Func<REAL>::fdlnfd(REAL e)
8287
{
8388
REAL e_mu = (e - mu) / this->tem;
84-
if (e_mu > 36)
89+
if (e_mu > 36) {
8590
return 0;
86-
else if (e_mu < -36)
91+
} else if (e_mu < -36) {
8792
return 0;
88-
else
93+
} else
8994
{
9095
REAL f = 1 / (1 + exp(e_mu));
91-
if (f == 0 || f == 1)
96+
if (f == 0 || f == 1) {
9297
return 0;
93-
else
98+
} else {
9499
return (f * log(f) + (1.0 - f) * log(1.0 - f));
100+
}
95101
}
96102
}
97103

@@ -101,17 +107,18 @@ REAL Sto_Func<REAL>::nfdlnfd(REAL rawe)
101107
REAL Ebar = (*Emin + *Emax) / 2;
102108
REAL DeltaE = (*Emax - *Emin) / 2;
103109
REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem;
104-
if (ne_mu > 36)
110+
if (ne_mu > 36) {
105111
return 0;
106-
else if (ne_mu < -36)
112+
} else if (ne_mu < -36) {
107113
return 0;
108-
else
114+
} else
109115
{
110116
REAL f = 1 / (1 + exp(ne_mu));
111-
if (f == 0 || f == 1)
117+
if (f == 0 || f == 1) {
112118
return 0;
113-
else
119+
} else {
114120
return f * log(f) + (1 - f) * log(1 - f);
121+
}
115122
}
116123
}
117124

@@ -121,17 +128,18 @@ REAL Sto_Func<REAL>::n_root_fdlnfd(REAL rawe)
121128
REAL Ebar = (*Emin + *Emax) / 2;
122129
REAL DeltaE = (*Emax - *Emin) / 2;
123130
REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem;
124-
if (ne_mu > 36)
131+
if (ne_mu > 36) {
125132
return 0;
126-
else if (ne_mu < -36)
133+
} else if (ne_mu < -36) {
127134
return 0;
128-
else
135+
} else
129136
{
130137
REAL f = 1 / (1 + exp(ne_mu));
131-
if (f == 0 || f == 1)
138+
if (f == 0 || f == 1) {
132139
return 0;
133-
else
140+
} else {
134141
return sqrt(-f * log(f) - (1 - f) * log(1 - f));
142+
}
135143
}
136144
}
137145

@@ -141,11 +149,12 @@ REAL Sto_Func<REAL>::nroot_mfd(REAL rawe)
141149
REAL Ebar = (*Emin + *Emax) / 2;
142150
REAL DeltaE = (*Emax - *Emin) / 2;
143151
REAL ne_mu = (rawe * DeltaE + Ebar - mu) / this->tem;
144-
if (ne_mu < -72)
152+
if (ne_mu < -72) {
145153
return 0;
146-
else
154+
} else {
147155
return 1 / sqrt(1 + exp(-ne_mu));
148156
}
157+
}
149158

150159
template <typename REAL>
151160
REAL Sto_Func<REAL>::ncos(REAL rawe)
@@ -178,11 +187,12 @@ template <typename REAL>
178187
REAL Sto_Func<REAL>::gauss(REAL e)
179188
{
180189
REAL a = pow((targ_e - e), 2) / 2.0 / pow(sigma, 2);
181-
if (a > 72)
190+
if (a > 72) {
182191
return 0;
183-
else
192+
} else {
184193
return exp(-a) / sqrt(TWOPI) / sigma;
185194
}
195+
}
186196

187197
template <typename REAL>
188198
REAL Sto_Func<REAL>::ngauss(REAL rawe)
@@ -191,11 +201,12 @@ REAL Sto_Func<REAL>::ngauss(REAL rawe)
191201
REAL DeltaE = (*Emax - *Emin) / 2;
192202
REAL e = rawe * DeltaE + Ebar;
193203
REAL a = pow((targ_e - e), 2) / 2.0 / pow(sigma, 2);
194-
if (a > 72)
204+
if (a > 72) {
195205
return 0;
196-
else
206+
} else {
197207
return exp(-a) / sqrt(TWOPI) / sigma;
198208
}
209+
}
199210

200211
template <typename REAL>
201212
REAL Sto_Func<REAL>::nroot_gauss(REAL rawe)
@@ -204,11 +215,12 @@ REAL Sto_Func<REAL>::nroot_gauss(REAL rawe)
204215
REAL DeltaE = (*Emax - *Emin) / 2;
205216
REAL e = rawe * DeltaE + Ebar;
206217
REAL a = pow((targ_e - e), 2) / 4.0 / pow(sigma, 2);
207-
if (a > 72)
218+
if (a > 72) {
208219
return 0;
209-
else
220+
} else {
210221
return exp(-a) / sqrt(sqrt(TWOPI) * sigma);
211222
}
223+
}
212224

213225
// we only have two examples: double and float.
214226
template class Sto_Func<double>;

source/module_io/bessel_basis.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,24 +71,24 @@ class Bessel_Basis
7171
/// @brief get energy cutoff, which is used to truncate SBF Jlq.
7272
/// @param
7373
/// @return energy cutoff in Ry
74-
const double &get_ecut(void) const {return ecut;}
74+
const double &get_ecut() const {return ecut;}
7575
/// @brief cutoff radius of radial SBF Jlq.
7676
/// @param
7777
/// @return cutoff radius in a.u.
78-
const double &get_rcut(void) const {return rcut;}
78+
const double &get_rcut() const {return rcut;}
7979

80-
const double &get_tolerence(void) const {return tolerence;}
80+
const double &get_tolerence() const {return tolerence;}
8181

8282

8383
/// @brief check if SBFs are smoothed (mohan add 2009-08-28)
8484
/// @attention in this case, the Jlq are not the true Jlq.
8585
/// @param
8686
/// @return boolean whether SBFs are smoothed
87-
const bool &get_smooth(void) const {return smooth;}
87+
const bool &get_smooth() const {return smooth;}
8888
/// @brief get sigma the stddev (standard deviation) used in smooth function (Gaussian function)
8989
/// @param
9090
/// @return stddev of smooth function
91-
const double &get_sigma(void) const {return sigma;}
91+
const double &get_sigma() const {return sigma;}
9292

9393
private:
9494
/// @brief the most important array to calculate spillage, has dimension (ntype, lmax+1, max_n, nk)
@@ -146,7 +146,7 @@ class Bessel_Basis
146146
const UnitCell& ucell
147147
);
148148

149-
void init_TableOne(void);
149+
void init_TableOne();
150150

151151
/// @brief calculate F_{aln}(it, il, in, ik) = sum_{ie}{C4(it, il, in, ie)*TableOne(il, ie, ik)}, where TableOne is overlap integral between two spherical bessel functions (jle(r) and jlk(r))
152152
/// @param ntype number of atomtype

0 commit comments

Comments
 (0)