Merge pull request #318 from andeplane/initialize_pointers

Initializing pointers in neighbor.cpp
This commit is contained in:
sjplimp
2017-01-06 10:03:05 -07:00
committed by GitHub
3 changed files with 6 additions and 1 deletions

View File

@ -390,6 +390,8 @@ void Atom::create_avec(const char *style, int narg, char **arg, int trysuffix)
{
delete [] atom_style;
if (avec) delete avec;
atom_style = NULL;
avec = NULL;
// unset atom style and array existence flags
// may have been set by old avec

View File

@ -195,6 +195,8 @@ void Force::create_pair(const char *style, int trysuffix)
{
delete [] pair_style;
if (pair) delete pair;
pair_style = NULL;
pair = NULL;
int sflag;
pair = new_pair(style,trysuffix,sflag);

View File

@ -73,7 +73,8 @@ static const char cite_neigh_multi[] =
/* ---------------------------------------------------------------------- */
Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp)
Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp),
pairclass(NULL), pairnames(NULL), pairmasks(NULL)
{
MPI_Comm_rank(world,&me);
MPI_Comm_size(world,&nprocs);