/*************************************************************************************
* *
* ***** OpenThermo ***** *
* Calculation of thermodynamic functions from molecular data *
* Copyright 2008 Konstantin Tokarev <annulen@users.sourceforge.net> *
* and others *
* *
*************************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License. See COPYING for *
* more details *
* *
*************************************************************************************
* Module name : atom.hpp *
* Author : Tokarev. K *
* Last modification : 2008/08/05 *
* Description : This module contains declarations of class 'Atom', *
* which is used for storage of atomic symbols, coordinates, *
* weights and other properties *
* *
*************************************************************************************/
#ifndef ATOM_HPP
#define ATOM_HPP
#include <iostream>
#include "thermo.h" // Build options
class ColumnVector;
/**
* \class Atom atom.hpp
* \brief Representation of atom
* \author Konstantin Tokarev
*
* Objects of Atom class are used by Structure objects. Normally they
* should be allocated and destroyed by top-level structure - Molecule.
* To initilalize Atom, use SetAtom function. Atom object will access to
* 'elements.dat' file and initialize mass and spin values internally.
* If the file is missing, it's created using default hard coded contents.
*/
class Atom
{
public:
/// Constructor
Atom ();
/// Destructor
~Atom ();
/**
* Initialize atom
* \param x x coordinate in Angstroms
* \param y y coordinate in Angstroms
* \param z z coordinate in Angstroms
* \param Name element symbol
*/
void SetAtom (double x, double y, double z, char * Name);
/// Get coordinates of atom in Angstroms
void GetCoordinates (double & x, double & y, double & z) const;
/// Get radius vector of atom in Angstroms
void GetCoordinates (ColumnVector &R) const;
/// Set coordinates of atom in Angstroms
void SetCoordinates (double x, double y, double z);
/// Get atomic weight in a.u.
double GetWeight () const;
/// Get atomic weight in kg
double GetWeightSI () const;
/// Get atomic number
int GetAtomicNumber () const;
/// Get element symbol of atom
const char * GetName () const;
/// Get nuclear spin of atom (always 0 if spin disabled)
double GetNuclearSpin () const;
/**
* Print line with information about atom. Consists of element symbol,
* XYZ coordinates in Angstroms, mass in a.u. and nuclear spin
*/
friend std::ostream & operator<< (std::ostream & theStream, Atom & theAtom);
// Debug
#ifdef OBJECT_COUNTERS
static int NumOfAtoms;
#endif
private:
int itsAtomicNumber;
char itsName[ATOM_NAME_LENGTH];
double itsNuclearSpin;
double itsX, itsY, itsZ, itsWeight;
};
typedef Atom* AtomPtr;
#endif /* ATOM_HPP */