function [lout, lin] = insdmesh(bndele,meshnod)
% [lout, lin] = insdmesh(bndele,meshnod);
% plot(meshnod(lout,2),meshnod(lout,3),'ro',meshnod(lin,2),meshnod(lin,3),'go')
n = length(meshnod);
lout = ones(n,1);
nout = 1;
lin = ones(n,1);
nin = 1;

for i = 1:length(meshnod)
ln = insdbnd(bndele,meshnod,meshnod(i,2),meshnod(i,3));

if ln ==0
% outside
lout(nout) = i; 
nout = nout+1;
else
% inside
lin(nin) = i;
nin = nin+1;
end

end
nin = nin-1;
nout = nout-1;
lout = lout(1:nout);
lin = lin(1:nin);

