[File: mech517/public_html/Matlab_Plots/MODEL_PLOTS_HELP.txt] [See: mech517/public_html/Matlab_Plots/MODEL_1_D_PLOTS_HELP.txt] Revised 1/18/00, 8/6/00, 1/10/01, 7/11/04, 2/5/05 FE Mesh and Post-Processing Plots (the command to produce *.ps files are now commented out) J.E. Akin, Copyright 2005. All rights reserved. The MODEL finite element program creates several sets of optional output data. This directory contains several Matlab scripts that have been developed to give students the ability to present those data in a graphical fashion. Some Unix aliases have been set up to reduce typing. Activate them by entering source ~mech517/public_html/Aliases Then you could enter "Subjects" for locating plot scripts by subject, or enter "Matlab5" to start old release 5. To use MODEL plot scripts from your local work directory you must enter Matlab and issue a command to identify the path to the scripts by entering the following command in Matlab: addpath /net/course-a/mech517/public_html/Matlab_Plots A number of ASCII files from the MODEL code, or related programs like mesh generators, are used as inputs for numerous plot options. The plotting programs use some or all of the following data files: mesh point bc_flag and coordinates : msh_bc_xyz.tmp mesh element type & connectivity data : msh_typ_nodes.tmp original boundary condition values : msh_bc_values.tmp element deleted flag (0=no, 1=yes) : msh_deleted.tmp element on boundary flag (0=no, 1=yes): on_boundary_input.tmp computed results (for each component) : node_results.tmp post_processed element flux components: el_qp_xyz_fluxes.tmp fluxes from an exact solution : exact_node_flux.tmp an exact solution at mesh nodes : exact_node_solution.tmp Super_Convergent Patch nodal fluxes : scp_node_ave_fluxes.tmp SCP element error estimates (% energy): el_error_est.tmp SCP error estimates averaged at nodes : pt_ave_error_est.tmp They all would be created by the latest MODEL output files. Note that these data are overwritten during each run so important results should be renamed to save them for future reuse. Some of the programs use the actual FE mesh and associated results as input and thus produce the most correct displays. Two node line elements (L2) are allowed as are the T3, T6, T10, T15 triangles and Q4, Q8, Q9, Q12, Q16, Q17, and Q25 quadrilaterals. Edges are drawn as piecewise linear segments. All the Matlab programs beginning with "contour" and "smooth" use a fixed rectangular grid on which the FEA data are approximated by a bi-cubic surface. Therefore, they may introduce smoothing errors and should be used for general checking purposes only. ------------------------------------------------------------------- Mesh or Element Type Displays ------------------------------------------------------------------- element_type_mesh_plot.m: element_type_mesh_plot (Type, inc_e, inc_p) displays the elements of type Type (0 defaults to all) in the mesh and displaces element and node numbers with increments of inc_e, and inc_p, respectively (or none if 0). The required files are msh_bc_xyz.tmp and msh_typ_nodes.tmp. The script works for 1D and 2D meshes. Output is element_type_mesh_plot.ps. element_type_mesh_shrink.m: element_type_mesh_shrink (Type, inc_e, inc_p) is the same as element_type_mesh_plot except the elements are plotted as an exploded view. Output is element_type_mesh_shrink.ps. mesh_plot.m: mesh_plot () displays the actual mesh with ten (rotated) element numbers and 20 node numbers displayed. The required files are msh_bc_xyz.tmp and msh_typ_nodes.tmp. The script works for 1D and 2D meshes. Output is mesh_plot.ps. Optional arguments (inc_e, inc_p) give increments in element and node point number displays. mesh_shrink_plot.m: mesh_shrink_plot () displays the actual mesh with a gap between each element so all its edges are visible. It also shows 10 (rotated) element numbers and 20 node numbers displayed. The required files are msh_bc_xyz.tmp and msh_typ_nodes.tmp. The script works for 1D and 2D meshes. Output is mesh_shrink_plot.ps. mesh_w_node_steps.m: mesh_w_node_steps (start, stop, inc) with a path highlited from node "start" to node "stop" in increments of "inc". It requires files msh_bc_xyz.tmp and msh_typ_nodes.tmp. Output is mesh_steps.ps. It is a companion script to node_graph_result.m. mesh_3d_plot.m: mesh_3d_plot (inc_e, inc_p) is the 3D extension of mesh_plot.m. Output is mesh_3d_plot.ps. mesh_3d_shrink.m: mesh_3d_shrink (inc_e, inc_p) is the 3D extension of mesh_shrink_plot.m, output is mesh_3d_shrink.ps. deleted_mesh_plot.m: deleted_mesh_plot () displays the actual mesh with 10 (rotated) element numbers and 20 node numbers displayed. The required files are msh_bc_xyz.tmp and msh_typ_nodes.tmp and the logical (0 or 1) deleted flag for each element in file msh_deleted.tmp. Output is deleted_mesh_plot.ps el_on_boundary_plot.m: el_on_boundary_plot () is like mesh_plot except it plots only elements that are flagged to be on the boundary. The output is el_on_boundary_plot.ps. ------------------------------------------------------------------- Essential Boundary Conditions or Multipoint Constraints (MPC) ------------------------------------------------------------------- bc_flags_plot.m: bc_flags_plot () displays the actual mesh with node numbers and integer boundary condition flags displayed on the mesh wherever the flags are non_zero. It requires files msh_bc_xyz.tmp and msh_typ_nodes.tmp. Output is bc_flags_plot.ps Any digit > 1 denotes a MPC associated with that nodal component. bc_values_input.m: bc_values_input (i_p) displays the actual mesh with assigned essential boundary condition values from msh_bc_values.tmp which is usually converted from a mesh generator output file named msh_bc_values.dat. Output is bc_values_input.ps. bc_values_plot.m: bc_values_plot (i_p) displays the actual mesh with node numbers and assigned essential boundary condition values where the i_p component of the soultion has a non-zero integer boundary condition flag. The value of i_p defaults to unity if omitted. It requires files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and computed node_results.tmp. Since an exact solution can be used to override input EBC values the node_results can differ from msh_bc_values used above in bc_values_input.m. Output is bc_values_plot.ps ------------------------------------------------------------------- Nodal Results Color Displays ------------------------------------------------------------------- color_result.m: color_result (i_p) fills the 2D mesh with a continuously colored value of the i_p component of the solution nodal results. A color scale bar is included. If i_p = 0 the RMS value is shown. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and node_results.tmp. The output file is color_result_#_plot.ps. color_result_rank.m: color_result_rank (i_p) fills each 2D element with one of eight constant colors ranging from the lowest to highest result values. The output file is color_result_#_rank.ps. color_result_step.m: color_result_step (i_p) fills each 2D element with a constant color that represents the average value of the i_p component within the element. Output is color_result_#_step.ps. color_result_surface.m: color_result_surface (i_p) is a "carpet" plot of 2D results colored like color_result.m. The output file is color_result_#_surface.ps. color_result_surface_rank.m: color_result_surface_rank (i_p) is a "carpet" plot of 2D results colored like color_result_rank.m. Output is color_result_#_surface_rank.ps. color_result_surface_step.m: color_result_surface_step (i_p) is a "carpet" plot of 2D results colored like color_result_step.m. Output is color_result_#_surface_step.ps. ------------------------------------------------------------------- Nodal Results Line Displays ------------------------------------------------------------------- deformed_mesh_plot.m: For 2-D stress analysis results deformed_mesh_plot (d_scale, inc_m, inc_e, inc_p) will plot the deformed mesh obtained by adding the displacement components multiplied by the value of d_scale. If inc_m = 1 the original un-deformed mesh is also displayed, else it is omitted. Output is deformed_mesh_plot.ps. node_graph_result.m: node_graph_result (i_p, start, stop, inc) shows the results for component i_p along the path of nodes defined by "start, stop, inc" as a 3D curve above the full mesh. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and node_results.tmp. Output is node_result_#_graph.ps. If i_p = 0 the RMS value is used. result_graph.m: result_graph (i_p) displays a line graph of the magnitude of the i_p-th component at all nodes in the 1D mesh. If i_p = 0, or no argument is used then the RMS value is plotted. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and node_results.tmp. Output is result_graph.ps and it contains an 'x' and 'n' to denote the maximum and minimum value locations. Node and element numbers are also shown along the bottom axis. result_node_range_graph.m: result_node_range_graph (i_p, start, stop, inc, mesh) is the same as node_graph_result.m except mesh = 0, or omitted turns off the mesh. Output is result_#_node_range_graph.ps. result_3d_graph.m: result_3d_graph (i_p, mesh) is similar in concept to result_surface_plot.m but is intended for line elements located in 2D space, such as trusses and frames. It displays a line graph of the magnitude of the i_p-th component "above" all nodes in the line element mesh. If mesh = 1, the line elements are also shown (in green) in the z_min plane. If i_p = 0, or is omitted then the RMS value is plotted. Required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and node_results.tmp. Output: result_3d_graph.ps. Node numbers are also shown at "value points" to clarify their source. Views from the X- and Y-axes also help see the nodal values more clearly. It is NOT useful for a mesh containing a large number of elements. result_surface_plot.m: result_surface_plot (i_p) displays a carpet, or surface, plot of the magnitude of the i_p-th component at all nodes in the mesh. If i_p = 0, or no argument is used then the RMS value is plotted. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and node_results.tmp. The output file is result_surface_plot.ps and it contains an 'x' and 'n' to denote the maximum and minimum value locations. Often the view orientation needs to be changed. Then issue the Matlab command view (az, el) or view ([x, y, z]) to set the [x, y, z] eye point. result_shrink_surface.m: result_shrink_surface (i_p) is like the above result_surface_plot except that the elements are shrunk with gaps between them to make them more clear. Symbols show the true node locations. Output is result_shrink_surface.ps ------------------------------------------------------------------- 2D Flux Vectors: Computed, Averaged, or Exact ------------------------------------------------------------------- Computed at quadrature points (qp): el_qp_flux_vectors.m: quiver_el_qp_flux.m: el_qp_gradient_vectors.m: quiver_qp_flux_mesh.m: quiver_qp_grad_mesh.m: quiver_el_qp_grad.m: quiver_el_qp_vel.m: quiver_torsion_qp_mesh.m: At mesh nodes: quiver_given_nodal_vectors.m: quiver_disp_vec_mesh.m: quiver_torsion_pt_mesh.m: quiver_Brz_vector.m Averaged (ave) with Super_convergent_patch (scp): ave_node_flux_1d_graph.m: quiver_scp_ave_pt_flux.m: scp_ave_pt_flux_vectors.m: Known exact (ex) flux values (when avilable): exact_and_fe_node_flux_vec.m: exact_node_flux_vectors.m: quiver_exact_node_flux.m: ------------------------------------------------------------------- General Flux Components: Computed, Averaged, or Exact ------------------------------------------------------------------- Computed at quadrature points (qp): color_flux_step.m: contour_qp_flux_component.m: contour_qp_flux_on_mesh.m: el_qp_flux_1d_graph.m: Averaged (ave) with Super_convergent_patch (scp): ave_node_flux_component.m: ave_node_flux_shrink.m: contour_n_ave_flux.m: Known exact (ex) flux values (when avilable): exact_flux_component.m: contour_n_exact_flux.m: exact_and_fe_node_flux_vec.m: ------------------------------------------------------------------- Error Estimates From Super_Convergent_Patch (SCP) ------------------------------------------------------------------- color_scp_el_err_est.m: color_scp_el_err_est () fills each 2D element with a constant color that represents the average value of its SCP error estimate in the energy norm. A color scale bar is included. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and el_error_est.tmp. The output file is color_scp_el_err_est.ps. color_scp_err_est_surf.m: color_scp_err_est_surf () is a "carpet" plot where each element is filled a continuously colored value of the nodal averages of the element SCP error estimate in the energy norm. A color scale bar is included. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and pt_ave_error_est.tmp. The output file is color_scp_err_est_surf.ps contour_pt_ave_err_est_w_mesh.m: contour_pt_ave_err_est_w_mesh () shows contours of the nodal averages of the element SCP error estimate superimposed on the 2D mesh. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and pt_ave_error_est.tmp. The output file is contour_pt_ave_err_est_w_mesh.ps. contour_pt_ave_error_est.m: A 2D error contour without the mesh of contour_pt_ave_err_est_w_mesh.m. Output contour_pt_ave_error_est.ps. el_error_color_plot.m: el_error_color_plot () plots the 2D mesh filled with a constant color that represents the average value of its SCP error estimate. (Use color_scp_el_err_est instead.) Output is el_error_color_plot.ps. el_error_rank_plot.m: el_error_rank_plot () plots the 1D or 2D mesh mesh with the integer error rank from 1 (low) to 20 (high) at the element centroid. Output is el_error_rank_plot.ps. el_error_value_plot.m: el_error_value_plot () plots the 1D or 2D mesh with the numerical value of the SCP error estimate printed at the element centroid. Output is el_error_value_plot.ps. elem_error_est_1d_graph.m: elem_error_est_1d_graph () gives a "stair step" plot of the constant element SCP error estimate. Also shown are the node and element numbers. Output elem_error_est_graph.ps. pt_ave_error_est_1d_graph.m: pt_ave_error_est_1d_graph () gives a line graph of the nodal averages of the element SCP error estimate. Also shown are the node and element numbers. The output file is ave_error_est_graph.ps. smooth_pt_ave_error_est.m: ------------------------------------------------------------------- Exact Nodal Results Displays (when available) ------------------------------------------------------------------- Sometimes the user can provide routines with the exact solution. Plots similar to those above, but using exact answers at the nodes (but thus non-exact inside an element) are: contour_exact.m contour_exact_on_mesh.m exact_1d_graph.m exact_1d_graph (i_p) plots a line graph of the exact value of nodal component i_p. The exact points are joined by straight lines, which are usually approximate. Also shown are the node and element numbers. Output is exact_#_graph.ps. exact_3d_graph.m exact_and_fe_1d_graph.m exact_and_fe_1d_graph (i_p) plots a pair of line graphs through the exact (solid lines) and FEA (dashed) nodal values of the i_p component. The nodal values are joined by straight lines, which are usually approximate. Also shown are the node and element numbers. Output is ex_fe_#_graph.ps. exact_solution.m (surface plot) exact_shrink_solution.m smooth_exact_solution.m ------------------------------------------------------------------- Exact Error Result Displays (when available) ------------------------------------------------------------------- Some scripts plot both the finite element node result and exact nodal solution and/our the nodal error values: contour_exact_err_on_mesh.m contour_exact_error.m exact_and_fe_1d_graph.m exact_error_1d_graph.m exact_solution_error.m exact_solution_error_shrink.m smooth_exact_error_component.m ------------------------------------------------------------------- Exact Flux Displays (when available) ------------------------------------------------------------------- 2D Vectors: exact_and_fe_node_flux_vec.m exact_node_flux_vectors.m quiver_exact_node_flux.m General components: exact_flux_component.m ------------------------------------------------------------------- Optional Post-Processing Displays ------------------------------------------------------------------- All of these files use files msh_bc_xyz.tmp and msh_typ_nodes.tmp as well as others noted. deleted_mesh_plot.m: deleted_mesh_plot () displays the mesh again but with deleted elements omitted and a point at the centroid of the remaining elements. The logical (0 or 1) deleted flag for each element in file msh_deleted.tmp is used. Output is deleted_mesh_plot.ps el_qp_flux_vectors.m: el_qp_flux_vectors () displays the mesh along with scaled flux vectors shown at the element quadrature point locations. File el_qp_xyz_fluxes.tmp is needed and must have only two flux components, or it aborts. Different component counts see contour_qp_flux_component or smooth_qp_flux.component. Output is el_qp_xyz_flux_vectors.ps. The optional agrument, length, in el_qp_flux_vectors (length) allows user control over arrow plots. el_qp_grad_vectors.m: el_qp_grad_vectors () displays the mesh along with scaled gradient vectors shown at the element quadrature point locations. File el_qp_xyz_grads.tmp is needed. It must have only two gradient components, or it aborts. Output is el_qp_xyz_grad_vectors.ps. The optional agrument, length, in el_qp_grad_vectors (length) allows user control over arrow plots. ave_node_flux_1d_graph.m: ave_node_flux_1d_graph (i_p) displays a 1-D graph of the magnitude of the i_p-th component of the flux at all nodes in the 1-D mesh. If i_p = 0, or no argument is used then the RMS value is plotted. Required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and scp_node_ave_fluxes.tmp. Output is file ave_node_flux_1d_graph.ps ave_node_flux_component.m: ave_node_flux_component (i_p) displays a carpet, or surface, plot of the magnitude of the i_p-th component of the flux at all nodes in the mesh. If i_p = 0, or no argument is used then the RMS value is plotted. Required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and scp_node_ave_fluxes.tmp. Output is ave_node_flux_surface.ps ave_node_flux_shrink.m: ave_node_flux_shrink (i_p) is the same as ave_node_flux_component.m above except each element is seen in an exploded view. ave_node_grad_component.m: ave_node_grad_component (i_p) displays a carpet, or surface, plot of the magnitude of the i_p-th component of the grad at all nodes in the mesh. If i_p = 0, or no argument is used then the RMS value is plotted. The required files are msh_bc_xyz.tmp, msh_typ_nodes.tmp, and scp_node_ave_grads.tmp. Output is ave_node_grad_surface.ps el_error_color_plot.m: el_error_color_plot () displays the mesh with the element percent error estimate as colors filling the element (using a set 14 colors). The elements with the maximum and minimum errors have those values printed at their centroid locations. It requires the element values in el_error_est.tmp. Output is el_error_color_plot.ps el_error_rank_plot.m: el_error_rank_plot (inc_e) displays the relative integer rank of the element error from low (1) to high (20) error. The element increment between displays is inc_e which defaults to unity. Output is el_error_rank_plot.ps. el_error_value_plot.m: el_error_value_plot() displays the mesh with an element percent error estimate printed at the element centroid (as a number rotated by 40 deg). It requires the element values in el_error_est.tmp. Output is el_error_value_plot.ps ------------------------------------------------------------------- Optional Nodal Vector Averages ------------------------------------------------------------------- All of these files use files msh_bc_xyz.tmp and msh_typ_nodes.tmp as well as others noted. scp_ave_pt_flux_vectors.m: scp_ave_pt_flux_vectors () displays the mesh with the averaged flux vector at each mesh node. Input file scp_node_ave_flux.tmp with point averages is used. Output is scp_ave_pt_flux_vectors.ps. The optional agrument, length, in scp_ave_pt_flux_vectors (length) allows control over arrow plots. scp_ave_pt_grad_vectors.m: scp_ave_pt_grad_vectors () displays the mesh with the averaged gradient vector at each mesh node. File scp_node_ave_grad.tmp with point averages is used. Output is scp_ave_grad_vectors.ps ------------------------------------------------------------------- Optional Exact Nodal Vector Averages ------------------------------------------------------------------- Sometimes the user can provide subroutines with the exact flux solution. Plots similar to those above, but using the exact flux answers at the nodes are: exact_node_flux_vectors.m exact_and_fe_node_flux_vec.m (nice visual for crude grids) exact_flux_component.m (surface plot of component value) ------------------------------------------------------------------- Others Displays ------------------------------------------------------------------- All the Matlab programs beginning with "contour" and "smooth" use a fixed rectangular grid on which the FEA data at the nodes and/or Gauss points are fit by a bi-cubic surface. Therefore, they may introduce smoothing errors and should be used for general checking purposes. Remember that on boundaries with zero normal flux the contours should be perpendicular to the boundary, but smoothing may violate this condition. (The default smoothing grid is 31x31 units but you could copy the following files and edit those values.) All of these files use files msh_bc_xyz.tmp and msh_typ_nodes.tmp as well as others noted. Contours (Matlab smoothed) contour_result.m or contour_result_on_mesh.m File node_results.tmp is required. contour_exact.m or contour_exact_on_mesh.m contour_qp_flux_component.m or contour_qp_flux_on_mesh.m File el_qp_xyz_fluxes.tmp is required. contour_exact_error.m or contour_exact_err_on_mesh.m File contour_pt_ave_error_est.m or contour_pt_ave_err_est_w_mesh.m File pt_ave_error_est.tmp is required. Smoothed surfaces smooth_result.m or smooth_result_w_bar.m File node_results.tmp is required. smooth_qp_flux.component.m File el_qp_xyz_fluxes.tmp is required. smooth_exact_solution.m smooth_exact_error_component.m smooth_pt_ave_error_est.m or smooth_pt_ave_err_est_w_bar.m File pt_ave_error_est.tmp is required. -------------------------------------------------------------------