% FEMLAB Model M-file
% Generated 18-Mar-2002 20:23:25 by FEMLAB 2.1.0.127.

flclear fem
% FEMLAB Version
clear vrsn;
vrsn.name='FEMLAB 2.1';
vrsn.major=0;
vrsn.build=127;
fem.version=vrsn;

% Space dimensions
fem.sdim={'x','y'};

% Geometry
clear s c p
p=[0 0 5 15 25 25 25;0 100 0 15 30 45 100];
rb={1:7,[1 1 2 3 4 5 6;2 3 7 4 5 6 7],zeros(3,0),zeros(4,0)};
wt={zeros(1,0),ones(2,7),zeros(3,0),zeros(4,0)};
lr={[NaN NaN NaN NaN NaN NaN NaN],[0 1 0 1 1 1 1;1 0 1 0 0 0 0],zeros(2,0), ...
zeros(2,0)};
CO1=solid2(p,rb,wt,lr);
objs={CO1};
names={'CO1'};
s.objs=objs;
s.name=names;

objs={};
names={};
c.objs=objs;
c.name=names;

objs={};
names={};
p.objs=objs;
p.name=names;

drawstruct=struct('s',s,'c',c,'p',p);
fem.draw=drawstruct;
fem.geom=geomcsg(fem);

% Recorded command sequence

clear appl

