Skip to content

Commit ab3876d

Browse files
committed
Debug
1 parent 77ef868 commit ab3876d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/compute_cluster_size_ext.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,11 @@ void ComputeClusterSizeExt::compute_vector()
253253
clstr.l_size = ns[2 * clidx + 1];
254254
clstr.rearrange();
255255
auto clatoms = clstr.atoms();
256-
for (int i = 0; i < clstr.l_size; ++i) { peratom_size[clatoms[i]] = clstr.g_size; }
256+
const auto clatoms = clstr.atoms();
257+
for (int i = 0; i < clstr.l_size; ++i) {
258+
if (clatoms[i] >= atom->nlocal) { error->one(FLERR, "{}/pre_exchange:{}: particle index exceeds nlocal", style, comm->me); }
259+
peratom_size[clatoms[i]] = clstr.g_size;
260+
}
257261
if ((clstr.g_size < size_cutoff) && (clstr.g_size > 1)) { cbs_all[clstr.g_size].push_back(clidx); }
258262
if (clstr.host == comm->me) {
259263
if (clstr.g_size < size_cutoff) { dist_local[clstr.g_size] += 1; }

src/fix_cluster_crush_delete.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ void FixClusterCrushDelete::pre_exchange()
352352
if (update->ntimestep < next_step) { return; }
353353
next_step = update->ntimestep + nevery;
354354

355-
if (compute_cluster_size->invoked_vector < update->ntimestep) { compute_cluster_size->compute_vector(); }
355+
if (compute_cluster_size->invoked_vector != update->ntimestep) { compute_cluster_size->compute_vector(); }
356356
const auto& cIDs_by_size = compute_cluster_size->get_cIDs_by_size();
357357

358358
if (nloc < atom->nlocal) {

0 commit comments

Comments
 (0)