Skip to content

Commit

Permalink
Fix private variables in Thermo::temperature
Browse files Browse the repository at this point in the history
vx, vy, vz should be private, not shared.
Missed in Mantevo#2.
  • Loading branch information
Pennycook authored and Jason Sewall committed Feb 19, 2019
1 parent 70be73d commit a1df9b6
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions target/thermo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,20 +163,17 @@ MMD_float Thermo::energy(Atom &atom, Neighbor &neighbor, Force *force)

MMD_float Thermo::temperature(Atom &atom)
{
MMD_int i;
MMD_float vx, vy, vz;

t_act = 0;

MMD_float *v = atom.v;

MMD_float t = 0.0;
#pragma omp parallel for reduction(+:t)
for(i = 0; i < atom.nlocal; i++)
for(MMD_int i = 0; i < atom.nlocal; i++)
{
vx = v[i * PAD + 0];
vy = v[i * PAD + 1];
vz = v[i * PAD + 2];
MMD_float vx = v[i * PAD + 0];
MMD_float vy = v[i * PAD + 1];
MMD_float vz = v[i * PAD + 2];
t += (vx * vx + vy * vy + vz * vz) * atom.mass;
}
t_act += t;
Expand Down

0 comments on commit a1df9b6

Please sign in to comment.