Commit c69b6eb
Fix ContinuousBoundaryFunction dispatch ambiguity on Flat grids (#5472)
* Fix ContinuousBoundaryFunction dispatch ambiguity on Flat grids
When a grid dimension is Flat, its location type is Nothing, which
collides with the convention that the boundary-normal dimension also
has location Nothing. This caused method ambiguity errors for
ContinuousBoundaryFunction getbc on grids like (Flat, Flat, Bounded).
Add grid-type-constrained disambiguation methods for all combinations
of two and three Nothing location parameters, for both domain boundary
(2-index) and immersed boundary (3-index) getbc methods.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Use normal FieldBoundaryConditions constructor in test
Use regularize_field_boundary_conditions to process BCs, matching
how model constructors handle user-provided boundary conditions.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Replace grid-type disambiguation with BoundaryNormal sentinel type
Instead of adding grid-type-constrained methods (which created more
ambiguities than it resolved), use a BoundaryNormal sentinel type
for the boundary-normal direction in ContinuousBoundaryFunction.
Previously, Nothing was used for both Flat dimensions and boundary-
normal directions, causing dispatch ambiguity. BoundaryNormal is a
distinct type that unambiguously marks the boundary-normal direction,
eliminating all practical ambiguities without adding any new methods.
Aqua recursive ambiguity count: 343 (baseline) → 325 (with fix).
CBF-specific ambiguities: 6 theoretical (unchanged, unreachable).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update location tests to expect BoundaryNormal instead of Nothing
The boundary-normal direction now uses BoundaryNormal instead of
Nothing, so the location assertions in the integration tests need
to be updated accordingly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add field_dependencies test for ContinuousBoundaryFunction on Flat grid
Exercises the interpolation_code(::BoundaryNormal, ...) methods to
improve patch coverage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* better name for new location
* Improve coverage: build and time-step model on Flat grid
Replace explicit interpolation_code tests with a full model build
and time_step! on a (Flat, Flat, Bounded) grid with field-dependent
ContinuousBoundaryFunction. This exercises the complete regularization
path including all BoundaryAdjacent interpolation_code methods.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 446b88e commit c69b6eb
File tree
3 files changed
+112
-34
lines changed- src/BoundaryConditions
- test
3 files changed
+112
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
12 | 32 | | |
13 | 33 | | |
14 | 34 | | |
| |||
61 | 81 | | |
62 | 82 | | |
63 | 83 | | |
64 | | - | |
| 84 | + | |
65 | 85 | | |
66 | 86 | | |
67 | 87 | | |
| |||
76 | 96 | | |
77 | 97 | | |
78 | 98 | | |
79 | | - | |
80 | | - | |
| 99 | + | |
| 100 | + | |
81 | 101 | | |
82 | 102 | | |
83 | 103 | | |
| |||
116 | 136 | | |
117 | 137 | | |
118 | 138 | | |
119 | | - | |
120 | | - | |
121 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
122 | 142 | | |
123 | 143 | | |
124 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
344 | 345 | | |
345 | 346 | | |
346 | 347 | | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
347 | 404 | | |
348 | 405 | | |
349 | 406 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
0 commit comments