Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

feat(grids): active-cell mask so stencil operators can skip inactive cells

Abierto
#61 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
38/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
julia
Área
hpc

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

enhancement

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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RallypointOne/MatrixFreeOperators.jl

Todos los issues de RallypointOne/MatrixFreeOperators.jl

Issues similares

Más issues de Julia

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.