Skip to content

Commit fb3486d

Browse files
committed
some logic cleanups
1 parent 8dde767 commit fb3486d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/distmeshnd.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,20 @@ function distmesh(fdist::Function,
138138
move = sqrt(sum((p[i]-p0).^2)) # compute movement from the displacement
139139
d_est = pt_dists[i] + move # apply the movement to our cache point
140140
d = d_est < -geps ? d_est : fdist(result.points[i]) # determine if we need correct or approximate distance
141-
pt_dists[i] = d # store distance
142141

143142
if d < -geps
144143
maxdp = max(maxdp, setup.deltat*sqrt(sum(dp[i].^2)))
145144
end
146145

147146
if d <= setup.iso
147+
pt_dists[i] = d # store distance
148148
maxmove = max(move,maxmove)
149-
continue
149+
else
150+
# bring points back to boundary if outside using central difference
151+
p[i] = p[i] .- centraldiff(fdist,p[i]).*(d+setup.iso)
152+
maxmove = max(sqrt(sum((p[i]-p0).^2)), maxmove)
153+
pt_dists[i] = setup.iso # ideally
150154
end
151-
152-
# bring points back to boundary if outside using central difference
153-
p[i] = p[i] .- centraldiff(fdist,p[i]).*(d+setup.iso)
154-
maxmove = max(sqrt(sum((p[i]-p0).^2)), maxmove)
155-
pt_dists[i] = setup.iso # ideally
156155
end
157156

158157
# increment iteration counter

0 commit comments

Comments
 (0)