Commit eebf110e authored by athomps's avatar athomps
Browse files

Further tweaked the flangevin issue

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14466 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent d13b2ecf
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -146,7 +146,13 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
  temperature = NULL;

  energy = 0.0;

  // flangevin is unallocated until first call to setup()
  // compute_scalar checks for this and returns 0.0 
  // if flangevin_allocated is not set

  flangevin = NULL;
  flangevin_allocated = 0;
  franprev = NULL;
  tforce = NULL;
  maxatom1 = maxatom2 = 0;
@@ -510,6 +516,7 @@ void FixLangevin::post_force_untemplated
      maxatom1 = atom->nmax;
      memory->create(flangevin,maxatom1,3,"langevin:flangevin");
    }
    flangevin_allocated = 1;
  }

  if (Tp_BIAS) temperature->compute_scalar();
@@ -824,7 +831,7 @@ int FixLangevin::modify_param(int narg, char **arg)

double FixLangevin::compute_scalar()
{
  if (!tallyflag) return 0.0;
  if (!tallyflag || !flangevin_allocated) return 0.0;

  // capture the very first energy transfer to thermal reservoir

+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ class FixLangevin : public Fix {

 protected:
  int gjfflag,oflag,tallyflag,zeroflag,tbiasflag;
  int flangevin_allocated;
  double ascale;
  double t_start,t_stop,t_period,t_target;
  double *gfactor1,*gfactor2,*ratio;