[go: up one dir, main page]

Menu

[r170]: / openthermo / atom.hpp  Maximize  Restore  History

Download this file

98 lines (86 with data), 4.0 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*************************************************************************************
* *
* ***** 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 */