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

This commit is contained in:
sjplimp
2008-03-20 17:35:20 +00:00
parent 4b237db3de
commit a49e234a37
18 changed files with 70 additions and 30 deletions

View File

@ -60,7 +60,7 @@ void ComputeTempSphere::init()
fix_dof = 0;
for (int i = 0; i < modify->nfix; i++)
fix_dof += modify->fix[i]->dof(igroup);
recount();
dof_compute();
tempbias = 0;
tbias = NULL;
@ -85,11 +85,12 @@ void ComputeTempSphere::init()
/* ---------------------------------------------------------------------- */
void ComputeTempSphere::recount()
void ComputeTempSphere::dof_compute()
{
double natoms = group->count(igroup);
if (domain->dimension == 3) dof = 6.0 * natoms;
else dof = 3.0 * natoms;
if (tbias) dof -= tbias->dof_remove(natoms);
dof -= extra_dof + fix_dof;
if (dof > 0) tfactor = force->mvv2e / (dof * force->boltz);
else tfactor = 0.0;
@ -138,7 +139,7 @@ double ComputeTempSphere::compute_scalar()
if (tbias) tbias->restore_bias_all();
MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
if (dynamic) recount();
if (dynamic || tbias) dof_compute();
scalar *= tfactor;
return scalar;
}