feat(grids): active-cell mask so stencil operators can skip inactive cells
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
Línea de trabajo
Start by reading the existing bounds masking in src/operators/abstract.jl:210, then trace apply!, apply_adjoint!, and operator_diagonal for the uniform CartesianGrid path. Also inspect _build_coarsest in src/multigrid.jl:288 for singular masked regions. Done means active-cell masking works for the stencil and its exact discrete transpose, with diagonal and multigrid behavior covered by tests.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What's missing
MFO has no domain masking. Every mask in src/ is bounds-masking inside adjoint gathers (_maskedget, src/operators/abstract.jl:210) — there is no active-cell indicator, no irregular-geometry / cut-cell support, and no Field of Bool that participates in stencils. BlockForest refinement changes resolution, not participation, so AMR is not a substitute.
Why (downstream)
The microvascular transport model solves a reaction–diffusion system on a hemisphere of tissue embedded in a Cartesian box. Cells outside the hemisphere must be excluded from both the reaction and the diffusion stencil. Today the downstream package carries a per-cell active::Vector that it multiplies into every reaction term by hand, because a masked operator does not exist.
Getting this wrong is not cosmetic: leaving the box corners active created a spurious O₂ sink outside the domain that broke the radial-O₂ comparator entirely. The mask is load-bearing physics, and it currently lives downstream where the operator algebra can't see it.
Sketch
g = CartesianGrid(...; bc = ((Neumann(), Neumann()), ...))
active = scalar_field(Bool, g); set!(active, inside_dome)
L = laplacian(g; active) # inactive cells contribute no flux and get no update
The interesting constraints:
- Adjoint correctness. Whatever
apply!does,apply_adjoint!has to remain its exact discrete transpose — masking a face flux must mask the same face on the way back, or⟨Lx,y⟩ = ⟨x,Lᵀy⟩breaks. That's the test that should gate this. operator_diagonal. An inactive neighbour looks like a no-flux face, so the diagonal correction is the same(-2 + bc_sign)h⁻²form already handled for BC faces — but it now varies cell to cell, which the current implementation doesn't allow for.- Singularity. A fully masked-off region turns the operator singular, which matters for the multigrid coarsest-level LU (
_build_coarsest,src/multigrid.jl:288) and for coarsening a mask consistently.
Scope note
Uniform CartesianGrid only would already unblock the downstream use. Masked BlockForest / distributed slabs can stay out of scope — same boundary you drew for Diffusion in #54.
🤖 Filed by Claude, who read the code so Kyle didn't have to scroll.
- Lenguaje dominante
- Julia
- Estrellas
- 3
- Forks
- 1
- Merge medio
- 1 d 28 min
- PR fusionados (30 d)
- 6
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de RallypointOne/MatrixFreeOperators.jl
-
Roadmap: open-issue priorityAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
-
perf(forest): thread the reference BlockForest path — leaf sweeps and exchange descriptor loopsAbiertoperformance
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Todos los issues de RallypointOne/MatrixFreeOperators.jl
Issues similares
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
NumericalEarth/Breeze.jl#1143 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
MagneticResonanceImaging/MRIReco.jl#315 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
JuliaMath/BFloat16s.jl#138 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
SciML/DiffEqParamEstim.jl#350 ·
-
QA test-env cannot resolve JET on Julia 1.13: compat ceiling 0.11 excludes the only 1.13-compatible versionsPosiblemente ocupada @ChrisRackauckas-Claude la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
SciML/BlackBoxOptim.jl#314 · 1 comentario ·
Los mantenedores suelen responder en 1 día