Open Babel  3.0
Functions | Variables
OpenBabel::OBElements Namespace Reference

Functions

const char * GetSymbol (unsigned int atomic_number)
 
const char * GetName (unsigned int atomic_number)
 
double GetMass (unsigned int atomic_number)
 
double GetExactMass (unsigned int atomic_number, unsigned int isotope=0)
 
unsigned int GetAtomicNum (const char *ptr)
 
double GetAllredRochowElectroNeg (unsigned int atomic_number)
 
double GetCovalentRad (unsigned int atomic_number)
 
double GetVdwRad (unsigned int atomic_number)
 
double GetElectronAffinity (unsigned int atomic_number)
 
double GetIonization (unsigned int atomic_number)
 
unsigned int GetMaxBonds (unsigned int atomic_number)
 
double GetElectroNeg (unsigned int atomic_number)
 
void GetRGB (unsigned int atomic_number, double *r, double *g, double *b)
 

Variables

const unsigned int Hydrogen = 1
 
const unsigned int Helium = 2
 
const unsigned int Lithium = 3
 
const unsigned int Beryllium = 4
 
const unsigned int Boron = 5
 
const unsigned int Carbon = 6
 
const unsigned int Nitrogen = 7
 
const unsigned int Oxygen = 8
 
const unsigned int Fluorine = 9
 
const unsigned int Neon = 10
 
const unsigned int Sodium = 11
 
const unsigned int Magnesium = 12
 
const unsigned int Aluminium = 13
 
const unsigned int Silicon = 14
 
const unsigned int Phosphorus = 15
 
const unsigned int Sulfur = 16
 
const unsigned int Chlorine = 17
 
const unsigned int Argon = 18
 
const unsigned int Potassium = 19
 
const unsigned int Calcium = 20
 
const unsigned int Scandium = 21
 
const unsigned int Titanium = 22
 
const unsigned int Vanadium = 23
 
const unsigned int Chromium = 24
 
const unsigned int Manganese = 25
 
const unsigned int Iron = 26
 
const unsigned int Cobalt = 27
 
const unsigned int Nickel = 28
 
const unsigned int Copper = 29
 
const unsigned int Zinc = 30
 
const unsigned int Gallium = 31
 
const unsigned int Germanium = 32
 
const unsigned int Arsenic = 33
 
const unsigned int Selenium = 34
 
const unsigned int Bromine = 35
 
const unsigned int Krypton = 36
 
const unsigned int Rubidium = 37
 
const unsigned int Strontium = 38
 
const unsigned int Yttrium = 39
 
const unsigned int Zirconium = 40
 
const unsigned int Niobium = 41
 
const unsigned int Molybdenum = 42
 
const unsigned int Technetium = 43
 
const unsigned int Ruthenium = 44
 
const unsigned int Rhodium = 45
 
const unsigned int Palladium = 46
 
const unsigned int Silver = 47
 
const unsigned int Cadmium = 48
 
const unsigned int Indium = 49
 
const unsigned int Tin = 50
 
const unsigned int Antimony = 51
 
const unsigned int Tellurium = 52
 
const unsigned int Iodine = 53
 
const unsigned int Xenon = 54
 
const unsigned int Caesium = 55
 
const unsigned int Barium = 56
 
const unsigned int Lanthanum = 57
 
const unsigned int Cerium = 58
 
const unsigned int Praseodymium = 59
 
const unsigned int Neodymium = 60
 
const unsigned int Promethium = 61
 
const unsigned int Samarium = 62
 
const unsigned int Europium = 63
 
const unsigned int Gadolinium = 64
 
const unsigned int Terbium = 65
 
const unsigned int Dysprosium = 66
 
const unsigned int Holmium = 67
 
const unsigned int Erbium = 68
 
const unsigned int Thulium = 69
 
const unsigned int Ytterbium = 70
 
const unsigned int Lutetium = 71
 
const unsigned int Hafnium = 72
 
const unsigned int Tantalum = 73
 
const unsigned int Tungsten = 74
 
const unsigned int Rhenium = 75
 
const unsigned int Osmium = 76
 
