move xhold checks caller-side
this also allows it to fall-back on do-nothing rather than crash
This commit is contained in:
@ -379,20 +379,21 @@ void FixIPI::initial_integrate(int /*vflag*/)
|
|||||||
// snapshot at neighbor list creation, minimizing the
|
// snapshot at neighbor list creation, minimizing the
|
||||||
// number of neighbor list updates
|
// number of neighbor list updates
|
||||||
auto xhold = neighbor->get_xhold();
|
auto xhold = neighbor->get_xhold();
|
||||||
for (int i = 0; i < nlocal; i++) {
|
if (xhold != NULL) { // don't wrap if xhold is not used in the NL
|
||||||
if (mask[i] & groupbit) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
auto delx = x[i][0] - xhold[i][0];
|
if (mask[i] & groupbit) {
|
||||||
auto dely = x[i][1] - xhold[i][1];
|
auto delx = x[i][0] - xhold[i][0];
|
||||||
auto delz = x[i][2] - xhold[i][2];
|
auto dely = x[i][1] - xhold[i][1];
|
||||||
|
auto delz = x[i][2] - xhold[i][2];
|
||||||
|
|
||||||
domain->minimum_image(delx, dely, delz);
|
domain->minimum_image(delx, dely, delz);
|
||||||
|
|
||||||
x[i][0] = xhold[i][0] + delx;
|
x[i][0] = xhold[i][0] + delx;
|
||||||
x[i][1] = xhold[i][1] + dely;
|
x[i][1] = xhold[i][1] + dely;
|
||||||
x[i][2] = xhold[i][2] + delz;
|
x[i][2] = xhold[i][2] + delz;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// move atoms to new processors via irregular()
|
// move atoms to new processors via irregular()
|
||||||
// only needed if migrate_check() says an atom moves to far
|
// only needed if migrate_check() says an atom moves to far
|
||||||
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
if (domain->triclinic) domain->x2lamda(atom->nlocal);
|
||||||
|
|||||||
@ -2976,13 +2976,11 @@ bigint Neighbor::get_nneigh_half()
|
|||||||
return nneighhalf;
|
return nneighhalf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------
|
||||||
|
return the pointer containing the last positions stored by the NL builder
|
||||||
|
------------------------------------------------------------------------- */
|
||||||
double **Neighbor::get_xhold()
|
double **Neighbor::get_xhold()
|
||||||
{
|
{
|
||||||
// Returns the pointer containing the last positions stored by the NL builder,
|
|
||||||
// checking it has actually been initialized
|
|
||||||
if (maxhold == 0) {
|
|
||||||
error->all(FLERR, "trying to access uninitialized xhold list");
|
|
||||||
}
|
|
||||||
return xhold;
|
return xhold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user