Loading...
Searching...
No Matches
gridfire::solver::DirectNetworkSolver Class Referencefinal

A network solver that directly integrates the reaction network ODEs. More...

`#include <solver.h>`

Inheritance diagram for gridfire::solver::DirectNetworkSolver:

## Classes

struct | JacobianFunctor
| Functor for calculating the Jacobian matrix. More...
struct | RHSManager
| Functor for calculating the right-hand side of the ODEs. More...
struct | TimestepContext
| Context for the timestep callback function for the DirectNetworkSolver. More...

## Public Types

using | TimestepCallback = std::function<void(const TimestepContext& context)>
| Type alias for a timestep callback function.

## Public Member Functions

NetOut | evaluate (const NetIn &netIn) override
| Evaluates the network for a given timestep using direct integration.
void | set_callback (const std::any &callback) override
| Sets the callback function to be called at the end of each timestep.
std::vector< std::tuple< std::string, std::string > > | describe_callback_context () const override
| Describe the context that will be passed to the callback function.
Public Member Functions inherited from gridfire::solver::NetworkSolverStrategy< DynamicEngine >
| NetworkSolverStrategy (DynamicEngine &engine)
| Constructor for the NetworkSolverStrategy.
virtual | ~NetworkSolverStrategy ()=default
| Virtual destructor.
| NetworkSolverStrategy (DynamicEngine &engine)
| Constructor for the NetworkSolverStrategy.
virtual | ~NetworkSolverStrategy ()=default
| Virtual destructor.

## Private Attributes

quill::Logger * | m_logger = LogManager::getInstance().getLogger("log")
| Logger instance.
Config & | m_config = Config::getInstance()
| Configuration instance.
TimestepCallback | m_callback

## Additional Inherited Members

Protected Attributes inherited from gridfire::solver::NetworkSolverStrategy< DynamicEngine >
DynamicEngine & | m_engine
| The engine used by this solver strategy.
DynamicEngine & | m_engine
| The engine used by this solver strategy.

## Detailed Description

A network solver that directly integrates the reaction network ODEs.

This solver uses a Runge-Kutta method to directly integrate the reaction network ODEs. It is simpler than the QSENetworkSolver, but it can be less efficient for stiff networks with disparate timescales.

## Member Typedef Documentation

## TimestepCallback

using gridfire::solver::DirectNetworkSolver::TimestepCallback = std::function<void(const TimestepContext& context)>

Type alias for a timestep callback function.

The type alias for the callback function that will be called at the end of each timestep. Type alias for a timestep callback function.

## Member Function Documentation

## describe_callback_context()

std::vector< std::tuple< std::string, std::string > > gridfire::solver::DirectNetworkSolver::describe_callback_context | ( |  | ) | const

overridevirtual

Describe the context that will be passed to the callback function.

Returns
  A vector of tuples, each containing a string for the parameter's name and a string for its type.

This method provides a description of the context that will be passed to the callback function. The intent is that an end user can investigate the context and use this information to craft their own callback function.

Implements gridfire::solver::NetworkSolverStrategy< DynamicEngine >.

## evaluate()

NetOut gridfire::solver::DirectNetworkSolver::evaluate | ( | const NetIn & | netIn | ) |

overridevirtual

Evaluates the network for a given timestep using direct integration.

Parameters

  netIn | The input conditions for the network.

Returns
  The output conditions after the timestep.

Implements gridfire::solver::NetworkSolverStrategy< DynamicEngine >.

## set_callback()

void gridfire::solver::DirectNetworkSolver::set_callback | ( | const std::any & | callback | ) |

overridevirtual

Sets the callback function to be called at the end of each timestep.

Parameters

  callback | The callback function to be called at the end of each timestep.

This function allows the user to set a callback function that will be called at the end of each timestep. The callback function will receive a gridfire::solver::DirectNetworkSolver::TimestepContext object.

Implements gridfire::solver::NetworkSolverStrategy< DynamicEngine >.

## Member Data Documentation

## m_callback

TimestepCallback gridfire::solver::DirectNetworkSolver::m_callback

private

## m_config

Config& gridfire::solver::DirectNetworkSolver::m_config = Config::getInstance()

private

Configuration instance.

## m_logger

quill::Logger* gridfire::solver::DirectNetworkSolver::m_logger = LogManager::getInstance().getLogger("log")

private

Logger instance.

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

- src/include/gridfire/solver/solver.h
- src/lib/solver/solver.cpp