Commit 65964f3b authored by David M. Rogers's avatar David M. Rogers
Browse files

Add error check to lammps_gather_atoms/lammps_scatter_atoms in library.cpp

parent 79b005dc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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