Loading...
Searching...
No Matches
fourdst::composition::MaskedComposition Class Referencefinal

`#include <composition_masked.h>`

Inheritance diagram for fourdst::composition::MaskedComposition:
[legend]
Collaboration diagram for fourdst::composition::MaskedComposition:
[legend]

## Public Types

using | iterator = detail::CompositionIterator<false>
using | const_iterator = detail::CompositionIterator<true>
Public Types inherited from fourdst::composition::CompositionAbstract
using | iterator = detail::CompositionIterator<false>
using | const_iterator = detail::CompositionIterator<true>

## Public Member Functions

| MaskedComposition (const CompositionAbstract &baseComposition, const std::vector< atomic::Species > &activeSpecies)
bool | contains (const atomic::Species &species) const noexcept override
| Check if the composition contains the given species.
bool | contains (const std::string &symbol) const override
| Check if the composition contains the given species.
const std::vector< atomic::Species > & | getRegisteredSpecies () const noexcept override
| Get all registered atomic species in the composition.
std::set< std::string > | getRegisteredSymbols () const noexcept override
| Get all registered chemical symbols in the composition.
size_t | size () const noexcept override
std::unordered_map< atomic::Species, double > | getMassFraction () const noexcept override
| Get the mass fraction for all registered symbols.
std::unordered_map< atomic::Species, double > | getNumberFraction () const noexcept override
| Get the number fraction for all registered symbols.
double | getMassFraction (const std::string &symbol) const override
| Get the mass fraction for a given symbol.
double | getMassFraction (const atomic::Species &species) const override
| Get the mass fraction for a given species.
double | getNumberFraction (const std::string &symbol) const override
| Get the number fraction for a given symbol.
double | getNumberFraction (const atomic::Species &species) const override
| Get the number fraction for a given species.
double | getMolarAbundance (const std::string &symbol) const override
| Get the molar abundance for a given symbol.
double | getMolarAbundance (const atomic::Species &species) const override
| Get the molar abundance for a given species.
double | getMeanParticleMass () const noexcept override
| Get the mean particle mass of the composition.
double | getElectronAbundance () const noexcept override
| Get the electron abundance of the composition.
std::vector< double > | getMassFractionVector () const noexcept override
| Get the mass fraction as a vector.
std::vector< double > | getNumberFractionVector () const noexcept override
| Get the number fraction as a vector.
std::vector< double > | getMolarAbundanceVector () const noexcept override
| Get the molar abundance as a vector.
size_t | getSpeciesIndex (const std::string &symbol) const override
| Get the index of a species by symbol.
size_t | getSpeciesIndex (const atomic::Species &species) const override
| Get the index of a species.
atomic::Species | getSpeciesAtIndex (size_t index) const override
| Get the species at a given index.
std::unique_ptr< CompositionAbstract > | clone () const override
iterator | begin () override
iterator | end () override
const_iterator | begin () const override
const_iterator | end () const override
size_t | hash () const override
Public Member Functions inherited from fourdst::composition::CompositionDecorator
| CompositionDecorator (std::unique_ptr< CompositionAbstract > decorator)
Public Member Functions inherited from fourdst::composition::CompositionAbstract
virtual | ~CompositionAbstract ()=default
| Virtual destructor.

## Private Attributes

std::vector< atomic::Species > | m_activeSpecies
std::vector< double > | m_molarAbundances

## Additional Inherited Members

Protected Attributes inherited from fourdst::composition::CompositionDecorator
std::unique_ptr< CompositionAbstract > | m_base_composition

## Detailed Description

Definition at line 15 of file composition_masked.h.

## Member Typedef Documentation

## const_iterator

using fourdst::composition::MaskedComposition::const_iterator = detail::CompositionIterator<true>

Definition at line 18 of file composition_masked.h.

## iterator

using fourdst::composition::MaskedComposition::iterator = detail::CompositionIterator<false>

Definition at line 17 of file composition_masked.h.

