Commit 5d4d53d
committed
fix: stable log_cosh difference and prohibit int_comp with viscous/surface_tension
f_thinc_integral_1d used log_cosh(a+h) - log_cosh(a-h) which suffers
catastrophic cancellation in single precision when h (= beta*n_transverse/2)
is small (interface nearly axis-aligned). Replace with the identity
2*atanh(tanh(a)*tanh(h)), which is algebraically equivalent and numerically
stable at all precisions. Fixes the single-precision CI failure on the
2D and 3D MTHINC WENO tests (5126B21F, 4F3722DB).
Also add validator rules prohibiting int_comp > 0 with viscous=T or
surface_tension=T: the split reconstruction paths in m_rhs prevent
s_thinc_compression from ever running in those cases, so permitting the
combination would silently produce unsharpened results.1 parent 78062e3 commit 5d4d53d
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
59 | 71 | | |
60 | 72 | | |
61 | 73 | | |
| |||
66 | 78 | | |
67 | 79 | | |
68 | 80 | | |
69 | | - | |
| 81 | + | |
70 | 82 | | |
71 | 83 | | |
72 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
394 | 398 | | |
395 | 399 | | |
396 | 400 | | |
| |||
0 commit comments