The Gnome Chemistry Utils  0.14.0
Public Member Functions | Static Public Member Functions | List of all members
gcu::Element Class Reference

Chemical element. More...

#include <gcu/element.h>

Public Member Functions

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 ()
DimensionalValue const * GetWeight ()
IsotopicPatternGetIsotopicPattern (unsigned natoms)
std::string const & GetElectronicConfiguration ()
std::map< std::string,
std::string > const & 
GetNames ()
GcuDimensionalValue const * GetIonizationEnergy (unsigned rank=1)
GcuDimensionalValue const * GetElectronAffinity (unsigned rank=1)
Value const * GetProperty (char const *property_name)
std::string & GetStringProperty (char const *property_name)
int GetIntegerProperty (char const *property_name)
bool IsMetallic ()
bool GetStability (void) const

Static Public Member Functions

static const char * Symbol (int Z)
static bool BestSide (int Z)
static int Z (const char *symbol)
static ElementGetElement (int Z)
static ElementGetElement (const char *symbol)
static bool GetRadius (GcuAtomicRadius *radius)
static bool GetElectronegativity (GcuElectronegativity *en)
static unsigned GetMaxBonds (int Z)
static void LoadRadii ()
static void LoadElectronicProps ()
static void LoadIsotopes ()
static void LoadBODR ()
static void LoadAllData ()
static void Init ()

Detailed Description

Chemical element.

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 60 of file element.h.

Member Function Documentation

static bool gcu::Element::BestSide ( int  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.
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 196 of file element.h.

double* gcu::Element::GetDefaultColor ( )
inline

Retrieves 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 201 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 184 of file element.h.

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.
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.
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.
std::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 246 of file element.h.

static Element* gcu::Element::GetElement ( int  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 char *  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.
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.
GcuDimensionalValue const* gcu::Element::GetIonizationEnergy ( unsigned  rank = 1)
Parameters
rank,:the rank of the ionization.
Returns
the requested ionization energy as a &GcuDimensionalValue.
IsotopicPattern* gcu::Element::GetIsotopicPattern ( unsigned  natoms)
Parameters
natoms,:atoms count.
Returns
the isotopic pattern correponding to a fragment containing n atoms of the element.
static unsigned gcu::Element::GetMaxBonds ( int  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.
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 190 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 229 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 205 of file element.h.

std::map<std::string, std::string> const& gcu::Element::GetNames ( )
inline
Returns
the map of known names for the element indexed by language.

Definition at line 250 of file element.h.

Value const* gcu::Element::GetProperty ( 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 property if known, or NULL.
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.
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.
gcu::Element::GetStability ( void  ) const
inline
Returns
true if the element has at least one stable isotope, false otherwise.

Definition at line 314 of file element.h.

std::string& gcu::Element::GetStringProperty ( 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 string property if known as a reference or an empty string.
const char* gcu::Element::GetSymbol ( )
inline
Returns
The chemical symbol of the element.

Definition at line 179 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 224 of file element.h.

unsigned gcu::Element::GetValenceElectrons ( )
inline
Returns
the number of valence electrons of the neutral atom.

Definition at line 219 of file element.h.

DimensionalValue const* gcu::Element::GetWeight ( )
Returns
the atomic molar mass of the element.
int gcu::Element::GetZ ( )
inline
Returns
The atomic number of the chemical element.

Definition at line 175 of file element.h.

static void gcu::Element::Init ( )
static

Intialize the element database. There is no need to call this method if any of the Load*() method is called.

bool gcu::Element::IsMetallic ( )
Returns
true if the element is a metal, false otherwise.
static void gcu::Element::LoadAllData ( )
static

Loads all databases.

static void gcu::Element::LoadBODR ( )
static

Loads the Blue Obelisk 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::LoadRadii ( )
static

Loads the atomic radii database.

static const char* gcu::Element::Symbol ( int  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 int gcu::Element::Z ( const char *  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.

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