SERiF 0.0.1a
3+1D Stellar Structure and Evolution
|
Represents an entry in the composition with a symbol and mass fraction. More...
#include <composition.h>
Public Member Functions | |
CompositionEntry () | |
Default constructor. | |
CompositionEntry (const std::string &symbol, bool massFracMode=true) | |
Constructs a CompositionEntry with the given symbol and mode. | |
CompositionEntry (const CompositionEntry &entry) | |
Copy constructor. | |
void | setSpecies (const std::string &symbol) |
Sets the species for the composition entry. | |
std::string | symbol () const |
Gets the chemical symbol of the species. | |
double | mass_fraction () const |
Gets the mass fraction of the species. | |
double | mass_fraction (double meanMolarMass) const |
Gets the mass fraction of the species given the mean molar mass. | |
double | number_fraction () const |
Gets the number fraction of the species. | |
double | number_fraction (double totalMoles) const |
Gets the number fraction of the species given the total moles. | |
double | rel_abundance () const |
Gets the relative abundance of the species. | |
serif::atomic::Species | isotope () const |
Gets the isotope of the species. | |
bool | getMassFracMode () const |
Gets the mode of the composition entry. | |
void | setMassFraction (double mass_fraction) |
Sets the mass fraction of the species. | |
void | setNumberFraction (double number_fraction) |
Sets the number fraction of the species. | |
bool | setMassFracMode (double meanMolarMass) |
Sets the mode to mass fraction mode. | |
bool | setNumberFracMode (double totalMoles) |
Sets the mode to number fraction mode. | |
Public Attributes | |
std::string | m_symbol |
The chemical symbol of the species. | |
serif::atomic::Species | m_isotope |
The isotope of the species. | |
bool | m_massFracMode = true |
The mode of the composition entry. True if mass fraction, false if number fraction. | |
double | m_massFraction = 0.0 |
The mass fraction of the species. | |
double | m_numberFraction = 0.0 |
The number fraction of the species. | |
double | m_relAbundance = 0.0 |
The relative abundance of the species for converting between mass and number fractions. | |
bool | m_initialized = false |
True if the composition entry has been initialized. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const CompositionEntry &entry) |
Overloaded output stream operator for CompositionEntry. | |
Represents an entry in the composition with a symbol and mass fraction.
Definition at line 64 of file composition.h.
serif::composition::CompositionEntry::CompositionEntry | ( | ) |
Default constructor.
Definition at line 38 of file composition.cpp.
serif::composition::CompositionEntry::CompositionEntry | ( | const std::string & | symbol, |
bool | massFracMode = true ) |
Constructs a CompositionEntry with the given symbol and mode.
symbol | The chemical symbol of the species. |
massFracMode | True if mass fraction mode, false if number fraction mode. Example Usage: |
Definition at line 42 of file composition.cpp.
serif::composition::CompositionEntry::CompositionEntry | ( | const CompositionEntry & | entry | ) |
Copy constructor.
entry | The CompositionEntry to copy. |
Definition at line 46 of file composition.cpp.
bool serif::composition::CompositionEntry::getMassFracMode | ( | ) | const |
Gets the mode of the composition entry.
Definition at line 142 of file composition.cpp.
serif::atomic::Species serif::composition::CompositionEntry::isotope | ( | ) | const |
Gets the isotope of the species.
Definition at line 104 of file composition.cpp.
double serif::composition::CompositionEntry::mass_fraction | ( | ) | const |
Gets the mass fraction of the species.
Definition at line 71 of file composition.cpp.
double serif::composition::CompositionEntry::mass_fraction | ( | double | meanMolarMass | ) | const |
Gets the mass fraction of the species given the mean molar mass.
meanMolarMass | The mean molar mass. |
Definition at line 78 of file composition.cpp.
double serif::composition::CompositionEntry::number_fraction | ( | ) | const |
Gets the number fraction of the species.
Definition at line 86 of file composition.cpp.
double serif::composition::CompositionEntry::number_fraction | ( | double | totalMoles | ) | const |
Gets the number fraction of the species given the total moles.
totalMoles | The total moles. |
Definition at line 93 of file composition.cpp.
double serif::composition::CompositionEntry::rel_abundance | ( | ) | const |
Gets the relative abundance of the species.
Definition at line 100 of file composition.cpp.
bool serif::composition::CompositionEntry::setMassFracMode | ( | double | meanMolarMass | ) |
Sets the mode to mass fraction mode.
meanMolarMass | The mean molar mass. |
Definition at line 124 of file composition.cpp.
void serif::composition::CompositionEntry::setMassFraction | ( | double | mass_fraction | ) |
Sets the mass fraction of the species.
mass_fraction | The mass fraction to set. |
Definition at line 108 of file composition.cpp.
bool serif::composition::CompositionEntry::setNumberFracMode | ( | double | totalMoles | ) |
Sets the mode to number fraction mode.
totalMoles | The total moles. |
Definition at line 133 of file composition.cpp.
void serif::composition::CompositionEntry::setNumberFraction | ( | double | number_fraction | ) |
Sets the number fraction of the species.
number_fraction | The number fraction to set. |
Definition at line 116 of file composition.cpp.
void serif::composition::CompositionEntry::setSpecies | ( | const std::string & | symbol | ) |
Sets the species for the composition entry.
symbol | The chemical symbol of the species. |
Definition at line 55 of file composition.cpp.
std::string serif::composition::CompositionEntry::symbol | ( | ) | const |
Gets the chemical symbol of the species.
Definition at line 67 of file composition.cpp.
|
friend |
Overloaded output stream operator for CompositionEntry.
os | The output stream. |
entry | The CompositionEntry to output. |
Definition at line 670 of file composition.cpp.
bool serif::composition::CompositionEntry::m_initialized = false |
True if the composition entry has been initialized.
Definition at line 73 of file composition.h.
serif::atomic::Species serif::composition::CompositionEntry::m_isotope |
The isotope of the species.
Definition at line 66 of file composition.h.
bool serif::composition::CompositionEntry::m_massFracMode = true |
The mode of the composition entry. True if mass fraction, false if number fraction.
Definition at line 67 of file composition.h.
double serif::composition::CompositionEntry::m_massFraction = 0.0 |
The mass fraction of the species.
Definition at line 69 of file composition.h.
double serif::composition::CompositionEntry::m_numberFraction = 0.0 |
The number fraction of the species.
Definition at line 70 of file composition.h.
double serif::composition::CompositionEntry::m_relAbundance = 0.0 |
The relative abundance of the species for converting between mass and number fractions.
Definition at line 71 of file composition.h.
std::string serif::composition::CompositionEntry::m_symbol |
The chemical symbol of the species.
Definition at line 65 of file composition.h.