Skip to content
Snippets Groups Projects
Commit 8f18c284 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

add crude check to print warning when using compute cnp/atom on multi-type system

parent 06915162
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,22 @@ ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) : ...@@ -61,6 +61,22 @@ ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) :
if (cutoff < 0.0) error->all(FLERR,"Illegal compute cnp/atom command"); if (cutoff < 0.0) error->all(FLERR,"Illegal compute cnp/atom command");
cutsq = cutoff*cutoff; cutsq = cutoff*cutoff;
// apply check for single type atoms in compute group
int lasttype = -1;
int n = -1;
for (int i=0; i < atom->nlocal; ++i) {
if (atom->mask[i] & groupbit) {
if (lasttype != atom->type[i]) {
lasttype = atom->type[i];
++n;
}
}
}
int all_n = 0;
MPI_Allreduce(&n,&all_n,1,MPI_INT,MPI_MAX,world);
if (all_n > 0)
error->warning(FLERR,"Compute cnp/atom requested on multi-type system");
nmax = 0; nmax = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment