% Schematic20.m %
clear; clf; 
nt= 160;nx = nt; t = linspace(-3*pi,3*pi,nt); x = linspace(1,nx+1,nx+1);
h = x(2) - x(1); 
hold on 
sh = 16;
plot(-100, -100,'ko','MarkerEdgeColor','k','markersize',12)
plot(-100, -100,'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',12)
hh = legend('${\Omega^h}$','${\partial \Omega^h}$',-1);
set(hh,'Position',[0.8254 0.7234 0.1556 0.2062],'fontsize',25)
set(hh,'Interpreter','latex')
plot(x(1)-2*x(sh),x(1)-x(sh),'k.','markersize',0.5)

patch([x(1)-x(sh) x(nx+1)+x(sh) x(nx+1)+x(sh) x(1)-x(sh) x(1)-x(sh)],[x(1)-x(sh) x(1)-x(sh) x(1) x(1) x(1)-x(sh)],[0.7 0.8 0.8],'edgecolor','none')
patch([x(nx+1) x(nx+1)+x(sh) x(nx+1)+x(sh) x(nx+1) x(nx+1)],[x(1) x(1) x(nx+1)+x(sh) x(nx+1)+x(sh) x(1)],[0.7 0.8 0.8],'edgecolor','none')
patch([x(1)-x(sh) x(nx+1) x(nx+1) x(1)-x(sh) x(1)-x(sh)],[x(nx+1) x(nx+1) x(nx+1)+x(sh) x(nx+1)+x(sh) x(nx+1)],[0.7 0.8 0.8],'edgecolor','none')
patch([x(1)-x(sh) x(1) x(1) x(1)-x(sh) x(1)-x(sh)],[x(1) x(1) x(nx+1) x(nx+1) x(1)],[0.7 0.8 0.8],'edgecolor','none')

for i = 1:sh:nx+1
line([x(1) x(nx+1)],[x(i) x(i)],'color','k','linewidth',0.5)
line([x(i) x(i)],[x(1) x(nx+1)],'color','k','linewidth',0.5)

end
  
line([x(1)-x(sh) x(nx+1)+x(sh)],[x(1)-x(sh) x(1)-x(sh)],'linestyle','--','color','k','linewidth',1.0)
line([x(1)-x(sh) x(nx+1)+x(sh)],[x(nx+1)+x(sh) x(nx+1)+x(sh)],'linestyle','--','color','k','linewidth',1.0)
line([x(nx+1)+x(sh) x(nx+1)+x(sh)],[x(1)-x(sh) x(nx+1)+x(sh)],'linestyle','--','color','k','linewidth',1.0)
line([x(1)-x(sh) x(1)-x(sh)],[x(1)-x(sh) x(nx+1)+x(sh)],'linestyle','--','color','k','linewidth',1.0)
for i = 1:sh:nx+1
    line([x(1)-x(sh) x(1)],[x(i) x(i)],'linestyle','--','color','k','linewidth',1.0)
    line([x(nx+1)+x(sh) x(nx+1)],[x(i) x(i)],'linestyle','--','color','k','linewidth',1.0)
    line([x(i) x(i)],[x(1)-x(sh) x(1)],'linestyle','--','color','k','linewidth',1.0)
    line([x(i) x(i)],[x(nx+1)+x(sh) x(nx+1)],'linestyle','--','color','k','linewidth',1.0)
end

for i = 9:sh:nx+1
       for k = 1:10 
            plot(x(1)+(k-0.5)*x(sh), x(i),'ko','MarkerEdgeColor','k','markersize',6)
       end
     plot(x(1)-(0.5)*x(sh), x(i),'ko','MarkerEdgeColor','k','markersize',6)
     plot(x(nx+1)+0.5*x(sh), x(i),'ko','MarkerEdgeColor','k','markersize',6);
     plot(x(i),x(1)-0.5*x(sh),'ko','MarkerEdgeColor','k','markersize',6);
     plot(x(i),x(nx+1)+0.5*x(sh),'ko','MarkerEdgeColor','k','markersize',6);
end

for i = 9:sh:nx+1
     plot(x(1)-0.5*x(sh), x(i),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
     plot(x(nx+1)+0.5*x(sh), x(i),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
     plot(x(i),x(1)-0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
     plot(x(i),x(nx+1)+0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
end
plot(x(1)-0.5*x(sh), x(1)-0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
plot(x(nx+1)+0.5*x(sh), x(nx+1)+0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
plot(x(1)-0.5*x(sh), x(nx+1)+0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);
plot(x(nx+1)+0.5*x(sh), x(1)-0.5*x(sh),'ko','MarkerEdgeColor','k','markerfacecolor','k','markersize',6);

axis image
line([x(1) x(nx+1) x(nx+1) x(1) x(1)],[x(1) x(1) x(nx+1) x(nx+1) x(1)],'linew',1.8,'color','k')
axis([x(1)-4*x(sh) x(nx+1)+x(sh) x(1)-x(sh) x(nx+1)+x(sh)])
axis off
set(gcf,'PaperPositionMode','auto')