|
GridFire 0.0.1a
General Purpose Nuclear Network
|
Key struct for the QSE abundance cache. More...
#include <engine_multiscale.h>
Public Member Functions | |
| QSECacheKey (const double T9, const double rho, const std::vector< double > &Y) | |
| Constructs a QSECacheKey. | |
| size_t | hash () const |
| Computes the hash value for this key. | |
| bool | operator== (const QSECacheKey &other) const |
| Equality operator for QSECacheKey. | |
Static Public Member Functions | |
| static long | bin (double value, double tol) |
| Converts a value to a discrete bin based on a tolerance. | |
Public Attributes | |
| double | m_T9 |
| double | m_rho |
| std::vector< double > | m_Y |
| Note that the ordering of Y must match the dynamic species indices in the view. | |
| std::size_t | m_hash = 0 |
| Precomputed hash value for this key. | |
| QSECacheConfig | m_cacheConfig |
Key struct for the QSE abundance cache.
@purpose This struct is used as the key for the QSE abundance cache (m_qse_abundance_cache) within the MultiscalePartitioningEngineView. Its primary goal is to avoid expensive re-partitioning and QSE solves for thermodynamic conditions that are "close enough" to previously computed ones.
@how It works by storing the temperature (m_T9), density (m_rho), and species abundances (m_Y). A pre-computed hash is generated in the constructor by calling the hash() method. This method discretizes the continuous physical values into bins using the tolerances defined in QSECacheConfig. The operator== simply compares the pre-computed hash values for fast lookups in the std::unordered_map.
Definition at line 47 of file engine_multiscale.h.
| gridfire::QSECacheKey::QSECacheKey | ( | const double | T9, |
| const double | rho, | ||
| const std::vector< double > & | Y ) |
Constructs a QSECacheKey.
| T9 | Temperature in units of 10^9 K. |
| rho | Density in g/cm^3. |
| Y | Species molar abundances. |
m_hash member is computed and stored. Definition at line 1556 of file engine_multiscale.cpp.
|
static |
Converts a value to a discrete bin based on a tolerance.
| value | The value to bin. |
| tol | The tolerance (bin width) to use for binning. |
@how The algorithm is floor(value / tol).
Definition at line 1588 of file engine_multiscale.cpp.
| size_t gridfire::QSECacheKey::hash | ( | ) | const |
Computes the hash value for this key.
@how This method combines the hashes of the binned temperature, density, and each species abundance. The bin() static method is used for discretization.
Definition at line 1567 of file engine_multiscale.cpp.
| bool gridfire::QSECacheKey::operator== | ( | const QSECacheKey & | other | ) | const |
Equality operator for QSECacheKey.
| other | The other QSECacheKey to compare to. |
Definition at line 1592 of file engine_multiscale.cpp.
| QSECacheConfig gridfire::QSECacheKey::m_cacheConfig |
Definition at line 55 of file engine_multiscale.h.
| std::size_t gridfire::QSECacheKey::m_hash = 0 |
Precomputed hash value for this key.
Definition at line 52 of file engine_multiscale.h.
| double gridfire::QSECacheKey::m_rho |
Definition at line 49 of file engine_multiscale.h.
| double gridfire::QSECacheKey::m_T9 |
Definition at line 48 of file engine_multiscale.h.
| std::vector<double> gridfire::QSECacheKey::m_Y |
Note that the ordering of Y must match the dynamic species indices in the view.
Definition at line 50 of file engine_multiscale.h.