if (mask[i] & groupbit_) internalToAtom_(j++) = i;
}
// construct reverse map
atomToInternal_.clear();
for (int i = 0; i < nLocal_; ++i) {
atomToInternal_[internalToAtom_(i)] = i;
}
}
if (nLocalGhost_>0) {
// set map
ghostToAtom_.reset(nLocalGhost_);
int j = 0;
for (int i = 0; i < nLocalTotal_; ++i) {
if (mask[i] & groupbitGhost_) ghostToAtom_(j++) = i;
}
}
//WIP_JAT this should not be needed at all, but a memory problem with sparse matrices requires them to be reset (possibly related to note in SparseMatrix-inl.h::_delete())