-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
When attempting to get the global values of a slice using to_global, I get the following error:
File "test.py", line 5, in <module>
sim.slices[1].to_global()
File "lib/python3.10/site-packages/fdsreader/slcf/slice.py", line 537, in to_global
base_coord = next(iter(self._subslices.values())).get_coordinates(ignore_cell_centered=False)[dimension][0]
File "lib/python3.10/site-packages/fdsreader/slcf/slice.py", line 66, in get_coordinates
co += abs(co[1] - co[0]) / 2
IndexError: index 1 is out of bounds for axis 0 with size 1
I think this is due to the mesh along one axis only having one coordinate in the FDS file:
&MULT ID='m1', DX=1.25,DZ=0.5 I_UPPER=7,K_UPPER=1/ 16 mesh
&MESH IJK=100,1,40, XB=0,1.25,-0.1,0.1,0,0.5, MULT_ID='m1'/
And the last coordinate being removed in get_coordinates before the shift is performed:
if self.cell_centered and not ignore_cell_centered:
co = co[:-1]
co += abs(co[1] - co[0]) / 2
Steps to reproduce
- Run the Pohlhausen validation case: https://github.com/firemodels/fds/blob/master/Validation/Convection/FDS_Input_Files/Pohlhausen_Pr_1.fds
- Try to load the temperature slice from the results:
import fdsreader
sim = fdsreader.Simulation("pohl_results")
temp_slice = [slice for slice in sim.slices if slice.quantity.quantity == "TEMPERATURE"][0]
values = temp_slice.to_global()
FDS version used
6.9.1
fdsreader version used
1.11.7
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working