Unverified Commit 93a6d3a1 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

print warning (once) if EAM embedding data is out of sync, error out, if...

print warning (once) if EAM embedding data is out of sync, error out, if embedding term is not available at all.
parent cf80495a
Loading
Loading
Loading
Loading
+11 −0
Changes for src/MANYBODY/pair_eam.cpp: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "neigh_list.h"
#include "memory.h"
#include "error.h"
#include "update.h"
#include "utils.h"

using namespace LAMMPS_NS;
@@ -39,6 +40,7 @@ PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp)
{
  restartinfo = 0;
  manybody_flag = 1;
  embedstep = -1;

  nmax = 0;
  rho = NULL;
@@ -246,6 +248,7 @@ void PairEAM::compute(int eflag, int vflag)
  // communicate derivative of embedding function

  comm->forward_comm_pair(this);
  embedstep = update->ntimestep;

  // compute forces on each atom
  // loop over neighbors of my atoms
@@ -808,6 +811,14 @@ double PairEAM::single(int i, int j, int itype, int jtype,
  double r,p,rhoip,rhojp,z2,z2p,recip,phi,phip,psip;
  double *coeff;

  if (!numforce)
    error->all(FLERR,"EAM embedding data required for this calculation is missing");

  if ((comm->me == 0) && (embedstep != update->ntimestep)) {
    error->warning(FLERR,"EAM embedding data not computed for this time step ");
    embedstep = update->ntimestep;
  }

  if (numforce[i] > 0) {
    p = rho[i]*rdrho + 1.0;
    m = static_cast<int> (p);
+1 −0
Changes for src/MANYBODY/pair_eam.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ class PairEAM : public Pair {
  int nmax;                   // allocated size of per-atom arrays
  double cutforcesq;
  double **scale;
  bigint embedstep;           // timestep, the embedding term was computed

  // per-atom arrays