function [n_uzly, n_prvky, n_ID, n_IN, n_hrany, n_okrajoveHrany,I ]  = refineMesh( a, b, h )
%REFINEMESH Summary of this function goes here
%   Detailed explanation goes here
% a,b,h - original mesh parameters

nx = floor(a/h);
ny = floor(b/h);
hx = a/nx;
hy = b/ny;

n = (nx+1)*(ny+1);
m = nx*ny*2;

n_h = h/2;
n_ny = floor(b/(h/2));

[n_uzly, n_prvky, n_ID, n_IN, n_hrany, n_okrajoveHrany ] = diskretizuj_obdelnik(a , b, n_h);

n_idx = 1;
I=zeros(size(n_uzly,2),n);


idx=1;
oidx = 1;
for i=0:nx
    for j=0:ny
        I(idx,oidx) = 1;
        if j<ny
            I(idx+1,oidx)=0.5; 
            I(idx+1,oidx+1)=0.5;
        end
        if j<ny & i<nx
            I(idx+n_ny+2,oidx)=0.5;
            I(idx+n_ny+2,oidx+ny+2)=0.5;
        end
        if i<nx
            I(idx+n_ny+1,oidx)=0.5;
            I(idx+n_ny+1,oidx+ny+1)=0.5;
        end
        idx = idx+2;
        oidx=oidx+1;
    end
    idx = idx + n_ny;
    %n_idx=n_idx+n_ny;
end

end

