Open BenWibking opened 2 weeks ago
Since everything is now templated on BurnT
, we should be able to just add an operator()
to the state
object and call it inside rhs
:
https://github.com/AMReX-Astro/Microphysics/blob/533f712d2d217ea4f4063f3a809eb16a839c9ef6/integration/integrator_rhs_strang.H#L25
There is somewhat of a design "impedance mismatch" between Quokka and Microphysics.
I think this can be solved with two straightforward API changes:
actual_rhs
a functor object, andNumSpec
actual_rhs
functor objectThen it should be possible to call any integrator (either BackwardEuler or VODE) with something like:
integrate<NumSpec, F>(F actual_rhs, ...)
from the application code, or from the existing burner. Note that since the type of F is known at compile time, the compiler can inline the function call toactual_rhs()
and there is no performance loss (it is not equivalent to a function pointer).The functor could look like this:
Calling the integrator could look like this:
where the template parameter
F
is deduced by the compiler from the type ofmy_actual_rhs
.For existing Microphysics networks, I think this could be accomplished with code changes only trivial syntactic changes to the generic burner code (although potentially changing a significant number of lines of code). But it would be good to hear from other Microphysics developers on this point.
Background information
cc @chongchonghe @markkrumholz @psharda @zingale