Slice.to_global puts the second-to-last node row on the domain's upper faces
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read the “We ignore border points” block in slcf/slice.py (lines 614–638 in 1.11.7), then run the supplied reproduction for Slice.to_global(). Done means node-based slices retain the last FDS-written values on the global maximum faces and corner, while cell-centred slices remain unchanged.
Written by the indexing model from the issue text.
Description
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().
- Dominant language
- Python
- Stars
- 75
- Forks
- 28
- Avg merge
- 2m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FireDynamics/fdsreader
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
FireDynamics/fdsreader#122 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
FireDynamics/fdsreader#121 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 76/100
FireDynamics/fdsreader#120 · 2 comments ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
FireDynamics/fdsreader#115 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
FireDynamics/fdsreader#99 · 11 comments ·
All issues in FireDynamics/fdsreader
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 3 days
-
Negation with "not" and "no" is ignored during sentiment analysisPossibly taken @vivek-3728 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
techcsispit/mess-mood#11 · 1 comment ·
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ramnes/notion-sdk-py#408 ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
btclib-org/btclib-wallet#267 ·
Maintainers usually reply within 1 day
-
good first issue tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
knnmelprop/YAADO#111 ·