Some time ago, someone (can't find the email right now) reported problems with CarpetRegrid2, where the grid structure may be inconsistent. I have restructured the code, but since this is a fairly invasive change I would like this to be thoroughly tested before committing it.
This change may lead to Carpet using a (slightly) different grid structure than before. The differences are not "important"; what potentially changes is the order in which consistency conditions are applied. I expect that, in most cases, there will be no differences. The list of consistency conditions is:
- ensure proper nesting (level must be larger than next finer level)
- add buffer zones (only once, not really a consistency condition)
- combine regions into a single box (if this is efficient)
- apply rotating 90/180 symmetry (if requested)
- clip at outer boundary (so that boxes that are too large or are outside are cut off)
I attach a patch and four new files that implement this restructuring. Give it a try if you are interested.