## Constructor & Destructor Documentation

## MaskedComposition()

fourdst::composition::MaskedComposition::MaskedComposition | ( | const CompositionAbstract & | baseComposition,
|  | const std::vector< atomic::Species > & | activeSpecies )

Definition at line 15 of file composition_masked.cpp.

## Member Function Documentation

## begin() [1/2]

MaskedComposition::const_iterator fourdst::composition::MaskedComposition::begin | ( |  | ) | const

nodiscardoverridevirtual

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 226 of file composition_masked.cpp.

## begin() [2/2]

MaskedComposition::iterator fourdst::composition::MaskedComposition::begin | ( |  | ) |

nodiscardoverridevirtual

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 218 of file composition_masked.cpp.

## clone()

std::unique_ptr< CompositionAbstract > fourdst::composition::MaskedComposition::clone | ( |  | ) | const

nodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Definition at line 214 of file composition_masked.cpp.

## contains() [1/2]

bool fourdst::composition::MaskedComposition::contains | ( | const atomic::Species & | species | ) | const

nodiscardoverridevirtualnoexcept

Check if the composition contains the given species.

Parameters

  species | The atomic species to check.

Returns
  True if the species is contained, false otherwise.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 37 of file composition_masked.cpp.

## contains() [2/2]

bool fourdst::composition::MaskedComposition::contains | ( | const std::string & | symbol | ) | const

nodiscardoverridevirtual

Check if the composition contains the given species.

Parameters

  symbol | The symbol of the atomic species to check.

Returns
  True if the species is contained, false otherwise.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 41 of file composition_masked.cpp.

## end() [1/2]

MaskedComposition::const_iterator fourdst::composition::MaskedComposition::end | ( |  | ) | const

nodiscardoverridevirtual

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 230 of file composition_masked.cpp.

## end() [2/2]

MaskedComposition::iterator fourdst::composition::MaskedComposition::end | ( |  | ) |

nodiscardoverridevirtual

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 222 of file composition_masked.cpp.

## getElectronAbundance()

double fourdst::composition::MaskedComposition::getElectronAbundance | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the electron abundance of the composition.

Returns
  The electron abundance.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 149 of file composition_masked.cpp.

## getMassFraction() [1/3]

std::unordered_map< atomic::Species, double > fourdst::composition::MaskedComposition::getMassFraction | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the mass fraction for all registered symbols.

Returns
  An unordered map from symbol to mass fraction.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 65 of file composition_masked.cpp.

## getMassFraction() [2/3]

double fourdst::composition::MaskedComposition::getMassFraction | ( | const atomic::Species & | species | ) | const

nodiscardoverridevirtual

Get the mass fraction for a given species.

Parameters

  species | The atomic species.

Returns
  The mass fraction for the species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 97 of file composition_masked.cpp.

## getMassFraction() [3/3]

double fourdst::composition::MaskedComposition::getMassFraction | ( | const std::string & | symbol | ) | const

nodiscardoverridevirtual

Get the mass fraction for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The mass fraction for the symbol.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 89 of file composition_masked.cpp.

## getMassFractionVector()

std::vector< double > fourdst::composition::MaskedComposition::getMassFractionVector | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the mass fraction as a vector.

Returns
  A vector of mass fractions for all species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 159 of file composition_masked.cpp.

## getMeanParticleMass()

double fourdst::composition::MaskedComposition::getMeanParticleMass | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the mean particle mass of the composition.

Returns
  The mean particle mass.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 137 of file composition_masked.cpp.

## getMolarAbundance() [1/2]

double fourdst::composition::MaskedComposition::getMolarAbundance | ( | const atomic::Species & | species | ) | const

nodiscardoverridevirtual

Get the molar abundance for a given species.

Parameters

  species | The atomic species.

Returns
  The molar abundance for the species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 129 of file composition_masked.cpp.

## getMolarAbundance() [2/2]

