git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@3993 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -11,6 +11,10 @@
|
|||||||
See the README file in the top-level LAMMPS directory.
|
See the README file in the top-level LAMMPS directory.
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
Contributing author: Michel Perez (U Lyon) for non-fcc lattices
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdlib.h"
|
#include "stdlib.h"
|
||||||
#include "compute_centro_atom.h"
|
#include "compute_centro_atom.h"
|
||||||
|
|||||||
@ -95,17 +95,20 @@ double DumpXYZ::memory_usage()
|
|||||||
|
|
||||||
void DumpXYZ::write_header(int n)
|
void DumpXYZ::write_header(int n)
|
||||||
{
|
{
|
||||||
|
// check bounds of atom IDs if group is all
|
||||||
// all procs realloc types & coords if necessary
|
// all procs realloc types & coords if necessary
|
||||||
|
|
||||||
if (igroup == 0 && n != natoms) {
|
if (igroup == 0) {
|
||||||
|
if (atom->tag_consecutive() == 0)
|
||||||
|
error->all("Atom IDs must be consecutive for dump xyz all");
|
||||||
|
if (n != natoms) {
|
||||||
memory->sfree(types);
|
memory->sfree(types);
|
||||||
memory->sfree(coords);
|
memory->sfree(coords);
|
||||||
if (atom->tag_consecutive() == 0)
|
|
||||||
error->all("Atom IDs must be consecutive for dump xyz");
|
|
||||||
natoms = n;
|
natoms = n;
|
||||||
types = (int *) memory->smalloc(natoms*sizeof(int),"dump:types");
|
types = (int *) memory->smalloc(natoms*sizeof(int),"dump:types");
|
||||||
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
coords = (float *) memory->smalloc(3*natoms*sizeof(float),"dump:coords");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// only proc 0 writes header
|
// only proc 0 writes header
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user