Loading...
Searching...
No Matches
Elements Class Reference

The Elements class stores basic data about chemical elements. More...

`#include <avogadro/core/elements.h>`

## Static Public Member Functions

static unsigned char | elementCount ()
static unsigned char | atomicNumberFromName (const std::string &name)
static unsigned char | atomicNumberFromSymbol (const std::string &symbol)
static unsigned char | guessAtomicNumber (const std::string &str)
static const char * | name (unsigned char atomicNumber)
static const char * | symbol (unsigned char atomicNumber)
static double | mass (unsigned char atomicNumber)
static double | radiusVDW (unsigned char atomicNumber)
static double | radiusCovalent (unsigned char atomicNumber)
static const unsigned char * | color (unsigned char atomicNumber)
static unsigned char | valenceElectrons (unsigned char atomicNumber)
static double | isotopeMass (unsigned char atomicNumber, unsigned short isotopeNumber)

## Detailed Description

The elements class gives a simple interface to basic data about chemical elements.

The atomic numbers between the symbolic constants CustomElementMin and CustomElementMax are used to represent non-elemental entities, such as particles or structures units from MD simulations. Custom elements names and symbols are returned as name="CustomElement_aa" and symbol="Xaa", where 'aa' is some combination of lowercase letters that is unique to the particular custom element atomic number. For all custom elements, the radii will match Carbon, the color is random (but consistent), and the mass is zero.

## Member Function Documentation

## elementCount()

unsigned char elementCount | ( |  | ) |

static

Returns
  the number of elements in the database.

## atomicNumberFromName()

unsigned char atomicNumberFromName | ( | const std::string & | name | ) |

static

Returns
  the atomic number from the supplied element `name`. If the name is not recognised then Avogadro::InvalidElement will be returned. 0 represents the dummy atom ("Dummy").

Note
  The input string is expected to be lowercase with the first letter capitalized.

## atomicNumberFromSymbol()

unsigned char atomicNumberFromSymbol | ( | const std::string & | symbol | ) |

static

Returns
  the atomic number from the supplied `symbol`. If the symbol is not recognised then Avogadro::InvalidElement will be returned. 0 represents the dummy atom ("Xx").

Note
  The input string is expected to be lowercase with the first letter capitalized.

## guessAtomicNumber()

unsigned char guessAtomicNumber | ( | const std::string & | str | ) |

static

Given a string `str`, attempt to identify an element symbol, name, or atomic number. This method is slower and less reliable than the atomicNumberFrom*() methods, and is only intended for making an initial guess of user input.

Returns
  the atomic number that best matches the string, or InvalidElement if no match can be made.

## name()

const char * name | ( | unsigned char | atomicNumber | ) |

static

Returns
  the name of the element with the supplied `atomicNumber`.

## symbol()

const char * symbol | ( | unsigned char | atomicNumber | ) |

static

Returns
  the symbol of the element with the supplied `atomicNumber`.

## mass()

double mass | ( | unsigned char | atomicNumber | ) |

static

Returns
  the mass of the element with the supplied `atomicNumber`.

## radiusVDW()

double radiusVDW | ( | unsigned char | atomicNumber | ) |

static

Returns
  the Van der Waals radius of the element with the supplied `atomicNumber`.

## radiusCovalent()

double radiusCovalent | ( | unsigned char | atomicNumber | ) |

static

Returns
  the covalent radius of the element with the supplied `atomicNumber`.

## color()

const unsigned char * color | ( | unsigned char | atomicNumber | ) |

static

Returns
  the default color of the element with the supplied `atomicNumber`. This is a pointer to a static three component unsigned char color.

## valenceElectrons()

unsigned char valenceElectrons | ( | unsigned char | atomicNumber | ) |

static

Returns
  the number of valence electrons for the supplied `atomicNumber`

## isotopeMass()

double isotopeMass | ( | unsigned char | atomicNumber,
|  | unsigned short | isotopeNumber )

static

Returns
  the mass of the element with the supplied `atomicNumber` and isotope `isotopeNumber`.

Parameters

  atomicNumber | The atomic number of the element.
  isotopeNumber | The isotope number of the element.

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

- elements.h