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:
janik
2026-07-15 17:57:12 +07:00
parent a2a8a9d702
commit 07ab59baad
7 changed files with 56 additions and 16 deletions
+8 -3
View File
@@ -56,11 +56,16 @@ ELECTRODE_NEG_LAYER = "User.2" # rectangles on this layer mark V- contact parts
ALWAYS_REFILL = False # refill zones even if KiCad says they are filled
# --- Adaptive grid ---
ADAPTIVE_CELLS = False # solve on a 2:1-balanced quadtree: fine at
ADAPTIVE_CELLS = True # solve on a 2:1-balanced quadtree: fine at
# copper boundaries/electrodes/features,
# coarse plane interiors (dialog-toggleable).
# Slight low bias (~0.5-1% on feature-dense
# boards); large speed/memory wins on pours
# With the deferred-correction pass the
# deviation from the uniform grid is <0.03%
# measured; untick for the reference grid
TARGET_CELLS_ADAPTIVE = 8_000_000 # auto cell-size budget with the adaptive
# grid: unknowns no longer scale with the
# fine cell count, so the auto sizer picks
# a ~2x finer h (memory-bound: masks/fields)
ADAPTIVE_MAX_CELL_UM = 2000.0 # coarsest leaf edge length. The MINIMUM
# element size is the grid cell size itself
# (auto / dialog / CELL_UM_OVERRIDE). Rarely