git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3993 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp 2010-04-14 15:02:39 +00:00
parent e7e695fa42
commit 31e51f9834
2 changed files with 14 additions and 7 deletions

View File

@ -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"

View File

@ -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