feat(GridFire): updated

This commit is contained in:
2026-04-20 12:42:23 -04:00
parent 54d3ec9920
commit e704d5a1a7
4 changed files with 34 additions and 1 deletions

1
.gitignore vendored
View File

@@ -135,4 +135,5 @@ cross/python_includes
*.pdf *.pdf
*pynuc.txt *pynuc.txt
*.dat
*pynucastro_network.py *pynucastro_network.py

View File

@@ -226,7 +226,7 @@ int main(int argc, char** argv) {
solver::PointSolverContext solver_ctx(*blob); solver::PointSolverContext solver_ctx(*blob);
solver::PointSolver solver(engine); solver::PointSolver solver(engine);
solver_ctx.stdout_logging=false; solver_ctx.stdout_logging=true;
double current_time = 180; double current_time = 180;
nlohmann::json j; nlohmann::json j;

View File

@@ -0,0 +1,20 @@
import pynucastro as pyna
def main():
lib = pyna.ReacLibLibrary()
filtered_rates = []
for rate in lib.get_rates():
if all(nuc.Z <= 26 for nuc in rate.reactants):
filtered_rates.append(rate)
out_file = "reaclib_pynucastro_latest_Z26.dat"
with open(out_file, "w") as f:
for rate in filtered_rates:
rate.write_to_file(f)
if __name__ == "__main__":
main()

View File

@@ -58,6 +58,18 @@ those changes get upstreamed into this utility script. It is a key development g
that all of our tools are well documented and easy for non `SERiF` developers that all of our tools are well documented and easy for non `SERiF` developers
to use. to use.
## Pynucastro rates
If you have pynucastro installed you may use the `gen_rates.py` function to generate
a rate file dump. Currently this file filters by Z but you can update this with
arbitrary internal logic. After generating this file run it through format.py with -f bin and -o reactions.bin
and then the bin to header script.
```bash
python ../bin_to_header.py reactions.bin reactions_data.h raw_reaction_data
```
then copy the reactions_data.h files to `GridFire/src/include/gridfire/reactions`
## Citations ## Citations
REACLIB: REACLIB:
- Rauscher, T., Heger, A., Hoffman, R. D., & Woosley, S. E. 2010, ApJS, 189, 240. - Rauscher, T., Heger, A., Hoffman, R. D., & Woosley, S. E. 2010, ApJS, 189, 240.