From 31e51f9834b0abd1e086e90514d831fbb9e226e2 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Wed, 14 Apr 2010 15:02:39 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3993 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/compute_centro_atom.cpp | 4 ++++ src/dump_xyz.cpp | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 5afdd4a0f9..de559b3e63 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -11,6 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Michel Perez (U Lyon) for non-fcc lattices +------------------------------------------------------------------------- */ + #include "string.h" #include "stdlib.h" #include "compute_centro_atom.h" diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index c91061a008..9219451fb3 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -95,16 +95,19 @@ double DumpXYZ::memory_usage() void DumpXYZ::write_header(int n) { + // check bounds of atom IDs if group is all // all procs realloc types & coords if necessary - if (igroup == 0 && n != natoms) { - memory->sfree(types); - memory->sfree(coords); + if (igroup == 0) { if (atom->tag_consecutive() == 0) - error->all("Atom IDs must be consecutive for dump xyz"); - natoms = n; - types = (int *) memory->smalloc(natoms*sizeof(int),"dump:types"); - coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords"); + error->all("Atom IDs must be consecutive for dump xyz all"); + if (n != natoms) { + memory->sfree(types); + memory->sfree(coords); + natoms = n; + types = (int *) memory->smalloc(natoms*sizeof(int),"dump:types"); + coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords"); + } } // only proc 0 writes header