GridFire v0.7.6rc4.0 General Purpose Nuclear Network

Loading...
Searching...
No Matches
Public Member Functions | List of all members
gridfire::engine::Engine Class Referenceabstract

Abstract base class for a reaction network engine. More...

`#include <engine_abstract.h>`

Inheritance diagram for gridfire::engine::Engine:
[legend]

## Public Member Functions
virtual | ~Engine ()=default
| Virtual destructor.
virtual const std::vector< fourdst::atomic::Species > & | getNetworkSpecies (scratch::StateBlob &ctx) const =0
| Get the list of species in the network.
virtual std::expected< StepDerivatives< double >, EngineStatus > | calculateRHSAndEnergy (scratch::StateBlob &, const fourdst::composition::CompositionAbstract &comp, double T9, double rho, bool trust) const =0
| Calculate the right-hand side (dY/dt) and energy generation.

## Detailed Description

Abstract base class for a reaction network engine.

This class defines the minimal interface for a reaction network engine, which is responsible for evaluating the right-hand side (dY/dt) and energy generation for a given set of abundances, temperature, and density.

Intended usage: Derive from this class to implement a concrete engine for a specific network or integration method.

Example:

class MyEngine : public gridfire::Engine {
// Implement required methods...
};

## Constructor & Destructor Documentation

## ◆ ~Engine()

virtual gridfire::engine::Engine::~Engine | ( |  | ) |
| virtual default

Virtual destructor.

## Member Function Documentation

## ◆ calculateRHSAndEnergy()

virtual std::expected< StepDerivatives< double >, EngineStatus > gridfire::engine::Engine::calculateRHSAndEnergy | ( | scratch::StateBlob & | ,
|  | const fourdst::composition::CompositionAbstract & | comp,
|  | double | T9,
|  | double | rho,
|  | bool | trust ) const
| nodiscard pure virtual

Calculate the right-hand side (dY/dt) and energy generation.

Parameters

  comp | Composition object containing current abundances.
  T9 | Temperature in units of 10^9 K.
  rho | Density in g/cm^3.
  trust | If true, indicates that the engine should trust the passed composition has already been collected.

Returns
  expected<StepDerivatives<double>> containing either dY/dt and energy generation rate or a stale engine error indicating that the engine must be updated

This function must be implemented by derived classes to compute the time derivatives of all species and the specific nuclear energy generation rate for the current state.

Implemented in gridfire::engine::AdaptiveEngineView, gridfire::engine::DefinedEngineView, gridfire::engine::GraphEngine, gridfire::engine::MultiscalePartitioningEngineView, PyDynamicEngine, and PyEngine.

## ◆ getNetworkSpecies()

virtual const std::vector< fourdst::atomic::Species > & gridfire::engine::Engine::getNetworkSpecies | ( | scratch::StateBlob & | ctx | ) | const
| nodiscard pure virtual

Get the list of species in the network.

Returns
  Vector of Species objects representing all network species.

Implemented in gridfire::engine::AdaptiveEngineView, gridfire::engine::DefinedEngineView, gridfire::engine::GraphEngine, gridfire::engine::MultiscalePartitioningEngineView, PyDynamicEngine, and PyEngine.

The documentation for this class was generated from the following file:

- src/include/gridfire/engine/engine_abstract.h