From 8af673c69d5f7b9faa7c3bb69806874dacc2fecd Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 15 Aug 2012 14:43:41 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8671 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/library.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/library.cpp b/src/library.cpp index 6aecc44805..da6836dc13 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -30,7 +30,9 @@ #include "modify.h" #include "compute.h" #include "fix.h" +#include "comm.h" #include "memory.h" +#include "error.h" using namespace LAMMPS_NS; @@ -383,8 +385,13 @@ void lammps_gather_atoms(void *ptr, char *name, // error if tags are not defined or not consecutive - if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) return; - if (lmp->atom->natoms > MAXSMALLINT) return; + int flag = 0; + if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (flag && lmp->comm->me == 0) { + lmp->error->warning(FLERR,"Library error in lammps_gather_atoms"); + return; + } int natoms = static_cast (lmp->atom->natoms); @@ -464,10 +471,16 @@ void lammps_scatter_atoms(void *ptr, char *name, { LAMMPS *lmp = (LAMMPS *) ptr; - // error if tags are not defined or not consecutive + // error if tags are not defined or not consecutive or no atom map - if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) return; - if (lmp->atom->natoms > MAXSMALLINT) return; + int flag = 0; + if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (lmp->atom->map_style == 0) flag = 1; + if (flag && lmp->comm->me == 0) { + lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms"); + return; + } int natoms = static_cast (lmp->atom->natoms);