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',3);
Th=fc_simesh.siMesh(meshfile);
Title=true;

%Th.plotmeshinfo()

figure(1)
Th.plotmesh('color','k')
hold on
Th.plotnodesidx('color','k','fontsize',12)
axis image;axis off

figure(2)
i=43;
ep01.plot_BasisFunction(Th,2,1,i,'title',Title) % On Omega_1, 43-th basis functions
Th.plotnodesidx('d',2,'labels',1,'color','b','fontsize',10,'idx',i)
Th.plotmesh('d',1,'linewidth',1)

figure(3)
Th.plotmesh('d',1,'inlegend',true)
hold on
fc_graphics4mesh.legend('location','eastoutside')
Th.plotnodesidx('d',1,'labels',1,'color','b','fontsize',12)
axis off

figure(4)
i=5;lab=1;
ep01.plot_BasisFunction(Th,1,lab,i,'title',Title) % On Gamma_lab, i-th basis functions
Th.plotnodesidx('d',1,'labels',lab,'color','b','fontsize',12)
Th.plotmesh('d',1,'linewidth',1)

figure(5)
ep01.plot_BasisFunction(Th,1,lab,i,'title',Title) % On Gamma_lab, i-th basis functions
Th.plotnodesidx('d',1,'labels',lab,'color','b','fontsize',12,'Global',-1)
Th.plotmesh('d',1,'linewidth',1)

figure(6)
idx=Th.find(1,lab);
ig=Th.sTh{idx}.toGlobal(i); % indice global du point
idx2=Th.find(2,1);
j=find(Th.sTh{idx2}.toGlobal==ig); 
ep01.plot_BasisFunction(Th,2,1,j,'title',Title) % On Gamma_lab, i-th basis functions
Th.plotmesh('d',1,'linewidth',1)
Th.plotnodesidx('d',2,'labels',1,'color','b','fontsize',10,'idx',j)

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