FDSReader documentation!

Simulation

class fdsreader.simulation.Simulation(path: str)[source]

Master class managing all data for a given simulation.

Variables:
  • reader_version – The version of the fdsreader used to load the Simulation.

  • smv_file_path – Path to the .smv file of the simulation.

  • root_path – Path to the root directory of the simulation.

  • fds_version – Version of FDS the simulation was performed with.

  • chid – Name (ID) of the simulation.

  • hrrpuv_cutoff – The hrrpuv_cutoff value.

  • default_texture_origin – The default origin used for textures with no explicit origin.

  • out_file_path – Path to the .out file of the simulation.

  • surfaces – List containing all surfaces defined in this simulation.

  • meshes – List containing all meshes (grids) defined in this simulation.

  • ventilations – List containing all ventilations defined in this simulation.

  • obstructions – All defined obstructions combined into a ObstructionCollection.

  • slices – All defined slices combined into a SliceCollection.

  • data_3d – All defined 3D plotting data combined into a Plot3DCollection.

  • smoke_3d – All defined 3D smoke data combine into a Smoke3DCollecction

  • isosurfaces – All defined isosurfaces combined into a IsosurfaceCollection.

  • particles – All defined particles combined into a ParticleCollection.

  • evacs – All defined evacuations combined into a EvacCollection.

  • devices – List containing all Device s defined in this simulation.

  • profiles – Dictionary mapping profile ids to the corresponding Profile s defined in this simulation.

  • geoms – List containing all geometries (Geometry) defined in this simulation.

  • geom_data – All geometry data by quantity combined into a GeometryCollection.

  • cpu – Dictionary mapping .csv header keys to numpy arrays containing cpu data.

  • hrr – Dictionary mapping .csv header keys to numpy arrays containing hrr data.

  • steps – Dictionary mapping .csv header keys to numpy arrays containing steps data.

Parameters:

path – Either the path to the directory containing the simulation data or direct path to the .smv file for the simulation in case that multiple simulation output was written to the same directory.

clear_cache(clear_persistent_cache=False)[source]

Remove all data from the internal cache that has been loaded so far to free memory.

Parameters:

clear_persistent_cache – Whether to clear the persistent simulation cache as well.

parse_smv_file()[source]

Slice files

Collection of Slice objects. Offers additional functionality for filtering and using slices as well as its subclasses such as SubSlice.

Classes:

Slice(root_path, slice_id, cell_centered, ...)

Slice file data container including metadata. Consists of multiple subslices, one for each

SubSlice(parent_slc, filename, dimension, ...)

Part of a slice that cuts through a single mesh.

Functions:

implements(np_function)

Decorator to register an __array_function__ implementation for Slices.

class fdsreader.slcf.slice.Slice(root_path: str, slice_id: str, cell_centered: bool, times: ndarray, multimesh_data: Collection[Dict])[source]
Slice file data container including metadata. Consists of multiple subslices, one for each

mesh the slice cuts through. In case a slice cuts right through the border of two meshes, the generated data would be duplicated. For edge-centered slices a random of both generated slices will be discarded as the data is completely identical. For cell-centered slices the data of both slices will be saved as SubSlice s, therefore it might seem as if all slices would be duplicated, in reality however the slices might contain different data.

Variables:
  • cell_centered – Indicates whether centered positioning for data is used.

  • quantity – Quantity object containing information about the quantity calculated for this slice with the corresponding short_name and unit.

  • times – Numpy array containing all times for which data has been recorded.

  • n_t – Total number of time steps for which output data has been written.

  • orientation – Orientation [1,2,3] of the slice in case it is 2D, 0 otherwise.

  • extentExtent object containing 3-dimensional extent information.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_2d_slice_from_3d(slice_direction, value)

Creates a 2D-Slice from a 3D-Slice by slicing the Slice.

get_coordinates([ignore_cell_centered])

Returns a dictionary containing a numpy ndarray with coordinates for each dimension.

get_nearest_index(dimension, value)

Get the nearest mesh coordinate index in a specific dimension.

get_nearest_timestep(time)

Calculates the nearest timestep for which data has been output for this slice.

get_subslice(key)

Returns the SubSlice that cuts through the given mesh.

mean()

Calculates the mean over the whole slice.

sort_subslices_cartesian()

Returns all subslices sorted in cartesian coordinates.

std()

Calculates the standard deviation over the whole slice.

to_global([masked, fill, return_coordinates])

Creates a global numpy ndarray from all subslices (works for 2D- and 3D-slices).

Attributes:

extent_dirs

The directions in which there is an extent.

meshes

Returns a list of all meshes this slice cuts through.

subslices

Get a list with all SubSlices.

type

vmax

vmin

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property extent_dirs: Tuple[Literal['x', 'y', 'z'], Literal['x', 'y', 'z'], Literal['x', 'y', 'z']]

The directions in which there is an extent. All three dimensions in case the slice is 3D.

get_2d_slice_from_3d(slice_direction: Literal['x', 'y', 'z', 1, 2, 3], value: float)[source]

Creates a 2D-Slice from a 3D-Slice by slicing the Slice. :param slice_direction: The direction in which to cut through the slice. :param value: The position at which to start cutting through the slice.

get_coordinates(ignore_cell_centered: bool = False) Dict[Literal['x', 'y', 'z'], ndarray][source]

Returns a dictionary containing a numpy ndarray with coordinates for each dimension. For cell-centered slices, the coordinates can be adjusted to represent cell-centered coordinates.

Parameters:

ignore_cell_centered – Whether to shift the coordinates when the slice is cell_centered or not.

get_nearest_index(dimension: Literal['x', 'y', 'z'], value: float) int[source]

Get the nearest mesh coordinate index in a specific dimension.

get_nearest_timestep(time: float) int[source]

Calculates the nearest timestep for which data has been output for this slice.

get_subslice(key: int | str | Mesh) SubSlice[source]

Returns the SubSlice that cuts through the given mesh. When an int is provided the nth SubSlice will be returned.

mean()[source]

Calculates the mean over the whole slice.

Returns:

The calculated mean value.

property meshes: List[Mesh]

Returns a list of all meshes this slice cuts through.

sort_subslices_cartesian()[source]

Returns all subslices sorted in cartesian coordinates.

std()[source]

Calculates the standard deviation over the whole slice.

Returns:

The calculated standard deviation.

property subslices: List[SubSlice]

Get a list with all SubSlices.

