Commit 269bff4b authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13344 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent cfc5c8b2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -143,6 +143,21 @@ void Compute::modify_params(int narg, char **arg)
  }
}

/* ----------------------------------------------------------------------
   calculate adjustment in DOF due to fixes
------------------------------------------------------------------------- */

void Compute::adjust_dof_fix()
{
  Fix **fix = modify->fix;
  int nfix = modify->nfix;

  fix_dof = 0;
  for (int i = 0; i < nfix; i++)
    if (fix[i]->dof_flag) 
      fix_dof += fix[i]->dof(igroup);
}

/* ----------------------------------------------------------------------
   reset extra_dof to its default value
------------------------------------------------------------------------- */
+4 −0
Original line number Diff line number Diff line
@@ -161,6 +161,10 @@ class Compute : protected Pointers {
    ubuf(int64_t arg) : i(arg) {}
    ubuf(int arg) : i(arg) {}
  };

  // private methods

  void adjust_dof_fix();
};

}
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@
#include "update.h"
#include "force.h"
#include "domain.h"
#include "modify.h"
#include "comm.h"
#include "group.h"
#include "error.h"
@@ -61,7 +60,7 @@ void ComputeTemp::setup()

void ComputeTemp::dof_compute()
{
  fix_dof = modify->adjust_dof_fix(igroup);
  adjust_dof_fix();
  double natoms = group->count(igroup);
  dof = domain->dimension * natoms;
  dof -= extra_dof + fix_dof;
@@ -97,7 +96,7 @@ double ComputeTemp::compute_scalar()

  MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
  if (dynamic) dof_compute();
  if (tfactor == 0.0 && scalar != 0.0) 
  if (tfactor == 0.0 && atom->natoms != 0) 
    error->all(FLERR,"Temperature compute degrees of freedom < 0");
  scalar *= tfactor;
  return scalar;
+2 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include "force.h"
#include "group.h"
#include "domain.h"
#include "modify.h"
#include "lattice.h"
#include "error.h"

@@ -70,7 +69,7 @@ void ComputeTempCOM::setup()

void ComputeTempCOM::dof_compute()
{
  fix_dof = modify->adjust_dof_fix(igroup);
  adjust_dof_fix();
  double natoms = group->count(igroup);
  int nper = domain->dimension;
  dof = nper * natoms;
@@ -113,7 +112,7 @@ double ComputeTempCOM::compute_scalar()

  MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
  if (dynamic) dof_compute();
  if (tfactor == 0.0 && scalar != 0.0) 
  if (tfactor == 0.0 && atom->natoms != 0) 
    error->all(FLERR,"Temperature compute degrees of freedom < 0");
  scalar *= tfactor;
  return scalar;
+2 −2
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ void ComputeTempDeform::setup()

void ComputeTempDeform::dof_compute()
{
  fix_dof = modify->adjust_dof_fix(igroup);
  adjust_dof_fix();
  double natoms = group->count(igroup);
  dof = domain->dimension * natoms;
  dof -= extra_dof + fix_dof;
@@ -148,7 +148,7 @@ double ComputeTempDeform::compute_scalar()

  MPI_Allreduce(&t,&scalar,1,MPI_DOUBLE,MPI_SUM,world);
  if (dynamic) dof_compute();
  if (tfactor == 0.0 && scalar != 0.0) 
  if (tfactor == 0.0 && atom->natoms != 0) 
    error->all(FLERR,"Temperature compute degrees of freedom < 0");
  scalar *= tfactor;
  return scalar;
Loading