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

This commit is contained in:
sjplimp 2015-02-02 21:37:12 +00:00
parent 76c7e6ed7b
commit 4a0ba2126e
2 changed files with 26 additions and 0 deletions

View File

@ -559,6 +559,11 @@ int Comm::coord2proc(double *x, int &igx, int &igy, int &igz)
double *prd = domain->prd;
double *boxlo = domain->boxlo;
// initialize triclinic b/c coord2proc can be called before Comm::init()
// via Irregular::migrate_atoms()
triclinic = domain->triclinic;
if (layout == LAYOUT_UNIFORM) {
if (triclinic == 0) {
igx = static_cast<int> (procgrid[0] * (x[0]-boxlo[0]) / prd[0]);

View File

@ -589,6 +589,27 @@ void ReadData::command(int narg, char **arg)
// in case data file re-defined them
if (atom->molecular == 2) atom->avec->onemols[0]->check_attributes(1);
// shrink-wrap the box if necessary and move atoms to new procs
// if atoms are lost is b/c data file box was far from shrink-wrapped
// do not use irregular() comm, which would not lose atoms,
// b/c then user could specify data file box as far too big and empty
if (domain->nonperiodic == 2) {
if (domain->triclinic) domain->x2lamda(atom->nlocal);
domain->reset_box();
comm->init();
comm->setup();
comm->exchange();
if (domain->triclinic) domain->lamda2x(atom->nlocal);
bigint natoms;
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
if (natoms != atom->natoms)
error->all(FLERR,
"Read_data shrink wrap did not assign all atoms correctly");
}
}
/* ----------------------------------------------------------------------