%% Clean up
clear
close all
%% Load data
% Load mesh
fid=fopen('gitter.grid','r');
num=fscanf(fid,'%i',2);
np=num(1);
nt=num(2);
ptmp=fscanf(fid,'%f',[2,np]);
ttmp=fscanf(fid,'%f',[3,nt]);
fclose(fid);
% Change for Matlab
px=ptmp(1,:)';
py=ptmp(2,:)';
triangles=ttmp'+1;
clear ptmp ttmp
% Load right-hand side
load f.dat

%% Plot
% Plot mesh
subplot(1,2,1);
triplot(triangles,px,py)
axis square
% Plot height data
subplot(1,2,2);
trisurf(triangles,px,py,f)
colormap winter;
shading interp;
lighting phong;
light;
view ( -40, 80 );
axis square
