# GridFire

## A General Purpose Nuclear Network

A graph-first nuclear network supporting dynamic network topologies. GridFire is intended to be easy to use and very adaptable to a variety of physical situations.

Read the Docs

# Usage

## Introduction

GridFire is written in C++ but we maintain a robust set of Python bindings. These call the underlying C++ code, meaning that they are nearly as performant as the raw C++. Here we provide a short demonstration of how to use GridFire in Python.

## Core Concepts

GridFire separates the network into four main parts.

- Species: These represent individual isotopes, tracking things such as their mass, beta decay energy, quantum numbers, and half-life.
- Reactions: These represent reactions. All reactions from REACLIB, which include only reactant species up to and including iron, are included. Each reaction can evaluate the reaction rate based on the REACLIB formula.
- Engines: Engines encode the underlying physical network. These can be either simplified networks (like `approx8Engine`) or more robust but slower networks (like `GraphEngine`). Engines are not directly evaluated; rather, solvers use engines to find abundances and energies.
- Solvers: Solvers take an engine and know how to integrate it through time. This can either be a simple evaluation of the network topology or it can include more complex approximations such as QSE.

## Python Example

    from gridfire import GraphEngine, DirectSolver, NetIn
    from gridfire.composition import Composition
    baseComposition = Composition(["H-1", "He-4"], [0.7, 0.3])
    engine = GraphEngine(baseComposition)
    solver = DirectSolver(engine)

    inputParams = NetIn(composition, 0.1, 100, 0, 1e17, 1e-16) // (composition, T9, density, intialEnergy, tMax, dt0)
    results = solver.evaluate(inputParams)

## Funding information

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

© 4D-STAR Collaboration.