/* Global system sized array, this should be avoided */
snew(shell_index, mtop->natoms);
- SystemAtomIterator aloop(*mtop);
nshell = 0;
- while (aloop.nextAtom())
+ for (const AtomProxy &atomP : AtomRange(*mtop))
{
- const t_atom &local = aloop.atom();
- int i = aloop.globalAtomNumber();
+ const t_atom &local = atomP.atom();
+ int i = atomP.globalAtomNumber();
if (local.ptype == eptShell)
{
shell_index[i] = nshell++;