Skip to content

Commit 19eb00f

Browse files
authored
Merge pull request #7 from dengwirda/dev
Update bindings for jigsaw-0.9.14.xx
2 parents de6eba7 + 334014d commit 19eb00f

23 files changed

+1554
-1420
lines changed

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# jigsaw things
2+
*
3+
!/**/
4+
!*.*
5+
*.exe
6+
*.dll
7+
*.so
8+
*.dylib
9+
cache/*.log
10+
cache/*.jig
11+
cache/*.msh
12+
13+
# python things
14+
__pycache__/
15+
*.py[cod]
16+
17+
jigsawpy/_bin/
18+
jigsawpy/_lib/
19+
20+
build/
21+
develop-eggs/
22+
dist/
23+
eggs/
24+
parts/
25+
sdist/
26+
var/
27+
*.egg-info/
28+
.installed.cfg
29+
*.egg
30+
31+
# data files, etc
32+
*.nc
33+
*.grd
34+
*.vtk
35+
*.off
36+
*.obj
37+
*.stl

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
language: python
2+
python:
3+
- 3.6
4+
- 3.7
5+
- 3.8
6+
7+
os: linux
8+
addons:
9+
apt:
10+
sources:
11+
- ubuntu-toolchain-r-test
12+
packages:
13+
- gcc-8
14+
- g++-8
15+
16+
script:
17+
- export CC=gcc-8
18+
- export CXX=g++-8
19+
- python3 setup.py build_external
20+
- python3 setup.py install
21+
- python3 example.py --IDnumber=0
22+
- python3 example.py --IDnumber=1
23+
- python3 example.py --IDnumber=2
24+
- python3 example.py --IDnumber=3
25+
- python3 example.py --IDnumber=4
26+
- python3 example.py --IDnumber=5
27+
- python3 example.py --IDnumber=6
28+
- python3 example.py --IDnumber=7
29+
- python3 example.py --IDnumber=8

external/jigsaw/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# cpp binaries
2+
*
3+
!/**/
4+
!*.*
5+
*.exe
6+
*.dll
7+
*.so
8+
*.dylib
9+

external/jigsaw/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The first step is to compile and configure the code! `JIGSAW` can either be buil
3232

3333
### `Building from src`
3434

35-
The full `JIGSAW` src can be found in <a href="../master/src/">`../jigsaw/src/`</a>. It has been built using various `c++11` conforming versions of the `g++`, `clang++` and `msvc` compilers.
35+
The full `JIGSAW` src can be found in <a href="../master/src/">`../jigsaw/src/`</a>. It has been built using various `c++17` conforming versions of the `g++`, `clang++` and `msvc` compilers.
3636

3737
`JIGSAW` is a `header-only` package - the single main `jigsaw.cpp` file simply `#include`'s the rest of the library directly. `JIGSAW` does not currently dependent on any external packages or libraries.
3838

external/jigsaw/src/hfn_load.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 26 April, 2020
34+
* Last updated: 30 Sept., 2020
3535
*
3636
* Copyright 2013-2020
3737
* Darren Engwirda
@@ -2295,7 +2295,7 @@
22952295
_jlog.push(" \n") ;
22962296

22972297
if (_hfun._ellipsoid_grid_3d._wrap)
2298-
_jlog.push(" PERIODIC = TRUE") ;
2298+
_jlog.push(" PERIODIC = TRUE\n" ) ;
22992299

23002300
}
23012301

external/jigsaw/src/jigsaw.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
* JIGSAW: an unstructured mesh generation library.
4141
--------------------------------------------------------
4242
*
43-
* JIGSAW release 0.9.13.x
44-
* Last updated: 27 July, 2020
43+
* JIGSAW release 0.9.14.x
44+
* Last updated: 30 Sept., 2020
4545
*
4646
* Copyright 2013 -- 2020
4747
* Darren Engwirda
@@ -187,7 +187,7 @@
187187
--------------------------------------------------------
188188
*/
189189

190-
# define __JGSWVSTR "JIGSAW VERSION 0.9.13"
190+
# define __JGSWVSTR "JIGSAW VERSION 0.9.14"
191191

192192
# if defined( USE_NETCDF)
193193
# define __use_netcdf

external/jigsaw/src/libcpp/aabb_tree/aabb_tree_k.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
------------------------------------------------------------
3333
*
34-
* Last updated: 02 April, 2020
34+
* Last updated: 28 Sept., 2020
3535
*
3636
* Copyright 2013-2020
3737
* Darren Engwirda
@@ -589,23 +589,29 @@
589589
_rnod->_pmin[_idim] ;
590590
}
591591

592-
if (_voll + _volr <= this->_vtol * _volp)
592+
if (_voll + _volr <= _volp * this->_vtol)
593593
{
594594
/*--------------- push children due to vol. ratio */
595+
if (_lnum < _cnum && _rnum < _cnum)
596+
{
595597
this->_work
596598
.push_tail(_rnod);
597599
this->_work
598600
.push_tail(_lnod);
599601
}
602+
}
600603

601604
}
602605
else
603606
{
604607
/*--------------- push children due to items cap. */
608+
if (_lnum < _cnum && _rnum < _cnum)
609+
{
605610
this->_work
606611
.push_tail(_rnod);
607612
this->_work
608613
.push_tail(_lnod);
614+
}
609615
}
610616
}
611617

external/jigsaw/src/libcpp/iter_mesh/iter_divs_2.inc

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 14 Sept., 2020
34+
* Last updated: 30 Sept., 2020
3535
*
3636
* Copyright 2013-2020
3737
* Darren Engwirda
@@ -97,10 +97,14 @@
9797
auto _jptr = _mesh.
9898
node().head() + _eptr->node(1);
9999

