function contour_qp_flux_component (i_p) Pts_wide=2; % Copyright 2000, J.E. Akin. All rights reserved. % plot element Gauss point flux i_p magnitude as a surface % convert any type of mesh to a structured square mesh % x,y == nodal coordinates of the FEA % f == nodal solution of the FEA % X,Y == nodal coordinates of the structured square mesh % F == interpolated solution for the structured square mesh % NX == number of nodes in x-direction for structured mesh % NY == number of nodes in y-direction for structured mesh if ( nargin == 0 ) i_p = 0 ; end % if no arguments load el_qp_xyz_fluxes.tmp; % x,y followed by flux list np = size (el_qp_xyz_fluxes, 1) ; % count points nf = size (el_qp_xyz_fluxes, 2) - 2; % count components if ( np == 0 ) error ('Error missing file el_qp_xyz_fluxes.tmp') end % if error if ( nf <= 0 ) error ('Error, no fluxes in file el_qp_xyz_fluxes.tmp') end % if error % NX, NY = 31 are default values, these can be altered by user NX = 41; NY = 41; x = el_qp_xyz_fluxes (:, 1); y = el_qp_xyz_fluxes (:, 2); if ( i_p > 0 ) f = el_qp_xyz_fluxes (:, (i_p + 2)) ; else for j = 1:np f(j) = sqrt ( sum(el_qp_xyz_fluxes (j, 3:(nf+2)).^2) ) ; end % for np points end % which component xlin = linspace (min(x), max(x), NX); ylin = linspace (min(y), max(y), NY); [X, Y] = meshgrid (xlin, ylin); F = griddata (x, y, f, X, Y, 'cubic'); clf c = contour (X,Y,F,'LineWidth',Pts_wide); clabel (c); hold on grid xlabel (['X: ', int2str(np),' Nodes']) ylabel ('Y'); if ( i_p > 0 ) title (['Matlab Smoothed FEA QP Flux Component\_', int2str(i_p), ... ': at ', int2str(np), ' Gauss Points']); else title (['Matlab Smoothed FEA QP Flux RMS Value at ', ... int2str(np), ' Gauss Points']) end % which component % -depsc -tiff % for an eps version %bprint ('-dpsc', ['contour_qp_flux_component_', int2str(i_p)]) hold off %bv_text = ['Created contour_qp_flux_component_', int2str(i_p), '.ps']; %bfprintf (1,'%s', v_text) ; fprintf (1, ' \n' ) % end of contour_qp_flux_component