git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1655 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
#include "compute_temp_partial.h"
|
||||
#include "atom.h"
|
||||
#include "force.h"
|
||||
#include "domain.h"
|
||||
#include "modify.h"
|
||||
#include "fix.h"
|
||||
#include "group.h"
|
||||
@ -65,7 +66,7 @@ void ComputeTempPartial::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) {
|
||||
@ -77,10 +78,11 @@ void ComputeTempPartial::init()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void ComputeTempPartial::recount()
|
||||
void ComputeTempPartial::dof_compute()
|
||||
{
|
||||
double natoms = group->count(igroup);
|
||||
dof = (xflag+yflag+zflag) * 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;
|
||||
@ -88,6 +90,18 @@ void ComputeTempPartial::recount()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double ComputeTempPartial::dof_remove(double &natoms)
|
||||
{
|
||||
double rmdof = 0.0;
|
||||
if (tbias) rmdof = tbias->dof_remove(natoms);
|
||||
int activedim = xflag+yflag+zflag;
|
||||
if (domain->dimension == 2) activedim = xflag+yflag;
|
||||
rmdof += (domain->dimension - activedim) * natoms;
|
||||
return rmdof;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double ComputeTempPartial::compute_scalar()
|
||||
{
|
||||
invoked |= INVOKED_SCALAR;
|
||||
@ -122,7 +136,7 @@ double ComputeTempPartial::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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user