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