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

@ -130,7 +130,7 @@ void ComputeTempRamp::init()
fix_dof = 0;
for (int i = 0; i < modify->nfix; i++)
fix_dof += modify->fix[i]->dof(igroup);
recount();
dof_compute();
tbias = NULL;
if (id_bias) {
@ -142,10 +142,11 @@ void ComputeTempRamp::init()
/* ---------------------------------------------------------------------- */
void ComputeTempRamp::recount()
void ComputeTempRamp::dof_compute()
{
double natoms = group->count(igroup);
dof = domain->dimension * 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;
@ -195,7 +196,7 @@ double ComputeTempRamp::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;
}