mesa icon indicating copy to clipboard operation
mesa copied to clipboard

Push net/ state into net_info

Open rjfarmer opened this issue 3 years ago • 3 comments

Simplify much of the net memory management by moving net_info components into allocatables instead of pointers, as well as making net_info not a pointer either.

I plan to push more of the net state into net_info so then it becomes easier to pass around the net (For instance making functions take both the temp and n, but n contains the temp anyway so one of these is redundant).

This has also fixed a hard to find bug in burn_const_P which was using (probably) random values for T,Rho as we where accessing the wrong part of an rpar array (which never errored as we had a large work array stuck to the end of rpar which masks the wrong access).

Hopefully by the end of this we can just call net_get(..., rates_only=.true.) and get back the rates for that zone, without having to re-implement half of eval_net

rjfarmer avatar Aug 26 '22 11:08 rjfarmer

whoa! freaking awesome!

fxt44 avatar Aug 26 '22 12:08 fxt44

Test suite https://testhub.mesastar.org/rf%2Fnet_rewrite/commits/246ac13 has only 2 failures for now, which isn't too bad. Though there are several test cases (like https://testhub.mesastar.org/rf%2Fnet_rewrite/test_cases/star/ppisn) that finish in fewer steps and less retires. Which is surprising, I was kinda hoping this would go for no change so we could be more confident i got things right.

So we should be wary of just accepting a passing test suite as it seems some models are changing.

rjfarmer avatar Aug 26 '22 16:08 rjfarmer

running 246ac13b now. happy to dig into some of the test suite cases that may be suspect.

fxt44 avatar Aug 26 '22 16:08 fxt44