Skip to content

Commit

Permalink
Update dpoly.m
Browse files Browse the repository at this point in the history
putting the in_boubox inside the sum(inside) == 0 directive to avoid error if there is no "inside".
  • Loading branch information
WPringle committed Aug 12, 2019
1 parent 0e9259e commit 05353d7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions @meshgen/private/dpoly.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,20 @@
% in_outer are the points inside the outer meshing domain.
%
% "in" is defined as the intersection of the in = in_boubox && in_outer
%
% Note: the boubox is pre-pended when forming outer.
firstNaN = find(isnan(outer(:,1)),1,'first') ;
in_boubox = inpoly(p(inside,:),outer(1:firstNaN-1,:)) ;

% Check if the points are inside the meshing domain (omega)
edges = Get_poly_edges( outer );
if sum(inside)~=0
% Check if the points are inside the meshing domain (omega)
% Note: the boubox is pre-pended when forming outer.
firstNaN = find(isnan(outer(:,1)),1,'first') ;
in_boubox = inpoly(p(inside,:),outer(1:firstNaN-1,:)) ;
% now check if inside the full boundary
edges = Get_poly_edges( outer );
in_outer = inpoly(p(inside,:),outer,edges);
if inpoly_flip
in_outer = ~in_outer;
end
else
in_boubox = d_l*0;
in_outer = d_l*0;
end

Expand All @@ -106,4 +107,5 @@

d(inside) = d_l;
end
% EOF
end

0 comments on commit 05353d7

Please sign in to comment.