1. The Enzo Project
  2. Untitled project
  3. enzo-dev
  4. Issues
Issue #15 new

SubgridSizeAutoAdjust creates inefficient hierarchies when initializing an AMR problem

Nathan Goldbaum
created an issue

This issue is triggered when DetermineSubgridSizeExtrema is called during the very first RebuildHierarchy. Since the hierarchy doesn't exist yet, the NumberOfCells array is zero for all levels but level 0. This causes MaximumSubgridSize and MinimumSubgridEdge to be floored to the smallest allowed values.

For most problems, this will create inefficient AMR hierarchies dominated by small grids with large surface area to volume ratios. Since SubgridSizeAdjust is turned on by default, this means new users will tend to be bit by this issue, as they are more likely to be running test problems rather than cosmology simulations which have static initial hierarchies and will not have this issue.

My workaround is simply to turn off SubgridSizeAdjust during initialization.

I could see two ways to fix this, one would be to alter DetermineSubgridSizeExtrema to respect the MinimumSubgridEdge and MaximumSubgridSize parameters supplied by the user in their parameter file rather than overwriting them.

Another would be to patch RebuildHierarchy so that DetermineSubgridSizeExtrema is never called during initialization. This will still create tiny grids on a new AMR level the first time the code reaches it, one would also have to patch the call to DetermineSubgridSizeExtrema to pass in (for example) NumberOfCells[i] if NumberOfCells[i+1] is zero.

Comments (1)

  1. Log in to comment