to_global(masked: bool = False, fill: float = 0, return_coordinates: bool = False) ndarray | Tuple[ndarray, ndarray] | Tuple[ndarray, Dict[Literal['x', 'y', 'z'], ndarray]] | Tuple[Tuple[ndarray, ndarray], Tuple[Dict[Literal['x', 'y', 'z'], ndarray], Dict[Literal['x', 'y', 'z'], ndarray]]][source]

Creates a global numpy ndarray from all subslices (works for 2D- and 3D-slices). Note: This method might create a sparse np-array that consumes lots of memory. Attention: Two global slices are returned in cases where cell-centered slices cut right through one or more mesh borders. If there is a cell-centered slice that cuts right through the border of two meshes (mesh1 and mesh2), there will actually be two slices that could be equally relevant for the user. The one will cells on mesh1 and the one with cells on mesh2. As there are no cells in between (i.e. where the slice “should” be) and cell-centered slices output values at the centers of each cell, FDS simply outputs two slices, one on each side of the mesh borders. The fdsreader will not discard any data, both slices that are output by FDS are sent to the user for him to decide which one to use.

Parameters:
  • masked – Whether to apply the obstruction mask to the slice or not.

  • fill – The fill value to use for masked slice entries. Only used when masked=True.

  • return_coordinates – If true, return the matching coordinate for each value on the generated grid.

property type: Literal['2D', '3D']
property vmax
property vmin
class fdsreader.slcf.slice.SubSlice(parent_slc, filename: str, dimension: Dimension, extent: Extent, mesh: Mesh)[source]

Part of a slice that cuts through a single mesh.

Variables:
  • mesh – The mesh the subslice cuts through.

  • extentExtent object containing 3-dimensional extent information.

  • dimensionDimension object containing information about steps in each dimension.

Attributes:

cell_centered

Indicates whether centered positioning for data is used.

data

Method to lazy load the slice's data.

n_t

Get the number of timesteps for which data was output.

orientation

Orientation [1,2,3] of the slice in case it is 2D, 0 otherwise.

shape

2D-shape of the slice.

times

vector_data

Method to lazy load the slice's vector data if it exists.

vmax

vmin

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_coordinates([ignore_cell_centered])

Returns a dictionary containing a numpy ndarray with coordinates for each dimension.

property cell_centered: bool

Indicates whether centered positioning for data is used.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: ndarray

Method to lazy load the slice’s data.

get_coordinates(ignore_cell_centered: bool = False) Dict[Literal['x', 'y', 'z'], ndarray][source]

Returns a dictionary containing a numpy ndarray with coordinates for each dimension. For cell-centered slices, the coordinates can be adjusted to represent cell-centered coordinates.

Parameters:

ignore_cell_centered – Whether to shift the coordinates when the slice is cell_centered or not.

property n_t: int

Get the number of timesteps for which data was output.

property orientation: Literal[0, 1, 2, 3]

Orientation [1,2,3] of the slice in case it is 2D, 0 otherwise.

property shape: Tuple[int, int]

2D-shape of the slice.

property times
property vector_data: Dict[str, ndarray]

Method to lazy load the slice’s vector data if it exists.

property vmax
property vmin
fdsreader.slcf.slice.implements(np_function)[source]

Decorator to register an __array_function__ implementation for Slices.

Collection of GeomSlice objects. Offers extensive functionality for filtering and using geomslices as well as its subclasses such as SubSlice.

Classes:

GeomSlice(root_path, geomslice_id, times, ...)

Slice file data container including metadata. Consists of multiple subgeomslices, one for each

SubGeomSlice(parent_slice, filename, ...)

Part of a geomslice that cuts through a single mesh.

Functions:

implements(np_function)

Decorator to register an __array_function__ implementation for GeomSlices.

class fdsreader.slcf.geomslice.GeomSlice(root_path: str, geomslice_id: str, times: ndarray, multimesh_data: Collection[Dict])[source]
Slice file data container including metadata. Consists of multiple subgeomslices, one for each

mesh the geomslice cuts through.

Variables:
  • cell_centered – Indicates whether centered positioning for data is used.

  • quantity – Quantity object containing information about the quantity calculated for this geomslice with the corresponding short_name and unit.

  • times – Numpy array containing all times for which data has been recorded.

  • n_t – Total number of time steps for which output data has been written.

  • orientation – Orientation [1,2,3] of the geomslice in case it is 2D, 0 otherwise.

  • extentExtent object containing 3-dimensional extent information.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_nearest_timestep(time)

Calculates the nearest timestep for which data has been output for this geomslice.

get_subgeomslice(key)

Returns the SubGeomSlice that cuts through the given mesh.

mean()

Calculates the mean over the whole geomslice.

std()

Calculates the standard deviation over the whole geomslice.

Attributes:

data

faces

meshes

Returns a list of all meshes this geomslice cuts through.

subgeomslices

Get a list with all SubGeomSlices.

vertices

vmax

vmin

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data
property faces
get_nearest_timestep(time: float) int[source]

Calculates the nearest timestep for which data has been output for this geomslice.

get_subgeomslice(key: int | str | Mesh) SubGeomSlice[source]

Returns the SubGeomSlice that cuts through the given mesh. When an int is provided the nth SubGeomSlice will be returned.

mean()[source]

Calculates the mean over the whole geomslice.

Returns:

The calculated mean value.

property meshes: List[Mesh]

Returns a list of all meshes this geomslice cuts through.

std()[source]

Calculates the standard deviation over the whole geomslice.

Returns:

The calculated standard deviation.

property subgeomslices: List[SubGeomSlice]

Get a list with all SubGeomSlices.

property vertices
property vmax
property vmin
class fdsreader.slcf.geomslice.SubGeomSlice(parent_slice, filename: str, geom_filename: str, extent: Extent, mesh: Mesh)[source]

Part of a geomslice that cuts through a single mesh.

Variables:

mesh – The mesh the subgeomslice cuts through.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

Attributes:

data

Method to lazy load the geomslice's data.

faces

Method to lazy load the geomslice's data.

n_t

Get the number of timesteps for which data was output.

orientation

Orientation [1,2,3] of the geomslice in case it is 2D, 0 otherwise.

times

vertices

Method to lazy load the geomslice's data.

vmax

vmin

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: ndarray

Method to lazy load the geomslice’s data.

property faces: ndarray

Method to lazy load the geomslice’s data.

property n_t: int

Get the number of timesteps for which data was output.

property orientation: Literal[1, 2, 3]

Orientation [1,2,3] of the geomslice in case it is 2D, 0 otherwise.

property times
property vertices: ndarray