% Application mode 1
appl{1}.mode='flpdec2d(1,''dim'',{''u'',''u_t''},''sdim'',{''x'',''y''},''submode'',''std'',''tdiff'',''on'')';
appl{1}.name='c1';
appl{1}.dim={'u','u_t'};
appl{1}.border='off';
appl{1}.var={};
appl{1}.form='coefficient';
appl{1}.assign={'abscu1x';'abscu1x_c1';'absga1x';'absga1x_c1';'absux'; ...
'absux_c1'};
appl{1}.equ.da={{{'1'}}};
appl{1}.equ.c={{{'B*x'}}};
appl{1}.equ.al={{{'0';'0'}}};
appl{1}.equ.ga={{{'0';'B*x.*uy'}}};
appl{1}.equ.be={{{'2*B';'x'}}};
appl{1}.equ.a={{{'0'}}};
appl{1}.equ.f={{{'0'}}};
appl{1}.equ.ind=1;
appl{1}.usage=1;
appl{1}.bnd.q={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
appl{1}.bnd.g={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
appl{1}.bnd.h={{{'1'}},{{'1'}},{{'0'}},{{'1'}}};
appl{1}.bnd.r={{{'0'}},{{'x.^2/25'}},{{'0'}},{{'1'}}};
appl{1}.bnd.type={'dir','dir','dir','dir'};
appl{1}.bnd.ind=[1 2 3 4 4 4 4];
appl{1}.init.sd={{{'0'}}};
appl{1}.init.ind=1;

fem.appl=appl;

% Initialize mesh
fem.mesh=meshinit(fem,...
	'Out',    {'mesh'},...
	'jiggle', 'mean',...
	'Hcurve', 0.29999999999999999,...
	'Hgrad',  1.3,...
	'Hpnt',   {10,[]});

% Dimension
fem.dim={{'u'}};

% Boundary conditions
fem.border=0;

% Usage
fem.usage=1;

% Problem form
fem.form='general';

% Differentiation
fem.diff={'ga','g','f','r'};

% Differentiation simplification
fem.simplify='on';

% Differentiation rules
fem.rules={};

% Define variables
fem.variables={...
	'D',      5,...
	'B',      1.3};

% Define application mode variables
fem.var={};

% Boundary conditions
clear bnd
bnd.q={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.g={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.h={{{'1'}},{{'1'}},{{'0'}},{{'1'}}};
bnd.r={{{'-u'}},{{'x./3-u'}},{{'0'}},{{'1-u'}}};
bnd.var={};
bnd.ind=[1 2 3 4 4 4 4];
fem.bnd=bnd;

% PDE coefficients
clear equ
equ.da={{{'1'}}};
equ.c={{{'B*x','0';'0','B*x-B*x'}}};
equ.al={{{'0';'0'}}};
equ.ga={{{'-B*x.*ux';'B*x.*uy-B*x.*uy'}}};
equ.be={{{'2*B';'x'}}};
equ.a={{{'0'}}};
equ.f={{{'-(2*B.*ux+x.*uy)'}}};
equ.var={'absux_c1','sqrt(ux.^2+uy.^2)','absga1x_c1', ...
'sqrt(ga1x.^2+ga1y.^2)'};
equ.ind=1;
fem.equ=equ;

% Evaluate initial condition
fem.init=asseminit(fem,...
	'context','local',...
	'init',   struct('sd',{{{{'0'}}}},'ind',{1}));

% Solve problem
fem.sol=femlin(fem,...
	'out',    {'sol'},...
	'context','local',...
	'sd',     'off',...
	'Epoint', 'gauss2',...
	'Nullfun','flnullorth',...
	'Tpoint', 'gauss2',...
	'Solcomp',1,...
	'method', 'eliminate');

% Save current mesh
restart.mesh=fem.mesh;
restart.usage=fem.usage;

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Dimension
fem.dim={{'u'}};

% Boundary conditions
fem.border=0;

% Usage
fem.usage=1;

% Problem form
fem.form='general';

% Differentiation
fem.diff={'ga','g','f','r'};

% Differentiation simplification
fem.simplify='on';

% Differentiation rules
fem.rules={};

% Define variables
fem.variables={...
	'D',      5,...
	'B',      1.3};

% Define application mode variables
fem.var={};

% Boundary conditions
clear bnd
bnd.q={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.g={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.h={{{'1'}},{{'1'}},{{'0'}},{{'1'}}};
bnd.r={{{'-u'}},{{'x/D-u'}},{{'0'}},{{'1-u'}}};
bnd.var={};
bnd.ind=[1 2 3 4 4 4 4];
fem.bnd=bnd;

% PDE coefficients
clear equ
equ.da={{{'1'}}};
equ.c={{{'B*x','0';'0','B*x-B*x'}}};
equ.al={{{'0';'0'}}};
equ.ga={{{'-B*x.*ux';'B*x.*uy-B*x.*uy'}}};
equ.be={{{'2*B';'x'}}};
equ.a={{{'0'}}};
equ.f={{{'-(2*B.*ux+x.*uy)'}}};
equ.var={'absux_c1','sqrt(ux.^2+uy.^2)','absga1x_c1', ...
'sqrt(ga1x.^2+ga1y.^2)'};
equ.ind=1;
fem.equ=equ;

% Evaluate initial condition
fem.init=asseminit(fem,...
	'context','local',...
	'init',   struct('sd',{{{{'0'}}}},'ind',{1}));

% Solve problem
fem.sol=femlin(fem,...
	'out',    {'sol'},...
	'context','local',...
	'sd',     'off',...
	'Epoint', 'gauss2',...
	'Nullfun','flnullorth',...
	'Tpoint', 'gauss2',...
	'Solcomp',1,...
	'method', 'eliminate');

% Save current mesh
restart.mesh=fem.mesh;
restart.usage=fem.usage;

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Refine mesh
fem.mesh=meshrefine(fem,...
	'out',    {'mesh'},...
	'rmethod','regular');

% Refine mesh
fem.mesh=meshrefine(fem,...
	'out',    {'mesh'},...
	'rmethod','regular');

% Dimension
fem.dim={{'u'}};

% Boundary conditions
fem.border=0;

% Usage
fem.usage=1;

% Problem form
fem.form='general';

% Differentiation
fem.diff={'ga','g','f','r'};

% Differentiation simplification
fem.simplify='on';

% Differentiation rules
fem.rules={};

% Define variables
fem.variables={...
	'D',      5,...
	'B',      1.3};

% Define application mode variables
fem.var={};

% Boundary conditions
clear bnd
bnd.q={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.g={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.h={{{'1'}},{{'1'}},{{'0'}},{{'1'}}};
bnd.r={{{'-u'}},{{'0.2*x-u'}},{{'0'}},{{'1-u'}}};
bnd.var={};
bnd.ind=[1 2 3 4 4 4 4];
fem.bnd=bnd;

% PDE coefficients
clear equ
equ.da={{{'1'}}};
equ.c={{{'B*x','0';'0','B*x-B*x'}}};
equ.al={{{'0';'0'}}};
equ.ga={{{'-B*x.*ux';'B*x.*uy-B*x.*uy'}}};
equ.be={{{'2*B';'x'}}};
equ.a={{{'0'}}};
equ.f={{{'-(2*B.*ux+x.*uy)'}}};
equ.var={'absux_c1','sqrt(ux.^2+uy.^2)','absga1x_c1', ...
'sqrt(ga1x.^2+ga1y.^2)'};
equ.ind=1;
fem.equ=equ;

% Evaluate initial condition
fem.init=asseminit(fem,...
	'context','local',...
	'init',   struct('sd',{{{{'0'}}}},'ind',{1}));

% Solve problem
fem.sol=femlin(fem,...
	'out',    {'sol'},...
	'context','local',...
	'sd',     'off',...
	'Epoint', 'gauss2',...
	'Nullfun','flnullorth',...
	'Tpoint', 'gauss2',...
	'Solcomp',1,...
	'method', 'eliminate');

% Save current mesh
restart.mesh=fem.mesh;
restart.usage=fem.usage;

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Dimension
fem.dim={{'u'}};

% Boundary conditions
fem.border=0;

% Usage
fem.usage=1;

% Problem form
fem.form='general';

% Differentiation
fem.diff={'ga','g','f','r'};

% Differentiation simplification
fem.simplify='on';

% Differentiation rules
fem.rules={};

% Define variables
fem.variables={...
	'D',      5,...
	'B',      1.3};

% Define application mode variables
fem.var={};

% Boundary conditions
clear bnd
bnd.q={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.g={{{'0'}},{{'0'}},{{'0'}},{{'0'}}};
bnd.h={{{'1'}},{{'1'}},{{'0'}},{{'1'}}};
bnd.r={{{'-u'}},{{'0.04*x.^2-u'}},{{'0'}},{{'1-u'}}};
bnd.var={};
bnd.ind=[1 2 3 4 4 4 4];
fem.bnd=bnd;

% PDE coefficients
clear equ
equ.da={{{'1'}}};
equ.c={{{'B*x','0';'0','B*x-B*x'}}};
equ.al={{{'0';'0'}}};
equ.ga={{{'-B*x.*ux';'B*x.*uy-B*x.*uy'}}};
equ.be={{{'2*B';'x'}}};
equ.a={{{'0'}}};
equ.f={{{'-(2*B.*ux+x.*uy)'}}};
equ.var={'absux_c1','sqrt(ux.^2+uy.^2)','absga1x_c1', ...
'sqrt(ga1x.^2+ga1y.^2)'};
equ.ind=1;
fem.equ=equ;

% Evaluate initial condition
fem.init=asseminit(fem,...
	'context','local',...
	'init',   struct('sd',{{{{'0'}}}},'ind',{1}));

% Solve problem
fem.sol=femlin(fem,...
	'out',    {'sol'},...
	'context','local',...
	'sd',     'off',...
	'Epoint', 'gauss2',...
	'Nullfun','flnullorth',...
	'Tpoint', 'gauss2',...
	'Solcomp',1,...
	'method', 'eliminate');

% Save current mesh
restart.mesh=fem.mesh;
restart.usage=fem.usage;

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',18,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',19,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'arrowdata',{'uy','-ux'},...
	'arrowcolor',[1 0 0],...
	'arrowscale','auto',...
	'arrowstyle','proportional',...
	'arrowxspacing',15,...
	'arrowyspacing',30,...
	'arrowmaxmin','off',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  Arrow: [uy (uy),-ux]  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',19,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','cool',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')

% Plot solution
postplot(fem,...
	'context','local',...
	'contdata',{'u','cont','on'},...
	'contlevels',19,...
	'contstyle','color',...
	'contlabel','off',...
	'contmaxmin','off',...
	'contbar','on',...
	'contmap','jet',...
	'geom',   'on',...
	'geomcol','bginv',...
	'view',   [0 90],...
	'title',  'Contour: u (u)  ',...
	'renderer','zbuffer',...
	'solnum', 1,...
	'axisvisible','on')
