|
29 | 29 | * way whatsoever. This code is provided "as-is" to be |
30 | 30 | * used at your own risk. |
31 | 31 | * |
| 32 | + -------------------------------------------------------- |
| 33 | + * |
| 34 | + * Last updated: 24 January, 2019 |
| 35 | + * |
| 36 | + * Copyright 2013-2019 |
| 37 | + * Darren Engwirda |
| 38 | + |
| 39 | + * https://github.com/dengwirda/ |
| 40 | + * |
32 | 41 | -------------------------------------------------------- |
33 | 42 | * |
34 | 43 | * This class defines the basic "restricted" delaunay |
|
44 | 53 | * Procedia Engineering, 163, pp. 84-96, |
45 | 54 | * http://dx.doi.org/10.1016/j.proeng.2016.11.024 |
46 | 55 | * |
47 | | - * D. Engwirda, (2014): "Locally-optimal Delaunay- |
48 | | - * refinement and optimisation-based mesh generation", |
49 | | - * Ph.D. Thesis, School of Mathematics and Statistics, |
50 | | - * Univ. of Sydney. |
| 56 | + * D. Engwirda, (2014): "Locally-optimal Delaunay- |
| 57 | + * refinement and optimisation-based mesh generation", |
| 58 | + * Ph.D. Thesis, School of Mathematics and Statistics, |
| 59 | + * Univ. of Sydney. |
51 | 60 | * http://hdl.handle.net/2123/13148 |
52 | 61 | * |
53 | 62 | * building on various previous works on rDT methods, |
|
128 | 137 | __normal_call double half_sign ( |
129 | 138 | __const_ptr (double) _pp, |
130 | 139 | __const_ptr (double) _pa, |
131 | | - __const_ptr (double) _pb, |
132 | | - double _rt |
| 140 | + __const_ptr (double) _pb |
133 | 141 | ) |
134 | 142 | { |
135 | 143 | /*-------- helper: eval. sign w.r.t. half-plane [a,b] */ |
|
155 | 163 | _ab[0] * _mp[0] + |
156 | 164 | _ab[1] * _mp[1] ; |
157 | 165 |
|
158 | | - if (_dp < -2.0 * _rt || |
159 | | - _dp > +2.0 * _rt ) |
160 | 166 | return ((double) _dp ); |
161 | | - |
162 | | - /*-------- fall-back to double-double if near to zero */ |
163 | | - dd_flt _PM[2]; |
164 | | - _PM[0] = _pa[0] * 0.5 ; |
165 | | - _PM[1] = _pa[1] * 0.5 ; |
166 | | - _PM[0]+= _pb[0] * 0.5 ; |
167 | | - _PM[1]+= _pb[1] * 0.5 ; |
168 | | - |
169 | | - dd_flt _AB[2]; |
170 | | - _AB[0] = _pb[0] ; |
171 | | - _AB[1] = _pb[1] ; |
172 | | - _AB[0]-= _pa[0] ; |
173 | | - _AB[1]-= _pa[1] ; |
174 | | - |
175 | | - dd_flt _MP[2]; |
176 | | - _MP[0] = _pp[0] ; |
177 | | - _MP[1] = _pp[1] ; |
178 | | - _MP[0]-= _pm[0] ; |
179 | | - _MP[1]-= _pm[1] ; |
180 | | - |
181 | | - dd_flt _DP = |
182 | | - _AB[0] * _MP[0] + |
183 | | - _AB[1] * _MP[1] ; |
184 | | - |
185 | | - return ((double) _DP ); |
186 | 167 | } |
187 | 168 |
|
188 | 169 | template < |
|
222 | 203 | _BPOS[1] = _mesh. |
223 | 204 | _tria.node(_bnod)->pval(1) ; |
224 | 205 |
|
225 | | - double _sign = +0.0; |
| 206 | + double _sign = +0.0 ; |
226 | 207 | if (_bnod > _anod) |
227 | 208 | _sign = + half_sign ( |
228 | 209 | (double*) _PPOS, |
229 | 210 | (double*) _APOS, |
230 | | - (double*) _BPOS, |
231 | | - (double ) _rtol) ; |
| 211 | + (double*) _BPOS) ; |
232 | 212 | else |
233 | 213 | _sign = - half_sign ( |
234 | 214 | (double*) _PPOS, |
235 | 215 | (double*) _BPOS, |
236 | | - (double*) _APOS, |
237 | | - (double ) _rtol) ; |
| 216 | + (double*) _APOS) ; |
238 | 217 |
|
| 218 | + /*-------- "fatten" dual cavity to filter imprecision */ |
239 | 219 | if (_sign >= -_rtol && |
240 | 220 | _sign <= +_rtol) |
241 | 221 | _safe = false; |
|
265 | 245 | iptr_type &_part |
266 | 246 | ) |
267 | 247 | { |
268 | | - real_type const _rEPS = |
| 248 | + real_type static const _rEPS = |
269 | 249 | std::pow(std::numeric_limits |
270 | 250 | <real_type>::epsilon(),+.67); |
271 | 251 |
|
|
417 | 397 | _pred._list.tend() ; |
418 | 398 | ++_iter ) |
419 | 399 | { |
420 | | - if (clip_dual(_mesh, _hset , |
421 | | - &_iter->pval( 0), _safe, |
422 | | - _RTOL) ) |
| 400 | + if (clip_dual( _mesh, _hset , |
| 401 | + &_iter->pval( 0), |
| 402 | + _safe, _RTOL) ) |
423 | 403 | { |
424 | 404 | /*--------------------------- dist to face circumball */ |
425 | 405 | real_type _dsqr = |
426 | 406 | geometry::lensqr_2d( |
427 | 407 | _ebal , |
428 | 408 | &_iter->pval( 0)) ; |
429 | 409 |
|
430 | | - if(!_safe && _dsqr > _RTOL) |
| 410 | + real_type _dtol = |
| 411 | + (real_type) 1./3. * _ebal[2] ; |
| 412 | + |
| 413 | + if(!_safe && _dsqr > _dtol) |
431 | 414 | /*--------------------------- prune near-degeneracies */ |
432 | 415 | continue ; |
433 | 416 |
|
|
0 commit comments