The Gnome Chemistry Utils: gcu::Element Class Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# gcu::Element Class Reference

`#include <gcu/element.h>`

List of all members.

## Public Member Functions
double | GetWeight (int Z, int &prec)
int | GetZ ()
const char * | GetSymbol ()
char | GetDefaultValence ()
unsigned | GetMaxBonds ()
bool | GetBestSide ()
double * | GetDefaultColor ()
const char * | GetName ()
const GcuAtomicRadius ** | GetRadii ()
const GcuElectronegativity ** | GetElectronegativities ()
unsigned | GetValenceElectrons ()
unsigned | GetTotalValenceElectrons ()
unsigned | GetMaxValenceElectrons ()
double | GetWeight (int &prec)
IsotopicPattern * | GetIsotopicPattern (unsigned natoms)
string const & | GetElectronicConfiguration ()
map< string, string > const & | GetNames ()
GcuDimensionalValue const * | GetIonizationEnergy (unsigned rank=1)
GcuDimensionalValue const * | GetElectronAffinity (unsigned rank=1)
Value const * | GetProperty (char const *property_name)
string & | GetStringProperty (char const *property_name)
int | GetIntegerProperty (char const *property_name)
## Static Public Member Functions
static const gchar * | Symbol (gint Z)
static bool | BestSide (gint Z)
static gint | Z (const gchar *symbol)
static Element * | GetElement (gint Z)
static Element * | GetElement (const gchar *symbol)
static bool | GetRadius (GcuAtomicRadius *radius)
static bool | GetElectronegativity (GcuElectronegativity *en)
static unsigned | GetMaxBonds (gint Z)
static void | LoadRadii ()
static void | LoadElectronicProps ()
static void | LoadIsotopes ()
static void | LoadBODR ()
static void | LoadAllData ()

## Detailed Description

Represents a chemical element. This class has no public constructor or destructor. The instances are created by the framework from data in the elements.xml file and a user cannot create a new element.

Definition at line 54 of file element.h.

## Member Function Documentation

static const gchar* gcu::Element::Symbol | ( | gint | Z | ) | `[static]`

Parameters:

  | Z,: | the atomic number of a chemical element.

Returns:
  The chemical symbol of the element whose atomic number is Z or NULL if the element is unknown.

static bool gcu::Element::BestSide | ( | gint | Z | ) | `[static]`

Parameters:

  | Z,: | the atomic number of a chemical element.

This static method is used to know on what side of the symbol of the element whose atomic number is Z attached hydrogens should be written.

Returns:
  true if hydrogens should be written on the right and false when it should be written on the left side.

static gint gcu::Element::Z | ( | const gchar * | symbol | ) | `[static]`

Parameters:

  | symbol,: | the symbol of a chemical element.

Returns:
  The atomic number of the element whose chemical symbol is used as parameter or 0 if the element is unknown.

static Element* gcu::Element::GetElement | ( | gint | Z | ) | `[static]`

Parameters:

  | Z,: | the atomic number of a chemical element.

Returns:
  a pointer to the Element whose atomic number is Z or NULL if the element is unknown.

static Element* gcu::Element::GetElement | ( | const gchar * | symbol | ) | `[static]`

Parameters:

  | symbol,: | the symbol of a chemical element.

Returns:
  a pointer to the Element whose symbol is used as parameter or NULL if the element is unknown.

double gcu::Element::GetWeight | ( | int | Z,
|  | int & | prec |
| ) |  |  |

Parameters:

  | Z,: | the atomic number of a chemical element.
  | prec,: | receive the number of significant digits.

Returns:
  the atomic mass of the element.

static bool gcu::Element::GetRadius | ( | GcuAtomicRadius * | radius | ) | `[static]`

Parameters:

  | radius,: | a pointer to a GcuAtomicRadius structure.

Before calling this function, most fields in the GcuAtomicRadius structure must be filled:

- Z: the atomic number, mandatory
- type: the type of the radius searched
- charge: the charge of the atom. 0 for all radii except ionic radii.
- cn: the coordination number or -1 if not significant
- spin: the spin state or GCU_N_A_SPIN if not significant
- scale: the name of the scale (e.g. "Pauling") or NULL

The programs searches a value corresponding to the fields having a non default value. If one is found the other fields are given the corresponding values f the first match before returning.

Returns:
  true if a radius has been found and false if not.

static bool gcu::Element::GetElectronegativity | ( | GcuElectronegativity * | en | ) | `[static]`

Parameters:

  | en,: | a pointer to a GcuElectronegativity structure.

Before calling this function, the following fields in the GcuElectronegativity structure must be filled:

- Z: the atomic number, mandatory
- type: the gcu_radius_type, mandatory
- charge: the charge of the atom, mandatory; must be 0 for non ionic radii and non null for ionic radii.
- scale: the name of the scale (e.g. "Pauling") or NULL

The programs searches an electronegativity value for the element in the scale if given. If one is found the value and the scale (if NULL on calling) are given the corresponding values of the first match before returning.

Returns:
  true if a match has been found and false if not.

static unsigned gcu::Element::GetMaxBonds | ( | gint | Z | ) | `[static]`

Parameters:

  | Z,: | the atomic number of a chemical element.

The value returned by this method might be too low in some cases and is only indicative. Instances of the Atom class accept any number of bonds. This behavior might change in future versions.

Returns:
  the maximum number of bonds an atom of the element can be involved in.

static void gcu::Element::LoadRadii | ( |  | ) | `[static]`