double fourdst::composition::MaskedComposition::getMolarAbundance | ( | const std::string & | symbol | ) | const

nodiscardoverridevirtual

Get the molar abundance for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The molar abundance for the symbol.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 121 of file composition_masked.cpp.

## getMolarAbundanceVector()

std::vector< double > fourdst::composition::MaskedComposition::getMolarAbundanceVector | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the molar abundance as a vector.

Returns
  A vector of molar abundances for all species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 177 of file composition_masked.cpp.

## getNumberFraction() [1/3]

std::unordered_map< atomic::Species, double > fourdst::composition::MaskedComposition::getNumberFraction | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the number fraction for all registered symbols.

Returns
  An unordered map from symbol to number fraction.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 77 of file composition_masked.cpp.

## getNumberFraction() [2/3]

double fourdst::composition::MaskedComposition::getNumberFraction | ( | const atomic::Species & | species | ) | const

nodiscardoverridevirtual

Get the number fraction for a given species.

Parameters

  species | The atomic species.

Returns
  The number fraction for the species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 113 of file composition_masked.cpp.

## getNumberFraction() [3/3]

double fourdst::composition::MaskedComposition::getNumberFraction | ( | const std::string & | symbol | ) | const

nodiscardoverridevirtual

Get the number fraction for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The number fraction for the symbol.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 105 of file composition_masked.cpp.

## getNumberFractionVector()

std::vector< double > fourdst::composition::MaskedComposition::getNumberFractionVector | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get the number fraction as a vector.

Returns
  A vector of number fractions for all species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 168 of file composition_masked.cpp.

## getRegisteredSpecies()

const std::vector< atomic::Species > & fourdst::composition::MaskedComposition::getRegisteredSpecies | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get all registered atomic species in the composition.

Returns
  A set of registered atomic species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 49 of file composition_masked.cpp.

## getRegisteredSymbols()

std::set< std::string > fourdst::composition::MaskedComposition::getRegisteredSymbols | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Get all registered chemical symbols in the composition.

Returns
  A set of registered chemical symbols.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 53 of file composition_masked.cpp.

## getSpeciesAtIndex()

atomic::Species fourdst::composition::MaskedComposition::getSpeciesAtIndex | ( | size_t | index | ) | const

nodiscardoverridevirtual

Get the species at a given index.

Parameters

  index | The index of the species.

Returns
  The atomic species at the specified index.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 205 of file composition_masked.cpp.

## getSpeciesIndex() [1/2]

size_t fourdst::composition::MaskedComposition::getSpeciesIndex | ( | const atomic::Species & | species | ) | const

nodiscardoverridevirtual

Get the index of a species.

Parameters

  species | The atomic species.

Returns
  The index of the species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 198 of file composition_masked.cpp.

## getSpeciesIndex() [2/2]

size_t fourdst::composition::MaskedComposition::getSpeciesIndex | ( | const std::string & | symbol | ) | const

nodiscardoverridevirtual

Get the index of a species by symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The index of the species.

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 186 of file composition_masked.cpp.

## hash()

size_t fourdst::composition::MaskedComposition::hash | ( |  | ) | const

nodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Definition at line 234 of file composition_masked.cpp.

## size()

size_t fourdst::composition::MaskedComposition::size | ( |  | ) | const

nodiscardoverridevirtualnoexcept

Reimplemented from fourdst::composition::CompositionDecorator.

Definition at line 61 of file composition_masked.cpp.

## Member Data Documentation

## m_activeSpecies

std::vector<atomic::Species> fourdst::composition::MaskedComposition::m_activeSpecies

private

Definition at line 65 of file composition_masked.h.

## m_molarAbundances

std::vector<double> fourdst::composition::MaskedComposition::m_molarAbundances

private

Definition at line 66 of file composition_masked.h.

The documentation for this class was generated from the following files:

- src/composition/include/fourdst/composition/decorators/composition_masked.h
- src/composition/lib/decorators/composition_masked.cpp