Obstruction masks are off by one cell/node (obstructions one cell too thick, cell-centred slice plane can be wrong)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start in Mesh.get_obstruction_mask_slice() and get_obstruction_mask, where the slice plane is rebuilt with coordinate_to_index(..., cell_centered=True) and the OBST bounds get the +1 offset for cell-centred masks. Reproduce with an OBST at 0.1 m and a cell-centred slice, then compare the masked cells against the slice data plane. Done means the mask uses the integer plane from the SLCC header and matches the data plane, the OBST cell range is corrected, and tests assert which cells are masked, not only shapes.
索引モデルが issue の本文から書いたものです。
説明
Found while reviewing #131, verified on FDS runs: the input file from #89 (two of its meshes at 0.1 m) and a small test case with a 2D and a 3D cell-centred slice and an obstruction at 0.1 m.
1. Cell-centred 2D slices can be masked with the wrong cell plane (depends on float rounding)
Mesh.get_obstruction_mask_slice() rebuilds the slice plane from the slice's extent via coordinate_to_index(..., cell_centered=True). FDS writes a cell-centred slice as SLCC … k k and fdsreader stores the extent of node k, which lies exactly between cell k-1 and cell k (0-based). The slice data belongs to the lower cell k-1: in a test run, a 2D cell-centred slice at PBZ=-1.05 (SLCC … 10 10) is identical to layer 9 of a 3D cell-centred slice (max difference 0.0) and differs from layer 10.
Which cell coordinate_to_index picks for that tie is decided by float32 rounding of the coordinates, so the result is sometimes right and sometimes wrong:
&SLCF … CELL_CENTERED |
.smv |
extent z | mask plane (centre) | slice data plane (centre) |
|---|---|---|---|---|
PBZ=-2.55 (case from #89) |
SLCC … 35 35 |
−2.50 | cell 35 (−2.45) ❌ | cell 34 (−2.55) |
PBZ=-1.05 (test run) |
SLCC … 10 10 |
−1.00 | cell 9 (−1.05) ✅ | cell 9 (−1.05) |
PBZ=-0.45 (top of mesh, #89) |
SLCC … 56 56 |
−0.40 | cell 55 (−0.45) ✅ | cell 55 (−0.45) |
When it goes wrong, the slice is masked with the obstruction layout of the neighbouring cell layer.
2. Cell-centred masks block one cell beyond the obstruction
get_obstruction_mask uses x1 : max(x2 + c, x1 + 1) with c = 1 for cell-centred masks. OBST bound indices are node indices, so the obstruction covers cells x1 … x2-1; the +1 adds the gas cell above/behind it on every axis.
Example: OBST XB=15.6,16.2,… (bound indices x = (31, 37)) blocks cell centres 15.65 … 16.25, i.e. 7 cells instead of 6. Same in a separate test run: OBST XB=0.3,0.7,… at 0.1 m blocks cell centres 0.35 … 0.75. Obstructions look one cell thicker with to_global(masked=True), as described in #89 ("Obstructions appear thicker than expected").
3. Node-based masks include the lower-face nodes but not the upper-face nodes
With c = 0 the mask covers nodes x1 … x2-1: for the same OBST, nodes 15.6 … 16.1 are masked, 16.2 is not (test run: XB=0.3,0.7 masks nodes 0.3 … 0.6, not 0.7). The masked outline is shifted towards the lower corner on each axis.
Suggested direction
Instead of rebuilding the plane from a float extent, keep the integer plane index from the slice header (SLCC … k k) on the SubSlice and use it directly (node k for node-based, cell k-1 for cell-centred). Convert OBST node bounds consistently: cells x1 … x2-1, nodes x1 … x2 (or decide explicitly whether face nodes count as obstructed). This removes the class of bugs that also caused #89 (empty mask at the top of a mesh below zero).
While at it: for 2D slices get_obstruction_mask_slice builds the (n_t, nx, ny, nz) mask of the whole mesh and keeps one plane (≈ 262 MB for one 67×70×56 mesh with 1000 timesteps). Building only the needed plane would avoid that.
Tests should place an obstruction and assert which plane/cells are masked, including an interior cell-centred slice. The current regression tests for #89 and #125 only check shapes and points strictly inside the obstruction.
Note: fixing this changes to_global(masked=True) results for existing users and should be mentioned in the release notes.
- 主要言語
- Python
- スター
- 76
- フォーク
- 28
- 平均マージ
- 16時間 49分
- マージ済み PR(30日)
- 28
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FireDynamics/fdsreader のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FireDynamics/fdsreader#133 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Get RGBA-Value of obstruction from Surf_Id再び着手できるかも @goelakash が 36 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
FireDynamics/fdsreader#77 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
to_global has Problem with different cell-sizes再び着手できるかも @lu-kas が 833 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
FireDynamics/fdsreader#49 · コメント 8 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
FireDynamics/fdsreader#23 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
FireDynamics/fdsreader の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
noontide-co/mainbranch#1211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adaptersオープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
dbt-labs/dbt#16784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug settings ui
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
DewaldOosthuizen/py-tray-command-launcher#162 ·
メンテナーはふだん 1 日以内に返信
-
run_all sleeps after the final job despite documenting delays between jobs対応中かも @Gambit-Checkmate が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100