function solvemodel(event)

frame=event;

fem=getdata(frame);

left=frame.get('left').getValue;
right=frame.get('right').getValue;
source=frame.get('source').getValue;
cond=frame.get('cond').getValue;
meshorder=frame.get('meshorder').getSelectedIndex;

if meshorder==1
 type={'shlag(1,''T'')'};
 gp=2;
 cp=1;
else
 type={'shlag(2,''T'')'};
 gp=4;
 cp=2;
end

% Application mode 1
clear appl
appl.mode.class = 'HeatTransfer';
appl.shape = type;
appl.gporder = gp;
appl.cporder = cp;
appl.assignsuffix = '_ht';
clear prop
prop.analysis='static';
appl.prop = prop;
clear bnd
bnd.type = 'T';
bnd.T0 = {left,right};
bnd.ind = [1,2];
appl.bnd = bnd;
clear equ
equ.k = cond;
equ.Q = source;
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);

storedata(frame,fem);

plotmodel(event);
