git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13354 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2015-04-01 14:41:46 +00:00
parent d497d65930
commit dc53071b60
5 changed files with 20 additions and 18 deletions

View File

@ -210,12 +210,10 @@ void ComputeTempCS::dof_compute()
{
adjust_dof_fix();
int nper = domain->dimension;
double natoms = group->count(igroup);
dof = nper * natoms;
natoms_temp = group->count(igroup);
dof = nper * natoms_temp;
dof -= nper * nshells;
dof -= extra_dof + fix_dof;
if (dof < 0.0 && natoms > 0.0)
error->all(FLERR,"Temperature compute degrees of freedom < 0");
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0;
}
@ -258,6 +256,8 @@ double ComputeTempCS::compute_scalar()
MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
if (dynamic) dof_compute();
if (dof < 0.0 && natoms_temp > 0.0)
error->all(FLERR,"Temperature compute degrees of freedom < 0");
scalar *= tfactor;
return scalar;
}