Loading...
Searching...
No Matches
gridfire::reaction::LogicalReactionSet Class Referencefinal

A collection of LogicalReaction objects. More...

`#include <reaction.h>`

Inheritance diagram for gridfire::reaction::LogicalReactionSet:

## Public Member Functions

| LogicalReactionSet ()=delete
| Deleted default constructor.
| LogicalReactionSet (const ReactionSet &reactionSet)
| Constructs a LogicalReactionSet from a ReactionSet.
size_t | size () const
| Gets the number of logical reactions in the set.
const LogicalReaction & | operator[] (size_t index) const
| Accesses a logical reaction by its index.
Iterators
Provides iterators to loop over the logical reactions in the set.
auto | begin ()
auto | begin () const
auto | end ()
auto | end () const
Public Member Functions inherited from gridfire::reaction::ReactionSet
| ReactionSet (std::vector< Reaction > reactions)
| Constructs a ReactionSet from a vector of reactions.
| ReactionSet (const ReactionSet &other)
| Copy constructor.
ReactionSet & | operator= (const ReactionSet &other)
| Copy assignment operator.
virtual | ~ReactionSet ()=default
| Virtual destructor.
virtual void | add_reaction (Reaction reaction)
| Adds a reaction to the set.
virtual void | remove_reaction (const Reaction &reaction)
| Removes a reaction from the set.
bool | contains (const std::string_view &id) const
| Checks if the set contains a reaction with the given ID.
bool | contains (const Reaction &reaction) const
| Checks if the set contains the given reaction.
void | clear ()
| Removes all reactions from the set.
bool | contains_species (const fourdst::atomic::Species &species) const
| Checks if any reaction in the set involves the given species.
bool | contains_reactant (const fourdst::atomic::Species &species) const
| Checks if any reaction in the set contains the given species as a reactant.
bool | contains_product (const fourdst::atomic::Species &species) const
| Checks if any reaction in the set contains the given species as a product.
const Reaction & | operator[] (const std::string_view &id) const
| Accesses a reaction by its ID.
bool | operator== (const ReactionSet &other) const
| Compares this set with another for equality.
bool | operator!= (const ReactionSet &other) const
| Compares this set with another for inequality.
uint64_t | hash (uint64_t seed=0) const
| Computes a hash for the entire set.
auto | begin ()
auto | begin () const
auto | end ()
auto | end () const

## Private Attributes

quill::Logger * | m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")
std::vector< LogicalReaction > | m_reactions
std::string | m_id
std::unordered_map< std::string, LogicalReaction > | m_reactionNameMap
| Maps reaction IDs to LogicalReaction objects for quick lookup.

## Detailed Description

A collection of LogicalReaction objects.

This class takes a `ReactionSet` and groups individual `Reaction` objects into `LogicalReaction` objects based on their `peName`. This provides a view of the network where all rates for the same physical process are combined.

Definition at line 554 of file reaction.h.

## Constructor & Destructor Documentation

## LogicalReactionSet() [1/2]

gridfire::reaction::LogicalReactionSet::LogicalReactionSet | ( |  | ) |

delete

Deleted default constructor.

## LogicalReactionSet() [2/2]

gridfire::reaction::LogicalReactionSet::LogicalReactionSet | ( | const ReactionSet & | reactionSet | ) |

explicit

Constructs a LogicalReactionSet from a ReactionSet.

Parameters

  reactionSet | The set of individual reactions to group.

This constructor iterates through the provided `ReactionSet`, groups reactions by their `peName`, and creates a `LogicalReaction` for each group.

Definition at line 347 of file reaction.cpp.

## Member Function Documentation

## begin() [1/2]

auto gridfire::reaction::LogicalReactionSet::begin | ( |  | ) |

inline

Definition at line 573 of file reaction.h.

## begin() [2/2]

auto gridfire::reaction::LogicalReactionSet::begin | ( |  | ) | const

inlinenodiscard

Definition at line 574 of file reaction.h.

## end() [1/2]

auto gridfire::reaction::LogicalReactionSet::end | ( |  | ) |

inline

Definition at line 575 of file reaction.h.

## end() [2/2]

auto gridfire::reaction::LogicalReactionSet::end | ( |  | ) | const

inlinenodiscard

Definition at line 576 of file reaction.h.

## operator[]()

const LogicalReaction & gridfire::reaction::LogicalReactionSet::operator[] | ( | size_t | index | ) | const

inlinenodiscardvirtual

Accesses a logical reaction by its index.

Parameters

  index | The index of the logical reaction.

Returns
  A const reference to the LogicalReaction.

Reimplemented from gridfire::reaction::ReactionSet.

Definition at line 590 of file reaction.h.

## size()

size_t gridfire::reaction::LogicalReactionSet::size | ( |  | ) | const

inlinenodiscardvirtual

Gets the number of logical reactions in the set.

Returns
  The size of the set.

Reimplemented from gridfire::reaction::ReactionSet.

Definition at line 583 of file reaction.h.

## Member Data Documentation

## m_id

std::string gridfire::reaction::LogicalReactionSet::m_id

private

Definition at line 594 of file reaction.h.

## m_logger

quill::Logger* gridfire::reaction::LogicalReactionSet::m_logger = fourdst::logging::LogManager::getInstance().getLogger("log")

private

Definition at line 592 of file reaction.h.

## m_reactionNameMap

std::unordered_map<std::string, LogicalReaction> gridfire::reaction::LogicalReactionSet::m_reactionNameMap

private

Maps reaction IDs to LogicalReaction objects for quick lookup.

Definition at line 595 of file reaction.h.

## m_reactions

std::vector<LogicalReaction> gridfire::reaction::LogicalReactionSet::m_reactions

private

Definition at line 593 of file reaction.h.

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

- src/network/include/gridfire/reaction/reaction.h
- src/network/lib/reaction/reaction.cpp