magnet.generate.generate_dataset_heterogeneous#

magnet.generate.generate_dataset_heterogeneous(n_cubes: dict[slice(<class 'int'>, <class 'int'>, None)], output_path: str, dataset_name: str, extension: str = 'vtk', base_name: str = 'mesh', seed: int | None = None) None#

Generate dataset of 3D heterogeneous meshes.

Generates dataset of 3D tetrahedral meshes of the unit cube divided into sections with alternating physical group (0 or 1). The meshes are saved together with a .npz file containing adjacency, centroid, volume and physical group data of the meshes. A text file containing a summary of the dataset is also saved.

Parameters:
  • n_cubes (dict of [int : int]) – dictionary with keys the number of parts of the cube and values equal to the number of meshes to be generated with that number of parts.

  • output_path (str) – folder path where the dataset will be saved.

  • dataset_name (str) – name of the folder containing the dataset

  • extension (str, optional) – Meshe file format extension (default is ‘vtk’).

  • base_name (str, optional) – Root name of the mesh files (default is ‘mesh’).

Return type:

None

See also

load_dataset

load mesh dataset.

generate_Heterogeneous_cube

heterogeneous mesh of the unit cube.