const unsigned int Iridium = 77
 
const unsigned int Platinum = 78
 
const unsigned int Gold = 79
 
const unsigned int Mercury = 80
 
const unsigned int Thallium = 81
 
const unsigned int Lead = 82
 
const unsigned int Bismuth = 83
 
const unsigned int Polonium = 84
 
const unsigned int Astatine = 85
 
const unsigned int Radon = 86
 
const unsigned int Francium = 87
 
const unsigned int Radium = 88
 
const unsigned int Actinium = 89
 
const unsigned int Thorium = 90
 
const unsigned int Protactinium = 91
 
const unsigned int Uranium = 92
 
const unsigned int Neptunium = 93
 
const unsigned int Plutonium = 94
 
const unsigned int Americium = 95
 
const unsigned int Curium = 96
 
const unsigned int Berkelium = 97
 
const unsigned int Californium = 98
 
const unsigned int Einsteinium = 99
 
const unsigned int Fermium = 100
 
const unsigned int Mendelevium = 101
 
const unsigned int Nobelium = 102
 
const unsigned int Lawrencium = 103
 
const unsigned int Rutherfordium = 104
 
const unsigned int Dubnium = 105
 
const unsigned int Seaborgium = 106
 
const unsigned int Bohrium = 107
 
const unsigned int Hassium = 108
 
const unsigned int Meitnerium = 109
 
const unsigned int Darmstadtium = 110
 
const unsigned int Roentgenium = 111
 
const unsigned int Copernicium = 112
 
const unsigned int Nihonium = 113
 
const unsigned int Flerovium = 114
 
const unsigned int Moscovium = 115
 
const unsigned int Livermorium = 116
 
const unsigned int Tennessine = 117
 
const unsigned int Oganesson = 118
 

Detailed Description

Functions and constants for handling the elements of the periodic table and associated data.

Translating element data is a common task given that many file formats give either element symbol or atomic number information, but not both. The OBElements namespace contains functions to handle this conversion, as well as providing information associated with particular elements. The following code sample demonstrates the use of members of this namespace:

cout << "The symbol for element 6 is " << OBElements::GetSymbol(6) << endl;
cout << "The atomic number for Sulfur is " << OBElements::GetAtomicNum(16) << endl;
cout << "The van der Waal radius for Nitrogen is " << OBElements::GetVdwRad(7);
if (atom->GetAtomicNum() == OBElements::Carbon) {
// then do something
}

Stored information in the OBElementTable includes elemental:

Function Documentation

◆ GetSymbol()

const char * GetSymbol ( unsigned int  atomic_number)
Returns
the element symbol matching the atomic number passed

Referenced by OBDepict::DrawMolecule(), OBMol::GetSpacedFormula(), and OBChainsParser::~OBChainsParser().

◆ GetName()

const char * GetName ( unsigned int  atomic_number)
Returns
the name of this element

Referenced by OBChainsParser::~OBChainsParser().

◆ GetMass()

double GetMass ( unsigned int  atomic_number)
Returns
the average atomic mass for this element. For exact isotope masses, use GetExactMass()

Referenced by OBAtom::GetAtomicMass(), and OBMol::GetMolWt().

◆ GetExactMass()

double GetExactMass ( unsigned int  atomic_number,
unsigned int  isotope = 0 
)
Returns
the exact mass of the specified isotope or by default (i.e. "isotope 0") the mass of the most abundant isotope

Referenced by OBAtom::GetAtomicMass(), OBMol::GetEnergy(), OBAtom::GetExactMass(), OBMol::GetExactMass(), and OBAtom::GetSpinMultiplicity().

◆ GetAtomicNum()

unsigned int GetAtomicNum ( const char *  ptr)

◆ GetAllredRochowElectroNeg()

double GetAllredRochowElectroNeg ( unsigned int  atomic_number)
Returns
the Allred-Rochow electronegativity for this element

◆ GetCovalentRad()

double GetCovalentRad ( unsigned int  atomic_number)
Returns
the covalent radius (in Angstrom) for this atomic number

