%--------------------------------------------
%     Define grid nodes and corresponding
%     cross section areas and circumferential 
%     lengths. Store in XM,SX,SCFL arrays. 
%     NI = total number of grid nodes.
%
%     Convergent - divergent nozzle
%
%--------------------------------------------

X1 = 0.0;                           % Left end of mesh
X2 = 1.0;                           % Right en of mesh
MSH.NI = 101;                       % Number of mesh points
MSH.XM = linspace(X1,X2,MSH.NI)';   % Mesh point vector

r1 = sqrt(0.30/pi);
r2 = sqrt(0.25/pi);
r3 = sqrt(0.50/pi);

i1 = 1;
i2 = floor(MSH.NI/3);
i3 = MSH.NI;

x1 = MSH.XM(i1);
x2 = MSH.XM(i2);
x3 = MSH.XM(i3);

MSH.SX = [.5*(r1+r2) + .5*(r1-r2)*cos(   pi/(x2-x1)*MSH.XM(i1:i2)); ...
          .5*(r2+r3) + .5*(r3-r2)*cos(pi+pi/(x3-x2)*(MSH.XM(i2+1:i3)-x2))].^2*pi;

% Assume circular nozzle
MSH.SCFL = sqrt(4*MSH.SX*pi);       % Circumferential lengths vector

