Skip to content
Snippets Groups Projects
Commit c97feafc authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #407 from frobnitzem/master

Add error check to lammps_gather_atoms/lammps_scatter_atoms in library.cpp
parents b20d95d4 65964f3b
No related branches found
No related tags found
No related merge requests found
......@@ -761,6 +761,10 @@ void lammps_gather_atoms(void *ptr, char *name,
int i,j,offset;
void *vptr = lmp->atom->extract(name);
if(vptr == NULL) {
lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name");
return;
}
// copy = Natom length vector of per-atom values
// use atom ID to insert each atom's values into copy
......@@ -857,6 +861,10 @@ void lammps_scatter_atoms(void *ptr, char *name,
int i,j,m,offset;
void *vptr = lmp->atom->extract(name);
if(vptr == NULL) {
lmp->error->warning(FLERR,"lammps_scatter_atoms: unknown property name");
return;
}
// copy = Natom length vector of per-atom values
// use atom ID to insert each atom's values into copy
......
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