Treat extra_dof as system-wide in compute_array for consistency, and include fix_dof

This commit is contained in:
Stephen Sanderson
2021-03-17 10:01:45 +10:00
parent ab07427339
commit c643389ec4

View File

@ -333,11 +333,15 @@ void ComputeTempProfile::compute_array()
MPI_Allreduce(tbin,tbinall,nbins,MPI_DOUBLE,MPI_SUM,world); MPI_Allreduce(tbin,tbinall,nbins,MPI_DOUBLE,MPI_SUM,world);
int nper = domain->dimension; double totcount = 0.0;
for (i = 0; i < nbins; i++) { for (i = 0; i < nbins; i++) {
array[i][0] = binave[i][ncount-1]; array[i][0] = binave[i][ncount-1];
totcount += array[i][0];
}
double nper = domain->dimension - (extra_dof + fix_dof)/totcount;
for (i = 0; i < nbins; i++) {
if (array[i][0] > 0.0) { if (array[i][0] > 0.0) {
dof = nper*array[i][0] - extra_dof; dof = nper*array[i][0] - domain->dimension;
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz); if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0; else tfactor = 0.0;
array[i][1] = tfactor*tbinall[i]; array[i][1] = tfactor*tbinall[i];