|
GridFire 0.0.1a
General Purpose Nuclear Network
|

GridFire is a C++ library designed to perform general nuclear network evolution using the Reaclib library. It is part of the larger SERiF project within the 4D-STAR collaboration. GridFire is primarily focused on modeling the most relevant burning stages for stellar evolution modeling. Currently, there is limited support for inverse reactions. Therefore, GridFire has a limited set of tools to evolves a fusing plasma in NSE; however, this is not the primary focus of the library and has therefor not had significant development. For those interested in modeling super nova, neutron star mergers, or other high-energy astrophysical phenomena, we strongly recomment using SkyNet.
Design Philosophy and Workflow: GridFire is architected to balance physical fidelity, computational efficiency, and extensibility when simulating complex nuclear reaction networks. Users begin by defining a composition, which is used to construct a full GraphEngine representation of the reaction network. To manage the inherent stiffness and multiscale nature of these networks, GridFire employs a layered view strategy: partitioning algorithms isolate fast and slow processes, adaptive culling removes negligible reactions at runtime, and implicit solvers stably integrate the remaining stiff system. This modular pipeline allows researchers to tailor accuracy versus performance trade-offs, reuse common engine components, and extend screening or partitioning models without modifying core integration routines.
GridFire is a part of the 4D-STAR collaboration.
4D-STAR is funded by European Research Council (ERC) under the Horizon Europe programme (Synergy Grant agreement No. 101071505: 4D-STAR) Work for this project is funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council.
meson-python>=0.15.0Note: Boost is the only external library dependency; no additional libraries are required beyond a C++ compiler, Meson, Python, and Boost.
Note: Windows is not supported at this time and there are no plans to support it in the future. Windows users are encouraged to use WSL2 or a Linux VM.
The Python interface is provided via meson-python and pybind11. To install the Python package:
pyproject.toml.GridFire is organized into a series of composable modules, each responsible for a specific aspect of nuclear reaction network modeling. The core components include:
GraphEngine) that evaluate reaction network rate equations and energy generation.WeakScreening, BareScreening, etc.) affecting reaction rates.GroundStatePartitionFunction, RauscherThielemannPartitionFunction) to weight reaction rates based on nuclear properties.DirectNetworkSolver) for solving the stiff ODE systems arising from reaction networks.Generally a user will start by selecting a base engine (currently we only offer GraphEngine), which constructs the full reaction network graph from a given composition. The user can then apply various engine views to adapt the network topology, such as partitioning fast and slow reactions, adaptively culling low-flow pathways, or priming the network with specific species. Finally, a numerical solver is selected to integrate the network over time, producing updated abundances and diagnostics.
GraphEngine exposes runtime configuration methods to tailor network construction and rate evaluations:
BuildDepthType (Full/Reduced/Minimal): controls network build depth, trading startup time for network completeness.partition::PartitionFunction: custom functor for network partitioning based on Z, A, and T9.BARE, WEAK).| Function Name | Identifier | Description |
|---|---|---|
GroundStatePartitionFunction | "GroundState" | Weights using nuclear ground-state spin factors. |
RauscherThielemannPartitionFunction | "RauscherThielemann" | Interpolates normalized g-factors per Rauscher & Thielemann. |
These functions implement:
The GridFire engine supports multiple engine view strategies to adapt or restrict network topology. Each view implements a specific algorithm:
| View Name | Purpose | Algorithm / Reference | When to Use |
|---|---|---|---|
| AdaptiveEngineView | Dynamically culls low-flow species and reactions during runtime | Iterative flux thresholding to remove reactions below a flow threshold | Large networks to reduce computational cost |
| DefinedEngineView | Restricts the network to a user-specified subset of species and reactions | Static network masking based on user-provided species/reaction lists | Targeted pathway studies or code-to-code comparisons |
| MultiscalePartitioningEngineView | Partitions the network into fast and slow subsets based on reaction timescales | Network partitioning following Hix & Thielemann Silicon Burning I & II (DOI:10.1086/177016,10.1086/306692) | Stiff, multi-scale networks requiring tailored integration |
| NetworkPrimingEngineView | Primes the network with an initial species or set of species for ignition studies | Single-species injection with transient flow analysis | Investigations of ignition triggers or initial seed sensitivities |
These engine views implement the common Engine interface and may be composed in any order to build complex network pipelines. New view types can be added by deriving from the EngineView base class, and linked into the composition chain without modifying core engine code.
Python Extensibility: Through the Python bindings, users can subclass engine view classes directly in Python, override methods like evaluate or generateStoichiometryMatrix, and pass instances back into C++ solvers. This enables rapid prototyping of custom view strategies without touching C++ sources.
GridFire defines a flexible solver architecture through the networkfire::solver::NetworkSolverStrategy interface, enabling multiple ODE integration algorithms to be used interchangeably with any engine that implements the Engine or DynamicEngine contract.
rosenbrock4<double>, optimized for stiff reaction networks with adaptive step size control using configurable absolute and relative tolerances.JacobianFunctor to assemble the Jacobian matrix (∂f/∂Y) at each step, enabling stable implicit integration.RHSManager to compute and cache derivative evaluations and specific energy rates, minimizing redundant computations.absTol, relTol) are read from configuration; Quill logger captures integration diagnostics and step statistics.Y from equilibrated composition.RHSManager and JacobianFunctor.integrate_adaptive advancing until tMax, catching any StaleEngineTrigger to repartition the network and update composition.RHSManager::observe.NetOut with updated composition and diagnostics.These strategies can be developed by inheriting from NetworkSolverStrategy and registering against the same engine types without modifying existing engine code.
More detailed python usage can be found here
A representative workflow often composes multiple engine views to balance accuracy, stability, and performance when integrating stiff nuclear networks:
Workflow Components and Effects:
This layered approach enhances stability for stiff networks while maintaining accuracy and performance.
GridFire integrates with and builds upon several key 4D-STAR libraries:
libcomposition, libconfig, liblogging, and libconstants