Class whose objects describe a virtual "element" in an alloy, i.e., a statistical mixture of chemical elements.
More...
#include <periodic_table.hpp>
|
| Virtual_element (const std::vector< std::string > &symbols, const std::vector< double > &ratios) |
| Trivial constructor. More...
|
|
| Virtual_element (const std::string &composition) |
| Create a Virtual_element from a string describing its composition. More...
|
|
std::size_t | get_nelements () const |
| Return the number of elements in the mix. More...
|
|
std::string | get_symbol (std::size_t i) const |
| Return the symbol of the i-th component of the mixture. More...
|
|
double | get_ratio (std::size_t i) const |
| Return the atomic ratio of the i-th component of the mixture. More...
|
|
std::string | get_name () const |
| Obtain a textual representation of the virtual element. More...
|
|
Class whose objects describe a virtual "element" in an alloy, i.e., a statistical mixture of chemical elements.
◆ Virtual_element() [1/2]
alma::Virtual_element::Virtual_element |
( |
const std::vector< std::string > & |
symbols, |
|
|
const std::vector< double > & |
ratios |
|
) |
| |
Trivial constructor.
The vector of atomic ratios need not be normalized, though its elements cannot be negative.
◆ Virtual_element() [2/2]
alma::Virtual_element::Virtual_element |
( |
const std::string & |
composition | ) |
|
Create a Virtual_element from a string describing its composition.
The format of the string is: "element1:ratio1;element2:ratio2" with as many elements as necessary. Whitespace is not significative. ratios must be positive decimal numbers, but need not be normalized.
- Parameters
-
[in] | composition | - a string describing the composition ratios. The elements of the latter add up to 1. |
◆ get_name()
std::string alma::Virtual_element::get_name |
( |
| ) |
const |
Obtain a textual representation of the virtual element.
- Returns
- a string in a format suitable to be passed to the class constructor.
◆ get_nelements()
std::size_t alma::Virtual_element::get_nelements |
( |
| ) |
const |
|
inline |
Return the number of elements in the mix.
- Returns
- the number of chemical elements making up the virtual element.
◆ get_ratio()
double alma::Virtual_element::get_ratio |
( |
std::size_t |
i | ) |
const |
|
inline |
Return the atomic ratio of the i-th component of the mixture.
- Parameters
-
[in] | i | - index of the element |
- Returns
- the atomic ratio of the requested element
◆ get_symbol()
std::string alma::Virtual_element::get_symbol |
( |
std::size_t |
i | ) |
const |
|
inline |
Return the symbol of the i-th component of the mixture.
- Parameters
-
[in] | i | - index of the element |
- Returns
- the chemical symbol of the requested element
The documentation for this class was generated from the following files: