neural_operators.plotting#
- neural_operators.plotting.field_plot.field_plot(ax, fn_nodal_values, nodes, elements=None, dim=2, plot_absolute=False, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed', dbg_log=False, **kwargs)[source]#
Triangulated pcolor of a nodal field’s magnitude. With is_displacement and add_displacement_to_nodes, warps the mesh by the field itself before plotting instead of coloring by it in place.
- neural_operators.plotting.field_plot.field_plot_grid(ax, fn_nodal_values, grid_x, grid_y, dim=2, plot_absolute=False, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed', dbg_log=False, **kwargs)[source]#
field_plot, but for a field on a regular grid instead of mesh nodes – still triangulates, doesn’t use the grid structure for a faster raster plot.
- neural_operators.plotting.field_plot.quick_field_plot(fn_nodal_values, nodes, title=None, cmap=None, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed', figsize=(6, 6), fs=20, savefilename=None, show_plot=True, elements=None, **kwargs)[source]#
- neural_operators.plotting.field_plot.quick_field_plot_grid(fn_nodal_values, grid_x, grid_y, title=None, cmap=None, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed', figsize=(6, 6), fs=20, savefilename=None, show_plot=True, **kwargs)[source]#
- neural_operators.plotting.field_plot.vector_values_at_nodes(nodal_values, num_nodes, vector_layout='mixed')[source]#
Reshape a flat vector field for plotting.
- vector_layout:
‘mixed’ – [dof0(n0), dof1(n0), …, dof0(n1), …] (FEniCSx P1 default) ‘block’ – [comp0 at all nodes, comp1 at all nodes, …]
- neural_operators.plotting.point_plot.point_plot(ax, nodal_values, nodes, cmap=None, plot_absolute=False, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed')[source]#
field_plot’s scatter counterpart: colors a point cloud by field magnitude instead of triangulating.
- neural_operators.plotting.point_plot.quick_point_plot(nodal_values, nodes, title=None, cmap=None, add_displacement_to_nodes=False, is_displacement=False, vector_layout='mixed', fs=20, figsize=(8, 8), axis_off=False, ax_lim=None)[source]#
- neural_operators.plotting.plot_mix_collection.get_default_plot_mix_collection_data(rows=1, cols=1, nodes=None, grid_x=None, grid_y=None, nodes_point_plot=None, figsize=(20, 20), fs=20, sup_title=None, y_sup_title=1.025, savefilename=None, fig_pad=1.08, cax_size='8%', cax_pad=0.03, u=None, cmap=None, title=None, row_titles=None, row_title_pad=0.08, plot_type=None, cbar_fmt=None, axis_off=None, is_vec=None, add_disp=None, vector_layout=None)[source]#
Builds the rows x cols per-panel data dict plot_mix_collection expects, filled with the defaults above.
- neural_operators.plotting.plot_mix_collection.plot_collection(uvec, rows, cols, nodes, title_vec=None, sup_title=None, cmapvec=None, fs=20, figsize=(20, 20), y_sup_title=1.025, savefilename=None, is_displacement=None, add_displacement_to_nodes=None, vector_layout=None, elements=None)[source]#
Grid of field_plot panels from a plain uvec[i][j] nested list, rather than plot_mix_collection’s data dict.
- neural_operators.plotting.plot_mix_collection.plot_collection_grid(uvec, rows, cols, grid_x, grid_y, title_vec=None, sup_title=None, cmapvec=None, fs=20, figsize=(20, 20), y_sup_title=1.025, savefilename=None, is_displacement=None, add_displacement_to_nodes=None, vector_layout=None)[source]#
plot_collection, on a regular grid instead of mesh nodes.
- neural_operators.plotting.plot_mix_collection.plot_mix_collection(data)[source]#
Grid of field/grid/point panels driven entirely by data, built with get_default_plot_mix_collection_data.
- neural_operators.plotting.plot_curve.plot_curve(data, x=None, xl=None, yl=None, fs=20, lw=2, lclr='tab:blue', l_lbl=None, title=None, savefile=None, figsize=None)[source]#
- neural_operators.plotting.plot_loss.plot_loss(train_loss, test_loss, xl=None, yl=None, fs=20, lw=2, train_clr='tab:blue', test_clr='tab:red', title=None, show_grid=True, savefile=None, figsize=None)[source]#
Train/test loss curves on a log-y axis, one figure.
- neural_operators.plotting.plot_svd.plot_s_vec_values(s_vec, r_vec, tag_vec, l_style_vec, xy_text_vec, plot_annot_xy, plot_annot_xy_region, savefilename=None)[source]#
Normalized singular-value decay curves with a zoomed inset, annotated at the PCA truncation rank r_vec[i] and near sigma = 0.1, 0.01.