1
1
#include " read_pp.h"
2
2
3
- #include < math.h >
3
+ #include < cmath >
4
4
5
5
#include < cstring> // Peize Lin fix bug about strcpy 2016-08-02
6
6
#include < fstream>
@@ -202,7 +202,8 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
202
202
ind1 = old_nbeta +1 ;
203
203
}
204
204
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
+ }
206
207
// average beta (betar)
207
208
for (int ir = 0 ; ir<pp.mesh ;ir++)
208
209
{
@@ -218,8 +219,9 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
218
219
}
219
220
else
220
221
{
221
- for (int ir = 0 ; ir<pp.mesh ;ir++)
222
+ for (int ir = 0 ; ir<pp.mesh ;ir++) {
222
223
pp.betar (nb, ir) = pp.betar (old_nbeta, ir);
224
+ }
223
225
pp.dion (nb, nb) = pp.dion (old_nbeta, old_nbeta);
224
226
}
225
227
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)
284
286
old_nwfc++;
285
287
}
286
288
else {
287
- for (int ir = 0 ; ir<pp.mesh ;ir++)
289
+ for (int ir = 0 ; ir<pp.mesh ;ir++) {
288
290
pp.chi (nb, ir) = pp.chi (old_nwfc, ir);
291
+ }
289
292
}
290
293
pp.lchi [nb] = pp.lchi [old_nwfc]; // reset lchi index
291
294
}
292
- pp.has_so = 0 ;
295
+ pp.has_so = false ;
293
296
return error;
294
297
}
295
298
else // lambda_ != 0, modulate the soc effect in pseudopotential
@@ -323,7 +326,8 @@ int Pseudopot_upf::average_p(const double& lambda, Atom_pseudo& pp)
323
326
ind1 = nb +1 ;
324
327
}
325
328
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
+ }
327
331
// average beta (betar)
328
332
const double sqrtDplus = sqrt (std::abs (pp.dion (ind,ind) / vion1));
329
333
const double sqrtDminus = sqrt (std::abs (pp.dion (ind1,ind1) / vion1));
0 commit comments