Skip to content

Commit a422bbd

Browse files
[pre-commit.ci lite] apply automatic fixes
1 parent 24595ac commit a422bbd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

source/module_cell/read_pp.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include "read_pp.h"
22

3-
#include <math.h>
3+
#include <cmath>
44

55
#include <cstring> // Peize Lin fix bug about strcpy 2016-08-02
66
#include <fstream>
@@ -202,7 +202,8 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
202202
ind1 = old_nbeta +1;
203203
}
204204
double vion1 = ((l+1.0) * pp.dion(ind,ind) + l * pp.dion(ind1,ind1)) / (2.0*l+1.0);
205-
if(std::abs(vion1)<1.0e-8) vion1 = 0.1;
205+
if(std::abs(vion1)<1.0e-8) { vion1 = 0.1;
206+
}
206207
//average beta (betar)
207208
for(int ir = 0; ir<pp.mesh;ir++)
208209
{
@@ -218,8 +219,9 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
218219
}
219220
else
220221
{
221-
for(int ir = 0; ir<pp.mesh;ir++)
222+
for(int ir = 0; ir<pp.mesh;ir++) {
222223
pp.betar(nb, ir) = pp.betar(old_nbeta, ir);
224+
}
223225
pp.dion(nb, nb) = pp.dion(old_nbeta, old_nbeta);
224226
}
225227
pp.lll[nb] = pp.lll[old_nbeta]; //reset the lll index, ignore jjj index
@@ -284,12 +286,13 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
284286
old_nwfc++;
285287
}
286288
else{
287-
for(int ir = 0; ir<pp.mesh;ir++)
289+
for(int ir = 0; ir<pp.mesh;ir++) {
288290
pp.chi(nb, ir) = pp.chi(old_nwfc, ir);
291+
}
289292
}
290293
pp.lchi[nb] = pp.lchi[old_nwfc]; //reset lchi index
291294
}
292-
pp.has_so = 0;
295+
pp.has_so = false;
293296
return error;
294297
}
295298
else//lambda_ != 0, modulate the soc effect in pseudopotential
@@ -323,7 +326,8 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
323326
ind1 = nb +1;
324327
}
325328
double vion1 = ((l+1.0) * pp.dion(ind,ind) + l * pp.dion(ind1,ind1)) / (2.0*l+1.0);
326-
if(std::abs(vion1)<1.0e-10) vion1 = 0.1;
329+
if(std::abs(vion1)<1.0e-10) { vion1 = 0.1;
330+
}
327331
//average beta (betar)
328332
const double sqrtDplus = sqrt(std::abs(pp.dion(ind,ind) / vion1));
329333
const double sqrtDminus = sqrt(std::abs(pp.dion(ind1,ind1) / vion1));

0 commit comments

Comments
 (0)