address segfault issue with fix nve/gpu when group is not "all"
This commit is contained in:
@ -37,7 +37,7 @@ using namespace FixConst;
|
||||
FixNVEGPU::FixNVEGPU(LAMMPS *lmp, int narg, char **arg) :
|
||||
FixNVE(lmp, narg, arg)
|
||||
{
|
||||
_dtfm = 0;
|
||||
_dtfm = nullptr;
|
||||
_nlocal_max = 0;
|
||||
}
|
||||
|
||||
@ -57,7 +57,11 @@ void FixNVEGPU::setup(int vflag)
|
||||
_respa_on = 1;
|
||||
else
|
||||
_respa_on = 0;
|
||||
if (atom->ntypes > 1) reset_dt();
|
||||
|
||||
// ensure that _dtfm array is initialized if the group is not "all"
|
||||
// or there is more than one atom type as that re-ordeted array is used for
|
||||
// per-type/per-atom masses and group membership detection.
|
||||
if ((igroup != 0) || (atom->ntypes > 1)) reset_dt();
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user