diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index ccd5da433f..013efb8c50 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -906,7 +906,11 @@ void ComputeChunkAtom::assign_chunk_ids() // update region if necessary - if (regionflag) region->prematch(); + if (regionflag) { + region = domain->get_region_by_id(idregion); + if (!region) error->all(FLERR, "Region {} for compute chunk/atom does not exist", idregion); + region->prematch(); + } // exclude = 1 if atom is not assigned to a chunk // exclude atoms not in group or not in optional region