clear all
close all
% Choix du moniteur pour les figures (pour la video):
% monitor=max(fc_tools.graphics.monitors.number());

meshfile=fc_oogmsh.gmsh.buildmesh2d('./geofile/ring.geo',30);
ThB=fc_simesh.siMesh(meshfile); % big mesh
meshfile=fc_oogmsh.gmsh.buildmesh2d('./geofile/ring.geo',8);
ThM=fc_simesh.siMesh(meshfile); % medium mesh
meshfile=fc_oogmsh.gmsh.buildmesh2d('./geofile/ring.geo',3);
ThS=fc_simesh.siMesh(meshfile); % small mesh
Title=true;

u=@(x,y) exp(-(x.^2+y.^2)).*cos(5/2*pi*(x.^2));
u=@(x,y) cos(pi*x).*sin(pi/3*y);

Th=ThS;
i1=Th.find(1,1);
i2=Th.find(1,2);

figure(1)
U1=Th.sTh{i1}.eval(u);
Th.sTh{i1}.plot(U1,'linewidth',3)
hold on

U2=Th.sTh{i2}.eval(u);
Th.sTh{i2}.plot(U2,'linewidth',3)
shading interp
ep01.special_plot(Th.sTh{i1},U1)
ep01.special_plot(Th.sTh{i2},U2)
view(3);axis off
colorbar
Th.plotmesh('color','gray')

figure(2)
U1=Th.sTh{i1}.eval(u);
Th.sTh{i1}.plot(U1,'linewidth',3)
hold on

U2=Th.sTh{i2}.eval(u);
Th.sTh{i2}.plot(U2,'linewidth',3)
shading interp
ep01.special_plot(Th.sTh{i1},U1)
ep01.special_plot(Th.sTh{i2},U2)
view(3);axis off
colorbar
Th.plotmesh('z',Th.eval(u),'edgecolor','gray','facecolor','lightgray')

Th=ThM;
figure(3)
U1=Th.sTh{i1}.eval(u);
Th.sTh{i1}.plot(U1,'linewidth',3)
hold on

U2=Th.sTh{i2}.eval(u);
Th.sTh{i2}.plot(U2,'linewidth',3)
shading interp
ep01.special_plot(Th.sTh{i1},U1)
ep01.special_plot(Th.sTh{i2},U2)
view(3);axis off
colorbar
Th.plotmesh('color','gray')

figure(4)
U1=Th.sTh{i1}.eval(u);
Th.sTh{i1}.plot(U1,'linewidth',3)
hold on

U2=Th.sTh{i2}.eval(u);
Th.sTh{i2}.plot(U2,'linewidth',3)
shading interp
ep01.special_plot(Th.sTh{i1},U1)
ep01.special_plot(Th.sTh{i2},U2)
view(3);axis off
colorbar
Th.plotmesh('z',Th.eval(u),'edgecolor','gray','facecolor','lightgray')

% fc_tools.graphics.monitors.autoGrid('monitor',monitor,'covers',0.9) % pour la video
% fc_tools.graphics.monitors.autoGrid('covers',0.9)
