Commit 9984cbc9 authored by Julien Devemy's avatar Julien Devemy
Browse files

Recheck existence of pair style in init

parent 350d8f58
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -87,7 +87,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
        pstyle = new char[n];
        strcpy(pstyle,arg[iarg++]);

        int nsub = 0;
        nsub = 0;

        if (narg > iarg) {
          if (isdigit(arg[iarg][0])) {
@@ -166,6 +166,20 @@ void ComputePressure::init()
    temperature = modify->compute[icompute];
  }

  // recheck if pair style with and without suffix exists

  if (pairhybridflag) {
    pairhybrid = (Pair *) force->pair_match(pstyle,1,nsub);
    if (!pairhybrid && lmp->suffix) {
      strcat(pstyle,"/");
      strcat(pstyle,lmp->suffix);
      pairhybrid = (Pair *) force->pair_match(pstyle,1,nsub);
    }

    if (!pairhybrid)
      error->all(FLERR,"Unrecognized pair style in compute pressure command");
  }

  // detect contributions to virial
  // vptr points to all virial[6] contributions

+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ class ComputePressure : public Compute {

 private:
  char *pstyle;
  int nsub;
};

}