function fiber_heat_flux_overlay (xmin, xmax, ymin, ymax, scale, Pts_wide) % Copyright 2007, J.E. Akin. All rights reserved. % ------------------------------------------------------ % bare minimum borders % Matlab program to calculate & plot 2-D FE meshes % ------------------------------------------------------ % c_x = x coordinates of nod_per_el line polygon % c_y = y coordinates of nod_per_el line polygon % inc_e = increment in element numbers on plot, if > 0 % inc_p = increment in node numbers on plot, if > 0 % msh_typ_nodes = connectivity list for elements, nt x nod_per_el % loop = corners for nod_per_el line polygon % lab_p = 1, if node points are circled lab_p = 0; % nod_per_el = Nodes per element % np = Number of Points % nt = Number of elements % pre_e = Element items before type & connectivity list % pre_p = Nodal items before coordinates % LIST1DN_001 = Nodal coordinates (with preceeding data) % t_x = x coordinates of nod_per_el corners % t_y = y coordinates of nod_per_el corners % xy = Coordinates of points, np x 2 if ( nargin < 6 ) Pts_wide = 2 end % if if ( nargin < 5 ) scale = 1 end % if pre_e = 0 ; pre_p = 0; hold on % Read coordinate file and connectivity file % integer bc code, real xy pairs for np points (pre_p = 1) % Set control data: number of points load LIST1DN_001.tmp ; np = size (LIST1DN_001,1) ; % number of nodal points ns = size (LIST1DN_001,2) - pre_p ; % dimension of space if ( np == 0 ) error ('Error missing file LIST1DN_001.tmp') %b else %b fprintf ('using fiber data LIST1DN_001.tmp') end % if error x (np) = 0. ; % pre-allocate array x y (np) = 0. ; % pre-allocate array y % LIST1DN_001 has: pre_p items then: x, y x = LIST1DN_001 (1:np, (pre_p+1)) ; % extract x %CL y = LIST1DN_001 (1:np, (pre_p+2)) ; % extract y %CL % Set control data: number elements & nodes_per_element load LIST1DE_001.tmp ; % nod_per_el nodes per element nt = size (LIST1DE_001,1); % number of elements if ( nt == 0 ) error ('Error missing file LIST1DE_001.tmp') end % if error nod_per_el = size (LIST1DE_001,2) - pre_e ; % nodes per element t_nodes (nod_per_el) = 0 ; % Optional pre-allocation t_x (nod_per_el) = 0 ; % Optional pre-allocation t_y (nod_per_el) = 0 ; % Optional pre-allocation c_x (nod_per_el + 1) = 0 ; % Optional pre-allocation c_y (nod_per_el + 1) = 0 ; % Optional pre-allocation loop (nod_per_el + 1) = 0 ; % Optional pre-allocation load seg_flux_001.tmp ; % centroid & flux vector ncg = size(seg_flux_001, 1) ; % number of centroids if ( ncg == 0 ) error ('Missing data file seg_flux_001.tmp') else fprintf ('Using fiber data seg_flux_001.tmp \n') end % if xcg = seg_flux_001(:,1) ; ycg = seg_flux_001(:,2) ; xhf = seg_flux_001(:,3) ; yhf = seg_flux_001(:,4) ; flux = sqrt ( xhf.^2 + yhf.^2 ) ; max_flux = max(flux) ; min_flux = min(flux) ; fprintf ('Largest fiber flux = %g \n', max_flux) % set constants [loop] = get_El_Loop (nod_per_el) ; if (Pts_wide > 0 ) % show fibers too for it = 1:nt ; t_nodes = LIST1DE_001 (it, 1:2 ) ; % Extract corner coordinates t_x = x (t_nodes) ; % x at those nodes, only t_y = y (t_nodes) ; % y at those nodes, only % Plot this segment c_x = t_x (loop) ; % x for nod_per_el line polygon c_y = t_y (loop) ; % y for nod_per_el line polygon %b plot (c_x, c_y, 'y-', 'LineWidth',Pts_wide) plot (c_x, c_y, 'g-', 'LineWidth',Pts_wide) %b plot (c_x, c_y, 'k-', 'LineWidth',Pts_wide) end % for over all elements end % if Pts_wide > 0 %b XXX xhf = xhf/10 ; yhf = yhf/10 ; scale = 4 quiver (xcg, ycg, xhf, yhf, scale) % -depsc -tiff % for an eps version % end fiber_heat_flux_overlay