Skip to content

Commit d763e05

Browse files
committed
reenable nonlinear
1 parent da4a214 commit d763e05

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/DistMesh.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ struct DistMeshSetup{T} <: AbstractDistMeshAlgorithm
2828
ptol::T
2929
sort::Bool # use hilbert sort to cache-localize points
3030
sort_interval::Int # retriangulations before resorting
31+
nonlinear::Bool # uses nonlinear edge force
3132
distribution::Symbol # intial point distribution
3233
end
3334

@@ -37,6 +38,7 @@ function DistMeshSetup(;iso=0,
3738
ttol=0.02,
3839
sort=false,
3940
sort_interval=20,
41+
nonlinear=false,
4042
distribution=:regular)
4143
T = promote_type(typeof(iso),typeof(ptol),typeof(deltat), typeof(ttol))
4244
DistMeshSetup{T}(iso,
@@ -45,6 +47,7 @@ function DistMeshSetup(;iso=0,
4547
ptol,
4648
sort,
4749
sort_interval,
50+
nonlinear,
4851
distribution)
4952
end
5053

src/common.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ function compute_displacements!(fh, dp, pair, L, L0, bars, p, setup,
3434
if non_uniform && L[i] < L0[i]*lscbrt || L[i] < lscbrt
3535
L0_f = non_uniform ? L0[i].*lscbrt : lscbrt
3636
# compute force vectors
37-
#F = setup.nonlinear ? (L[i]+L0_f)*(L0_f-L[i])/(2*L0_f) : L0_f-L[i]
38-
F = L0_f-L[i]
37+
F = setup.nonlinear ? (L[i]+L0_f)*(L0_f-L[i])/(2*L0_f) : L0_f-L[i]
3938
# edges are not allowed to pull, only repel
4039
FBar = bars[i].*F./L[i]
4140
# add the force vector to the node

0 commit comments

Comments
 (0)