100-
_cset.set_count(+0);
101-
_cnew.set_count(+0);
102-
_iset.set_count(+0);
103-
_jset.set_count(+0);
100+
_cset.set_count(
101+
0, containers::loose_alloc);
102+
_cnew.set_count(
103+
0, containers::loose_alloc);
104+
_iset.set_count(
105+
0, containers::loose_alloc);
106+
_jset.set_count(
107+
0, containers::loose_alloc);
104108

105109
_mesh.connect_2(
106110
_enum, EDGE2_tag, _cset) ;
@@ -140,7 +144,7 @@
140144

141145
_qinc -= (real_type)+1./2. ;
142146

143-
_qinc /= std::cbrt (_iout) ; // no oscl. wrt. zip
147+
_qinc /= std::sqrt (_iout) ; // no oscl. wrt. zip
144148

145149
}
146150
else
@@ -332,7 +336,8 @@
332336
for (auto _iloc = +0; _iloc != _INUM;
333337
++_iloc )
334338
{
335-
_qtmp.set_count(0) ;
339+
_qtmp.set_count(
340+
+0, containers::loose_alloc);
336341

337342
real_type _minC =
338343
loop_cost( _mesh,
@@ -350,58 +355,59 @@
350355
}
351356

352357
/*--------------------------------- is cost improved? */
353-
_qdst.set_count(0);
358+
_qdst.set_count(
359+
0, containers::loose_alloc) ;
354360

355361
real_type _QMIN =
356362
loop_cost( _mesh,
357-
_cnew, _qdst, cell_kind ()
358-
) ;
363+
_cnew, _qdst, cell_kind()) ;
359364

360365
move_okay( _qdst, _qsrc, _move,
361-
+1.0 , _qinc) ;
366+
std::sqrt( _QLIM) ,
367+
_qinc) ;
362368

363369
if((_okay = _move > 0 &&
364370
_QMIN >= _qmin+_qinc))
365371
{
366372
/*--------------------------------- delete old cavity */
367-
for (auto _cell = _cset.head();
368-
_cell != _cset.tend();
373+
for (auto _cell = _cset.head() ;
374+
_cell != _cset.tend() ;
369375
++_cell )
370376
{
371377
if (_cell->_kind == TRIA3_tag)
372378
{
373379
_mesh.
374-
_pop_tri3(_cell->_cell);
380+
_pop_tri3(_cell->_cell) ;
375381
}
376382
else
377383
if (_cell->_kind == QUAD4_tag)
378384
{
379385
_mesh.
380-
_pop_quad(_cell->_cell);
386+
_pop_quad(_cell->_cell) ;
381387
}
382388
}
383389
}
384390
else
385391
{
386392
/*--------------------------------- delete new cavity */
387-
for (auto _cell = _cnew.head();
388-
_cell != _cnew.tend();
393+
for (auto _cell = _cnew.head() ;
394+
_cell != _cnew.tend() ;
389395
++_cell )
390396
{
391397
if (_cell->_kind == TRIA3_tag)
392398
{
393399
_mesh.
394-
_pop_tri3(_cell->_cell);
400+
_pop_tri3(_cell->_cell) ;
395401
}
396402
else
397403
if (_cell->_kind == QUAD4_tag)
398404
{
399405
_mesh.
400-
_pop_quad(_cell->_cell);
406+
_pop_quad(_cell->_cell) ;
401407
}
402408
}
403409

404-
_mesh._pop_node ( &_inew ) ;
410+
_mesh._pop_node ( &_inew );
405411
}
406412

407413
# undef NULLHINT

external/jigsaw/src/libcpp/iter_mesh/iter_mesh_2.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*
3232
--------------------------------------------------------
3333
*
34-
* Last updated: 12 Sept., 2020
34+
* Last updated: 30 Sept., 2020
3535
*
3636
* Copyright 2013-2020
3737
* Darren Engwirda
@@ -399,7 +399,7 @@
399399
std::min(_0src, *_iter) ;
400400

401401
_msrc += std::pow(
402-
(real_type)1. / *_iter, +7);
402+
(real_type)1. / *_iter, +9);
403403
}
404404
for (auto _iter = _cdst.head(),
405405
_tend = _cdst.tend();
@@ -410,20 +410,20 @@
410410
std::min(_0dst, *_iter) ;
411411

412412
_mdst += std::pow (
413-
(real_type)1. / *_iter, +7);
413+
(real_type)1. / *_iter, +9);
414414
}
415415

416416
_qtol *= std::max(_0src, _zero);
417417

418418
_msrc = std::pow(
419-
_csrc.count() / _msrc, +1./7.) ;
419+
_csrc.count() / _msrc, +1./9.0);
420420
_mdst = std::pow(
421-
_cdst.count() / _mdst, +1./7.) ;
421+
_cdst.count() / _mdst, +1./9.0);
422422

423423
_qtol /=
424-
std::pow(_csrc.count(), 1./7.) ;
424+
std::pow(_csrc.count(), 1./9.0);
425425
_qtol /=
426-
std::pow(_cdst.count(), 1./7.) ;
426+
std::pow(_cdst.count(), 1./9.0);
427427

428428
/*---------------------------- test move = "okay" */
429429
if (_0dst >= _GOOD)
@@ -1653,7 +1653,7 @@
16531653
if (MARKNODE(_enod[0])>_imrk) continue ;
16541654
if (MARKNODE(_enod[1])>_imrk) continue ;
16551655

1656-
if (MARKNODE(_enod[0]) < +0 ||
1656+
if (MARKNODE(_enod[0]) < +0 &&
16571657
MARKNODE(_enod[1]) < +0 ) continue ;
16581658

16591659
if(!_mesh.find_edge(

0 commit comments

Comments
 (0)