Cleaned up math for clarity
This commit is contained in:
@ -118,8 +118,7 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
nbins = nbinx*nbiny*nbinz;
|
nbins = nbinx*nbiny*nbinz;
|
||||||
if (nbins <= 0) error->all(FLERR,"Illegal compute temp/profile command");
|
if (nbins <= 0) error->all(FLERR,"Illegal compute temp/profile command");
|
||||||
|
|
||||||
nconstraints = (xflag==0 ? 0 : 1) + (yflag==0 ? 0 : 1) + (zflag==0 ? 0 : 1);
|
nstreaming = (xflag==0 ? 0 : 1) + (yflag==0 ? 0 : 1) + (zflag==0 ? 0 : 1);
|
||||||
nconstraints *= nbins;
|
|
||||||
reset_extra_dof();
|
reset_extra_dof();
|
||||||
|
|
||||||
memory->create(vbin,nbins,ncount,"temp/profile:vbin");
|
memory->create(vbin,nbins,ncount,"temp/profile:vbin");
|
||||||
@ -203,7 +202,7 @@ void ComputeTempProfile::dof_compute()
|
|||||||
// subtract additional Nbins DOF for each adjusted direction,
|
// subtract additional Nbins DOF for each adjusted direction,
|
||||||
// as in Evans and Morriss paper
|
// 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);
|
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
|
||||||
else tfactor = 0.0;
|
else tfactor = 0.0;
|
||||||
}
|
}
|
||||||
@ -347,7 +346,7 @@ void ComputeTempProfile::compute_array()
|
|||||||
double dofbin, tfactorbin;
|
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) {
|
||||||
dofbin = nper*array[i][0] - nconstraints/nbins;
|
dofbin = nper*array[i][0] - nstreaming;
|
||||||
if (dofbin > 0) tfactorbin = force->mvv2e / (dofbin * force->boltz);
|
if (dofbin > 0) tfactorbin = force->mvv2e / (dofbin * force->boltz);
|
||||||
else tfactorbin = 0.0;
|
else tfactorbin = 0.0;
|
||||||
array[i][1] = tfactorbin*tbinall[i];
|
array[i][1] = tfactorbin*tbinall[i];
|
||||||
|
|||||||
@ -48,7 +48,7 @@ class ComputeTempProfile : public Compute {
|
|||||||
int nbinx,nbiny,nbinz,nbins;
|
int nbinx,nbiny,nbinz,nbins;
|
||||||
int ivx,ivy,ivz;
|
int ivx,ivy,ivz;
|
||||||
double tfactor;
|
double tfactor;
|
||||||
double nconstraints;
|
double nstreaming;
|
||||||
|
|
||||||
int box_change,triclinic;
|
int box_change,triclinic;
|
||||||
int *periodicity;
|
int *periodicity;
|
||||||
|
|||||||
Reference in New Issue
Block a user