Further tweaked the flangevin issue

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14466 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
athomps
2016-01-21 18:16:07 +00:00
parent d13b2ecfc9
commit eebf110e02
2 changed files with 9 additions and 1 deletions

View File

@ -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

View File

@ -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;