jaxfluids.post_process package

Submodules

jaxfluids.post_process.post_process_utils module

jaxfluids.post_process.post_process_utils.create_contourplot(data_dictionary: Dict, cell_centers: List, times: ndarray, levelset: ndarray | None = None, nrows_ncols: Tuple | None = None, plane: str = 'xy', plane_value: float = 0.0, static_time: float | None = None, save_fig: str | None = None, save_anim: str | None = None, interval: int = 50, dpi: int = 100) None[source]

Creates a subplot of 2D pcolormesh plots and subsequently creates an animation. If the levelset argument is provided, the interface will be visualized as an isoline. If the static_time argument is provided, no animation is created, but a plot at this time will be shown.

Parameters:
  • data_dictionary (Dict) – Data buffers

  • cell_centers (List) – Cell center coordinates

  • times (np.ndarray) – Times

  • levelset (np.ndarray, optional) – Levelset buffer, defaults to None

  • nrows_ncols (Tuple, optional) – Shape of the subplot, defaults to None

  • plane (str, optional) – Plane to slice, defaults to “xy”

  • plane_value (float, optional) – Value of remaining axis to slice, defaults to 0.0

  • static_time (float, optional) – Static time to plot, defaults to None

  • save_fig (str, optional) – Path to save the static time figure, defaults to None

  • save_anim (str, optional) – Path to save the animation, defaults to None

  • interval (int, optional) – Interval in ms for the animation, defaults to 50

  • dpi (int, optional) – Resolution in dpi, defaults to 100

jaxfluids.post_process.post_process_utils.create_figure_2D(data: List, levelset: ndarray, nrows_ncols: Tuple, titles: List, X: ndarray, Y: ndarray, minmax: List, index: int = 0) Tuple[source]
jaxfluids.post_process.post_process_utils.create_lineplot(data_dictionary: List, cell_centers: List, times: ndarray, nrows_ncols: Tuple, axis: str = 'x', values: List = [0.0, 0.0], static_time: float | None = None, save_fig: str | None = None, save_anim: str | None = None, interval: int = 50, dpi: int = 100) None[source]

Creates a subplot of 1D line plots. If the levelset argument is provided, the interface will be visualized as an isoline. If the static_time argument is provided, no animation is created, but a plot at this time will be shown.

Parameters:
  • data_dictionary (List) – Data buffers

  • cell_centers (List) – Cell center coordinates

  • times (np.ndarray) – Time buffer

  • nrows_ncols (Tuple) – Shape of subplots

  • axis (str, optional) – Axis to slice, defaults to “x”

  • values (List, optional) – Values of remaining axis to slice, defaults to [0.0,0.0]

  • static_time (float, optional) – Static time, defaults to None

  • save_fig (str, optional) – Path to save static plot, defaults to None

  • save_anim (str, optional) – Path to save animation, defaults to None

  • interval (int, optional) – Interval in ms for animation, defaults to 50

  • dpi (int, optional) – Resolution in dpi, defaults to 100

jaxfluids.post_process.post_process_utils.create_xdmf_from_h5(path: str) None[source]

Creates .xdmf files from .h5 files for Paraview visualization.

Parameters:

path (str) – Path to .h5 files.

jaxfluids.post_process.post_process_utils.generate_png(X: ndarray, Y: ndarray, data_dictionary: Dict[str, ndarray], save_path: str, levelset: ndarray | None = None, nrows_ncols: Tuple | None = None, dpi=200) None[source]

Generates a subplot of pcolormesh and saves it as png. If the levelset argument is provided, the interface is plotted as an isoline.

Parameters:
  • X (np.ndarray) – X meshgrid

  • Y (np.ndarray) – Y meshgrid

  • data_dictionary (Dict[str, np.ndarray]) – Data buffer

  • save_path (str) – Save path

  • levelset (np.ndarray, optional) – Levelset buffer, defaults to None

  • nrows_ncols (Tuple, optional) – Shape of the subplot, defaults to None

  • dpi (int, optional) – Resolution in dpi, defaults to 200

jaxfluids.post_process.post_process_utils.get_xdmf(group: str, quant: str, h5file_name: str, Nx: int, Ny: int, Nz: int) str[source]
jaxfluids.post_process.post_process_utils.load_data(path: str, quantities: List, start: int = 0, end: int | None = None, N: int = 1) Tuple[List, List, List, Dict][source]

Loads .h5 result files generated by a jaxfluids simulation.

Parameters:
  • path (str) – Path to the folder containing the .h5 files for the time snapshots

  • quantities (List) – Quantities to load

  • start (int, optional) – Starting time snapshot to load, defaults to 0

  • end (int, optional) – Ending time snapshot to load, defaults to None

  • N (int, optional) – Interval of time snapshots to load, defaults to 1

Returns:

Cell centers coordinates, cell sizes, times and dictionary of buffers

Return type:

Tuple

jaxfluids.post_process.post_process_utils.update_1D(i: int, data: List, lines: List) List[source]

Update function for FuncAnimation for the create_lineplot() function.

Parameters:
  • i (int) – Time snapshot index

  • data (List) – Data buffers

  • lines (List) – Line objects

Returns:

List of collections

Return type:

List

jaxfluids.post_process.post_process_utils.update_2D(i: int, X: ndarray, Y: ndarray, data: List, levelset: ndarray, axes: ndarray, quadmesh_list: List, pciset_list: List) List[source]

Update function for FuncAnimation for the create_contourplot() function.

Parameters:
  • i (int) – Time snapshot index

  • X (np.ndarray) – X meshgrid

  • Y (np.ndarray) – Y Meshgrid

  • data (List) – Data buffers

  • levelset (np.ndarray) – Levelet buffer

  • axes (np.ndarray) – Axes

  • quadmesh_list (List) – Quadmesh objects returned by pcolormesh()

  • pciset_list (List) – Pciset objects return by contour()

Returns:

List of collections

Return type:

List

Module contents