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:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user