noether.data.datasets.cfd.caeml.preprocessing

Converts raw DrivAerML or AhmedML dataset into subsampled pytorch files

Attributes

Classes

Functions

parse_args()

assert_same_length(*arrays)

Checks that all arrays have the same length.

time_block(run_folder, label)

A context manager to measure execution time of a code block.

merge_vtu_parts(folder)

Merge .part VTU fragments into a full .vtu file in the specified folder.

process_run(run_folder, root, output_dir, ...)

main(dataset, root, output_dir, subsample_factor, ...)

Module Contents

class noether.data.datasets.cfd.caeml.preprocessing.DataFieldKeyMap
stl_prefix: str
vtp_pressure: str
vtp_wallshearstress: str
vtu_pressure: str
vtu_velocity: str
vtu_totalp: str
vtu_vorticity: str | None
noether.data.datasets.cfd.caeml.preprocessing.dataset_keymaps
noether.data.datasets.cfd.caeml.preprocessing.parse_args()
noether.data.datasets.cfd.caeml.preprocessing.assert_same_length(*arrays)

Checks that all arrays have the same length.

Parameters:

*arrays (numpy.ndarray | torch.Tensor) – any number of arrays.

Return type:

None

noether.data.datasets.cfd.caeml.preprocessing.time_block(run_folder, label)

A context manager to measure execution time of a code block.

Parameters:
  • run_folder – The name of the run folder. Will be printed.

  • label (str) – The name of the process/algorithm/code executed within the with block. Will be printed.

Usage:
with time_block(“some task”):

# code

noether.data.datasets.cfd.caeml.preprocessing.merge_vtu_parts(folder)

Merge .part VTU fragments into a full .vtu file in the specified folder.

This function is required for DrivAerML on Huggingface, where the volume data is split into two .part files. See files in https://huggingface.co/datasets/neashton/drivaerml/tree/main/run_1.

Parameters:

folder (str | Path) – Path to the run_i directory containing .part files.

Raises:

NotADirectoryError – If the provided folder path is not a directory.

noether.data.datasets.cfd.caeml.preprocessing.process_run(run_folder, root, output_dir, data_field_keymap, subsample_factor, compute_surface_distance_via_trimesh)
Parameters:
Return type:

None

noether.data.datasets.cfd.caeml.preprocessing.main(dataset, root, output_dir, subsample_factor, compute_surface_distance_via_trimesh, num_workers)
Parameters:
  • dataset (str)

  • root (str)

  • output_dir (str)

  • subsample_factor (int)

  • compute_surface_distance_via_trimesh (bool)

  • num_workers (int)

Return type:

None