Method to lazy load the geomslice’s data.

property vmax
property vmin
fdsreader.slcf.geomslice.implements(np_function)[source]

Decorator to register an __array_function__ implementation for GeomSlices.

Boundary files

Collection of Obstruction objects. Offers extensive functionality for filtering and using obstructions as well as dependent such as Boundary.

Classes:

Boundary(quantity, cell_centered, times, ...)

Container for boundary data specific to one quantity.

Obstruction(oid, color_index, block_type, ...)

A box-shaped obstruction with specific surfaces (materials) on each side.

Patch(file_path, dimension, extent, ...)

Container for the actual data which is stored as rectangular plane with specific orientation

SubObstruction(side_surfaces, bound_indices, ...)

An Obstruction consists of 1 or more SubObstructions which can be hidden at specific points in time.

class fdsreader.bndf.obstruction.Boundary(quantity: Quantity, cell_centered: bool, times: Sequence[float], patches: List[Patch], lower_bounds: ndarray, upper_bounds: ndarray)[source]

Container for boundary data specific to one quantity.

Variables:
  • quantity – Quantity object containing information about the quantity calculated for this Obstruction with the corresponding short_name and unit.

  • times – Numpy array containing all times for which data has been recorded.

  • cell_centered – Indicates whether centered positioning for data is used.

  • lower_bounds – Dictionary with lower bounds for each timestep with meshes as keys.

  • upper_bounds – Dictionary with upper bounds for each timestep with meshes as keys.

  • n_t – Total number of time steps for which output data has been written.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_nearest_timestep(time)

Calculates the nearest timestep for which data has been output for this obstruction.

n_t([count_duplicates])

Get the number of timesteps for which data was output. :param count_duplicates: If true, return the total number of data points, even if there is duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

vmax([orientation])

Maximum value of all patches at any time.

vmin([orientation])

Minimum value of all patches at any time.

Attributes:

data

The Patch in each direction (-3=-z, -2=-y, -1=-x, 1=x, 2=y, 3=y).

orientations

Return all orientations for which there is data available.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: Dict[int, Patch]

The Patch in each direction (-3=-z, -2=-y, -1=-x, 1=x, 2=y, 3=y).

get_nearest_timestep(time: float) int[source]

Calculates the nearest timestep for which data has been output for this obstruction.

n_t(count_duplicates=True) int[source]

Get the number of timesteps for which data was output. :param count_duplicates: If true, return the total number of data points, even if there is

duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

property orientations

Return all orientations for which there is data available.

