Home > SRC > PLOT_FEMESH.m

PLOT_FEMESH

PURPOSE ^

plot the FE meshes of Inner, Outer, ECS compartments

SYNOPSIS ^

function PLOT_FEMESH(mymesh,OUT_cmpts_index,ECS_cmpts_index,IN_cmpts_index)

DESCRIPTION ^

 plot the FE meshes of Inner, Outer, ECS compartments
 
 Input:
     1. mymesh is a structure with 10 elements:
         Nnode
         Nele
         Nface
         Pts_cmpt_reorder
         Ele_cmpt_reorder
         Pts_ind
         Pts_boundary_reorder
         Fac_boundary_reorder
         Nboundary
         Ncmpt
 
     2. OUT_cmpts_index
     
     3. ECS_cmpts_index
     
     4. IN_cmpts_index
     
 Output:
     figures for FE mesh of Inner, (Outer, ECS) compartments

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function PLOT_FEMESH(mymesh,OUT_cmpts_index,ECS_cmpts_index,IN_cmpts_index)
0002 
0003 % plot the FE meshes of Inner, Outer, ECS compartments
0004 %
0005 % Input:
0006 %     1. mymesh is a structure with 10 elements:
0007 %         Nnode
0008 %         Nele
0009 %         Nface
0010 %         Pts_cmpt_reorder
0011 %         Ele_cmpt_reorder
0012 %         Pts_ind
0013 %         Pts_boundary_reorder
0014 %         Fac_boundary_reorder
0015 %         Nboundary
0016 %         Ncmpt
0017 %
0018 %     2. OUT_cmpts_index
0019 %
0020 %     3. ECS_cmpts_index
0021 %
0022 %     4. IN_cmpts_index
0023 %
0024 % Output:
0025 %     figures for FE mesh of Inner, (Outer, ECS) compartments
0026 
0027 xmin=0;
0028 xmax=0;
0029 ymin=0;
0030 ymax=0;
0031 zmin=0;
0032 zmax=0;
0033 for icmpt = 1:mymesh.Ncmpt
0034     xx=max(mymesh.Pts_cmpt_reorder{icmpt}(1,:));
0035     yx=max(mymesh.Pts_cmpt_reorder{icmpt}(2,:));
0036     zx=max(mymesh.Pts_cmpt_reorder{icmpt}(3,:));
0037     xn=min(mymesh.Pts_cmpt_reorder{icmpt}(1,:));
0038     yn=min(mymesh.Pts_cmpt_reorder{icmpt}(2,:));
0039     zn=min(mymesh.Pts_cmpt_reorder{icmpt}(3,:));
0040     xmin = min(xmin,xn);
0041     xmax = max(xmax,xx);
0042     ymin = min(ymin,yn);
0043     ymax = max(ymax,yx);
0044     zmin = min(zmin,zn);
0045     zmax = max(zmax,zx);
0046 end
0047 
0048 if (~isempty(OUT_cmpts_index))
0049     figure; 
0050     %subplot(1,3,1);
0051     hold on;
0052     cmptvec = OUT_cmpts_index;
0053     for ict = 1:length(cmptvec)
0054         icmpt = cmptvec(ict);
0055         Fac = [];
0056         for iboundary = 1:mymesh.Nboundary
0057             Fac = [Fac,mymesh.Fac_boundary_reorder{icmpt}{iboundary}];
0058         end
0059         h = trisurf(Fac',mymesh.Pts_cmpt_reorder{icmpt}(1,:),mymesh.Pts_cmpt_reorder{icmpt}(2,:),...
0060             mymesh.Pts_cmpt_reorder{icmpt}(3,:));
0061         set(h,'facealpha',0.9);
0062         axis equal;
0063         axis([xmin,xmax,ymin,ymax,zmin,zmax]); 
0064         view(3);
0065         title(['FE Mesh Inner cmpts: ',num2str(OUT_cmpts_index)]);
0066     end
0067 end
0068 
0069 if (~isempty(IN_cmpts_index))
0070     figure;
0071     %subplot(1,3,2);
0072     hold on;
0073     cmptvec = IN_cmpts_index;
0074     for ict = 1:length(cmptvec)
0075         icmpt = cmptvec(ict);
0076         Fac = [];
0077         for iboundary = 1:mymesh.Nboundary
0078             Fac = [Fac,mymesh.Fac_boundary_reorder{icmpt}{iboundary}];
0079         end
0080         h = trisurf(Fac',mymesh.Pts_cmpt_reorder{icmpt}(1,:),mymesh.Pts_cmpt_reorder{icmpt}(2,:),...
0081             mymesh.Pts_cmpt_reorder{icmpt}(3,:));
0082         set(h,'facealpha',0.9);
0083         axis equal;
0084         axis([xmin,xmax,ymin,ymax,zmin,zmax]);
0085         view(3);
0086         title(['FE Mesh Outer cmpts: ',num2str([IN_cmpts_index])]);
0087     end
0088 end
0089 
0090 if (~isempty(ECS_cmpts_index))
0091     figure; 
0092     %subplot(1,3,3);
0093     hold on;
0094     cmptvec = ECS_cmpts_index;
0095     for ict = 1:length(cmptvec)
0096         icmpt = cmptvec(ict);
0097         Fac = [];
0098         for iboundary = 1:mymesh.Nboundary
0099             Fac = [Fac,mymesh.Fac_boundary_reorder{icmpt}{iboundary}];
0100         end
0101         h = trisurf(Fac',mymesh.Pts_cmpt_reorder{icmpt}(1,:),mymesh.Pts_cmpt_reorder{icmpt}(2,:),...
0102             mymesh.Pts_cmpt_reorder{icmpt}(3,:));
0103         set(h,'facealpha',0.9);
0104         axis equal;
0105         axis([xmin,xmax,ymin,ymax,zmin,zmax]); 
0106         view(3);
0107         title(['FE Mesh ECS cmpt: ',num2str([ECS_cmpts_index])]);
0108     end
0109 end

Generated on Mon 28-Jan-2019 12:43:57 by m2html © 2005