Loading...
Searching...
No Matches
fourdst::composition::CompositionDecorator Class Reference

`#include <composition_decorator_abstract.h>`

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

## Public Member Functions

| CompositionDecorator (std::unique_ptr< CompositionAbstract > decorator)
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.
size_t | size () const noexcept override
std::set< std::string > | getRegisteredSymbols () const noexcept override
| Get all registered chemical symbols in the composition.
const std::vector< atomic::Species > & | getRegisteredSpecies () const noexcept override
| Get all registered atomic species in the composition.
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 (const size_t index) const override
| Get the species at a given index.
detail::CompositionIterator< false > | begin () override
detail::CompositionIterator< false > | end () override
detail::CompositionIterator< true > | begin () const override
detail::CompositionIterator< true > | end () const override
Public Member Functions inherited from fourdst::composition::CompositionAbstract
virtual | ~CompositionAbstract ()=default
| Virtual destructor.
virtual std::unique_ptr< CompositionAbstract > | clone () const =0
virtual std::size_t | hash () const =0

## Protected Attributes

std::unique_ptr< CompositionAbstract > | m_base_composition

## Additional Inherited Members

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

## Detailed Description

Definition at line 16 of file composition_decorator_abstract.h.

## Constructor & Destructor Documentation

## CompositionDecorator()

fourdst::composition::CompositionDecorator::CompositionDecorator | ( | std::unique_ptr< CompositionAbstract > | decorator | ) |

inlineexplicit

Definition at line 18 of file composition_decorator_abstract.h.

## Member Function Documentation

## begin() [1/2]

detail::CompositionIterator< true > fourdst::composition::CompositionDecorator::begin | ( |  | ) | const

inlinenodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 44 of file composition_decorator_abstract.h.

## begin() [2/2]

detail::CompositionIterator< false > fourdst::composition::CompositionDecorator::begin | ( |  | ) |

inlinenodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 41 of file composition_decorator_abstract.h.

## contains() [1/2]

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

inlinenodiscardoverridevirtualnoexcept

Check if the composition contains the given species.

Parameters

  species | The atomic species to check.

Returns
  True if the species is contained, false otherwise.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 19 of file composition_decorator_abstract.h.

## contains() [2/2]

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

inlinenodiscardoverridevirtual

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.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 20 of file composition_decorator_abstract.h.

## end() [1/2]

detail::CompositionIterator< true > fourdst::composition::CompositionDecorator::end | ( |  | ) | const

inlinenodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 45 of file composition_decorator_abstract.h.

## end() [2/2]

detail::CompositionIterator< false > fourdst::composition::CompositionDecorator::end | ( |  | ) |

inlinenodiscardoverridevirtual

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 42 of file composition_decorator_abstract.h.

## getElectronAbundance()

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

inlinenodiscardoverridevirtualnoexcept

Get the electron abundance of the composition.

Returns
  The electron abundance.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 33 of file composition_decorator_abstract.h.

## getMassFraction() [1/3]

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

inlinenodiscardoverridevirtualnoexcept

Get the mass fraction for all registered symbols.

Returns
  An unordered map from symbol to mass fraction.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 24 of file composition_decorator_abstract.h.

## getMassFraction() [2/3]

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

inlinenodiscardoverridevirtual

Get the mass fraction for a given species.

Parameters

  species | The atomic species.

Returns
  The mass fraction for the species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 27 of file composition_decorator_abstract.h.

## getMassFraction() [3/3]

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

inlinenodiscardoverridevirtual

Get the mass fraction for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The mass fraction for the symbol.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 26 of file composition_decorator_abstract.h.

## getMassFractionVector()

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

inlinenodiscardoverridevirtualnoexcept

Get the mass fraction as a vector.

Returns
  A vector of mass fractions for all species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 34 of file composition_decorator_abstract.h.

## getMeanParticleMass()

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

inlinenodiscardoverridevirtualnoexcept

Get the mean particle mass of the composition.

Returns
  The mean particle mass.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 32 of file composition_decorator_abstract.h.

## getMolarAbundance() [1/2]

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

inlinenodiscardoverridevirtual

Get the molar abundance for a given species.

Parameters

  species | The atomic species.

Returns
  The molar abundance for the species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 31 of file composition_decorator_abstract.h.

## getMolarAbundance() [2/2]

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

inlinenodiscardoverridevirtual

Get the molar abundance for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The molar abundance for the symbol.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 30 of file composition_decorator_abstract.h.

## getMolarAbundanceVector()

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

inlinenodiscardoverridevirtualnoexcept

Get the molar abundance as a vector.

Returns
  A vector of molar abundances for all species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 36 of file composition_decorator_abstract.h.

## getNumberFraction() [1/3]

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

inlinenodiscardoverridevirtualnoexcept

Get the number fraction for all registered symbols.

Returns
  An unordered map from symbol to number fraction.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 25 of file composition_decorator_abstract.h.

## getNumberFraction() [2/3]

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

inlinenodiscardoverridevirtual

Get the number fraction for a given species.

Parameters

  species | The atomic species.

Returns
  The number fraction for the species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 29 of file composition_decorator_abstract.h.

## getNumberFraction() [3/3]

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

inlinenodiscardoverridevirtual

Get the number fraction for a given symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The number fraction for the symbol.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 28 of file composition_decorator_abstract.h.

## getNumberFractionVector()

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

inlinenodiscardoverridevirtualnoexcept

Get the number fraction as a vector.

Returns
  A vector of number fractions for all species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 35 of file composition_decorator_abstract.h.

## getRegisteredSpecies()

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

inlinenodiscardoverridevirtualnoexcept

Get all registered atomic species in the composition.

Returns
  A set of registered atomic species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 23 of file composition_decorator_abstract.h.

## getRegisteredSymbols()

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

inlinenodiscardoverridevirtualnoexcept

Get all registered chemical symbols in the composition.

Returns
  A set of registered chemical symbols.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 22 of file composition_decorator_abstract.h.

## getSpeciesAtIndex()

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

inlinenodiscardoverridevirtual

Get the species at a given index.

Parameters

  index | The index of the species.

Returns
  The atomic species at the specified index.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 39 of file composition_decorator_abstract.h.

## getSpeciesIndex() [1/2]

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

inlinenodiscardoverridevirtual

Get the index of a species.

Parameters

  species | The atomic species.

Returns
  The index of the species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 38 of file composition_decorator_abstract.h.

## getSpeciesIndex() [2/2]

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

inlinenodiscardoverridevirtual

Get the index of a species by symbol.

Parameters

  symbol | The chemical symbol.

Returns
  The index of the species.

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 37 of file composition_decorator_abstract.h.

## size()

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

inlinenodiscardoverridevirtualnoexcept

Implements fourdst::composition::CompositionAbstract.

Reimplemented in fourdst::composition::MaskedComposition.

Definition at line 21 of file composition_decorator_abstract.h.

## Member Data Documentation

## m_base_composition

std::unique_ptr<CompositionAbstract> fourdst::composition::CompositionDecorator::m_base_composition

protected

Definition at line 47 of file composition_decorator_abstract.h.

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

- src/composition/include/fourdst/composition/decorators/composition_decorator_abstract.h