Source: GitHub
Signature¶
def sdynpy.fem.sdynpy_visualization_reduction.build_visualization_graph_from_fe_data(node_ids, node_coords, elem_conn, elem_block_ids, retained_node_ids=None, k_candidates=12, k_extra=2, block_penalty=0.5, max_length_factor=3.0, use_node_adjacency=False)Build a sparse visualization graph for retained FE nodes.
Parameters¶
node_ids : (n,) array-like All node IDs.
node_coords : (n,3) array-like Coordinates for all nodes.
elem_conn : sequence length m Each element is an iterable of node IDs.
elem_block_ids : (m,) array-like Block ID per element.
retained_node_ids : array-like, optional Subset of node IDs to include. If None, all nodes are retained.
k_candidates : int Number of Euclidean nearest neighbors to consider.
k_extra : int Number of extra local edges per node beyond the MST.
block_penalty : float Penalty applied when nodes share no block membership.
max_length_factor : float Local edges longer than this times median nearest-neighbor distance are pruned. MST edges are always kept.
use_node_adjacency : bool If True, require candidate edges to be between nodes that are adjacent in the coarse element-derived node adjacency graph.
Returns¶
retained_ids : (nr,) ndarray Retained node IDs, in returned local ordering.
retained_coords : (nr,3) ndarray Retained node coordinates.
edges : list of tuple(int, int) Undirected edges in retained-node local indexing.
edge_lengths : ndarray Euclidean edge lengths.
retained_block_sets : list of sets Block-membership sets for retained nodes.