Skip to content

Commit

Permalink
this fixes a few issues in chunkerfunc.m
Browse files Browse the repository at this point in the history
- fixes a bug in how the diameter of the object was
tabulated
- makes the detection of partition points in [a,b]
more robust to rounding errors, etc and
- changes the resol_speed_test to make it more robust to doing
dyadic refinement for a curve defined by position only
(i.e. when the user does not provide analytic derivatives)
  • Loading branch information
askhamwhat committed Oct 16, 2024
1 parent a395c7b commit afd42c5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions chunkie/chunkerfunc.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
tsplits = [ta;tb];
end

tsplits = sort(unique(tsplits),'ascend');
tsplits = sort(uniquetol(tsplits,eps),'ascend');
lab = length(tsplits);
if (lab-1 > nchmax)
error(['CHUNKERFUNC: nchmax exceeded in chunkerfunc on initial splits.\n ',...
Expand Down Expand Up @@ -184,14 +184,15 @@

maxiter_res=nchmax-nch;

xmin = Inf;
xmax = -Inf;
ymin = Inf;
ymax = -Inf;

rad_curr = 0;
for ijk = 1:maxiter_res

% loop through all existing chunks, if resolved store, if not split
xmin = Inf;
xmax = -Inf;
ymin = Inf;
ymax = -Inf;

ifdone=1;
for ich=1:nchnew
Expand Down Expand Up @@ -224,7 +225,7 @@

resol_speed_test = err1>eps;
if nout < 2
resol_speed_test = err1>eps*k;
resol_speed_test = err1*(b-a) > eps*k;
end

xmax = max(xmax,max(r(1,:)));
Expand Down

0 comments on commit afd42c5

Please sign in to comment.