13#include "SpeciesBase.h"
14#include "PrismConstants.h"
53 Species(
const std::string &
name,
const bool marked_constant =
false);
58 SpeciesId
id()
const {
return _id; }
59 bool markedConstant()
const {
return _marked_constant; }
60 bool isConstant()
const
62 return _unbalanced_rate_based_data.size() + _unbalanced_xsec_based_data.size() == 0 ||
79 return convertToSharedPtr(_rate_based);
90 return convertToSharedPtr(_xsec_based);
101 return convertToSharedPtr(_tabulated_rate_based);
112 return convertToSharedPtr(_function_rate_based);
123 return convertToSharedPtr(_tabulated_xsec_based);
134 return convertToSharedPtr(_function_xsec_based);
147 return _tabulated_rate_based_data;
155 return _function_rate_based_data;
168 return _tabulated_xsec_based_data;
176 return _function_xsec_based_data;
186 return _unbalanced_rate_based_data;
196 return _unbalanced_tabulated_rate_based_data;
206 return _unbalanced_function_rate_based_data;
216 return _unbalanced_xsec_based_data;
226 return _unbalanced_tabulated_xsec_based_data;
236 return _unbalanced_function_xsec_based_data;
239 const std::vector<SubSpecies> &
subSpecies()
const {
return _sub_species; }
241 virtual std::string to_string()
const override;
242 friend std::string to_string(
const std::shared_ptr<prism::Species> & s);
243 friend std::string to_string(
const std::shared_ptr<const prism::Species> & s);
244 friend std::ostream & operator<<(std::ostream & os,
const std::shared_ptr<prism::Species> & s);
245 friend std::ostream & operator<<(std::ostream & os,
246 const std::shared_ptr<const prism::Species> & s);
253 const bool _marked_constant;
255 const std::vector<SubSpecies> _sub_species;
258 std::vector<ReactionData> _rate_based_data;
259 std::vector<ReactionData> _tabulated_rate_based_data;
260 std::vector<ReactionData> _function_rate_based_data;
261 std::vector<ReactionData> _unbalanced_rate_based_data;
262 std::vector<ReactionData> _unbalanced_tabulated_rate_based_data;
263 std::vector<ReactionData> _unbalanced_function_rate_based_data;
264 std::vector<std::weak_ptr<const Reaction>> _rate_based;
265 std::vector<std::weak_ptr<const Reaction>> _tabulated_rate_based;
266 std::vector<std::weak_ptr<const Reaction>> _function_rate_based;
270 std::vector<ReactionData> _xsec_based_data;
271 std::vector<ReactionData> _tabulated_xsec_based_data;
272 std::vector<ReactionData> _function_xsec_based_data;
273 std::vector<ReactionData> _unbalanced_xsec_based_data;
274 std::vector<ReactionData> _unbalanced_tabulated_xsec_based_data;
275 std::vector<ReactionData> _unbalanced_function_xsec_based_data;
276 std::vector<std::weak_ptr<const Reaction>> _xsec_based;
277 std::vector<std::weak_ptr<const Reaction>> _tabulated_xsec_based;
278 std::vector<std::weak_ptr<const Reaction>> _function_xsec_based;
282 void setLatexName()
override;
287 const std::vector<SubSpecies> decomposeSpecies();
289 void setMass()
override;
291 void setCharge()
override;
293 virtual void setNeutralGroundState()
override;
295 const std::vector<std::shared_ptr<const Reaction>>
296 convertToSharedPtr(
const std::vector<std::weak_ptr<const Reaction>> & vec)
const;
298 void setId(SpeciesId
id) { _id =
id; }
303struct std::hash<prism::Species>
Stores all of the data needed to perform calculations with a specific reaction.
Definition Reaction.h:73
const std::string & name() const
Getter method for the name of species.
Definition SpeciesBase.h:33
SpeciesBase(const std::string &name)
Definition SpeciesBase.C:21
The species object which represents the products and reactants in the reaction.
Definition Species.h:47
const std::vector< ReactionData > & tabulatedRateBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:145
Species(const std::string &name, const bool marked_constant=false)
Constructor for the species based on its symbolic representation.
Definition Species.C:23
const std::vector< ReactionData > & xsecBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:161
const std::vector< std::shared_ptr< const Reaction > > functionXSecBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:132
const std::vector< ReactionData > & unbalancedTabulatedRateBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:194
const std::vector< std::shared_ptr< const Reaction > > tabulatedXSecBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:121
const std::vector< SubSpecies > & subSpecies() const
Getter method for the subspecies list.
Definition Species.h:239
SpeciesId id() const
getter for the unique id for the species
Definition Species.h:58
const std::vector< std::shared_ptr< const Reaction > > rateBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:77
const std::vector< ReactionData > & unbalancedFunctionXSecBasedReactionData() const
Getter methods for the reaction data of specific types this species getting the unbalanced data only ...
Definition Species.h:234
const std::vector< ReactionData > & rateBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:140
const std::vector< ReactionData > & unbalancedFunctionRateBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:204
const std::vector< std::shared_ptr< const Reaction > > xsecBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:88
const std::vector< ReactionData > & tabulatedXSecBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:166
const std::vector< std::shared_ptr< const Reaction > > functionRateBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:110
bool operator!=(const Species &other) const
Comparison for checking whether or not the two are not equal.
Definition Species.C:125
const std::vector< std::shared_ptr< const Reaction > > tabulatedRateBasedReactions() const
Getter methods for the reactions of specific types this species is either a product or reactant of Wa...
Definition Species.h:99
friend class SpeciesFactory
The species factory helps add reactionts to our lists.
Definition Species.h:250
const std::vector< ReactionData > & unbalancedTabulatedXSecBasedReactionData() const
Getter methods for the reaction data of specific types this species getting the unbalanced data only ...
Definition Species.h:224
const std::vector< ReactionData > & functionXSecBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:174
const std::vector< ReactionData > & unbalancedXSecBasedReactionData() const
Getter methods for the reaction data of specific types this species getting the unbalanced data only ...
Definition Species.h:214
bool operator==(const Species &other) const
Comparison operator checks if the sub species have the same member variables.
Definition Species.C:103
const std::vector< ReactionData > & unbalancedRateBasedReactionData() const
Getter methods for the reaction data of specific types this species getting the unbalanced data only ...
Definition Species.h:184
const std::vector< ReactionData > & functionRateBasedReactionData() const
Getter methods for the reaction data of specific types this species.
Definition Species.h:153
The parts with a Species can be brokenup into Eg Speices: NH3, SubSpecies: [N, H3].
Definition SubSpecies.h:26
Struct for a quick way to access which reactions the species is in Since we keep track of rate_based ...
Definition Species.h:31
ReactionId id
the id of a given reaction that this species is a part of
Definition Species.h:33
int stoic_coeff
the species stoichiometry for the species in the reaction with the prescribed if
Definition Species.h:36
size_t operator()(const prism::Species &obj) const
Hash method for species hashing is based on the hash of each subspecies the total mass the charge num...