Using local dof and tfactor for compute_array to prevent overwrite
This commit is contained in:
@ -339,12 +339,13 @@ void ComputeTempProfile::compute_array()
|
|||||||
totcount += array[i][0];
|
totcount += array[i][0];
|
||||||
}
|
}
|
||||||
double nper = domain->dimension - (extra_dof + fix_dof)/totcount;
|
double nper = domain->dimension - (extra_dof + fix_dof)/totcount;
|
||||||
|
double dofbin, tfactorbin;
|
||||||
for (i = 0; i < nbins; i++) {
|
for (i = 0; i < nbins; i++) {
|
||||||
if (array[i][0] > 0.0) {
|
if (array[i][0] > 0.0) {
|
||||||
dof = nper*array[i][0] - domain->dimension;
|
dofbin = nper*array[i][0] - domain->dimension;
|
||||||
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
|
if (dofbin > 0) tfactorbin = force->mvv2e / (dofbin * force->boltz);
|
||||||
else tfactor = 0.0;
|
else tfactorbin = 0.0;
|
||||||
array[i][1] = tfactor*tbinall[i];
|
array[i][1] = tfactorbin*tbinall[i];
|
||||||
} else array[i][1] = 0.0;
|
} else array[i][1] = 0.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user