Cleaned up math for clarity

This commit is contained in:
Stephen Sanderson
2021-03-17 15:56:48 +10:00
parent 471cfa8ac3
commit 97f90f1146
2 changed files with 4 additions and 5 deletions

View File

@ -118,8 +118,7 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
nbins = nbinx*nbiny*nbinz;
if (nbins <= 0) error->all(FLERR,"Illegal compute temp/profile command");
nconstraints = (xflag==0 ? 0 : 1) + (yflag==0 ? 0 : 1) + (zflag==0 ? 0 : 1);
nconstraints *= nbins;
nstreaming = (xflag==0 ? 0 : 1) + (yflag==0 ? 0 : 1) + (zflag==0 ? 0 : 1);
reset_extra_dof();
memory->create(vbin,nbins,ncount,"temp/profile:vbin");
@ -203,7 +202,7 @@ void ComputeTempProfile::dof_compute()
// subtract additional Nbins DOF for each adjusted direction,
// as in Evans and Morriss paper
dof -= extra_dof + fix_dof + nconstraints;
dof -= extra_dof + fix_dof + nstreaming*nbins;
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0;
}
@ -347,7 +346,7 @@ void ComputeTempProfile::compute_array()
double dofbin, tfactorbin;
for (i = 0; i < nbins; i++) {
if (array[i][0] > 0.0) {
dofbin = nper*array[i][0] - nconstraints/nbins;
dofbin = nper*array[i][0] - nstreaming;
if (dofbin > 0) tfactorbin = force->mvv2e / (dofbin * force->boltz);
else tfactorbin = 0.0;
array[i][1] = tfactorbin*tbinall[i];

View File

@ -48,7 +48,7 @@ class ComputeTempProfile : public Compute {
int nbinx,nbiny,nbinz,nbins;
int ivx,ivy,ivz;
double tfactor;
double nconstraints;
double nstreaming;
int box_change,triclinic;
int *periodicity;