Commit b2e9f7dc authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1272 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 428ca840
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -29,6 +29,9 @@

using namespace LAMMPS_NS;

#define INVOKED_SCALAR 1
#define INVOKED_VECTOR 2

/* ---------------------------------------------------------------------- */

ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :
@@ -41,7 +44,8 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) :

  scalar_flag = vector_flag = 1;
  size_vector = 6;
  extensive = 0;
  extscalar = 0;
  extvector = 1;
  tempflag = 1;

  vector = new double[6];
@@ -110,6 +114,8 @@ void ComputeTempAsphere::recount()

double ComputeTempAsphere::compute_scalar()
{
  invoked |= INVOKED_SCALAR;

  double **v = atom->v;
  double **quat = atom->quat;
  double **angmom = atom->angmom;
@@ -163,6 +169,8 @@ void ComputeTempAsphere::compute_vector()
{
  int i;

  invoked |= INVOKED_VECTOR;

  double **v = atom->v;
  double **quat = atom->quat;
  double **angmom = atom->angmom;
+1 −3
Original line number Diff line number Diff line
@@ -172,18 +172,16 @@ void FixNPTASphere::final_integrate()

  t_current = temperature->compute_scalar();
  if (press_couple == 0) {
    if (ptemperature) double ptmp = ptemperature->compute_scalar();
    double tmp = pressure->compute_scalar();
  } else {
    temperature->compute_vector();
    if (ptemperature) ptemperature->compute_vector();
    pressure->compute_vector();
  }
  couple();

  // trigger virial computation on next timestep

  pressure->add_step(update->ntimestep+1);
  pressure->addstep(update->ntimestep+1);

  // update eta_dot

+2 −2
Original line number Diff line number Diff line
@@ -198,12 +198,12 @@ void BondClass2::read_restart(FILE *fp)

/* ---------------------------------------------------------------------- */

void BondClass2::single(int type, double rsq, int i, int j, double &eng)
double BondClass2::single(int type, double rsq, int i, int j)
{
  double r = sqrt(rsq);
  double dr = r - r0[type];
  double dr2 = dr*dr;
  double dr3 = dr2*dr;
  double dr4 = dr3*dr;
  eng = k2[type]*dr2 + k3[type]*dr3 + k4[type]*dr4;
  return (k2[type]*dr2 + k3[type]*dr3 + k4[type]*dr4);
}
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ class BondClass2 : public Bond {
  double equilibrium_distance(int);
  void write_restart(FILE *);
  void read_restart(FILE *);
  void single(int, double, int, int, double &);
  double single(int, double, int, int);

 private:
  double *r0,*k2,*k3,*k4;
+7 −10
Original line number Diff line number Diff line
@@ -354,9 +354,9 @@ void PairLJClass2::read_restart_settings(FILE *fp)

/* ---------------------------------------------------------------------- */

void PairLJClass2::single(int i, int j, int itype, int jtype, double rsq,
		       double factor_coul, double factor_lj, int eflag,
		       One &one)
double PairLJClass2::single(int i, int j, int itype, int jtype, double rsq,
			    double factor_coul, double factor_lj,
			    double &fforce)
{
  double r2inv,rinv,r3inv,r6inv,forcelj,philj;

@@ -365,12 +365,9 @@ void PairLJClass2::single(int i, int j, int itype, int jtype, double rsq,
  r3inv = r2inv*rinv;
  r6inv = r3inv*r3inv;
  forcelj = r6inv * (lj1[itype][jtype]*r3inv - lj2[itype][jtype]);
  one.fforce = factor_lj*forcelj*r2inv;
  fforce = factor_lj*forcelj*r2inv;

  if (eflag) {
  philj = r6inv*(lj3[itype][jtype]*r3inv-lj4[itype][jtype]) -
    offset[itype][jtype];
    one.eng_vdwl = factor_lj*philj;
    one.eng_coul = 0.0;
  }
  return factor_lj*philj;
}
Loading