diff --git a/src/distmeshnd.jl b/src/distmeshnd.jl index ac51fdd..f3c1f4a 100644 --- a/src/distmeshnd.jl +++ b/src/distmeshnd.jl @@ -65,12 +65,12 @@ function distmesh(fdist::Function, # add points to p based on the initial distribution if setup.distribution === :regular - simplecubic!(fdist, p, pt_dists, h, setup.iso, origin, widths, VertType) + simplecubic!(fdist, p, pt_dists, h, geps, origin, widths, VertType) elseif setup.distribution === :packed # face-centered cubic point distribution - facecenteredcubic!(fdist, p, pt_dists, h, setup.iso, origin, widths, VertType) + facecenteredcubic!(fdist, p, pt_dists, h, geps, origin, widths, VertType) end - + @show length(p) # initialize arrays pair_set = Set{Tuple{Int32,Int32}}() # set used for ensure we have a unique set of edges pair = Tuple{Int32,Int32}[] # edge indices (Int32 since we use Tetgen) @@ -117,10 +117,11 @@ function distmesh(fdist::Function, pt_dists[i] = fdist(p[i]) end end + triangulationcount == 0 && @show length(t) triangulationcount += 1 stats && push!(statsdata.retriangulations, lcount) end - + #@show lcount, triangulationcount compute_displacements!(fh, dp, pair, L, L0, bars, p, setup, VertType) # Zero out forces on fix points diff --git a/src/tetgen.jl b/src/tetgen.jl index bcacf45..993bfb9 100644 --- a/src/tetgen.jl +++ b/src/tetgen.jl @@ -1,5 +1,5 @@ function delaunayn(points) - tetio = tetrahedralize(TetGen.TetgenIO(points), "Q") # Q- Quiet + tetio = tetrahedralize(TetGen.TetgenIO(points), "S0JNFIQ") # Q- Quiet tetio end @@ -13,7 +13,8 @@ function delaunayn!(fdist, p, t, geps, sorted_pts) t_d = triangulation.tetrahedra resize!(t, length(t_d)) copyto!(t, t_d) # we need to copy since we have a shared reference with tetgen - + @show length(t_d) + exit() # average points to get mid point of each tetrahedra # if the mid point of the tetrahedra is outside of # the boundary we remove it. @@ -24,7 +25,7 @@ function delaunayn!(fdist, p, t, geps, sorted_pts) for ai in t t[j] = ai pm = (p[ai[1]].+p[ai[2]].+p[ai[3]].+p[ai[4]])./4 - j = ifelse(fdist(pm) <= -geps, nextind(t, j), j) + j = ifelse(fdist(pm) < -geps, nextind(t, j), j) end j <= lastindex(t) && resize!(t, j-1) nothing