Commit fed629c2 authored by Tim Mattox's avatar Tim Mattox
Browse files

USER-DPD: Bugfix for fix_rx and fix_eos_table_rx to handle restart files.

Patch by Jim Larentzos.  Applied by Tim Mattox.
parent 925481c3
Loading
Loading
Loading
Loading
+9 −7
Original line number Diff line number Diff line
@@ -162,6 +162,7 @@ void FixEOStableRX::setup(int vflag)
  double *uCG   = atom->uCG;
  double *uCGnew = atom->uCGnew;

  if(!this->restart_reset){
    for (int i = 0; i < nlocal; i++)
      if (mask[i] & groupbit){
        duChem = uCG[i] - uCGnew[i];
@@ -169,6 +170,7 @@ void FixEOStableRX::setup(int vflag)
        uCG[i] = 0.0;
        uCGnew[i] = 0.0;
      }
  }

  // Communicate the updated momenta and velocities to all nodes
  comm->forward_comm_fix(this);
+4 −0
Original line number Diff line number Diff line
@@ -106,6 +106,10 @@ E: eos/table/rx values are not increasing

The equation-of-state must an increasing function

E:  FixEOStableRX requires atom_style with internal temperature and energies (e.g. dpd)

Self-explanatory.

E:  Internal temperature <= zero.

Self-explanatory.
+30 −26
Original line number Diff line number Diff line
@@ -69,7 +69,6 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) :
  id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL)
{
  if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command");
  restart_peratom = 1;
  nevery = 1;

  nreactions = maxparam = 0;
@@ -366,6 +365,7 @@ void FixRX::post_constructor()

  modify->add_fix(nspecies+5,newarg);
  fix_species = (FixPropertyAtom *) modify->fix[modify->nfix-1];
  restartFlag = modify->fix[modify->nfix-1]->restart_reset;

  modify->add_fix(nspecies+5,newarg2);
  fix_species_old = (FixPropertyAtom *) modify->fix[modify->nfix-1];
@@ -647,6 +647,9 @@ void FixRX::setup_pre_force(int vflag)
  double tmp;
  int ii;

  if(restartFlag){
    restartFlag = 0;
  } else {
    if(localTempFlag){
      int count = nlocal + (newton_pair ? nghost : 0);
      dpdThetaLocal = new double[count];
@@ -676,6 +679,7 @@ void FixRX::setup_pre_force(int vflag)
    comm->forward_comm_fix(this);
    if(localTempFlag) delete [] dpdThetaLocal;
  }
}

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

+1 −0
Original line number Diff line number Diff line
@@ -132,6 +132,7 @@ class FixRX : public Fix {
  char *kineticsFile;
  char *id_fix_species,*id_fix_species_old;
  class FixPropertyAtom *fix_species,*fix_species_old;
  int restartFlag;

};