feat(grids): active-cell mask so stencil operators can skip inactive cells
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Julia
- スター
- 3
- フォーク
- 1
- 平均マージ
- 1日 28分
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RallypointOne/MatrixFreeOperators.jl のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
performance
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
-
perf(forest): thread the reference BlockForest path — leaf sweeps and exchange descriptor loopsオープンperformance
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RallypointOne/MatrixFreeOperators.jl の issue をすべて見る
似ている issue
-
`SplitRungeKutta` time steppers never call `update_lagrangian_particle_state!`, so particle `tracked_fields` are never updated対応中かも @ali-ramadhan が今日担当しました。 オープンbug 🐞
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
CliMA/Oceananigans.jl#6381 ·
メンテナーはふだん 1 日以内に返信
-
ci system:windows test
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
Single-column TKE example: boundary-layer depth description doesn't match Han & Bretherton (2019)オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
NumericalEarth/Breeze.jl#1143 ·
メンテナーはふだん 1 日以内に返信
-
format-check (Runic) is red on master: formatter drift on ~200 files対応中かも @ChrisRackauckas-Claude が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
SciML/ModelingToolkit.jl#5337 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
bug parsers
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
lanl-ansi/GasModels.jl#366 ·