UM2N.processor package

Submodules

UM2N.processor.processor module

class MeshProcessor(original_mesh, optimal_mesh, function_space, use_4_edge=True, poly_mesh=False, num_boundary=4, nu=None, feature={'grad_uh': None, 'uh': None}, raw_feature={'hessian_norm': None, 'uh': None}, dist_params={'n_dist': None, 'use_iso': None, 'w': None, 'z': None, 'μ_x': None, 'μ_y': None, 'σ_x': None, 'σ_y': None}, gauss_list=None, swirl_params=None, dur=None, t=None, idx=None)[source]

Bases: object

MeshProcessor class for pre-processing mesh data, attaching features to

nodes,

and converting them to training data.

Parameters: - original_mesh: The initial mesh. - optimal_mesh: The optimal mesh after adaptation. - function_space: The function space over which the mesh is defined. - use_4_edge: Whether to use four edges for finding boundaries. - feature: Dictionary containing features like ‘uh’, ‘grad_uh’ etc. - raw_feature: Dictionary containing raw features like ‘uh’, ‘hessian_norm

etc.

  • dist_params: Dictionary containing distribution parameters.

Attributes: - dist_params: Distribution parameters. - mesh: The original mesh. - optimal_mesh: The optimal mesh. - function_space: The function space. - feature: The attached features. - raw_feature: The raw features. - coordinates: The coordinates of the original mesh. - optimal_coordinates: The coordinates of the optimal mesh. - cell_node_list: The list of nodes for each cell. - num_nodes: The number of nodes in each cell.

attach_feature()[source]
Attach features to nodes of the mesh. The features to be attached are

specified

in the ‘feature’ attribute.

find_bd()[source]
Identify the boundary nodes of the mesh and update various boundary

masks.

find_edges()[source]

Find the edges of the mesh and update the ‘edges’ attribute.

get_conv_feat(fix_reso_x=20, fix_reso_y=20)[source]

Generate features for convolution. This involves grid spacing and other related features.

get_conv_feat_poly()[source]
save_taining_data(path)[source]

Save the processed data into disk for future use.

Parameters: - path: The directory where to save the data.

to_train_data()[source]

Convert mesh and associated features to PyTorch Geometric Data format. This can be used directly for machine learning training.

Module contents