forked from lijiext/lammps
avoid unneeded division
This commit is contained in:
parent
6967522a4f
commit
909960514a
|
@ -78,7 +78,7 @@ double ComputePressureUef::compute_scalar()
|
||||||
addstep(update->ntimestep+1);
|
addstep(update->ntimestep+1);
|
||||||
|
|
||||||
int k =0;
|
int k =0;
|
||||||
scalar = 0;
|
scalar = 0.0;
|
||||||
if (ext_flags[0]) {
|
if (ext_flags[0]) {
|
||||||
scalar += vector[0];
|
scalar += vector[0];
|
||||||
k++;
|
k++;
|
||||||
|
@ -92,7 +92,7 @@ double ComputePressureUef::compute_scalar()
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar /= k;
|
if (k > 1) scalar /= k;
|
||||||
return scalar;
|
return scalar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue