File ElementData.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 -
namespace
Constants A namespace for all constant (hardcoded) data.
This namespace does not include fitted parameters for specific methods, only general constant parameters, such as natural constants and atomic data.
-
class
ElementDataSingleton - #include <ElementData.h>
Provides a mapping of ElementType to ElementData and accessing Elements by a symbol string.
This class is a singleton to avoid multiple instances of the same hardcoded data in memory.
Features:
Fast lookup for subscript operator [ElementType]. Throws std::out_of_range.
Slow lookup for subscript operator [std::string]. Throws ElementData::DataNotAvailable.
Public Functions
-
const ElementData &
operator[](const std::string &symbol) const Access element information based on element symbol.
- Return
const ElementData& Returns the data associated with this element.
- Parameters
symbol: The symbol of the element (1st character upper case, 2nd lower case).
- Exceptions
-
const ElementData &
operator[](const ElementType &type) const Access element information based on type.
Fastest lookup.
- Return
const ElementData& Returns the data associated with this element.
- Parameters
type: The ElementType.
- Exceptions
std::out_of_range:
Public Static Functions
-
static const ElementDataSingleton &
instance() Access singleton instance.
Creates one if necessary.
- Return
const ElementDataSingleton& A reference to the one instance allowed.
Private Functions
-
ElementDataSingleton()¶ Private constructor to prevent instantiation by client.
-
void
init_data()¶ Creates hard coded element data.
Private Members
-
std::map<ElementType, ElementData>
d_container¶ Storage: internal map.
Private Static Attributes
-
std::unique_ptr<ElementDataSingleton>
d_instance¶ The singleton instance.
-
class
ElementData - #include <ElementData.h>
Data type for each element of the periodic table, Data includes: Mass (a.u.), Z,.
Public Functions
-
ElementData() Constructor for default (empty) element.
-
ElementData(std::string symbol, int Z, double mass, double vdWRadiusInPicometers = -1, int valElectrons = -1, int sElectrons = -1, int pElectrons = -1, int dElectrons = -1) Construct a new ElementData object.
- Parameters
symbol: The element symbol.Z: The nuclear charge.mass: The mass (isotope average, precision: 3 digits).vdWRadiusInPicometers: The van der Waals radius in pm.valElectrons: The number of electrons in the valence shell.sElectrons: The number of s-electrons in the valence shell.pElectrons: The number of p-electrons in the valence shell.dElectrons: The number of d-electrons in the valence shell.
-
std::string
symbol() const Getter for the element symbol.
- Return
std::string Returns the element symbol as string.
-
int
Z() const Getter for the atomic number.
- Return
int Returns the atomic number.
-
double
mass() const Getter for the mass in atomic mass units (u).
- Return
double Returns the atomic mass (isotope average, precision: 3 digits)
-
double
vdWRadius() const Getter for the Van-der-Waals Radius.
- Return
double Returns the Van-der-Waals Radius in atomic units.
-
int
valElectrons() const Getter for the number of valence electrons.
- Return
int Returns the number of valence electrons.
-
int
sElectrons() const Getter for the number of valence s-electrons.
- Return
int Returns the number of valence s-electrons.
-
int
pElectrons() const Getter for the number of valence p-electrons.
- Return
int Returns the number of valence p-electrons.
-
int
dElectrons() const Getter for the number of valence d-electrons.
- Return
int Returns the number of valence d-electrons.
Private Members
-
std::string
d_symbol= {}¶
-
int
d_Z= {0}¶
-
double
d_mass= {-1}¶
-
double
d_vdWRadius= {-1}¶
-
int
d_valElectrons= {-1}¶
-
int
d_sElectrons= {-1}¶
-
int
d_pElectrons= {-1}¶
-
int
d_dElectrons= {-1}¶
-
class
DataNotAvailable - #include <ElementData.h>
An exception if the data does not exist.
-
-
class
-
namespace
-
namespace