Indices of points in canonical ordering for rectangular grid
[n1,n2,h1,h2,i,c,ii,cc] = poiindex(p,e,t,sd)
[n1,n2,h1,h2,i,c,ii,cc] = poiindex(p,e,t,sd) identifies a given grid p, e, t in the subdomain sd as an evenly spaced rectangular grid. If the grid is not rectangular, n1 is 0 on return. Otherwise n1 and n2 are the number of points in the first and second directions, h1 and h2 are the spacings. i and ii are of length (n1-2)*(n2-2) and contain indices of interior points. i contains indices of the original mesh, whereas ii contains indices of the canonical ordering. c and cc are of length n1*n2-(n1-2)*(n2-2) and contain indices of border points. ii and cc are increasing.
In the canonical ordering, points are numbered from left to right and then from bottom to top. Thus if n1 = 3 and n2 = 5, then ii = [5 8 11] and cc = [1 2 3 4 6 7 9 10 12 13 14 15].