We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3380484 commit ac83daaCopy full SHA for ac83daa
src/distmeshnd.jl
@@ -308,11 +308,11 @@ function distmesh(fdist::Function,
308
309
# Move mesh points based on edge lengths L and forces F
310
for i in eachindex(pair)
311
- L0_f = non_uniform ? L0[i].*lscbrt : lscbrt
312
- # compute force vectors
313
- F = L0_f-L[i]
314
- # edges are not allowed to pull, only repel
315
- if F > zero(eltype(L))
+ if non_uniform && L[i] < L0[i] || L[i] < lscbrt
+ L0_f = non_uniform ? L0[i].*lscbrt : lscbrt
+ # compute force vectors
+ F = L0_f-L[i]
+ # edges are not allowed to pull, only repel
316
FBar = bars[i].*F./L[i]
317
# add the force vector to the node
318
b1 = pair[i][1]
0 commit comments