meshConversion module
Warning
The following description is partially AI generated, it might be incomplete or incorrect.
- meshConversion.classify_surfaces(h5_file_path)[source]
Classifies and identifies the surfaces (top, bottom, internal, and external) of a mesh structure based on node information from an HDF5 file.
- Args:
h5_file_path (str): The file path to the HDF5 file containing mesh data.
- Functionality:
Reads the mesh data from the HDF5 file, including node coordinates and element information.
Groups mesh elements by ID.
Identifies the top and bottom surfaces based on the z-coordinate of the nodes.
Calculates the radius of each remaining surface and classifies them as internal or external.
Saves the surface classification in a JSON file.
- Returns:
None
- meshConversion.estimate_radius_by_sections(points, num_sections=50)[source]
Extracts and returns the node coordinates of the current face of the mesh element.
- Args:
key (int): The identifier key for the group of mesh elements. grouped_elements (dict): Dictionary where keys are element IDs and values are arrays of grouped mesh elements. nodes (ndarray): Array containing the coordinates of the mesh nodes.
- Returns:
- ndarray: The node coordinates corresponding to the extracted face,
after removing duplicates and shifting positions by 1.
- meshConversion.extract_current_face_nodes(key, grouped_elements, nodes)[source]
Extracts and returns the node coordinates of the current face of the mesh element.
- Args:
key (int): The identifier key for the group of mesh elements. grouped_elements (dict): Dictionary where keys are element IDs and values are arrays of grouped mesh elements. nodes (ndarray): Array containing the coordinates of the mesh nodes.
- Returns:
- ndarray: The node coordinates corresponding to the extracted face,
after removing duplicates and shifting positions by 1.
- meshConversion.main(argv)[source]
Main function to process a mesh file and export its properties.
- Args:
- argv (list): List of command-line arguments.
If no arguments are provided, a file dialog is opened to select the mesh file.
If one argument is provided, it is treated as the path to the mesh file.
If two arguments are provided, the first is the path to the mesh file, and the second is the export path.
- Functionality:
Reads a mesh file in either UTF-8 or ISO-8859-1 encoding.
Calls helper functions to find mesh delimiters and write mesh information to a specified export path.
If no file path is provided via the command-line arguments, a file selection dialog is opened.
- Raises:
SystemExit: Exits the program if more than two arguments are provided.