vmax(orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Maximum value of all patches at any time.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

vmin(orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Minimum value of all patches at any time.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

class fdsreader.bndf.obstruction.Obstruction(oid: str, color_index: int, block_type: int, texture_origin: Tuple[float, float, float], rgba: Tuple | Tuple[float, float, float, float] = ())[source]

A box-shaped obstruction with specific surfaces (materials) on each side.

Variables:
  • id – ID of the obstruction.

  • color_index – Type of coloring used to color obstruction. -1 - default color -2 - invisible -3 - use red, green, blue and alpha (rgba attribute) n>0 - use n’th color table entry

  • block_type – Defines how the obstruction is drawn. -1 - use surface to obtain blocktype 0 - regular block 2 - outline

  • texture_origin – Origin position of the texture provided by the surface. When the texture does have a pattern, for example windows or bricks, the texture_origin specifies where the pattern should begin.

  • rgba – Optional color of the obstruction in form of a 4-element tuple (ranging from 0.0 to 1.0).

Attributes:

bounding_box

Extent object representing the bounding box around the Obstruction.

has_boundary_data

Whether boundary data has been output in the simulation.

meshes

Returns a list of all meshes this slice cuts through.

orientations

Return all orientations for which there is data available.

quantities

Get a list of all quantities for which boundary data exists.

times

Return all timesteps for which boundary data is available, if any.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

filter_by_orientation([orientation])

Filter all SubObstructions by a specific orientation.

get_boundary_data(quantity[, orientation])

Gets the boundary data for a specific quantity of all SubObstructions.

get_coordinates([ignore_cell_centered])

Returns a dictionary containing a numpy ndarray with coordinates for each dimension.

get_global_boundary_data_arrays(quantity)

Creates a global numpy ndarray from all subobstruction's boundary data for each orientation.

get_nearest_index(dimension, orientation, value)

Get the nearest mesh coordinate index in a specific dimension for a specific orientation.

get_nearest_patch([x, y, z])

Gets the patch of the SubObstruction that has the least distance to the given point.

get_nearest_timestep(time[, visible_only])

Calculates the nearest timestep for which data has been output for this obstruction.

get_visible_times(times)

Returns an ndarray filtering all time steps when theSubObstruction is visible/not hidden.

n_t([count_duplicates])

Returns the number of timesteps for which boundary data is available. :param count_duplicates: If true, return the total number of data points, even if there is duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

vmax(quantity[, orientation])

Maximum value of all patches at any time for a specific quantity.

vmin(quantity[, orientation])

Minimum value of all patches at any time for a specific quantity.

property bounding_box: Extent

Extent object representing the bounding box around the Obstruction.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

filter_by_orientation(orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) List[SubObstruction][source]

Filter all SubObstructions by a specific orientation. All returned SubObstructions will contain boundary data in the specified orientation.

get_boundary_data(quantity: Quantity | str, orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) Dict[str, Boundary][source]

Gets the boundary data for a specific quantity of all SubObstructions.

Parameters:
  • quantity – The quantity to filter by.

  • orientation – Optionally filter by a specific orientation as well (-3=-z, -2=-y, -1=-x, 1=x, 2=y, 3=z). A value of 0 indicates to no filter.

get_coordinates(ignore_cell_centered: bool = False) Dict[int, Dict[Literal['x', 'y', 'z'], ndarray]][source]

Returns a dictionary containing a numpy ndarray with coordinates for each dimension. For cell-centered boundary data, the coordinates can be adjusted to represent cell-centered coordinates.

Parameters:

ignore_cell_centered – Whether to shift the coordinates when the bndf is cell_centered or not.

get_global_boundary_data_arrays(quantity: str | Quantity) Dict[int, ndarray | Tuple[ndarray, ndarray]][source]

Creates a global numpy ndarray from all subobstruction’s boundary data for each orientation.

Parameters:

quantity – The quantity’s name or short name for which to load the global arrays.

get_nearest_index(dimension: Literal['x', 'y', 'z'], orientation: int, value: float) int[source]

Get the nearest mesh coordinate index in a specific dimension for a specific orientation.

get_nearest_patch(x: float = None, y: float = None, z: float = None)[source]

Gets the patch of the SubObstruction that has the least distance to the given point. If there are multiple patches with the same distance, a random one will be selected.

get_nearest_timestep(time: float, visible_only: bool = False) int[source]

Calculates the nearest timestep for which data has been output for this obstruction.

get_visible_times(times: Sequence[float])[source]

Returns an ndarray filtering all time steps when theSubObstruction is visible/not hidden.

property has_boundary_data

Whether boundary data has been output in the simulation.

property meshes: List[Mesh]

Returns a list of all meshes this slice cuts through.

n_t(count_duplicates=True) int[source]

Returns the number of timesteps for which boundary data is available. :param count_duplicates: If true, return the total number of data points, even if there is

duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

property orientations

Return all orientations for which there is data available.

property quantities: List[Quantity]

Get a list of all quantities for which boundary data exists.

property times

Return all timesteps for which boundary data is available, if any.

vmax(quantity: str | Quantity, orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Maximum value of all patches at any time for a specific quantity.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

vmin(quantity: str | Quantity, orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Minimum value of all patches at any time for a specific quantity.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

class fdsreader.bndf.obstruction.Patch(file_path: str, dimension: Dimension, extent: Extent, orientation: int, cell_centered: bool, patch_offset: int, initial_offset: int, n_t: int, mesh: Mesh)[source]
Container for the actual data which is stored as rectangular plane with specific orientation

and extent.

Variables:
  • dimensionDimension object containing information about steps in each dimension.

  • extentExtent object containing 3-dimensional extent information.

  • orientation – The direction the patch is facing (x={-1;1}, y={-2;2}, z={-3;3}).

  • cell_centered – Indicates whether centered positioning for data is used.

  • _n_t – Total number of time steps for which output data has been written.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_coordinates([ignore_cell_centered])

Returns a dictionary containing a numpy ndarray with coordinates for each dimension.

n_t([count_duplicates])

Get the number of timesteps for which data was output. :param count_duplicates: If true, return the total number of data points, even if there is duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

Attributes:

data

Method to load the quantity data for a single patch.

shape

Convenience function to calculate the shape of the array containing data for this patch.

size

Convenience function to calculate the number of data points in the array for this patch.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data

Method to load the quantity data for a single patch.

get_coordinates(ignore_cell_centered: bool = False) Dict[Literal['x', 'y', 'z'], ndarray][source]

Returns a dictionary containing a numpy ndarray with coordinates for each dimension. For cell-centered boundary data, the coordinates can be adjusted to represent cell-centered coordinates.

Parameters:

ignore_cell_centered – Whether to shift the coordinates when the bndf is cell_centered or not.

n_t(count_duplicates=True) int[source]

Get the number of timesteps for which data was output. :param count_duplicates: If true, return the total number of data points, even if there is

duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

property shape: Tuple

Convenience function to calculate the shape of the array containing data for this patch.

property size: int

Convenience function to calculate the number of data points in the array for this patch.

class fdsreader.bndf.obstruction.SubObstruction(side_surfaces: Tuple, bound_indices: Tuple[int, int, int, int, int, int], extent: Extent, mesh: Mesh)[source]

An Obstruction consists of 1 or more SubObstructions which can be hidden at specific points in time.

Variables:
  • extentExtent object containing 3-dimensional extent information.

  • bound_indices – Indices used to define obstruction bounds in terms of mesh locations.

  • side_surfaces – Tuple of six Surface s for each side of the cuboid.

  • hide_times – List with points in time from when on the SubObstruction will be hidden.

  • show_times – List with points in time from when on the SubObstruction will be shown.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_coordinates([ignore_cell_centered])

Returns a dictionary containing a numpy ndarray with coordinates for each dimension.

get_data(quantity)

get_nearest_index(dimension, orientation, value)

Get the nearest mesh coordinate index in a specific dimension for a specific orientation.

get_visible_times(times)

Returns a ndarray filtering all time steps when the SubObstruction is visible/not hidden.

n_t([count_duplicates])

Returns the number of timesteps for which boundary data is available. :param count_duplicates: If true, return the total number of data points, even if there is duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

vmax(quantity[, orientation])

Maximum value of all patches at any time for a specific quantity.

vmin(quantity[, orientation])

Minimum value of all patches at any time for a specific quantity.

Attributes:

has_boundary_data

orientations

Return all orientations for which there is data available.

times

Return all timesteps for which boundary data is available, if any.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

get_coordinates(ignore_cell_centered: bool = False) Dict[int, Dict[Literal['x', 'y', 'z'], ndarray]][source]

Returns a dictionary containing a numpy ndarray with coordinates for each dimension. For cell-centered boundary data, the coordinates can be adjusted to represent cell-centered coordinates.

Parameters:

ignore_cell_centered – Whether to shift the coordinates when the bndf is cell_centered or not.

get_data(quantity: str | Quantity)[source]
get_nearest_index(dimension: Literal['x', 'y', 'z'], orientation: int, value: float) int[source]

Get the nearest mesh coordinate index in a specific dimension for a specific orientation.

get_visible_times(times: Sequence[float]) ndarray[source]

Returns a ndarray filtering all time steps when the SubObstruction is visible/not hidden.

property has_boundary_data
n_t(count_duplicates=True) int[source]

Returns the number of timesteps for which boundary data is available. :param count_duplicates: If true, return the total number of data points, even if there is

duplicate data for a timestep. Duplicate data might be output when restarting the simulation in between the simulation run.

property orientations

Return all orientations for which there is data available.

property times

Return all timesteps for which boundary data is available, if any.

vmax(quantity: str | Quantity, orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Maximum value of all patches at any time for a specific quantity.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

vmin(quantity: str | Quantity, orientation: Literal[-3, -2, -1, 0, 1, 2, 3] = 0) float[source]

Minimum value of all patches at any time for a specific quantity.

Parameters:

orientation – Optionally filter by patches with a specific orientation.

Functions:

sort_patches_cartesian(patches_in)

Returns all patches (of same orientation!) sorted in cartesian coordinates.

fdsreader.bndf.utils.sort_patches_cartesian(patches_in: List[Patch])[source]

Returns all patches (of same orientation!) sorted in cartesian coordinates.

Complex Geometry

Classes:

GeomBoundary(quantity, times, n_t)

Boundary data of a specific quantity for all geoms in the simulation.

Geometry(file_path, texture_mapping, ...[, ...])

Obstruction defined as a complex geometry.

class fdsreader.geom.geometry.GeomBoundary(quantity: Quantity, times: ndarray, n_t: int)[source]

Boundary data of a specific quantity for all geoms in the simulation.

Variables:
  • quantity – Quantity object containing information about the quantity calculated for geoms.

  • times – Numpy array containing all times for which data has been recorded.

  • n_t – Total number of time steps for which output data has been written.

  • lower_bounds – Dictionary with lower bounds for each timestep per mesh.

  • upper_bounds – Dictionary with upper bounds for each timestep per mesh.

Attributes:

data

Returns a global array of the loaded data for the quantity with data from all meshes.

faces

Returns a global array of the faces from all meshes.

vertices

Returns a global array of the vertices from all meshes.

vmax

Maximum value of all faces at any time.

vmin

Minimum value of all faces at any time.

property data: ndarray

Returns a global array of the loaded data for the quantity with data from all meshes.

property faces: ndarray

Returns a global array of the faces from all meshes.

property vertices: Iterable

Returns a global array of the vertices from all meshes.

property vmax: float

Maximum value of all faces at any time.

property vmin: float

Minimum value of all faces at any time.

class fdsreader.geom.geometry.Geometry(file_path: str, texture_mapping: str, texture_origin: Tuple[float, float, float], is_terrain: bool, rgb: Tuple[int, int, int], surface: Surface = None)[source]

Obstruction defined as a complex geometry.

Variables:
  • file_path – Path to the .ge file that defines the geom.

  • texture_map – Path to the texture map of the geometry.

  • texture_origin – Origin position of the texture provided by the surface.

  • is_terrain – Indicates whether the geometry is a regular complex geom or terrain geometry.

  • rgb – Color of the geometry in form of a 3-element tuple.

  • surface – Surface object used for the geometry.

Collection of GeomBoundary objects. Offers extensive functionality for filtering and using geometry data.

Isosurface files

Collection of Isosurface objects. Offers extensive functionality for filtering and using isosurfaces as well as its subclasses such as SubSurface.

Classes:

Isosurface(isosurface_id, double_quantity, ...)

Isosurface file data container including metadata. Consists of a list of vertices forming a

SubSurface(mesh, iso_filepath, times[, ...])

Part of an isosurface with data for a specific mesh.

class fdsreader.isof.isosurface.Isosurface(isosurface_id: int, double_quantity: bool, quantity: str, short_name: str, unit: str, levels: List[float], v_quantity: str = '', v_short_name: str = '', v_unit: str = '')[source]
Isosurface file data container including metadata. Consists of a list of vertices forming a

list of triangles. Can optionally have additional color data for the surfaces.

Variables:
  • id – The ID of this isosurface.

  • quantity – Quantity object containing information about the quantity calculated for this isosurface with the corresponding short_name and unit.

  • v_quantity – Information about the color quantity.

  • levels – All isosurface levels.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

export(file_path, mesh)

Export the isosurface for a single timestep into one of many formats.

get_nearest_timestep(time)

Calculates the nearest timestep for which data has been output for this isosurface.

get_pyvista_mesh(vertices, triangles)

Creates a PyVista mesh from the data.

join_pyvista_meshes(meshes)

Combines multiple PyVista meshes.

to_global(time)

Creates an array containing all global vertices and a list containing numpy arrays with

Attributes:

has_color_data

Defines whether there is color data for this isosurface or not.

surfaces

Gets all surfaces per mesh.

times

List containing all times for which data has been recorded.

triangles

Gets all triangles per mesh.

vertices

Gets all vertices per mesh.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

export(file_path: str, mesh)[source]

Export the isosurface for a single timestep into one of many formats.

Parameters:
  • file_path – Absolute path to the the file which should we written. The file ending denotes the file format to export to (supports pretty much every common format).

  • time – Either the index of the timestep or an actual time value. In the latter case data for the nearest matching timestep will be used.

get_nearest_timestep(time: float) int[source]

Calculates the nearest timestep for which data has been output for this isosurface.

get_pyvista_mesh(vertices: ndarray, triangles: ndarray)[source]

Creates a PyVista mesh from the data.

property has_color_data: bool

Defines whether there is color data for this isosurface or not.

join_pyvista_meshes(meshes: List)[source]

Combines multiple PyVista meshes.

Returns:

The combined mesh of class PolyData.

property surfaces: Dict[str, List[ndarray]]

Gets all surfaces per mesh.

property times: List[float]

List containing all times for which data has been recorded.

to_global(time: int | float) Tuple[ndarray, List[ndarray], ndarray | None][source]
Creates an array containing all global vertices and a list containing numpy arrays with

triangles for each surface level.

Parameters:

time – Either the index of the timestep or an actual time value. In the latter case data for the nearest matching timestep will be used.

property triangles: Dict[str, List[ndarray]]

Gets all triangles per mesh.

property vertices: Dict[str, List[ndarray]]

Gets all vertices per mesh.

class fdsreader.isof.isosurface.SubSurface(mesh: Mesh, iso_filepath: str, times: List, viso_filepath: str = '')[source]

Part of an isosurface with data for a specific mesh.

Variables:
  • mesh – The mesh containing all data for this SubSurface.

  • file_path – Path to the binary data file.

  • v_file_path – Path to the binary data file containing color data.

  • n_vertices – The number of vertices for this subsurface.

  • n_triangles – The number of triangles for this subsurface.

  • n_t – Total number of time steps for which output data has been written.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

Attributes:

colors

Property to lazy load the color data that might be associated with the isosurfaces.

has_color_data

Defines whether there is color data for this subsurface or not.

surfaces

Property to lazy load a list that maps triangles to an isosurface for a specific level.

triangles

Property to lazy load all triangles of any level.

vertices

Property to lazy load all vertices for all triangles of any level.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property colors

Property to lazy load the color data that might be associated with the isosurfaces.

property has_color_data

Defines whether there is color data for this subsurface or not.

property surfaces

Property to lazy load a list that maps triangles to an isosurface for a specific level. The list has the size n_triangles, while the indices correspond to indices of the triangles.

property triangles

Property to lazy load all triangles of any level.

property vertices

Property to lazy load all vertices for all triangles of any level.

Plot3D files

Collection of Plot3D objects. Offers extensive functionality for filtering and using plot3Ds as well as its subclasses such as SubPlot3D.

Classes:

Plot3D(root_path)

Plot3d file data container including metadata. Consists of multiple subplots, one for each

SubPlot3D(mesh, quantity_idx)

Subplot of a pl3d output for a single mesh.

Functions:

implements(np_function)

Decorator to register an __array_function__ implementation for Plot3Ds.

class fdsreader.pl3d.pl3d.Plot3D(root_path: str)[source]
Plot3d file data container including metadata. Consists of multiple subplots, one for each

mesh.

Variables:
  • times – All times for which data has been recorded.

  • quantities – List with quantity objects containing information about recorded quantities calculated for this Plot3D with the corresponding short_name and unit.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

mean()

Calculates the mean value of the whole Plot3D.

std()

Calculates the standard deviation for each quantity individually of the whole Plot3D.

to_global([masked, fill, return_coordinates])

Creates a global numpy ndarray from all subplots.

Attributes:

n_t

Get the number of timesteps for which data was output.

subplots

Returns a list with one SubPlot3D object per mesh.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

mean() float[source]

Calculates the mean value of the whole Plot3D.

Returns:

The calculated mean value.

property n_t: int

Get the number of timesteps for which data was output.

std() float[source]

Calculates the standard deviation for each quantity individually of the whole Plot3D.

Returns:

The calculated standard deviation.

property subplots

Returns a list with one SubPlot3D object per mesh.

to_global(masked: bool = False, fill: float = 0, return_coordinates: bool = False) ndarray | Tuple[ndarray, Dict[Literal['x', 'y', 'z'], ndarray]][source]

Creates a global numpy ndarray from all subplots.

Parameters:
  • masked – Whether to apply the obstruction mask to the data or not.

  • fill – The fill value to use for masked entries. Only used when masked=True.

  • return_coordinates – If true, return the matching coordinate for each value on the generated grid.

class fdsreader.pl3d.pl3d.SubPlot3D(mesh: Mesh, quantity_idx: int)[source]

Subplot of a pl3d output for a single mesh.

Variables:

mesh – The mesh containing the data.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

Attributes:

data

Method to lazy load the 3D data for each quantity of a single mesh.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: ndarray

Method to lazy load the 3D data for each quantity of a single mesh.

Returns:

4D numpy array with (t,x,y,z) as dimensions.

fdsreader.pl3d.pl3d.implements(np_function)[source]

Decorator to register an __array_function__ implementation for Plot3Ds.

Smoke3D files

Collection of Smoke3D objects. Offers extensive functionality for filtering and using Smoke3Ds as well as its subclasses such as SubSmoke3D.

Classes:

Smoke3D(root_path, times, quantity)

Smoke3D file data container including metadata. Consists of multiple subsmokes, one for each

SubSmoke3D(file_path, mesh, upper_bounds, times)

Part of a smoke3d output for a single mesh.

Functions:

implements(np_function)

Decorator to register an __array_function__ implementation for Smoke3Ds.

class fdsreader.smoke3d.smoke3d.Smoke3D(root_path: str, times: ndarray, quantity: Quantity)[source]
Smoke3D file data container including metadata. Consists of multiple subsmokes, one for each

mesh.

Variables:
  • times – Numpy ndarray containing all time steps for which data has been written out.

  • quantityQuantity object containing information about the recorded quantity and its unit.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

get_subsmoke(mesh)

Returns the SubSmoke that contains data for the given mesh.

mean()

Calculates the mean value of all Smoke3D data for this quantity.

std()

Calculates the standard deviation of all Smoke3D data for this quantity.

to_global([masked, fill, return_coordinates])

Creates a global numpy ndarray from all subsmokes.

Attributes:

n_t

Get the number of timesteps for which data was output.

subsmokes

Returns a list with one SubSmoke3D object per mesh.

vmax

Maximum value of all data at any time.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

get_subsmoke(mesh: Mesh)[source]

Returns the SubSmoke that contains data for the given mesh.

mean() ndarray[source]

Calculates the mean value of all Smoke3D data for this quantity.

property n_t: int

Get the number of timesteps for which data was output.

std() ndarray[source]

Calculates the standard deviation of all Smoke3D data for this quantity.

property subsmokes

Returns a list with one SubSmoke3D object per mesh.

to_global(masked: bool = False, fill: float = 0, return_coordinates: bool = False) ndarray | Tuple[ndarray, Dict[Literal['x', 'y', 'z'], ndarray]][source]

Creates a global numpy ndarray from all subsmokes.

Parameters:
  • masked – Whether to apply the obstruction mask to the data or not.

  • fill – The fill value to use for masked entries. Only used when masked=True.

  • return_coordinates – If true, return the matching coordinate for each value on the generated grid.

property vmax

Maximum value of all data at any time.

class fdsreader.smoke3d.smoke3d.SubSmoke3D(file_path: str, mesh: Mesh, upper_bounds: ndarray, times: ndarray)[source]

Part of a smoke3d output for a single mesh.

Variables:
  • mesh – The mesh containing the data.

  • upper_bounds – Numpy ndarray containing the maxmimum data value for each timestep.

  • times – Numpy ndarray containing all time steps for which data has been written out.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

Attributes:

data

Method to lazy load the Smoke3D data of a single mesh.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: ndarray

Method to lazy load the Smoke3D data of a single mesh.

fdsreader.smoke3d.smoke3d.implements(np_function)[source]

Decorator to register an __array_function__ implementation for Smoke3Ds.

Particles

Collection of Particle objects.

Classes:

Particle(class_name, quantities, color)

Container to store particle data from particle simulations with FDS.

class fdsreader.part.particle.Particle(class_name: str, quantities: List[Quantity], color: Tuple[float, float, float])[source]

Container to store particle data from particle simulations with FDS.

Variables:
  • class_name – Name of the particle class defined in the FDS input-file.

  • quantities – List of all quantities for which data has been written out.

  • color – Color assigned to the particle.

  • n_particles – Number of existing particles for each timestep per mesh.

  • lower_bounds – Dictionary with lower bounds for each timestep with quantities as keys.

  • upper_bounds – Dictionary with upper bounds for each timestep with quantities as keys.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

filter_by_tag(tag)

Filter all particles by a single one with the specified tag.

Attributes:

data

Dictionary with quantities as keys and a list with a numpy array for each timestep which contains data for each particle in that timestep.

id

positions

List with a numpy array for each timestep which contains the position of each particle in that timestep.

tags

List with a numpy array for each timestep which contains a tag for each particle in that timestep.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: Dict[str, List[ndarray]]

Dictionary with quantities as keys and a list with a numpy array for each timestep which contains data for each particle in that timestep.

filter_by_tag(tag: int)[source]

Filter all particles by a single one with the specified tag.

property id
property positions: List[ndarray]

List with a numpy array for each timestep which contains the position of each particle in that timestep.

property tags: List[ndarray]

List with a numpy array for each timestep which contains a tag for each particle in that timestep.

Devices

class fdsreader.devc.Device(device_id: str, quantity: Quantity, position: Tuple[float, float, float], orientation: Tuple[float, float, float])[source]

Represents a single Device.

Variables:
  • id – The id the device was given.

  • quantity – The Quantity the device measured.

  • position – Position of the device in the simulation space.

  • orientation – The direction the device was facing.

  • data – All data the device measured.

clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data
property quantity_name

Alias for Device.quantity.name.

property unit

Alias for Device.quantity.unit.

property xyz

Alias for Device.position.

Evacuation

Collection of Evacuation objects. Next to agent-class specific data (such as trajectories) lots of other data such as FED-data is provided via this class.

ivar times:

List of all time steps of the simulation.

ivar z_offsets:

The offset in z-direction for each mesh where the evac plane lays.

ivar all_agents:

Number of all agents per time step.

ivar agents_inside_mesh:

Number of all agents per time step inside a specific mesh.

ivar number_of_deads:

Number of dead agents per time step.

ivar fed_max:

FED max per time step.

ivar fed_max_alive:

FED max alive per time step.

ivar exit_counters:

Exit counts per time step.

ivar target_exit_counters:

Target exit counts per time step.

ivar door_counters:

Door counts per time step.

ivar target_door_counters:

Target door counts per time step.

Classes:

Evacuation(class_name, quantities, color)

Container to store evac data from evac simulations with FDS.

class fdsreader.evac.evacuation.Evacuation(class_name: str, quantities: List[Quantity], color: Tuple[float, float, float])[source]

Container to store evac data from evac simulations with FDS.

Variables:
  • class_name – Name of the evac class defined in the FDS input-file.

  • quantities – List of all quantities for which data has been written out.

  • color – Color assigned to the evac.

  • n_humans – Number of existing evacs for each timestep per mesh.

  • lower_bounds – Dictionary with lower bounds for each timestep with quantities as keys.

  • upper_bounds – Dictionary with upper bounds for each timestep with quantities as keys.

Attributes:

agent_heights

body_angles

data

Dictionary with quantities as keys and a list with a numpy array for each timestep which contains data for each person in that timestep.

id

positions

List with a numpy array for each timestep which contains the position of each evac in that timestep.

semi_major_axis

semi_minor_axis

tags

List with a numpy array for each timestep which contains a tag for each evac in that timestep.

Methods:

clear_cache()

Remove all data from the internal cache that has been loaded so far to free memory.

filter_by_tag(tag)

Filter all evacs by a single one with the specified tag.

get_data(quantity)

Returns a list with a numpy array for each timestep which contains data about the specified quantity for each person in that timestep.

has_quantity(quantity)

property agent_heights: List[ndarray]
property body_angles: List[ndarray]
clear_cache()[source]

Remove all data from the internal cache that has been loaded so far to free memory.

property data: Dict[str, List[ndarray]]

Dictionary with quantities as keys and a list with a numpy array for each timestep which contains data for each person in that timestep.

filter_by_tag(tag: int)[source]

Filter all evacs by a single one with the specified tag.

get_data(quantity: Quantity | str) List[ndarray][source]

Returns a list with a numpy array for each timestep which contains data about the specified quantity for each person in that timestep.

has_quantity(quantity: Quantity | str)[source]
property id
property positions: List[ndarray]

List with a numpy array for each timestep which contains the position of each evac in that timestep.

property semi_major_axis: List[ndarray]
property semi_minor_axis: List[ndarray]
property tags: List[ndarray]

List with a numpy array for each timestep which contains a tag for each evac in that timestep.

Quantity

class fdsreader.utils.data.Quantity(quantity: str, short_name: str, unit: str)[source]

Object containing information about a quantity with the corresponding short_name and unit.

Variables:
  • short_name – The short short_name representing the quantity.

  • quantity – The name of the quantity.

  • unit – The corresponding unit of the quantity.

property label
property quantity

FDS classes

class fdsreader.fds_classes.mesh.Mesh(coordinates: Dict[Literal['x', 'y', 'z'], ndarray], extents: Dict[Literal['x', 'y', 'z'], Tuple[float, float]], mesh_id: str)[source]

3-dimensional Mesh of fixed, defined size.

Variables:
  • coordinates – Coordinate values for each of the 3 dimension.

  • dimensionsDimension describing the size of the 3 dimensions regarding indices.

  • extentExtent object containing 3-dimensional extent information.

  • n – Number of elements for each of the 3 dimensions.

  • n_size – Total number of blocks in this mesh.

  • id – Mesh id/short_name assigned to this mesh.

Parameters:
  • coordinates – Coordinate values of the three axes.

  • extents – Extent of the mesh in each dimension.

  • mesh_id – ID of this mesh.

coordinate_to_index(coordinate: Tuple[float, ...], dimension: Tuple[Literal[1, 2, 3, 'x', 'y', 'z'], ...] = ('x', 'y', 'z'), cell_centered=False) Tuple[int, ...][source]

Finds the nearest point in the mesh’s grid and returns its indices.

Parameters:
  • coordinate – Tuple of 3 floats. If the dimension parameter is supplied, up to 2 dimensions can be left out from the tuple.

  • dimension – The dimensions in which to return the indices (1=x, 2=y, 3=z).

  • cell_centered – Instead of finding the nearest point on the mesh, find the center of the nearest cell.

get_boundary_data(quantity: str | Quantity)[source]
get_nearest_coordinate(coordinate: Tuple[float, ...], dimension: Tuple[Literal[1, 2, 3, 'x', 'y', 'z'], ...] = ('x', 'y', 'z'), cell_centered=False) Tuple[float, ...][source]

Finds the nearest point in the mesh’s grid.

Parameters:
  • coordinate – Tuple of 3 floats. If the dimension parameter is supplied, up to 2 dimensions can be left out from the tuple.

  • dimension – The dimensions in which to return the indices (1=x, 2=y, 3=z).

  • cell_centered – Instead of finding the nearest point on the mesh, find the center of the nearest cell.

get_obstruction_mask(times: Sequence[float], cell_centered=False) ndarray[source]

Marks all cells which are blocked by an obstruction.

Parameters:

times – All timesteps of the simulation.

Returns:

A 4-dimensional array with time as first and x,y,z as last dimensions. The array depends on time as obstructions may be hidden as specific points in time.

get_obstruction_mask_slice(subslice)[source]

Marks all cells of a single subslice which are blocked by an obstruction.

Returns:

A 4-dimensional array with time as first and x,y,z as last dimensions. The array depends on time as obstructions may be hidden at specific points in time.

class fdsreader.fds_classes.surface.Surface(name: str, tmpm: float, material_emissivity: float, surface_type: int, texture_width: float, texture_height: float, texture_map: str | None, rgb: Tuple[float, float, float], transparency: float)[source]
Surface objects describe what bounding surfaces consist of. Boundary conditions for obstructions and vents are

prescribed by referencing the appropriate surface.

Variables:
  • name – Name of the surface.

  • material_emissivity – Emissivity of the material.

  • surface_type – Type of the surface.

:ivar texture_width:Width of the texture of the surface. :ivar texture_height: Height of the texture of the surface. :ivar texture_map: Path to the texture map used for the surface. :ivar rgb: Color of the surface in form of a 3-element tuple. :ivar transparency: Transparency of the color (alpha channel).

id()[source]
class fdsreader.fds_classes.ventilation.SubVentilation(mesh: Mesh, extent: Extent)[source]

Part of a Ventilation.

Variables:
  • extentExtent object containing 3-dimensional extent information.

  • mesh – The mesh that contains this part of the ventilation.

class fdsreader.fds_classes.ventilation.Ventilation(surface: Surface, bound_indices: Tuple[int, int, int, int, int, int], color_index: int, draw_type: int, rgba: Tuple | Tuple[float, float, float, float] = (), texture_origin: Tuple | Tuple[float, float, float] = (), circular_vent_origin: Tuple | Tuple[float, float, float] = (), radius: float = -1)[source]
A ventilation can be used to model components of the ventilation system in a building, like a

diffuser or a return. A ventilation can also be used as a means of applying a particular boundary condition to a rectangular patch on a solid surface.

Variables:
  • id – ID of the ventilation.

  • extentExtent object containing 3-dimensional extent information.

  • surface – Surface object used for the ventilation.

  • bound_indices – Indices used to define ventilation bounds in terms of mesh locations.

  • color_index – Type of coloring used to color ventilation. -99 or +99 - use default color -n or +n - use n’th palette color < 0 - do not draw boundary file over vent > 0 - draw boundary file over vent

  • draw_type – Defines how the ventilation is drawn. 0 - solid surface 2 - outline -2 - hidden

  • open_time – Point in time the ventilation should open.

  • close_time – Point in time the ventilation should close.

  • rgba – Color of the ventilation in form of a 4-element tuple (ranging from 0.0 to 1.0).

  • texture_origin – Origin position of the texture provided by the surface. When the texture does have a pattern, for example windows or bricks, the texture_origin specifies where the pattern should begin.

  • circular_vent_origin – Origin of the ventilation relative to bounding box.

  • radius – Radius of the ventilation circle.

Utilities

class fdsreader.utils.extent.Extent(*args, skip_dimension: Literal['x', 1, 'y', 2, 'z', 3, ''] = '')[source]

Three-dimensional value-based extent with support for a missing dimension (2D).

as_list(reduced=True) List[float][source]

Gives the extent in list notation (without empty extents).

Parameters:

reduced – Whether to leave out empty extents or not.

as_tuple(reduced=True) Tuple[float, ...][source]

Gives the extent in tuple notation (without empty extents).

Parameters:

reduced – Whether to leave out empty extents or not.

property x_end: float

Gives the absolute extent in x-direction.

property x_start: float

Gives the absolute extent in x-direction.

property y_end: float

Gives the absolute extent in y-direction.

property y_start: float

Gives the absolute extent in y-direction.

property z_end: float

Gives the absolute extent in z-direction.

property z_start: float

Gives the absolute extent in z-direction.

class fdsreader.utils.dimension.Dimension(*args, skip_dimension: Literal['x', 1, 'y', 2, 'z', 3, ''] = '')[source]

Three-dimensional index-based extent with support for a missing dimension (2D).

Variables:
  • x – Number of data points in x-direction (end is exclusive).

  • y – Number of data points in y-direction (end is exclusive).

  • z – Number of data points in z-direction (end is exclusive).

as_list(cell_centered=False, reduced=True) List[source]

Gives the dimension in list notation (without empty extents).

Parameters:

reduced – Whether to leave out empty dimensions (size of 1) or not.

as_tuple(cell_centered=False, reduced=True) Tuple[source]

Gives the dimensions in tuple notation (optionally without empty dimensions).

Parameters:

reduced – Whether to leave out empty dimensions (size of 1) or not.

shape(cell_centered=False) Tuple[source]

Method to get the actual number of data points per dimension.

size(cell_centered=False)[source]

Export

fdsreader.export.sim_exporter.export_sim(sim: Simulation, output_dir: str, ordering: Literal['C', 'F'] = 'C')[source]
Exports the 3d arrays to raw binary files with corresponding .yaml meta files.

Warning: This method does not work for large simulations as some internal multiprocess buffers overflow after a few GB of data. Please export the simulation manually using the functions used in this method in separate python instances.

Parameters:
  • sim – The Simulation to export.

  • output_dir – The directory in which to save all files.

  • ordering – Whether to write the data in C or Fortran ordering.

fdsreader.export.slcf_exporter.export_slcf_raw(slc: Slice, output_dir: str, ordering: Literal['C', 'F'] = 'C')[source]

Exports the 3d arrays to raw binary files with corresponding .yaml meta files.

Parameters:
  • slc – The Slice object to export.

  • output_dir – The directory in which to save all files.

  • ordering – Whether to write the data in C or Fortran ordering.

fdsreader.export.obst_exporter.export_obst_raw(obst: Obstruction, output_dir: str, ordering: Literal['C', 'F'] = 'C')[source]

Exports the 3d arrays to raw binary files with corresponding .yaml meta files.

Parameters:
  • obst – The Obstruction object to export including its Boundary data.

  • output_dir – The directory in which to save all files.

  • ordering – Whether to write the data in C or Fortran ordering.

fdsreader.export.smoke3d_exporter.export_smoke_raw(smoke3d: Smoke3D, output_dir: str, ordering: Literal['C', 'F'] = 'C')[source]

Exports the 3d arrays to raw binary files with corresponding .yaml meta files.

Parameters:
  • smoke3d – The Smoke3D object to export.

  • output_dir – The directory in which to save all files.

  • ordering – Whether to write the data in C or Fortran ordering.