Home > vbmeg > external > iso2mesh > sample > demo_directplc_ex1.m

demo_directplc_ex1

PURPOSE ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% angular resolution

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0002 %
0003 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0004 %% angular resolution
0005 dt=pi/40;        
0006 t=0:dt:2*pi-dt;
0007 
0008 %% parameters of a side-cut fiber
0009 h=100;
0010 r1=20;
0011 r2=25;
0012 a=-1;     
0013 b=0;
0014 c=1;
0015 d=-h;
0016 
0017 %% key nodes of a side-cut fiber
0018 
0019 n1=[r1*sin(t(:)) r1*cos(t(:)) zeros(size(t(:)))];
0020 n2=[r2*sin(t(:)) r2*cos(t(:)) zeros(size(t(:)))];
0021 
0022 n3=[r1*sin(t(:)) r1*cos(t(:)) -d-(a*r1*sin(t(:))+b*r1*cos(t(:)))/c];
0023 n4=[r2*sin(t(:)) r2*cos(t(:)) -d-(a*r2*sin(t(:))+b*r2*cos(t(:)))/c];
0024 
0025 no=[n1;n2;n3;n4];
0026 
0027 %% PLCs of the side-cut fiber
0028 
0029 clear fc;
0030 count=1;  
0031 for i=1:length(t)-1
0032    % the last number in each cell is the fc id
0033    fc{count}={[i+length(t) i+3*length(t) i+3*length(t)+1 i+length(t)+1],1}; count=count+1;
0034    fc{count}={[i i+2*length(t) i+2*length(t)+1 i+1],2}; count=count+1;
0035 end
0036 i=length(t);
0037 fc{count}={[i+length(t) i+3*length(t) 1+3*length(t) 1+length(t)],1}; count=count+1;
0038 fc{count}={[i i+2*length(t) 1+2*length(t) 1],2}; count=count+1;
0039 
0040 fc{count}={1:1+length(t)-1,3};count=count+1;  % bottom inner circle
0041 fc{count}={[1+length(t):1+length(t)*2-1 nan fliplr(1:1+length(t)-1)],4};count=count+1; % button outter circle
0042 fc{count}={1+length(t)*2:1+length(t)*3-1,5};count=count+1;  % top inner circle
0043 fc{count}={[1+length(t)*3:1+length(t)*4-1 nan fliplr(1+length(t)*2:1+length(t)*3-1)],6}; % top outter circle
0044 
0045 %% mesh generation of the cladding for the side-cut fiber
0046 %[node,elem,face]=s2m(no,face,1,50);
0047 [node,elem,face]=surf2mesh(no,fc,min(no),max(no),1,50,[0 0 1],[],0);
0048 
0049 plotmesh(no,fc,'y>-0.1');
0050 figure
0051 plotmesh(node,elem,'x>0 | y>0');

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005