Repository navigation
Use monotonic cubic Hermite interpolation for the NSE table - #2092
Conversation
this is consistent with our naming convention that test_* tests use a grid of cells.
|
addresses #2072 I need to fix the behavior at the edge of tables. I also need to deal with the species normalization -- we might just want to drop to linear for the species. |
|
I also need to fix the T derivative of the interpolation. Because we are nonlinear, we need to do things in the same order as the original interpolation and for the final interpolation (now rho), we need to limit on the function values, not derivatives, from the second pass. So this would require a new interface. |
|
I did a small run of |
There was a problem hiding this comment.
This makes sense to me. I trust that combining cubic and cubic_deriv leads to less overall work.
| indices of lowest corner of 4x4x4 cube: ir0 = 58, it0 = 16, ic0 = 26 | ||
|
|
||
| cubic interpolation gives: e_nu = -4.353326582e+12 | ||
| cubic interpolation gives: e_nu = 5.481706469e+12 |
There was a problem hiding this comment.
This troublesome state is the only value I've seen vary by more than 2%. Was this value originally negative because of non-monotonic cubic interpolation?
There was a problem hiding this comment.
yes. All the values are positive, so there should never be a negative value.
| std::cout << " 4 rho values: " << std::endl; | ||
|
|
||
| amrex::Real _d[] = {nse_table::abartab(nse_idx(ir0, it0, ic0)), | ||
| amrex::Real _d[] = {nse_table::abartab(nse_idx(ir0-1, it0, ic0)), |
There was a problem hiding this comment.
Is this a different location than before? Previously it0 and ic0 were decremented, now they are not
There was a problem hiding this comment.
I don't see where you mean previously. The point here is that we are just doing a slice in the "rho" direction through the data cube, extracting 4 values.
There was a problem hiding this comment.
For example, here, previously you were extracting the value abartab(nse_idx( nse_get_logrho_index(logrho)-1, nse_get_logT_index(logT)-1, nse_get_ye_index(ye)-1 )) and now you are extracting the value abartab(nse_idx( nse_get_logrho_index(logrho)-1, nse_get_logT_index(logT), nse_get_ye_index(ye) )).
There was a problem hiding this comment.
I see what you mean. What has changed is that for the new cubic, the point lies between [ir0, ir0+1], while in the old method, it lied between [ir0+1, ir0+2]. So I go rid of the subtracting 1, since it was not needed. It does have the side-effect of shifting the point, but I don't think that matters for this test.
This addresses an issue where even if the data were all positive, we could get negative values in the interpolation due to undershoots in the existing cubic interpolation.
There is one downside though -- because the limiting is nonlinear, it no longer guarantees that sum{X_i} = 1.