Adaptive grid on by default; finer auto cell size under it
ADAPTIVE_CELLS defaults to True (dialog checkbox stays; untick or --no-adaptive for the uniform reference grid). With the adaptive grid the auto cell sizer targets TARGET_CELLS_ADAPTIVE (8M fine cells, ~2x finer h) since unknowns no longer scale with the fine cell count - memory of the masks/field arrays is the new bound. The test suite pins ADAPTIVE_CELLS off via an autouse conftest fixture: the exact-value tests define the uniform reference grid; adaptive tests opt in per test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,7 +97,11 @@ def choose_cell_size(bbox_nm: tuple[int, int, int, int], nlayers: int) -> float:
|
||||
)
|
||||
h = config.CELL_UM_OVERRIDE * 1000.0
|
||||
else:
|
||||
h = math.sqrt(w * ht * nlayers / config.TARGET_CELLS)
|
||||
# the adaptive grid decouples unknowns from the fine cell count,
|
||||
# so its auto sizing affords a larger fine-cell budget (finer h)
|
||||
target = (config.TARGET_CELLS_ADAPTIVE if config.ADAPTIVE_CELLS
|
||||
else config.TARGET_CELLS)
|
||||
h = math.sqrt(w * ht * nlayers / target)
|
||||
h = min(max(h, config.MIN_CELL_UM * 1000.0), config.MAX_CELL_UM * 1000.0)
|
||||
|
||||
ncells = math.ceil(w / h) * math.ceil(ht / h) * nlayers
|
||||
|
||||
Reference in New Issue
Block a user