Commit d497d659 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13353 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent dddce90b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -78,11 +78,9 @@ void ComputeTempRotate::setup()
void ComputeTempRotate::dof_compute()
{
  adjust_dof_fix();
  double natoms = group->count(igroup);
  dof = domain->dimension * natoms;
  natoms_temp = group->count(igroup);
  dof = domain->dimension * natoms_temp;
  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;
}
@@ -144,6 +142,8 @@ double ComputeTempRotate::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;
}
+1 −0
Original line number Diff line number Diff line
@@ -137,6 +137,7 @@ class Compute : protected Pointers {
 protected:
  int instance_me;             // which Compute class instantiation I am

  double natoms_temp;          // # of atoms used for temperature calculation
  int extra_dof;               // extra DOF for temperature computes
  int fix_dof;                 // DOF due to fixes
  int dynamic;                 // recount atoms for temperature computes
+4 −4
Original line number Diff line number Diff line
@@ -61,11 +61,9 @@ void ComputeTemp::setup()
void ComputeTemp::dof_compute()
{
  adjust_dof_fix();
  double natoms = group->count(igroup);
  dof = domain->dimension * natoms;
  natoms_temp = group->count(igroup);
  dof = domain->dimension * natoms_temp;
  dof -= extra_dof + fix_dof;
  //if (dof < 0.0 && natoms > 0.0) 
  //  error->all(FLERR,"Temperature compute degrees of freedom < 0");
  if (dof > 0.0) tfactor = force->mvv2e / (dof * force->boltz);
  else tfactor = 0.0;
}
@@ -98,6 +96,8 @@ double ComputeTemp::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;
}
+2 −2
Original line number Diff line number Diff line
@@ -288,10 +288,10 @@ double ComputeTempChunk::compute_scalar()
  MPI_Allreduce(&rcount,&allcount,1,MPI_DOUBLE,MPI_SUM,world);

  double dof = nchunk*cdof + adof*allcount;
  if (dof < 0.0 && allcount > 0.0)
    error->all(FLERR,"Temperature compute degrees of freedom < 0");
  double tfactor = 0.0;
  if (dof > 0.0) tfactor = force->mvv2e / (dof * force->boltz);
  if (dof < 0.0 && allcount > 0.0)
    error->all(FLERR,"Temperature compute degrees of freedom < 0");
  scalar *= tfactor;
  return scalar;
}
+4 −4
Original line number Diff line number Diff line
@@ -70,11 +70,9 @@ void ComputeTempCOM::setup()
void ComputeTempCOM::dof_compute()
{
  adjust_dof_fix();
  double natoms = group->count(igroup);
  dof = domain->dimension * natoms;
  natoms_temp = group->count(igroup);
  dof = domain->dimension * natoms_temp;
  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;
}
@@ -113,6 +111,8 @@ double ComputeTempCOM::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;
}
Loading