From c643389ec4db55b77a789afa38a3a6f4d95a2d2c Mon Sep 17 00:00:00 2001 From: Stephen Sanderson Date: Wed, 17 Mar 2021 10:01:45 +1000 Subject: [PATCH] Treat extra_dof as system-wide in compute_array for consistency, and include fix_dof --- src/compute_temp_profile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 5f95ef29e5..5bb415f5ed 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -333,11 +333,15 @@ void ComputeTempProfile::compute_array() MPI_Allreduce(tbin,tbinall,nbins,MPI_DOUBLE,MPI_SUM,world); - int nper = domain->dimension; + double totcount = 0.0; for (i = 0; i < nbins; i++) { 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) { - dof = nper*array[i][0] - extra_dof; + dof = nper*array[i][0] - domain->dimension; if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz); else tfactor = 0.0; array[i][1] = tfactor*tbinall[i];