Commit dc53071b authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13354 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent d497d659
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ void ComputeTempAsphere::dof_compute()
  // assume full rotation of extended particles
  // user should correct this via compute_modify if needed

  double natoms = group->count(igroup);
  natoms_temp = group->count(igroup);
  int nper;
  if (domain->dimension == 3) {
    if (mode == ALL) nper = 6;
@@ -156,12 +156,12 @@ void ComputeTempAsphere::dof_compute()
    if (mode == ALL) nper = 3;
    else nper = 1;
  }
  dof = nper*natoms;
  dof = nper*natoms_temp;

  // additional adjustments to dof

  if (tempbias == 1) {
    if (mode == ALL) dof -= tbias->dof_remove(-1) * natoms;
    if (mode == ALL) dof -= tbias->dof_remove(-1) * natoms_temp;

  } else if (tempbias == 2) {
    int *mask = atom->mask;
@@ -179,8 +179,6 @@ void ComputeTempAsphere::dof_compute()
  }

  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;
}
@@ -269,6 +267,8 @@ double ComputeTempAsphere::compute_scalar()

  MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
  if (dynamic || tempbias == 2) dof_compute();
  if (dof < 0.0 && natoms_temp > 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
@@ -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;
}
+4 −4
Original line number Diff line number Diff line
@@ -101,8 +101,8 @@ void ComputeTempDeformEff::setup()
void ComputeTempDeformEff::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;

  // just include nuclear dof
@@ -123,8 +123,6 @@ void ComputeTempDeformEff::dof_compute()

  dof -= domain->dimension * nelectrons;

  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;
}
@@ -176,6 +174,8 @@ double ComputeTempDeformEff::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;
}
+4 −4
Original line number Diff line number Diff line
@@ -67,8 +67,8 @@ void ComputeTempEff::setup()
void ComputeTempEff::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;

  int *spin = atom->spin;
@@ -87,8 +87,6 @@ void ComputeTempEff::dof_compute()

  dof -= domain->dimension * nelectrons;

  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;
}
@@ -122,6 +120,8 @@ double ComputeTempEff::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;
}
+3 −1
Original line number Diff line number Diff line
@@ -148,6 +148,8 @@ double ComputeTempRegionEff::compute_scalar()
  tarray[1] = t;
  MPI_Allreduce(tarray,tarray_all,2,MPI_DOUBLE,MPI_SUM,world);
  dof = domain->dimension * tarray_all[0] - extra_dof;
  if (dof < 0.0 && tarray_all[0] > 0.0) 
    error->all(FLERR,"Temperature compute degrees of freedom < 0");

  int one = 0;
  for (int i = 0; i < nlocal; i++)
@@ -155,7 +157,7 @@ double ComputeTempRegionEff::compute_scalar()
      if (abs(spin[i])==1) one++;
    }

  if (dof > 0) scalar = force->mvv2e * tarray_all[1] / (dof * force->boltz);
  if (dof > 0.0) scalar = force->mvv2e * tarray_all[1] / (dof * force->boltz);
  else scalar = 0.0;
  return scalar;
}