AMReX-Astro / Microphysics

common astrophysical microphysics routines with interfaces for the different AMReX codes
https://amrex-astro.github.io/Microphysics
Other
35 stars 35 forks source link

regenerate the helmtable without needing std::log10 #1258

Open zingale opened 1 year ago

zingale commented 1 year ago

One of the most expensive parts of the Helmholtz EOS (on GPUs) is taking the log to T, rho each time we need to find the index into the electron table. We should regenerate the table with a different spacing that doesn't require the log. Some ideas are contained in this paper:

https://arxiv.org/abs/2206.08957

and the code appears here:

https://github.com/lanl/singularity-eos/blob/2ea3957cc18cd4709b926f415dd68a8d4daf8821/singularity-eos/base/fast-math/logs.hpp#L38C3-L38C3

This will require us to write a standalone EOS that computes the F-D integrals to tabulate the electron-positron values. This would be nice to have in any case, because it would allow us to sync up the values of the fundamental constants.

BenWibking commented 1 year ago

It might also be possible to replace all of these kinds of tabular interpolations with DNNs. In any case, it would be fun to try.