% COMSOL Multiphysics Model M-file
% Generated by COMSOL 3.2a (COMSOL 3.2.0.301, $Date: 2006/02/02 08:34:25 $)

flclear fem

% COMSOL version
clear vrsn
vrsn.name = 'COMSOL 3.2';
vrsn.ext = 'a';
vrsn.major = 0;
vrsn.build = 301;
vrsn.rcs = '$Name:  $';
vrsn.date = '$Date: 2006/02/02 08:34:25 $';
fem.version = vrsn;

% Geometry
g1=solid1([-0.0,1.0]);
clear s
s.objs={g1};
s.name={'I1'};
s.tags={'g1'};

fem.draw=struct('s',s);
fem.geom=geomcsg(fem);
g1=scale(g1,10,0);
clear s
s.objs={g1};
s.name={'I1'};
s.tags={'g1'};

fem.draw=struct('s',s);
fem.geom=geomcsg(fem);
g1=scale(g1,0.1,0);
clear s
s.objs={g1};
s.name={'I1'};
s.tags={'g1'};

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

% Initialize mesh
fem.mesh=meshinit(fem, ...
                  'hmax',[0.05]);

% (Default values are not included)

% Application mode 1
clear appl
appl.mode.class = 'HeatTransfer';
appl.shape = {'shlag(1,''T'')'};
appl.gporder = 2;
appl.cporder = 1;
appl.assignsuffix = '_ht';
clear prop
prop.analysis='static';
appl.prop = prop;
clear bnd
bnd.type = 'T';
bnd.T0 = {273,293};
bnd.ind = [1,2];
appl.bnd = bnd;
clear equ
equ.k = 40;
equ.Q = '2e3*x';
equ.ind = [1];
appl.equ = equ;
fem.appl{1} = appl;
fem.frame = {'ref'};
fem.border = 1;
fem.outform = 'general';
fem.units = 'SI';

% Multiphysics
fem=multiphysics(fem);

% Extend mesh
fem.xmesh=meshextend(fem);

% Solve problem
fem.sol=femnlin(fem, ...
                'solcomp',{'T'}, ...
                'outcomp',{'T'});

% Save current fem structure for restart purposes
fem0=fem;

% Plot solution
postplot(fem, ...
         'liny',{'flux_ht','cont','internal'}, ...
         'lincolor',[0.0,0.0,0.0], ...
         'title','Line: Heat flux [W/m^2]', ...
         'geom','off', ...
         'axis',[-0.05,1.05,83.75,1183.75,-1,1]);

% Plot solution
postplot(fem, ...
         'liny',{'T','cont','internal'}, ...
         'lincolor',[0.0,0.0,0.0], ...
         'title','Line: Temperature [K]', ...
         'geom','off', ...
         'axis',[-0.05,1.05,135,1180,-1,1]);

% Plot solution
postplot(fem, ...
         'liny',{'T','cont','internal'}, ...
         'lincolor',[0.0,0.0,0.0], ...
         'title','Line: Temperature [K]', ...
         'refine',1, ...
         'geom','off', ...
         'axis',[-0.05,1.05,272,294,-1,1]);

% Plot solution
postplot(fem, ...
         'liny',{'T','cont','internal'}, ...
         'lincolor',[0.0,0.0,0.0], ...
         'title','Line: Temperature [K]', ...
         'refine',1, ...
         'geom','off', ...
         'axis',[-0.05,1.05,272,294,-1,1]);

% (Default values are not included)

% Application mode 1
clear appl
appl.mode.class = 'HeatTransfer';
appl.shape = {'shlag(1,''T'')'};
appl.gporder = 2;
appl.cporder = 1;
appl.assignsuffix = '_ht';
clear prop
prop.analysis='static';
appl.prop = prop;
clear bnd
bnd.type = 'T';
bnd.T0 = {273,293};
bnd.ind = [1,2];
appl.bnd = bnd;
clear equ
equ.k = 40;
equ.Q = '2e3*x';
equ.ind = [1];
appl.equ = equ;
fem.appl{1} = appl;
fem.frame = {'ref'};
fem.border = 1;
fem.outform = 'general';
fem.units = 'SI';

% Multiphysics
fem=multiphysics(fem);

% Extend mesh
fem.xmesh=meshextend(fem);

% Solve problem
fem.sol=femnlin(fem, ...
                'solcomp',{'T'}, ...
                'outcomp',{'T'});

% Save current fem structure for restart purposes
fem0=fem;

% Plot solution
postplot(fem, ...
         'liny',{'T','cont','internal'}, ...
         'lincolor',[0.0,0.0,0.0], ...
         'title','Line: Temperature [K]', ...
         'refine',1, ...
         'geom','off', ...
         'axis',[-0.05,1.05,272,294,-1,1]);