Loads the atomic radii database.

static void gcu::Element::LoadElectronicProps | ( |  | ) | `[static]`

Loads the atomic electronic properties database.

static void gcu::Element::LoadIsotopes | ( |  | ) | `[static]`

Loads the isotopes database.

static void gcu::Element::LoadBODR | ( |  | ) | `[static]`

Loads the Blue Obelisk Database.

static void gcu::Element::LoadAllData | ( |  | ) | `[static]`

Loads all databases.

int gcu::Element::GetZ | ( |  | ) | `[inline]`

Returns:
  The atomic number of the chemical element.

Definition at line 168 of file element.h.

const char* gcu::Element::GetSymbol | ( |  | ) | `[inline]`

Returns:
  The chemical symbol of the element.

Definition at line 172 of file element.h.

char gcu::Element::GetDefaultValence | ( |  | ) | `[inline]`

Returns:
  The default valence of the element for some elements, mainly non metals. For others, the returned value is -1 and should not be taken into account.

Definition at line 177 of file element.h.

unsigned gcu::Element::GetMaxBonds | ( |  | ) | `[inline]`

The value returned by this method might be too low in some cases and is only indicative. Instances of the Atom class accept any number of bonds. This behavior might change in future versions.

Returns:
  the maximum number of bonds an atom of the element can be involved in.

Definition at line 183 of file element.h.

bool gcu::Element::GetBestSide | ( |  | ) | `[inline]`

This static method is used to know on what side of the symbol of the element attached hydrogens should be written.

Returns:
  true if hydrogens should be written on the right and false when it should be written on the left side.

Definition at line 189 of file element.h.

double* gcu::Element::GetDefaultColor | ( |  | ) | `[inline]`

Retreives the default color used for the element.

Returns:
  an array of three double values for the red, green and blue components of the color.

Definition at line 194 of file element.h.

const char* gcu::Element::GetName | ( |  | ) | `[inline]`

Returns:
  the name of the element in the current locale or in english if the current locale is not supported in the database.

Definition at line 198 of file element.h.

const GcuAtomicRadius** gcu::Element::GetRadii | ( |  | ) |

Returns:
  a pointer to the array of pointers to GcuAtomicRadius structures for all known radii for the element. Last value in the array is NULL.

const GcuElectronegativity** gcu::Element::GetElectronegativities | ( |  | ) |

Returns:
  a pointer to the array of pointers to GcuElectronegativity structures for all known electronegativities for the element. Last value in the array is NULL.

unsigned gcu::Element::GetValenceElectrons | ( |  | ) | `[inline]`

Returns:
  the number of valence electrons of the neutral atom.

Definition at line 212 of file element.h.

unsigned gcu::Element::GetTotalValenceElectrons | ( |  | ) | `[inline]`

Returns:
  the number of valence electrons of the neutral atom, including d and f electrons.

Definition at line 217 of file element.h.

unsigned gcu::Element::GetMaxValenceElectrons | ( |  | ) | `[inline]`

Returns:
  the maximume number of valence electrons of the neutral atom, including d and f electrons.

Definition at line 222 of file element.h.

double gcu::Element::GetWeight | ( | int & | prec | ) | `[inline]`

Parameters:

  | prec,: | receive the number of significant digits.

Returns:
  the atomic mass of the element.

Definition at line 228 of file element.h.

IsotopicPattern* gcu::Element::GetIsotopicPattern | ( | unsigned | natoms | ) |

Parameters:

  | natoms,: | atoms count.

Returns:
  the isotopic pattern correponding to a fragment containing n atoms of the element.

string const& gcu::Element::GetElectronicConfiguration | ( |  | ) | `[inline]`

Returns:
  the fundamental electronic configuration for the element. The returned string is formated as a pango markup, with electron numbers for each sublevel as superscript.

Definition at line 241 of file element.h.

map<string, string> const& gcu::Element::GetNames | ( |  | ) | `[inline]`

Returns:
  the map of known names for the element indexed by language.

Definition at line 245 of file element.h.

GcuDimensionalValue const* gcu::Element::GetIonizationEnergy | ( | unsigned | rank = `1` | ) |

Parameters:

  | rank,: | the rank of the ionization.

Returns:
  the requested ionization energy as a &GcuDimensionalValue.

GcuDimensionalValue const* gcu::Element::GetElectronAffinity | ( | unsigned | rank = `1` | ) |

Parameters:

  | rank,: | the rank of the electron affinity.

Returns:
  the requested electron affinity as a &GcuDimensionalValue. For most elements, only the first is known.

Value const* gcu::Element::GetProperty | ( | char const * | property_name | ) | `[inline]`

Parameters:

  | property_name,: | the name of the property as used in the Blue Obelisk Data Repository (without the "bo:" prefix).

Returns:
  the requested property if known, or NULL.

Definition at line 265 of file element.h.

string& gcu::Element::GetStringProperty | ( | char const * | property_name | ) | `[inline]`

Parameters:

  | property_name,: | the name of the property as used in the Blue Obelisk Data Repository (without the "bo:" prefix).

Returns:
  the requested string property if known as a reference or an empty string.

Definition at line 272 of file element.h.

int gcu::Element::GetIntegerProperty | ( | char const * | property_name | ) |

Parameters:

  | property_name,: | the name of the property as used in the Blue Obelisk Data Repository (without the "bo:" prefix).

Returns:
  the requested integer property if known, or G_MININT32.

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

- element.h