Slice.to_global puts the second-to-last node row on the domain's upper faces
評価
調査の方向性
slcf/slice.py の「We ignore border points」ブロック(1.11.7 では 614–638 行目)を読み、Slice.to_global() 用に提供された再現を実行してください。完了とは、ノードベースのスライスが全球最大の面およびコーナーにおける FDS が最後に書き込んだ値を保持し、セル中心のスライスは変更されないことを意味します。
索引モデルが issue の本文から書いたものです。
説明
Slice.to_global() (slcf/slice.py, the "We ignore border points ..." block;
1.11.7 lines 614-638, unchanged on the default branch at c5aac2a) writes the wrong values
into the node row at the global maximum of a node-based slice. For each axis it
first drops the mesh's last node (reduced_shape[axis + 1] -= 1) and only then
saves the "border points" from the shortened array, so the node appended at the
global maximum is the original second-to-last node. Cell-centred slices skip
this block and are not affected. Same code block as #121 (dropped upper-face nodes), distinct defect.
Reproduction (one mesh [0, 1] x [0, 1], node spacing 0.5, horizontal
node-based slice, FDS data K = x + 10 y; the mesh and subslice are fdsreader's
own classes, only the data is set):
import numpy as np
from fdsreader.fds_classes.mesh import Mesh
from fdsreader.slcf.slice import Slice, SubSlice
from fdsreader.utils.extent import Extent
class OneMeshSlice:
to_global = Slice.to_global
subslices = Slice.subslices
orientation, id, n_t, times, cell_centered = 3, "s", 1, np.array([0.0]), False
def __init__(self):
nodes = {"x": np.array([0.0, 0.5, 1.0]), "y": np.array([0.0, 0.5, 1.0]),
"z": np.array([0.0, 1.0, 2.0])}
mesh = Mesh(nodes, {"x": (0.0, 1.0), "y": (0.0, 1.0), "z": (0.0, 2.0)}, "M")
sub = SubSlice(self, "", None, Extent(0.0, 1.0, 0.0, 1.0, 1.0, 1.0), mesh)
X, Y = np.meshgrid(nodes["x"], nodes["y"], indexing="ij")
sub._data = (X + 10 * Y)[None].astype(np.float32) # as FDS wrote it, (t, x, y)
self._subslices = {"M": sub}
self.extent = Extent(0.0, 1.0, 0.0, 1.0, 1.0, 1.0)
print(np.asarray(OneMeshSlice().to_global())[0])
FDS data (rows over x): to_global() returns:
[[0. 5. 10. ] [[0. 5. 5. ]
[0.5 5.5 10.5] [0.5 5.5 5.5]
[1. 6. 11. ]] [0.5 5.5 5.5]]
The y = 1 entries repeat y = 0.5, the x = 1 row repeats x = 0.5, and the corner
(1, 1) is 5.5 (the node (0.5, 0.5)) instead of 11. Reproduced on 1.11.5,
1.11.6, 1.11.7, 1.11.9, 1.12.0 and 1.12.1. The same setup with a cell-centred
slice returns the data unchanged.
Expected: the node row at the global maximum is the last node row FDS wrote.
On a real deck (L-shaped corridor, 8 meshes at 0.25 m, SOOT EXTINCTION
COEFFICIENT at z = 2.0 m, FDS 6.10.1) 153 nodes on the upper faces y = 28 m
and x = 45 m are affected; the values differ from the written last node by up
to 0.33 1/m.
Suggested fix: save the border slice (temp_data, and temp_mask when
masked) from the unreduced array, i.e. before slc_data is shortened, and
append it after the repeat as now.
Found through fdsvismap, which reads slices with to_global().
- 主要言語
- Python
- スター
- 75
- フォーク
- 28
- 平均マージ
- 2分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
FireDynamics/fdsreader のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
FireDynamics/fdsreader#125 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
FireDynamics/fdsreader#122 · コメント 2 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
FireDynamics/fdsreader#121 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
FireDynamics/fdsreader#120 · コメント 2 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
FireDynamics/fdsreader#115 · コメント 1 件 ·
FireDynamics/fdsreader の issue をすべて見る
似ている issue
-
HTML: <template> content is extracted as document text対応中かも @ryanmeowy が今日担当しました。 オープンbug html
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
docling-project/docling#4714 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Qdrant RAG client applies score_threshold to raw cosine similarity, not the 0-1 score it returns対応中かも @roydonsequeira が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
Host test failure in core/direct_io.zig on Linux kernel 6.17: O_DIRECT open succeeds on procfs, so the test's 'plain' fd is not plain対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ashhart/TensorFold#536 ·
メンテナーはふだん 1 日以内に返信
-
area/install-update comp/cli duplicate P2 python:uv sweeper:risk-compatibility type/bug
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
NousResearch/hermes-agent#135440 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Deepak3699/Ai_Mentor#244 ·
メンテナーはふだん 1 日以内に返信