Referenced by OBMol::ConnectTheDots(), OpenBabel::CorrectedBondRad(), OBDepict::DrawMolecule(), and OpenBabel::GetCorrectedBondVector().

◆ GetVdwRad()

double GetVdwRad ( unsigned int  atomic_number)
Returns
the van der Waals radius (in Angstrom) for this atomic number

Referenced by OBStericConformerFilter::IsGood().

◆ GetElectronAffinity()

double GetElectronAffinity ( unsigned int  atomic_number)
Returns
the electron affinity (in eV) for this element

◆ GetIonization()

double GetIonization ( unsigned int  atomic_number)
Returns
the ionization potential (in eV) for this element

◆ GetMaxBonds()

unsigned int GetMaxBonds ( unsigned int  atomic_number)
Returns
the maximum expected number of bonds to this element

Referenced by OBMol::ConnectTheDots(), and OBMol::PerceiveBondOrders().

◆ GetElectroNeg()

double GetElectroNeg ( unsigned int  atomic_number)
Returns
the Pauling electronegativity for this element

Referenced by OBMol::PerceiveBondOrders().

◆ GetRGB()

void GetRGB ( unsigned int  atomic_number,
double *  r,
double *  g,
double *  b 
)

Sets the red, green, and blue color values for this element.

Referenced by OBDepict::DrawMolecule().

Variable Documentation

◆ Hydrogen

const unsigned int Hydrogen = 1

◆ Helium

const unsigned int Helium = 2

◆ Lithium

const unsigned int Lithium = 3

◆ Beryllium

const unsigned int Beryllium = 4

◆ Boron

const unsigned int Boron = 5

◆ Carbon

const unsigned int Carbon = 6

◆ Nitrogen

const unsigned int Nitrogen = 7

◆ Oxygen

const unsigned int Oxygen = 8

◆ Fluorine

const unsigned int Fluorine = 9

◆ Neon

const unsigned int Neon = 10

◆ Sodium

const unsigned int Sodium = 11

◆ Magnesium

const unsigned int Magnesium = 12

◆ Aluminium

const unsigned int Aluminium = 13

◆ Silicon

const unsigned int Silicon = 14

◆ Phosphorus

const unsigned int Phosphorus = 15

◆ Sulfur

const unsigned int Sulfur = 16

◆ Chlorine

const unsigned int Chlorine = 17

◆ Argon

const unsigned int Argon = 18

◆ Potassium

const unsigned int Potassium = 19

◆ Calcium

const unsigned int Calcium = 20

◆ Scandium

const unsigned int Scandium = 21

◆ Titanium

const unsigned int Titanium = 22

◆ Vanadium

const unsigned int Vanadium = 23

◆ Chromium

const unsigned int Chromium = 24

◆ Manganese

const unsigned int Manganese = 25

◆ Iron

const unsigned int Iron = 26

◆ Cobalt

const unsigned int Cobalt = 27

◆ Nickel

const unsigned int Nickel = 28

◆ Copper

const unsigned int Copper = 29

◆ Zinc

const unsigned int Zinc = 30

◆ Gallium

const unsigned int Gallium = 31

◆ Germanium

const unsigned int Germanium = 32

◆ Arsenic

const unsigned int Arsenic = 33

◆ Selenium

const unsigned int Selenium = 34

◆ Bromine

const unsigned int Bromine = 35

◆ Krypton

const unsigned int Krypton = 36

◆ Rubidium

const unsigned int Rubidium = 37

◆ Strontium

const unsigned int Strontium = 38

◆ Yttrium

const unsigned int Yttrium = 39

◆ Zirconium

const unsigned int Zirconium = 40

◆ Niobium

const unsigned int Niobium = 41

◆ Molybdenum

const unsigned int Molybdenum = 42

◆ Technetium

const unsigned int Technetium = 43

◆ Ruthenium

const unsigned int Ruthenium = 44

◆ Rhodium

const unsigned int Rhodium = 45

◆ Palladium

const unsigned int Palladium = 46

◆ Silver

const unsigned int Silver = 47

◆ Cadmium

const unsigned int Cadmium = 48

