File ElementInfo.h¶
- Copyright
This code is licensed under the 3-clause BSD license.
Copyright ETH Zurich, Laboratory for Physical Chemistry, Reiher Group.
See LICENSE.txt for details.
-
namespace
Scine
This header file contains functions that allow for common notation for common things that can be done at a different degree of derivatives.
This header contains alias definitions defining which classes to use for the different degrees of derivatives.
-
namespace
Utils
-
class
ElementSymbolNotFound
: public runtime_error - #include <ElementInfo.h>
A runtime error specific to an element not being found.
Public Functions
-
ElementSymbolNotFound
(const std::string &symbol)¶
-
-
class
ElementInfo
- #include <ElementInfo.h>
Provides information about elements, such as mass, van-der-Waals radius, etc.
This class only wraps around the actual data and their handling. For the underlying data see ElementInfoData.h and ElementInfoData.cpp.
Public Static Functions
-
static ElementType
elementTypeForSymbol
(const std::string &symbol) Translation from std::string to ElementType enum.
Permissive regarding digits specifying isotope atomic mass numbers, either pre- or postfixed.
ElementType hydrogen = elementTypeForSymbol("H"); // ElementType::H ElementType h1prefixed = elementTypeForSymbol("1H"); // ElementType::H1 ElementType h1postfixed = elementTypeForSymbol("H1"); // ElementType::H1 ElementType deuterium = elementTypeForSymbol("D"); // ElementType::D ElementType h2prefixed = elementTypeForSymbol("2H"); // ElementType::D ElementType tritium = elementTypeForSymbol("T"); // ElementType::T ElementType h3prefixed = elementTypeForSymbol("3H"); // ElementType::T
- Return
ElementType Returns the ElementType.
- Parameters
symbol
: The atom symbol. First character captitalized, other lower case.
-
static std::string
symbol
(ElementType e) Translation from ElementType enum to std::string.
- Return
std::string Returns the symbol string.
- Parameters
e
: The ElementType.
-
static double
mass
(ElementType e) Standard atomic weight of the atom.
The standard atomic weight of an element (e.g. H) is the average of its isotopic weights weighted by their natural abundance. If no natural abundance for an element was measured or no standard atomic weight is defined, returns the weight of one of its isotopes.
The atomic weight of an isotope (e.g. D) is the mass of the isotope scaled onto the standard atomic weight scale, where the standard atomic weight of C-12 is set to 12.
- Return
standard atomic weight in unified atomic mass units (u)
- Parameters
element
: The element type for which to fetch the standard atomic weight
-
static double
vdwRadius
(ElementType e) Getter for the van der Waals radius in atomic units.
- Return
double Returns the van der Waals radius in atomic units.
- Parameters
e
: The ElementType.
-
static constexpr unsigned
Z
(const ElementType e) Getter for the atomic number.
- Return
int Returns the atomic number
- Parameters
e
: The ElementType.
-
static constexpr unsigned
A
(const ElementType e) Gets the atomic mass number of an element type.
-
static double
abundance
(ElementType element) Natural abundance of an isotope.
Note that the stored natural abundances of particular isotopes may not sum to one, but may all be zero for cases in which no natural abundances have been measured.
- Return
natural relative abundance of an isotope in fractions <= 1
- Parameters
element
: The element type of the isotope
- Exceptions
std::logic_error
: For unspecified isotopes (e.g. H, but not Be, which is monoisotopic)
-
static ElementType
element
(unsigned z) Returns the element for a particular atomic number.
-
static ElementType
isotope
(unsigned z, unsigned a) Returns an element type corresponding to atomic- and atomic mass-numbers.
-
static std::vector<ElementType>
isotopes
(ElementType element) Returns the isotopes of an element, unordered.
-
static ElementType
base
(ElementType isotope) Returns the base of an isotope (e.g. Li for Li6)
-
static int
valElectrons
(ElementType e) Getter for the number of valence electrons.
- Return
int Returns the number of valence electrons.
- Parameters
e
: The ElementType.
-
static int
sElectrons
(ElementType e) Getter for the number of valence s-electrons.
- Return
int Returns the number of valence s-electrons.
- Parameters
e
: The ElementType.
-
static int
pElectrons
(ElementType e) Getter for the number of valence p-electrons.
- Return
int Returns the number of valence p-electrons.
- Parameters
e
: The ElementType.
-
static int
dElectrons
(ElementType e) Getter for the number of valence d-electrons.
- Return
int Returns the number of valence d-electrons.
- Parameters
e
: The ElementType.
Private Static Attributes
-
std::unordered_map<std::string, ElementType>
stringToElementType
¶ A map mapping between string an enum type of an element.
Note: please do not use this map directly, instead use: ElementInfo::elementTypeForSymbol() because it includes error handling.
-
std::unordered_map<ElementType, IsotopeData>
isotopeMap
¶
-
struct
IsotopeData
¶
-
static ElementType
-
class
-
namespace