|
GridFire v0.7.1_rc2
General Purpose Nuclear Network
|
Namespaces | |
| namespace | diagnostics |
Classes | |
| class | AdaptiveEngineView |
| An engine view that dynamically adapts the reaction network based on runtime conditions. More... | |
| class | DefinedEngineView |
| class | DynamicEngine |
| Abstract class for engines supporting Jacobian and stoichiometry operations. More... | |
| struct | EnergyDerivatives |
| Structure holding derivatives of energy generation rate with respect to T and rho. More... | |
| class | Engine |
| Abstract base class for a reaction network engine. More... | |
| class | EngineView |
| Abstract base class for a "view" of a reaction network engine. More... | |
| class | FileDefinedEngineView |
| class | GraphEngine |
| A reaction network engine that uses a graph-based representation. More... | |
| class | MultiscalePartitioningEngineView |
| An engine view that partitions the reaction network into multiple groups based on timescales. More... | |
| class | NetworkJacobian |
| A wrapper class for handling the network Jacobian matrix. More... | |
| class | NetworkPrimingEngineView |
| Provides a view of a DynamicEngine filtered to reactions involving a specified priming species. More... | |
| struct | PrimingReport |
| Captures the result of a network priming operation. More... | |
| struct | StepDerivatives |
| Structure holding derivatives and energy generation for a network step. More... | |
Concepts | |
| concept | EngineType |
| Concept for types allowed as engine bases in EngineView. | |
Typedefs | |
| using | SparsityPattern = std::vector< std::pair< size_t, size_t > > |
| Type alias for sparsity pattern representation. | |
| typedef CppAD::AD< double > | ADDouble |
| Alias for CppAD AD type for double precision. | |
| using | BuildDepthType = std::variant< NetworkBuildDepth, int > |
| Variant specifying either a predefined NetworkBuildDepth or a custom integer depth. | |
| using | JacobianEntry = std::pair< std::pair< fourdst::atomic::Species, fourdst::atomic::Species >, double > |
| Represents an entry in the Jacobian matrix. | |
Enumerations | |
| enum class | EngineStatus { OKAY , STALE , ERROR , COUNT } |
| Enumeration of possible engine statuses. More... | |
| enum class | NetworkConstructionFlags : uint32_t { NONE = 0 , REACLIB_STRONG = 1 << 0 , WRL_BETA_MINUS = 1 << 1 , WRL_BETA_PLUS = 1 << 2 , WRL_ELECTRON_CAPTURE = 1 << 3 , WRL_POSITRON_CAPTURE = 1 << 4 , REACLIB_WEAK = 1 << 5 , WRL_WEAK = WRL_BETA_MINUS | WRL_BETA_PLUS | WRL_ELECTRON_CAPTURE | WRL_POSITRON_CAPTURE , REACLIB = REACLIB_STRONG | REACLIB_WEAK , DEFAULT = REACLIB } |
| Flags to specify which types of nuclear reactions to include when constructing a reaction network. More... | |
| enum class | NetworkBuildDepth { Full = -1 , Shallow = 1 , SecondOrder = 2 , ThirdOrder = 3 , FourthOrder = 4 , FifthOrder = 5 } |
| Specifies supported depths for building the reaction network. More... | |
| enum class | EngineTypes { GRAPH_ENGINE , ADAPTIVE_ENGINE_VIEW , MULTISCALE_PARTITIONING_ENGINE_VIEW , PRIMING_ENGINE_VIEW , DEFINED_ENGINE_VIEW , FILE_DEFINED_ENGINE_VIEW } |
| Enumeration of different engine types available in GridFire. More... | |
| enum class | PrimingReportStatus { SUCCESS , ALREADY_PRIMED , SOLVER_FAILURE } |
| Enumerates outcome codes for a network priming operation. More... | |
| enum class | SpeciesStatus { ACTIVE , EQUILIBRIUM , INACTIVE_FLOW , NOT_PRESENT } |
| Enumerates the status of a species in the simulation. More... | |
Functions | |
| constexpr std::string_view | EngineStatus_to_string (const EngineStatus status) |
| Convert EngineStatus enum to string representation. | |
| constexpr auto | to_underlying (NetworkConstructionFlags f) noexcept |
| Helper function to convert NetworkConstructionFlags to their underlying integer type. | |
| NetworkConstructionFlags | operator| (const NetworkConstructionFlags lhs, const NetworkConstructionFlags rhs) |
| Bitwise OR operator for NetworkConstructionFlags. | |
| NetworkConstructionFlags | operator& (const NetworkConstructionFlags lhs, const NetworkConstructionFlags rhs) |
| Bitwise AND operator for NetworkConstructionFlags. | |
| bool | has_flag (const NetworkConstructionFlags flags, const NetworkConstructionFlags flag_to_check) |
| Checks if a specific flag is set within a NetworkConstructionFlags value. | |
| std::string | NetworkConstructionFlagsToString (NetworkConstructionFlags flags) |
| Converts NetworkConstructionFlags to a human-readable string. | |
| reaction::ReactionSet | build_nuclear_network (const fourdst::composition::CompositionAbstract &composition, const rates::weak::WeakRateInterpolator &weakInterpolator, BuildDepthType maxLayers=NetworkBuildDepth::Full, NetworkConstructionFlags ReactionTypes=NetworkConstructionFlags::DEFAULT) |
| Builds a nuclear reaction network from the Reaclib library based on an initial composition. | |
| PrimingReport | primeNetwork (const NetIn &netIn, GraphEngine &engine, const std::optional< std::vector< reaction::ReactionType > > &ignoredReactionTypes) |
| Primes absent species in the network to their equilibrium abundances. | |
| constexpr std::string_view | engine_type_to_string (const EngineTypes type) |
| Converts an EngineTypes enum value to its corresponding string representation. | |
| NetworkJacobian | regularize_jacobian (const NetworkJacobian &jacobian, const fourdst::composition::CompositionAbstract &comp, std::optional< quill::Logger * > logger=std::nullopt) |
| Regularizes the given Jacobian matrix based on the provided composition. | |
| std::string | SpeciesStatus_to_string (const SpeciesStatus status) |
| Convert a SpeciesStatus enum value to its string representation. | |
| NetworkJacobian | regularize_jacobian (const NetworkJacobian &jacobian, const fourdst::composition::CompositionAbstract &comp, const std::optional< quill::Logger * > logger) |
Variables | |
| static constexpr double | MIN_DENSITY_THRESHOLD = 1e-18 |
| Minimum density threshold below which reactions are ignored. | |
| static constexpr double | MIN_ABUNDANCE_THRESHOLD = 1e-18 |
| Minimum abundance threshold below which species are ignored. | |
| static constexpr double | MIN_JACOBIAN_THRESHOLD = 1e-24 |
| Minimum value for Jacobian matrix entries. | |
| constexpr double | MIN_ABUNDANCE_TO_CONTRIBUTE_TO_JACOBIAN = 1e-100 |
| Minimum abundance for a species to contribute to the Jacobian. | |
| std::map< PrimingReportStatus, std::string > | PrimingReportStatusStrings |
| Mapping from PrimingReportStatus codes to human-readable strings. | |
| typedef CppAD::AD<double> gridfire::engine::ADDouble |
Alias for CppAD AD type for double precision.
This alias simplifies the use of the CppAD automatic differentiation type.
Variant specifying either a predefined NetworkBuildDepth or a custom integer depth.
| using gridfire::engine::JacobianEntry = typedef std::pair<std::pair<fourdst::atomic::Species, fourdst::atomic::Species>, double> |
Represents an entry in the Jacobian matrix.
| using gridfire::engine::SparsityPattern = typedef std::vector<std::pair<size_t, size_t> > |
Type alias for sparsity pattern representation.
|
strong |
|
strong |
Enumeration of different engine types available in GridFire.
Values:
| Enumerator | |
|---|---|
| GRAPH_ENGINE | |
| ADAPTIVE_ENGINE_VIEW | |
| MULTISCALE_PARTITIONING_ENGINE_VIEW | |
| PRIMING_ENGINE_VIEW | |
| DEFINED_ENGINE_VIEW | |
| FILE_DEFINED_ENGINE_VIEW | |
|
strong |
Specifies supported depths for building the reaction network.
Values:
| Enumerator | |
|---|---|
| Full | |
| Shallow | |
| SecondOrder | |
| ThirdOrder | |
| FourthOrder | |
| FifthOrder | |
|
strong |
Flags to specify which types of nuclear reactions to include when constructing a reaction network.
These flags allow fine-grained control over the inclusion of strong and weak nuclear reactions (beta decay, electron/positron capture) from various sources (Reaclib, WRL) during network construction. They can be combined using bitwise operations to create custom reaction sets.
| Enumerator | |
|---|---|
| NONE | |
| REACLIB_STRONG | |
| WRL_BETA_MINUS | |
| WRL_BETA_PLUS | |
| WRL_ELECTRON_CAPTURE | |
| WRL_POSITRON_CAPTURE | |
| REACLIB_WEAK | |
| WRL_WEAK | |
| REACLIB | |
| DEFAULT | |
|
strong |
Enumerates outcome codes for a network priming operation.
These status codes indicate the reason for success or failure of the priming process:
| Enumerator | |
|---|---|
| SUCCESS | |
| ALREADY_PRIMED | |
| SOLVER_FAILURE | |
|
strong |
Enumerates the status of a species in the simulation.
These status codes indicate the current state of a species:
| Enumerator | |
|---|---|
| ACTIVE | |
| EQUILIBRIUM | |
| INACTIVE_FLOW | |
| NOT_PRESENT | |
| ReactionSet gridfire::engine::build_nuclear_network | ( | const fourdst::composition::CompositionAbstract & | composition, |
| const rates::weak::WeakRateInterpolator & | weakInterpolator, | ||
| BuildDepthType | maxLayers = NetworkBuildDepth::Full, |
||
| NetworkConstructionFlags | ReactionTypes = NetworkConstructionFlags::DEFAULT |
||
| ) |
Builds a nuclear reaction network from the Reaclib library based on an initial composition.
Constructs a layered reaction network by collecting reactions up to the specified depth from the Reaclib dataset. Starting species are those with non-zero mass fractions in the input composition. Layers expand by including products of collected reactions until the depth limit. Optionally selects reverse reactions instead of forward.
See implementation in construction.cpp for details on the layering algorithm, logging, and performance.
| composition | Mapping of isotopic species to their mass fractions; species with positive mass fraction seed the network. |
| weakInterpolator | Interpolator to build weak rates from. Must be constructed and owned by the caller. |
| maxLayers | Variant specifying either a predefined NetworkBuildDepth or a custom integer depth; negative depth (Full) collects all reactions, zero is invalid. |
| ReactionTypes |
| std::logic_error | If the resolved network depth is zero (no reactions can be collected). |
|
constexpr |
Converts an EngineTypes enum value to its corresponding string representation.
| type | The EngineTypes enum value to convert. |
|
constexpr |
Convert EngineStatus enum to string representation.
| status | The EngineStatus value to convert. |
|
inline |
Checks if a specific flag is set within a NetworkConstructionFlags value.
This function determines whether a particular flag is present in a given NetworkConstructionFlags value.
| flags | The NetworkConstructionFlags value to check. |
| flag_to_check | The specific flag to look for. |
|
inline |
Converts NetworkConstructionFlags to a human-readable string.
This function generates a comma-separated string representation of the set flags within a NetworkConstructionFlags value. If no flags are set, it returns "No reactions".
| flags | The NetworkConstructionFlags value to convert. |
|
inline |
Bitwise AND operator for NetworkConstructionFlags.
This operator allows checking for common flags between two NetworkConstructionFlags values using the bitwise AND operation.
| lhs | The left-hand side NetworkConstructionFlags value. |
| rhs | The right-hand side NetworkConstructionFlags value. |
|
inline |
Bitwise OR operator for NetworkConstructionFlags.
This operator allows combining two NetworkConstructionFlags values using the bitwise OR operation.
| lhs | The left-hand side NetworkConstructionFlags value. |
| rhs | The right-hand side NetworkConstructionFlags value. |
| PrimingReport gridfire::engine::primeNetwork | ( | const NetIn & | netIn, |
| GraphEngine & | engine, | ||
| const std::optional< std::vector< reaction::ReactionType > > & | ignoredReactionTypes | ||
| ) |
Primes absent species in the network to their equilibrium abundances.
Executes a network priming algorithm that iteratively rebuilds the reaction network, calculates equilibrium mass fractions for species with zero initial abundance, and applies mass transfers based on reaction flows.
Refer to priming.cpp for implementation details on logging, algorithmic steps, and error handling.
| netIn | Input network data containing initial composition, temperature, and density. |
| engine | DynamicEngine used to build and evaluate the reaction network. |
| ignoredReactionTypes | Types of reactions to ignore during priming (e.g., weak reactions). |
| NetworkJacobian gridfire::engine::regularize_jacobian | ( | const NetworkJacobian & | jacobian, |
| const fourdst::composition::CompositionAbstract & | comp, | ||
| const std::optional< quill::Logger * > | logger | ||
| ) |
| NetworkJacobian gridfire::engine::regularize_jacobian | ( | const NetworkJacobian & | jacobian, |
| const fourdst::composition::CompositionAbstract & | comp, | ||
| std::optional< quill::Logger * > | logger = std::nullopt |
||
| ) |
Regularizes the given Jacobian matrix based on the provided composition.
This function applies regularization techniques to the Jacobian matrix to improve its numerical stability. Specifically any (row, column) entries corresponding to species who's abundance is below a threshold of MIN_ABUNDANCE_TO_CONTRIBUTE_TO_JACOBIAN in the provided composition will be set to zero if those entries were either infinite or NaN.
| jacobian | The NetworkJacobian to be regularized. |
| comp | The composition used for regularization. |
| logger | Optional logger for logging regularization steps and information. |
|
inline |
Convert a SpeciesStatus enum value to its string representation.
| status | The SpeciesStatus value to convert. |
|
constexprnoexcept |
Helper function to convert NetworkConstructionFlags to their underlying integer type.
This function facilitates bitwise operations on NetworkConstructionFlags by converting them to their underlying integer representation.
| f | The NetworkConstructionFlags value to convert. |
|
staticconstexpr |
Minimum abundance threshold below which species are ignored.
Species with abundances below this threshold are treated as zero in reaction rate calculations. This helps to improve performance by avoiding unnecessary calculations for trace species.
|
constexpr |
Minimum abundance for a species to contribute to the Jacobian.
|
staticconstexpr |
Minimum density threshold below which reactions are ignored.
Reactions are not calculated if the density falls below this threshold. This helps to improve performance by avoiding unnecessary calculations in very low-density regimes.
|
staticconstexpr |
Minimum value for Jacobian matrix entries.
Jacobian matrix entries with absolute values below this threshold are treated as zero to maintain sparsity and improve performance.
|
inline |
Mapping from PrimingReportStatus codes to human-readable strings.
Used when formatting or logging the priming status. No preconditions. The map contains entries for all PrimingReportStatus values.