Commit f1d3637b authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15605 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent ce367667
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ PairEAM::~PairEAM()
    type2frho = NULL;
    memory->destroy(type2rhor);
    memory->destroy(type2z2r);
    memory->destroy(scale);
  }

  if (funcfl) {
@@ -280,6 +281,7 @@ void PairEAM::compute(int eflag, int vflag)
        // psip needs both fp[i] and fp[j] terms since r_ij appears in two
        //   terms of embed eng: Fi(sum rho_ij) and Fj(sum rho_ji)
        //   hence embed' = Fi(sum rho_ij) rhojp + Fj(sum rho_ji) rhoip
        // scale factor can be applied by thermodynamic integration

        coeff = rhor_spline[type2rhor[itype][jtype]][m];
        rhoip = (coeff[0]*p + coeff[1])*p + coeff[2];
@@ -293,7 +295,7 @@ void PairEAM::compute(int eflag, int vflag)
        phi = z2*recip;
        phip = z2p*recip - phi*recip;
        psip = fp[i]*rhojp + fp[j]*rhoip + phip;
        fpair = -psip*recip;
        fpair = -scale[itype][jtype]*psip*recip;

        f[i][0] += delx*fpair;
        f[i][1] += dely*fpair;
@@ -336,6 +338,7 @@ void PairEAM::allocate()
  type2frho = new int[n+1];
  memory->create(type2rhor,n+1,n+1,"pair:type2rhor");
  memory->create(type2z2r,n+1,n+1,"pair:type2z2r");
  memory->create(scale,n+1,n+1,"pair:scale");
}

/* ----------------------------------------------------------------------
@@ -393,6 +396,7 @@ void PairEAM::coeff(int narg, char **arg)
        atom->set_mass(i,funcfl[ifuncfl].mass);
        count++;
      }
      scale[i][j] = 1.0;
    }
  }

@@ -423,6 +427,8 @@ double PairEAM::init_one(int i, int j)
  // for funcfl could be multiple files
  // for setfl or fs, just one file

  scale[j][i] = scale[i][j];

  if (funcfl) {
    cutmax = 0.0;
    for (int m = 0; m < nfuncfl; m++)
@@ -886,3 +892,12 @@ void PairEAM::swap_eam(double *fp_caller, double **fp_caller_hold)
  fp = fp_caller;
  *fp_caller_hold = tmp;
}

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

void *PairEAM::extract(const char *str, int &dim)
{
  dim = 2;
  if (strcmp(str,"scale") == 0) return (void *) scale;
  return NULL;
}
+2 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ class PairEAM : public Pair {
  void init_style();
  double init_one(int, int);
  double single(int, int, int, int, double, double, double, double &);
  void *extract(const char *, int &);

  virtual int pack_forward_comm(int, int *, double *, int, int *);
  virtual void unpack_forward_comm(int, int, double *);
@@ -65,6 +66,7 @@ class PairEAM : public Pair {
 protected:
  int nmax;                   // allocated size of per-atom arrays
  double cutforcesq;
  double **scale;

  // per-atom arrays