File reaction_data.hxx#
Defines
-
REACTION_DATA_H#
Typedefs
-
template<typename DerivedType>
using RegisterReactionData = ReactionDataFactory::RegisterInFactory<DerivedType># More concise alias for registering a reaction data type.
Functions
-
std::filesystem::path get_json_db_dir(Options &options)
Get the json database location from options, or default to a standard location in the repo, relative to this header.
============================= Helper functions ============================
- Parameters:
options – Options object
- Returns:
std::filesystem::path the path to the database directory
-
class ReactionData#
- #include <reaction_data.hxx>
Abstract base class that defines the interface for all reaction data objects.
Subclassed by ReactionDataWithCoeffs
Public Functions
-
virtual ~ReactionData() = default#
-
inline explicit ReactionData(ReactionDataTypes type, std::string data_label, std::vector<std::string> metadata_keys = {})#
Construct a new Reaction Data object.
- Parameters:
type – The type of reaction data source (e.g., ADAS, Amjuel)
data_label – Label/ID associated with the dataset (e.g. “H.2_3.1.8” for type=Amjuel)
[optional] – metadata_keys List of keys that a derived class should populate in the metadata map.
-
virtual const std::vector<std::vector<BoutReal>> &get_coeffs() const = 0#
Subclasses must implement retrieval/calculation of coefficients.
- Returns:
const reference to the (1D or) 2D rate coefficients.
-
RateParamsTypes get_fit_type() const#
Get the fit type (e.g. T, nT, ET)
- Returns:
The RateParamsTypes value
-
BoutReal eval_sigma_v_ET(BoutReal E, BoutReal T)#
Evaluate <sigma.v> at a particular energy and temperature.
Subclasses override eval_sigma_v_ET_impl to provide the actual implementation.
- Parameters:
E – a energy
T – a temperature
- Returns:
BoutReal <sigma.v>(E,T)
-
BoutReal eval_sigma_v_T(BoutReal T)#
Evaluate <sigma.v> at a particular density and temperature.
Subclasses override eval_sigma_v_T_impl to provide the actual implementation.
- Parameters:
T – a temperature
- Returns:
BoutReal <sigma.v>(T)
-
BoutReal eval_sigma_v_nT(BoutReal T, BoutReal n)#
Evaluate <sigma.v> at a particular density and temperature.
Subclasses override eval_sigma_v_nT_impl to provide the actual implementation.
- Parameters:
T – a temperature
n – a density
- Returns:
BoutReal <sigma.v>(n,T)
-
BoutReal eval_sigma_vE_nT(BoutReal T, BoutReal n)#
Evaluate <sigma.v.E> at a particular density and temperature.
============================== ReactionData ===============================
Subclasses override eval_sigma_vE_nT_impl to provide the actual implementation.
- Parameters:
T – a temperature
n – a density
- Returns:
BoutReal <sigma.v.E>(n,T)
-
BoutReal get_metadata(const std::string &key) const#
Get a (real-valued) metadata value by key.
-
inline ReactionDataTypes get_type() const#
Get the type of this reaction data (e.g. Amjuel, ADAS)
-
std::string src_str()#
Protected Functions
-
virtual BoutReal eval_sigma_v_ET_impl(BoutReal E, BoutReal T) = 0#
Subclasses provide an implementation of eval_sigma_v_ET.
-
virtual BoutReal eval_sigma_v_T_impl(BoutReal T) = 0#
Subclasses provide an implementation of eval_sigma_v_T.
-
virtual BoutReal eval_sigma_v_nT_impl(BoutReal T, BoutReal n) = 0#
Subclasses provide an implementation of eval_sigma_v_nT.
-
virtual BoutReal eval_sigma_vE_nT_impl(BoutReal T, BoutReal n) = 0#
Subclasses provide an implementation of eval_sigma_vE_nT.
-
inline void set_metadata(const std::string &key, BoutReal value)#
Allow subclasses to set metadata values.
- Parameters:
key –
value –
Protected Attributes
-
RateParamsTypes fit_type = RateParamsTypes::undefined#
The type of parameterization used for the reaction rate fit.
-
const ReactionDataTypes type#
The type of reaction data source.
-
const std::string data_label#
Label/ID associated with the dataset (e.g. “H.2_3.1.8” for type=Amjuel)
-
const std::vector<std::string> metadata_keys#
Private Members
-
std::map<std::string, BoutReal> metadata#
Reaction metadata; only real values supported for now.
-
virtual ~ReactionData() = default#
-
class ReactionDataWithCoeffs : public ReactionData#
- #include <reaction_data.hxx>
Base for reaction data classes that store coefficients.
Subclassed by hermes::AmjuelData
Public Functions
-
explicit ReactionDataWithCoeffs(ReactionDataTypes type, std::string data_label, std::vector<std::string> metadata_keys = {})#
Construct a ReactionDataWithCoeffs object.
========================= ReactionDataWithCoeffs ==========================
- Parameters:
type – The type of reaction data source (e.g., ADAS, Amjuel)
data_label – Label/ID associated with the dataset (e.g. “H.2_3.1.8” for type=Amjuel)
-
virtual const std::vector<std::vector<BoutReal>> &get_coeffs() const final#
Get the coefficients.
- Returns:
const reference to the coefficient matrix
Protected Attributes
-
std::vector<std::vector<BoutReal>> coeffs#
The coefficients for the reaction rate fit.
-
explicit ReactionDataWithCoeffs(ReactionDataTypes type, std::string data_label, std::vector<std::string> metadata_keys = {})#
-
class ReactionDataFactory : public Factory<ReactionData, ReactionDataFactory, const std::string&, Options&, const std::vector<std::string>>#
- #include <reaction_data.hxx>
Factory for creating ReactionData objects.