Loading...
Searching...
No Matches
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 () const =0
| Get the list of species in the network.
virtual std::expected< StepDerivatives< double >, EngineStatus > | calculateRHSAndEnergy (const fourdst::composition::CompositionAbstract &comp, double T9, double rho) 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 | ( |  | ) |

virtualdefault

Virtual destructor.

## Member Function Documentation

## calculateRHSAndEnergy()

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

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.

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::GraphEngine, gridfire::engine::AdaptiveEngineView, gridfire::engine::DefinedEngineView, gridfire::engine::MultiscalePartitioningEngineView, PyEngine, and PyDynamicEngine.

## getNetworkSpecies()

virtual const std::vector< fourdst::atomic::Species > & gridfire::engine::Engine::getNetworkSpecies | ( |  | ) | const

pure virtual

Get the list of species in the network.

Returns
  Vector of Species objects representing all network species.

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

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

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