Obstruction masks are off by one cell/node (obstructions one cell too thick, cell-centred slice plane can be wrong)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 76
- Forks
- 28
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de FireDynamics/fdsreader
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
FireDynamics/fdsreader#133 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]:the sum data of hrrpuv data in smoke_3d is five times smaller than the hrr data in CSVAbiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
FireDynamics/fdsreader#115 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
FireDynamics/fdsreader#81 ·
Los mantenedores suelen responder en 1 día
-
Get RGBA-Value of obstruction from Surf_IdQuizá libre de nuevo @goelakash la tomó hace 34 días y no hay ningún pull request abierto. Abiertoenhancement help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
FireDynamics/fdsreader#77 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
SCLF Data not AccurateAbiertohelp wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
FireDynamics/fdsreader#73 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de FireDynamics/fdsreader
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
onyx-dot-app/onyx#16016 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
black --check exits 0 and prints All done when a multi file run is interruptedPosiblemente ocupada @jiteshgulati la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
Non-positive worker counts wait for results without starting workersPosiblemente ocupada @IlyaKhalafi la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día