Skip to content

fix: global boundary arrays keep the time axis first and all face positions - #146

Merged
m-fehr merged 2 commits into
masterfrom
fix/boundary-global-arrays
Oct 15, 2026
Merged

m-fehr merged 2 commits into
masterfrom
fix/boundary-global-arrays

Conversation

@m-fehr

@m-fehr m-fehr commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Obstruction.get_global_boundary_data_arrays() had three problems:

  • Swapped axes: faces one cell wide came out as (1, n_t, n) instead of (n_t, 1, n), because every axis of length one was squeezed.
  • Mixed quantities: whether the data is cell-centred was taken from whichever quantity came first, so a node-based quantity failed when the obstruction also had a cell-centred one.
  • Lost face position: if a face lies at two positions (an obstruction across meshes with different cell sizes, whose bounds FDS snaps to each grid), the first one was dropped.

The arrays are now built from the patches of the requested quantity only, grouped by face position, and always have the shape (n_t, a, b). Several positions give a tuple ordered by position; export_obst_raw writes such faces part by part. Orientations stay sorted; frames a mesh did not write are NaN.

Tests

  • New case bndf_global (FDS 6.11.1, input in tests/cases/fds_inputs/): two meshes with 0.1 m and 0.2 m cells, an obstruction across both, one a cell wide, with a node-based and a cell-centred quantity. 10 of the 12 tests for the function fail on master.
  • On the stored bndf_data cases (FDS 6.10 and 6.11), 38 arrays are identical to master; the other 10 differ only by the corrected axes.

🤖 Generated with Claude Code

m-fehr and others added 2 commits October 15, 2026 21:44
…itions

get_global_boundary_data_arrays squeezed every axis of length one, so faces one
cell wide came out as (1, n_t, n) instead of (n_t, 1, n). It also decided
whether the data is cell-centred from whichever quantity came first, which made
a node-based quantity fail when the obstruction also had a cell-centred one,
and it dropped the first of two face positions (an obstruction spanning meshes
with different cell sizes, whose bounds FDS snaps to each grid).

The arrays are now built from the patches of the requested quantity only,
grouped by face position, and always have the shape (n_t, a, b). Several
positions give a tuple ordered by position; export_obst_raw writes such faces
part by part.

The new case bndf_global (FDS 6.11.1) has two meshes with 0.1 m and 0.2 m
cells, an obstruction across both and one a cell wide, with a node-based and a
cell-centred quantity. On bndf_data the results equal the previous ones except
for the swapped axes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Orientations come in sorted order, as before.
- Meshes with fewer written frames leave the missing frames NaN instead of
  failing on the assignment.
- Face positions and patch nodes are compared with a tolerance relative to the
  cell size; Patch.get_coordinates uses it too, so the grid code reuses it.
- Document that the global grid is uniform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.64706% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
fdsreader/export/obst_exporter.py 16.66% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@m-fehr
m-fehr merged commit 8838353 into master Oct 15, 2026
10 checks passed
@m-fehr
m-fehr deleted the fix/boundary-global-arrays branch October 15, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant