Elements Class Reference

#include <elements.h>

Inheritance diagram for Elements:

DataContainer List of all members.

Public Member Functions

General functions for building and manipulating the set of elements
 Elements (string aFileName, string aGramAtomFileName)
 ~Elements ()
Atomoperator[] (string aSymbol)
AtomgetElement (string aSymbol)
void loadGramAtoms (string filename)
string getAtomKernelName ()
void loadDefinition (string aFilename)
uint numElements ()

Public Attributes

float gramAtom [NUMELEMENTS][NUMELEMENTS]
string gramAtomName

Private Attributes

map< string, Atom * > periodicTable

Detailed Description

Instanciates chemical elements
Author:
Dr Jean-Luc Perret (luc@kuicr.kyoto-u.ac.jp), Kyoto University, Japan
Version:
0.1
Date:
8 Jan 2004
CLASS NAME: Elements

FOR: SNSF SPONSORED PROJECT

PURPOSE: Instanciates the chemical elements (each of class Atom) and load their physico-chemical properties

Physico-chemical properties are loaded from file ELEMENTSFILENAME in the chemcpp distribution.

Warning:
Elements currently only instanciates the following elements: H, He, Li, Be, B, C, N, O, F, Ne, Na, Mg, Al, Si, P, S, Cl, Ar, K, Ca with the full set of physico-chemical properties, and Br, I with only full name, atomic number and symbol.
An Atom pointer to an Element can be obtained by using the elements global instance of class Elements, using the following syntax:

 Atom* myPointer = elements["H"]; 

Warning:
note that to create a new Atom the copy operator should be used as described in "atom_example.cpp".
The properties of the elements can be retrieve as pointers to a Descriptor by using the getIntDescriptor(), getFloatDescriptor() or getStringDescriptor() functions of the DataContainer class from which the class Atom is derived. To designate the physico-chemical properties use the macros defined in constants.h Here is a list of these macros:

for example to get the covalent radius value of an atom use:

 float myCR = myPointer->getFloatDescriptor(CR)->getValue(); 


Constructor & Destructor Documentation

Elements::Elements string  aFileName,
string  aGramAtomFileName
 

loads the elements from a file.

Elements::~Elements  ) 
 

elements destructor. at the moment only a default desctructor, but could eventually delete all chemical elements this class created.


Member Function Documentation

string Elements::getAtomKernelName  ) 
 

returns the filename of the atom kernel matrix loaded. returns "default" if no kernel matrix was loaded.

Atom* Elements::getElement string  aSymbol  ) 
 

returns a pointer to the element designed by aSymbol.

void Elements::loadDefinition string  aFilename  ) 
 

loads the definition of elements.

void Elements::loadGramAtoms string  filename  ) 
 

function to load a gram matrix to compare atoms. this matrix will then be used by the kashima kernel. by default without calling this function, the identity matrix is loaded by the elements constructor.

uint Elements::numElements  )  [inline]
 

returns the number of elements in periodicTable.

Atom* Elements::operator[] string  aSymbol  ) 
 

returns an atom pointer to an element designed using its chemical symbol.


Member Data Documentation

float Elements::gramAtom[NUMELEMENTS][NUMELEMENTS]
 

gram matrix used to compare atoms. can be set with loadGramAtom(). this matrix is initialized to the identity matrix by the constructor.

string Elements::gramAtomName
 

filename of the atom kernel matrix loaded.

map<string, Atom*> Elements::periodicTable [private]
 

hash of atoms indexed by their symbolic names (ex: H, Na,...).


The documentation for this class was generated from the following file:
Generated on Wed Nov 28 12:12:51 2007 for ChemCpp by  doxygen 1.4.6