After #497, we could implement a
for pti in pc.iterator(level="all"):
# ...
Since we cannot yield MFIter without a nested iterator warning in AMReX, we could implement a lightweight iterator wrapper that iterates level by level the per-level iterator for us.
We can forward all properties and methods of the underlying Iterator type like this:
def __getattr__(self, name):
# For attributes not explicitly defined here, return the
# attribute of the underlying Iterator
return getattr(self.pc.Iterator, name)
After #497, we could implement a
Since we cannot
yield MFIterwithout a nested iterator warning in AMReX, we could implement a lightweight iterator wrapper that iterates level by level the per-level iterator for us.We can forward all properties and methods of the underlying
Iteratortype like this: