Skip to content

Commit 478dfbe

Browse files
committed
Lots of improvements and convenience methods for obstructions
1 parent 7a135c3 commit 478dfbe

32 files changed

+654
-343
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@ pip install fdsreader
1313
_FDS Version 6.7.5 and above are fully supported. Versions below 6.7.5 might work, but are not guaranteed to work._
1414

1515
## Usage example
16+
1617
```python
1718
import fdsreader as fds
1819

1920
# Creates an instance of a simulation master-class which manages all data for a given simulation
2021
sim = fds.Simulation("./sample_data")
2122

2223
# Examples of data that can be easily accessed
23-
print(sim.meshes, sim.surfaces, sim.slices, sim.data_3d, sim.isosurfaces, sim.particles, sim.obstructions)
24+
print(sim.meshes, sim.surfaces, sim.slices, sim.data_3d, sim.smoke_3d, sim.isosurfaces, sim.particles, sim.obstructions)
2425
```
2526

2627
More advanced examples can be found in the respective data type directories inside of the examples directory.

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
## Release History
2+
* 1.8.1
3+
* Lots of improvements and convenience methods for obstructions
4+
* 1.8.0
5+
* Reworked Devices: Now using a DeviceCollection with pandas support, devices do now lazyload as well
26
* 1.7.5
37
* Fixed bug in get_subslice method
48
* 1.7.4

examples/bndf/bndf_example_anim.py

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,16 @@ def main():
1010
sim = Simulation("./fds_data")
1111

1212
# Get first obstruction
13-
obst = sim.obstructions.get_nearest_obstruction((-0.8, 1, 1))
14-
obst = sim.obstructions[3]
13+
obst = sim.obstructions.get_nearest(-0.8, 1, 1)
1514

1615
# Get all patches with orientation=1 (equals positive x-dimension)
1716
orientation = 1
1817
quantity = "Wall Temperature"
19-
patches = list()
20-
for sub_obst in obst.filter_by_orientation(orientation):
21-
# Get boundary data for a specific quantity
22-
sub_obst_data = sub_obst.get_data(quantity)
23-
patches.append(sub_obst_data.data[orientation])
24-
25-
# Combine patches to a single face for plotting
26-
patches = sort_patches_cartesian(patches)
27-
28-
shape_dim1 = sum([patch_row[0].shape[0] for patch_row in patches])
29-
shape_dim2 = sum([patch.shape[1] for patch in patches[0]])
30-
n_t = patches[0][0].n_t # Number of timesteps
31-
32-
face = np.empty(shape=(n_t, shape_dim1, shape_dim2))
33-
dim1_pos = 0
34-
dim2_pos = 0
35-
for patch_row in patches:
36-
d1 = patch_row[0].shape[0]
37-
for patch in patch_row:
38-
d2 = patch.shape[1]
39-
face[:, dim1_pos:dim1_pos + d1,
40-
dim2_pos:dim2_pos + d2] = patch.data
41-
dim2_pos += d2
42-
dim1_pos += d1
43-
dim2_pos = 0
18+
face = obst.get_global_boundary_data_arrays(quantity)[orientation]
4419

4520
# Value range
4621
vmax = np.ceil(obst.vmax(quantity))
47-
# vmin = np.floor(obst.vmin(quantity))
48-
vmin = 40 - vmax
22+
vmin = np.floor(obst.vmin(quantity))
4923

5024
# Value ticks
5125
ticks = [vmin+i*(vmax-vmin)/10 for i in range(11)]

examples/geom/geom_slices.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import time
2-
3-
import pyvista as pv
41
from fdsreader import Simulation
5-
import numpy as np
62

73

84
def main():

examples/smoke3d/smoke3d_example.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
def main():
1111
sim = fds.Simulation("./fds_steckler/")
12-
sim = fds.Simulation("C:\\Users\\janv1\\Documents\\Unreal Projects\\TBRaymarchProject\\fds_data")
1312

1413
# Select the seconds mesh (index counting starts at 0)
1514
mesh = sim.meshes[0]

fdsreader/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77

88
from incremental import Version
99

10-
__version__ = Version("fdsreader", 1, 7, 5)
10+
__version__ = Version("fdsreader", 1, 8, 1)
1111
__all__ = ["__version__"]

fdsreader/bndf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from .obstruction import Obstruction, SubObstruction, Patch, Boundary
22

3-
from .ObstructionCollection import ObstructionCollection
3+
from .obstruction_collection import ObstructionCollection

0 commit comments

Comments
 (0)