File reaction_settings.hxx#

Functions

inline std::string get_default_data_id(const std::string &reaction_str, const ReactionDataTypes &data_type, const ReactionCoeffTypes &coeff_type)#

Get the default data id for a given reaction data type and reaction string, if one exists. Otherwise return a fixed string indicating no default was found.

Get the default data id for a given reaction data type and reaction string, if it exists. Otherwise return a fixed string indicating no default was found.

Parameters:
  • reaction_str – The reaction string (e.g. “H + e -> H+ + 2e”)

  • data_type – reaction data type enum (e.g. ReactionDataTypes::Amjuel)

  • coeff_type – reaction coefficient type enum (e.g. ReactionCoeffTypes::sigma_v)

Returns:

std::string The corresponding default data id (e.g. “H.2_3.1.8”), or a fixed string if no default is found.

static inline void add_default_id(ReactionDataTypes data_type, const std::string &reaction_str, ReactionCoeffTypes coeff_type, const std::string &data_id)#
static inline void generate_default_data_ids_map()#

Populate a map of default data ids for some of the most frequently used reactions. Removes the need for users to specify data ids in the .inp file in most cases.

static inline std::string get_default_data_ids_str(const std::vector<std::string> reaction_strs, const std::vector<ReactionDataTypes> data_types, const ReactionCoeffTypes coeff_type)#
inline std::vector<std::string> split_csv_str(std::string csv_str)#

Split comma-separated strings of the form (a,b,c,d), removing parentheses and whitespace.

Parameters:

csv_str – input string

Returns:

std::vector<std::string>

inline std::vector<std::string> split_csv_str(std::string csv_str, const std::size_t num_expected, const std::string lbl)#

Split comma-separated strings of the form (a,b,c,d), removing parentheses and whitespace. If the result has num_expected values, return, if it has only one value, duplicate the value num_expected times. If it’s any other size, throw an exception.

Parameters:
  • csv_str – the string to split

  • num_expected – the expected number of values

  • lbl – label used to refer to the string if there’s an error

Returns:

std::vector<std::string>

Variables

static const std::string NO_DATA_ID_DEFAULT_FOUND = "__NO_DEFAULT_ID_FOUND__"#

Helper functions for extracting and processing reaction settings from the options.

String returned if no default data id is found

static std::map<ReactionDataTypes, std::map<std::string, std::map<ReactionCoeffTypes, std::string>>> default_data_ids#

Map of default data ids for each reaction data type and reaction string.

  • First key is the reaction data type

  • Second key is the reaction string

  • Third key is the reaction coefficient type

  • Value is the default data id.