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);
Th=fc_simesh.siMesh(meshfile); % small mesh
Title=true;

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

figure(1)
UB=ThB.eval(u);
ThB.plot(UB)
shading interp;view(3);axis off
colorbar

figure(2)
U=Th.eval(u);
Th.plot(U)
shading interp;view(3);axis off
hold on
Th.plotmesh('z',U,'edgecolor','k','facecolor','None')
colorbar

figure(3)
UM=ThM.eval(u);
ThM.plot(UM)
shading interp;view(3);axis off
hold on
ThM.plotmesh('z',UM,'edgecolor','k','facecolor','None')
colorbar

figure(4)
Ur=rand(Th.nq,1);
Th.plot(Ur)
shading interp;view(3);axis off
hold on
Th.plotmesh('z',Ur,'edgecolor','k','facecolor','None')
colorbar

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