@@ -71,9 +71,6 @@ function distmesh(fdist::Function,
71
71
facecenteredcubic! (fdist, p, pt_dists, h, setup. iso, origin, widths, VertType)
72
72
end
73
73
74
- # use nearest neighbors kd tree to spatially sort points if point set is large
75
- sort_pts = ! have_fixed
76
-
77
74
# initialize arrays
78
75
pair_set = Set {Tuple{Int32,Int32}} () # set used for ensure we have a unique set of edges
79
76
pair = Tuple{Int32,Int32}[] # edge indices (Int32 since we use Tetgen)
@@ -93,17 +90,17 @@ function distmesh(fdist::Function,
93
90
statsdata = DistMeshStatistics ()
94
91
lcount = 0 # iteration counter
95
92
triangulationcount = 0 # triangulation counter
96
- resortinterval = 10
97
93
98
94
@inbounds while true
99
95
# if large move, retriangulation
100
96
if maxmove> setup. ttol* h
101
97
102
98
# use hilbert sort to improve cache locality of points
103
- if sort_pts && iszero (triangulationcount% resortinterval )
99
+ if setup . sort && iszero (triangulationcount % setup . sort_interval )
104
100
hilbertsort! (p)
105
101
end
106
- delaunayn! (fdist, p, t, geps, sort_pts) # compute a new delaunay triangulation
102
+
103
+ delaunayn! (fdist, p, t, geps, false ) # compute a new delaunay triangulation
107
104
108
105
tet_to_edges! (pair, pair_set, t) # Describe each edge by a unique pair of nodes
109
106
@@ -113,7 +110,7 @@ function distmesh(fdist::Function,
113
110
non_uniform && resize! (L0, length (pair))
114
111
115
112
# if the points were sorted we need to update the distance cache
116
- if sort_pts && iszero (triangulationcount% resortinterval )
113
+ if setup . sort && iszero (triangulationcount % setup . sort_interval )
117
114
for i in eachindex (p)
118
115
pt_dists[i] = fdist (p[i])
119
116
end
0 commit comments