Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#61 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
julia
領域
hpc

調査の方向性

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 の本文から書いたものです。

説明

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.

主要言語
Julia
スター
3
フォーク
1
平均マージ
1日 28分
マージ済み PR(30日)
6

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

RallypointOne/MatrixFreeOperators.jl のほかの issue

RallypointOne/MatrixFreeOperators.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。