◆ Indium

const unsigned int Indium = 49

◆ Tin

const unsigned int Tin = 50

◆ Antimony

const unsigned int Antimony = 51

◆ Tellurium

const unsigned int Tellurium = 52

◆ Iodine

const unsigned int Iodine = 53

◆ Xenon

const unsigned int Xenon = 54

◆ Caesium

const unsigned int Caesium = 55

◆ Barium

const unsigned int Barium = 56

◆ Lanthanum

const unsigned int Lanthanum = 57

◆ Cerium

const unsigned int Cerium = 58

◆ Praseodymium

const unsigned int Praseodymium = 59

◆ Neodymium

const unsigned int Neodymium = 60

◆ Promethium

const unsigned int Promethium = 61

◆ Samarium

const unsigned int Samarium = 62

◆ Europium

const unsigned int Europium = 63

◆ Gadolinium

const unsigned int Gadolinium = 64

◆ Terbium

const unsigned int Terbium = 65

◆ Dysprosium

const unsigned int Dysprosium = 66

◆ Holmium

const unsigned int Holmium = 67

◆ Erbium

const unsigned int Erbium = 68

◆ Thulium

const unsigned int Thulium = 69

◆ Ytterbium

const unsigned int Ytterbium = 70

◆ Lutetium

const unsigned int Lutetium = 71

◆ Hafnium

const unsigned int Hafnium = 72

◆ Tantalum

const unsigned int Tantalum = 73

◆ Tungsten

const unsigned int Tungsten = 74

◆ Rhenium

const unsigned int Rhenium = 75

◆ Osmium

const unsigned int Osmium = 76

◆ Iridium

const unsigned int Iridium = 77

◆ Platinum

const unsigned int Platinum = 78

◆ Gold

const unsigned int Gold = 79

◆ Mercury

const unsigned int Mercury = 80

◆ Thallium

const unsigned int Thallium = 81

◆ Lead

const unsigned int Lead = 82

◆ Bismuth

const unsigned int Bismuth = 83

◆ Polonium

const unsigned int Polonium = 84

◆ Astatine

const unsigned int Astatine = 85

◆ Radon

const unsigned int Radon = 86

◆ Francium

const unsigned int Francium = 87

◆ Radium

const unsigned int Radium = 88

◆ Actinium

const unsigned int Actinium = 89

◆ Thorium

const unsigned int Thorium = 90

◆ Protactinium

const unsigned int Protactinium = 91

◆ Uranium

const unsigned int Uranium = 92

◆ Neptunium

const unsigned int Neptunium = 93

◆ Plutonium

const unsigned int Plutonium = 94

◆ Americium

const unsigned int Americium = 95

◆ Curium

const unsigned int Curium = 96

◆ Berkelium

const unsigned int Berkelium = 97

◆ Californium

const unsigned int Californium = 98

◆ Einsteinium

const unsigned int Einsteinium = 99

◆ Fermium

const unsigned int Fermium = 100

◆ Mendelevium

const unsigned int Mendelevium = 101

◆ Nobelium

const unsigned int Nobelium = 102

◆ Lawrencium

const unsigned int Lawrencium = 103

◆ Rutherfordium

const unsigned int Rutherfordium = 104

◆ Dubnium

const unsigned int Dubnium = 105

◆ Seaborgium

const unsigned int Seaborgium = 106

◆ Bohrium

const unsigned int Bohrium = 107

◆ Hassium

const unsigned int Hassium = 108

◆ Meitnerium

const unsigned int Meitnerium = 109

◆ Darmstadtium

const unsigned int Darmstadtium = 110

◆ Roentgenium

const unsigned int Roentgenium = 111

◆ Copernicium

const unsigned int Copernicium = 112

◆ Nihonium

const unsigned int Nihonium = 113

◆ Flerovium

const unsigned int Flerovium = 114

◆ Moscovium

const unsigned int Moscovium = 115

◆ Livermorium

const unsigned int Livermorium = 116

◆ Tennessine

const unsigned int Tennessine = 117

◆ Oganesson

const unsigned int Oganesson = 118