Skip to content

Commit 5465d5d

Browse files
authored
Merge pull request #1 from dengwirda/dev
Initial bindings for jigsaw-0.9.12.xx
2 parents 55d391e + 9b5a4da commit 5465d5d

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

jigsawpy/jigsaw.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def jitter(opts, imax, ibad, mesh=None):
244244
if (mesh is None): mesh = jigsaw_msh_t()
245245

246246
#--------- call JIGSAW iteratively; try to improve topology.
247-
OPTS = copy.copy(opts)
247+
OPTS = copy.deepcopy(opts)
248248

249249
done = False
250250

@@ -278,6 +278,9 @@ def jitter(opts, imax, ibad, mesh=None):
278278
mesh.tria3["index"])
279279

280280
ierr = np.abs(vdeg - 6) # err in topo. deg.
281+
282+
ierr[vdeg > 6] = ierr[vdeg > 6] * 2
283+
281284
ierr = ierr[mesh.tria3["index"]]
282285

283286
M = np.sum(ierr, axis=1) >= ibad
@@ -295,19 +298,18 @@ def jitter(opts, imax, ibad, mesh=None):
295298
keep = np.full(
296299
(nvrt), True, dtype=bool)
297300

301+
done = np.all(keep)
302+
298303
#------------------------------ keep nodes far from seam
299304
init = jigsaw_msh_t()
300305
init.point = mesh.point[keep]
301306

302307
savemsh(OPTS.init_file, init)
303308

304-
done = (
305-
np.count_nonzero(keep) == +0)
306-
307309
#------------------------------ call JIGSAW with new ICs
308310
jigsaw(OPTS, mesh)
309311

310-
if (done is True): break
312+
if (done): return
311313

312314
return
313315

@@ -352,7 +354,7 @@ def tetris(opts, nlev, mesh=None):
352354
#---------------------------- call JIGSAW via inc. bisection
353355
SCAL = +2. ** nlev
354356

355-
OPTS = copy.copy(opts)
357+
OPTS = copy.deepcopy(opts)
356358

357359
while (nlev >= +0):
358360

@@ -400,14 +402,14 @@ def tetris(opts, nlev, mesh=None):
400402
njit = round(
401403
3 * (nlev + 1) ** (+5. / 4.))
402404

403-
jitter(OPTS, njit, +1, mesh)
405+
jitter(OPTS, njit, +2, mesh)
404406

405407
else:
406408

407409
njit = round(
408410
3 * (nlev + 1) ** (+5. / 4.))
409411

410-
jitter(OPTS, njit, +1, mesh)
412+
jitter(OPTS, njit, +3, mesh)
411413

412414
nlev = nlev - 1
413415
SCAL = SCAL / 2.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
AUTHOR = "Darren Engwirda"
1313
AUTHOR_EMAIL = "[email protected]"
1414
URL = "https://github.com/dengwirda/"
15-
VERSION = "0.2.0"
15+
VERSION = "0.2.1"
1616
REQUIRES_PYTHON = ">=3.6.0"
1717
KEYWORDS = "Mesh-generation Delaunay Voronoi"
1818

0 commit comments

Comments
 (0)