function [] = plot_bc_ids(NodeP, idsP)
%% Plot the boundary cell positions and boundary IDs

% Last modified by Jing Lin in Apr. 2014

NodeP2 = NodeP(2:end-1, 2:end-1);
Nbcs = min(NodeP2(idsP)) - 1;
[x, y] = meshgrid(1:size(NodeP, 2), size(NodeP, 1):-1:1);
figure;
colors = jet(Nbcs); colormap(jet(Nbcs)); hold on;
for i = 1 : Nbcs
    ids = (NodeP == i);
    plot(x(ids), y(ids),'o', 'MarkerEdgeColor', colors(i, :),...
        'MarkerFaceColor', colors(i, :));
    text(mean(x(ids(:))), mean(y(ids(:))), num2str(i), 'FontSize',14);
end;
xlim([-1, size(NodeP, 2)+1]); ylim([-1, size(NodeP, 1)+1]);

if (Nbcs >= 1)
    caxis([1, Nbcs]);
else
    text(max(x(:))/4, mean(y(:)), 'No non-periodic boundary.', 'FontSize',14);
end;

end