1 | #ifndef PERIODENTAFEL_HPP_
|
---|
2 | #define PERIODENTAFEL_HPP_
|
---|
3 |
|
---|
4 | using namespace std;
|
---|
5 |
|
---|
6 | #include "defs.hpp"
|
---|
7 | #include "helpers.hpp"
|
---|
8 |
|
---|
9 | // include config.h
|
---|
10 | #ifdef HAVE_CONFIG_H
|
---|
11 | #include <config.h>
|
---|
12 | #endif
|
---|
13 |
|
---|
14 | // ====================================== class definitions =========================
|
---|
15 |
|
---|
16 | class element;
|
---|
17 | class periodentafel;
|
---|
18 |
|
---|
19 | /** Chemical element.
|
---|
20 | * Class incorporates data for a certain chemical element to be referenced from atom class.
|
---|
21 | */
|
---|
22 | class element {
|
---|
23 | public:
|
---|
24 | double mass; //!< mass in g/mol
|
---|
25 | double CovalentRadius; //!< covalent radius
|
---|
26 | double VanDerWaalsRadius; //!< can-der-Waals radius
|
---|
27 | int Z; //!< atomic number
|
---|
28 | char name[64]; //!< atom name, i.e. "Hydrogren"
|
---|
29 | char symbol[3]; //!< short form of the atom, i.e. "H"
|
---|
30 | char period[8]; //!< period: n quantum number
|
---|
31 | char group[8]; //!< group: l quantum number
|
---|
32 | char block[8]; //!< block: l quantum number
|
---|
33 | element *previous; //!< previous item in list
|
---|
34 | element *next; //!< next element in list
|
---|
35 | int *sort; //!< sorc criteria
|
---|
36 | int No; //!< number of element set on periodentafel::Output()
|
---|
37 | double Valence; //!< number of valence electrons for this element
|
---|
38 | int NoValenceOrbitals; //!< number of valence orbitals, used for determining bond degree in molecule::CreateConnectmatrix()
|
---|
39 | double HBondDistance[NDIM]; //!< distance in Angstrom of this element to hydrogen (for single, double and triple bonds)
|
---|
40 | double HBondAngle[NDIM]; //!< typical angle for one, two, three bonded hydrogen (in degrees)
|
---|
41 |
|
---|
42 | element();
|
---|
43 | ~element();
|
---|
44 |
|
---|
45 | //> print element entries to screen
|
---|
46 | bool Output(ofstream *out) const;
|
---|
47 | bool Checkout(ofstream *out, const int No, const int NoOfAtoms) const;
|
---|
48 |
|
---|
49 | private:
|
---|
50 | };
|
---|
51 |
|
---|
52 | /** Periodentafel is a list of all elements sorted by their atomic number.
|
---|
53 | */
|
---|
54 | class periodentafel {
|
---|
55 | public:
|
---|
56 | element *start; //!< start of element list
|
---|
57 | element *end; //!< end of element list
|
---|
58 | char header1[MAXSTRINGSIZE]; //!< store first header line
|
---|
59 | char header2[MAXSTRINGSIZE]; //!< store second header line
|
---|
60 |
|
---|
61 | periodentafel();
|
---|
62 | ~periodentafel();
|
---|
63 |
|
---|
64 | bool AddElement(element *pointer);
|
---|
65 | bool RemoveElement(element *pointer);
|
---|
66 | bool CleanupPeriodtable();
|
---|
67 | element * FindElement(int Z);
|
---|
68 | element * FindElement(char *shorthand) const;
|
---|
69 | element * AskElement();
|
---|
70 | bool Output(ofstream *output) const;
|
---|
71 | bool Checkout(ofstream *output, const int *checkliste) const;
|
---|
72 | bool LoadPeriodentafel(char *path = NULL);
|
---|
73 | bool StorePeriodentafel(char *path = NULL) const;
|
---|
74 |
|
---|
75 | private:
|
---|
76 | };
|
---|
77 |
|
---|
78 |
|
---|
79 | #endif /*PERIODENTAFEL_HPP_*/
|
---|