function smooth_qp_source_component (i_p) % Copyright 2000 J.E. Akin. All rights reserved. % plot finite element nodal flux magnitude as a surface % convert any type of mesh to a structured square mesh % plot of i_p-th component. If i_p = 0, show RMS % 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_sources.tmp; % x,y followed by flux list np = size (el_qp_xyz_sources, 1) ; % count points nf = size (el_qp_xyz_sources, 2) - 2; % count components if ( np == 0 ) error ('Error missing file el_qp_xyz_sources.tmp') end % if error if ( nf <= 0 ) error ('Error, no fluxes in file el_qp_xyz_sources.tmp') end % if error % NX, NY = 31 are default values, these can be altered by user NX = 61; NY = 61; x = el_qp_xyz_sources (:, 1); y = el_qp_xyz_sources (:, 2); % disp (x) ; disp (y) if ( i_p > 0 ) f = el_qp_xyz_sources (:, (i_p + 2)) ; else for j = 1:np f(j) = sqrt ( sum(el_qp_xyz_sources (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 meshc (X, Y, F) hold on xlabel ('X'); ylabel ('Y'); if ( i_p > 0 ) title (['Matlab Smoothed FEA QP Source Component\_', ... int2str(i_p), ': at ',int2str(np),' Gauss Points']) zlabel (['FEA Source Component ', int2str(i_p)]); else title (['Matlab Smoothed FEA RMS QP Source Value: at ', ... int2str(np),' Gauss Points']) zlabel ('FEA Source RMS Value'); end % which component % -depsc -tiff % for an eps version print ('-dpsc', ['smooth_qp_source_component_', int2str(i_p)]) hold off v_text = ['Created smooth_qp_source_component_', int2str(i_p), '.ps']; fprintf (1,'%s', v_text) ; fprintf (1, ' \n' ) % end of smooth_qp_source_component