Merge branch 'master' into math_eigen

This commit is contained in:
Axel Kohlmeyer
2020-09-15 21:37:05 -04:00
1663 changed files with 20567 additions and 19420 deletions

View File

@ -59,7 +59,7 @@ Group::Group(LAMMPS *lmp) : Pointers(lmp)
inversemask = new int[MAX_GROUP];
dynamic = new int[MAX_GROUP];
for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL;
for (int i = 0; i < MAX_GROUP; i++) names[i] = nullptr;
for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i;
for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0;
for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0;
@ -127,7 +127,7 @@ void Group::assign(int narg, char **arg)
modify->delete_fix(std::string("GROUP_") + names[igroup]);
delete [] names[igroup];
names[igroup] = NULL;
names[igroup] = nullptr;
dynamic[igroup] = 0;
ngroup--;
@ -236,8 +236,8 @@ void Group::assign(int narg, char **arg)
bound2 = utils::tnumeric(FLERR,arg[4],false,lmp);
} else if (narg != 4) error->all(FLERR,"Illegal group command");
int *attribute = NULL;
tagint *tattribute = NULL;
int *attribute = nullptr;
tagint *tattribute = nullptr;
if (category == TYPE) attribute = atom->type;
else if (category == MOLECULE) tattribute = atom->molecule;
else if (category == ID) tattribute = atom->tag;
@ -297,8 +297,8 @@ void Group::assign(int narg, char **arg)
// args = list of values
} else {
int *attribute = NULL;
tagint *tattribute = NULL;
int *attribute = nullptr;
tagint *tattribute = nullptr;
if (category == TYPE) attribute = atom->type;
else if (category == MOLECULE) tattribute = atom->molecule;
else if (category == ID) tattribute = atom->tag;
@ -311,9 +311,9 @@ void Group::assign(int narg, char **arg)
if (strchr(arg[iarg],':')) {
ptr = strtok(arg[iarg],":");
start = utils::tnumeric(FLERR,ptr,false,lmp);
ptr = strtok(NULL,":");
ptr = strtok(nullptr,":");
stop = utils::tnumeric(FLERR,ptr,false,lmp);
ptr = strtok(NULL,":");
ptr = strtok(nullptr,":");
if (ptr) delta = utils::tnumeric(FLERR,ptr,false,lmp);
} else {
start = stop = utils::tnumeric(FLERR,arg[iarg],false,lmp);
@ -618,7 +618,7 @@ int Group::find_or_create(const char *name)
int Group::find_unused()
{
for (int igroup = 0; igroup < MAX_GROUP; igroup++)
if (names[igroup] == NULL) return igroup;
if (names[igroup] == nullptr) return igroup;
return -1;
}
@ -655,7 +655,7 @@ void Group::add_molecules(int /*igroup*/, int bit)
for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first;
molbit = bit;
comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this);
comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this);
delete hash;
memory->destroy(list);
@ -725,7 +725,7 @@ void Group::read_restart(FILE *fp)
for (i = 0; i < MAX_GROUP; i++) delete [] names[i];
if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&ngroup,1,MPI_INT,0,world);
// use count to not change restart format with deleted groups
@ -734,17 +734,17 @@ void Group::read_restart(FILE *fp)
int count = 0;
for (i = 0; i < MAX_GROUP; i++) {
if (count == ngroup) {
names[i] = NULL;
names[i] = nullptr;
continue;
}
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error);
MPI_Bcast(&n,1,MPI_INT,0,world);
if (n) {
names[i] = new char[n];
if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,NULL,error);
if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,nullptr,error);
MPI_Bcast(names[i],n,MPI_CHAR,0,world);
count++;
} else names[i] = NULL;
} else names[i] = nullptr;
}
}