~ubuntu-branches/ubuntu/precise/kalzium/precise

« back to all changes in this revision

Viewing changes to libscience/isotope.h

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-03 12:28:58 UTC
  • Revision ID: james.westby@ubuntu.com-20110703122858-q1yyxncs89e4w0hs
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef ISOTOPE_H
 
2
#define ISOTOPE_H
 
3
/***************************************************************************
 
4
 *   Copyright (C) 2005-2008 by Carsten Niehaus                            *
 
5
 *   cniehaus@kde.org                                                      *
 
6
 *                                                                         *
 
7
 *   This program is free software; you can redistribute it and/or modify  *
 
8
 *   it under the terms of the GNU General Public License as published by  *
 
9
 *   the Free Software Foundation; either version 2 of the License, or     *
 
10
 *   (at your option) any later version.                                   *
 
11
 *                                                                         *
 
12
 *   This program is distributed in the hope that it will be useful,       *
 
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
14
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
15
 *   GNU General Public License for more details.                          *
 
16
 *                                                                         *
 
17
 *   You should have received a copy of the GNU General Public License     *
 
18
 *   along with this program; if not, write to the                         *
 
19
 *   Free Software Foundation, Inc.,                                       *
 
20
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.          *
 
21
 ***************************************************************************/
 
22
 
 
23
#include "chemicaldataobject.h"
 
24
 
 
25
#include "libkdeedu_science_export.h"
 
26
 
 
27
/**
 
28
 * @author Carsten Niehaus
 
29
 *
 
30
 * This class represents an Isotope with all its properties
 
31
 */
 
32
class SCIENCE_EXPORT Isotope
 
33
{
 
34
        public:
 
35
                /**
 
36
                 * Constructs a new empty isotope.
 
37
                 */
 
38
                Isotope();
 
39
 
 
40
                /**
 
41
                 * Destructor
 
42
                 */
 
43
                ~Isotope();
 
44
 
 
45
                /**
 
46
                 * This struct stores the information how the nucleons in the 
 
47
                 * isotopes are split into neutrons and protons.
 
48
                 */
 
49
                struct Nucleons
 
50
                {
 
51
                        /**
 
52
                         * the number of neutrons of the isotope
 
53
                         */
 
54
                        int neutrons;
 
55
                        
 
56
                        /**
 
57
                         * the number of protons of the isotope
 
58
                         */
 
59
                        int protons;
 
60
                };
 
61
 
 
62
                /**
 
63
                 * @return the mass of the isotope
 
64
                 */
 
65
                double mass() const;
 
66
 
 
67
                /**
 
68
                 * @return the errormargin ( delta mass ) of the isotope
 
69
                 */
 
70
                QString errorMargin() const;
 
71
 
 
72
                /**
 
73
                 * If the isotope belongs to Iron, this method will return "26"
 
74
                 * @return the number of the element the isotope belongs to
 
75
                 */
 
76
                int parentElementNumber() const;
 
77
 
 
78
                /**
 
79
                 * If the isotope belongs to Iron, this method will return "Fe"
 
80
                 * @return the symbol of the element the isotope belongs to
 
81
                 */
 
82
                QString parentElementSymbol() const;
 
83
 
 
84
                QString spin() const;
 
85
 
 
86
                /**
 
87
                 * @return the magnetic moment of the Isotope
 
88
                 */
 
89
                QString magmoment() const;
 
90
 
 
91
                QString abundance() const;              
 
92
 
 
93
                /**
 
94
                 * @return for example '17' if halflife of this Isotope is 17 seconds
 
95
                 * @ref halflife()
 
96
                 */
 
97
                double halflife() const;
 
98
 
 
99
                /**
 
100
                 * @return for example 's' if the unit of the halflife of this Isotope is given in
 
101
                 * seconds
 
102
                 */
 
103
                QString halflifeUnit() const;
 
104
                
 
105
                /**
 
106
                 * add the ChemicalDataObject @p o
 
107
                 */
 
108
                void addData( ChemicalDataObject o );
 
109
 
 
110
                /**
 
111
                 * Set the number of nucleons of the isotope to @number
 
112
                 */ 
 
113
                void setNucleons( int number );
 
114
                
 
115
                /**
 
116
                 * @return the sum of protons and neutrons
 
117
                 */
 
118
                int nucleons() const;
 
119
 
 
120
                /**
 
121
                 * @return decay
 
122
                 */
 
123
                double ecdecay() const;
 
124
 
 
125
                /**
 
126
                 * @return decay likeliness
 
127
                 */
 
128
                double eclikeliness() const;
 
129
 
 
130
                /**
 
131
                 * @return decay
 
132
                 */
 
133
                double betaminusdecay() const;
 
134
                /**
 
135
                 * @return decay likeliness
 
136
                 */
 
137
                double betaminuslikeliness() const;
 
138
 
 
139
                /**
 
140
                 * @return decay
 
141
                 */
 
142
                double betaplusdecay() const;
 
143
                
 
144
                /**
 
145
                 * @return decay likeliness
 
146
                 */
 
147
                double betapluslikeliness() const;
 
148
 
 
149
                /**
 
150
                 * @return decay
 
151
                 */
 
152
                double alphadecay() const;
 
153
 
 
154
                
 
155
                /**
 
156
                 * @return decay
 
157
                 */
 
158
                double alphalikeliness() const;
 
159
 
 
160
                /**
 
161
                 * This enum stores the different kinds of decay
 
162
                 */
 
163
                enum Decay
 
164
                {
 
165
                        ALPHA/**<alpha decay*/,
 
166
                        BETAPLUS/**<beta plus decay*/,
 
167
                        BETAMINUS/**<beta minus decay*/,
 
168
                        EC/**ec decay*/
 
169
                };
 
170
 
 
171
                /**
 
172
                 * @return the nucleons of neutrons of the Isotope after the decay
 
173
                 */
 
174
                Isotope::Nucleons nucleonsAfterDecay( Decay kind );
 
175
 
 
176
 
 
177
        private:
 
178
                /**
 
179
                 * the symbol of the element the isotope belongs to
 
180
                 */
 
181
                ChemicalDataObject m_parentElementSymbol;
 
182
                
 
183
                /**
 
184
                 * stores the information about the mass of the Isotope
 
185
                 */
 
186
                ChemicalDataObject m_mass;
 
187
 
 
188
                /**
 
189
                 * stores the atomicNumber of the Isotope
 
190
                 */
 
191
                ChemicalDataObject m_identifier;
 
192
                
 
193
                /**
 
194
                 * stores the spin of the Isotope
 
195
                 */
 
196
                ChemicalDataObject m_spin;
 
197
                
 
198
                /**
 
199
                 * stores the magneticMoment of the Isotope
 
200
                 */
 
201
                ChemicalDataObject m_magmoment;
 
202
                
 
203
                /**
 
204
                 * stores the relative abundance of the Isotope
 
205
                 */
 
206
                ChemicalDataObject m_abundance; 
 
207
 
 
208
                /**
 
209
                 * stores the halfLife of the Isotope
 
210
                 */
 
211
                ChemicalDataObject m_halflife;
 
212
                
 
213
                /**
 
214
                 * stores decay energy of the isotope
 
215
                 */
 
216
                ChemicalDataObject m_ecdecay;
 
217
                ChemicalDataObject m_betaplusdecay;
 
218
                ChemicalDataObject m_betaminusdecay; 
 
219
                ChemicalDataObject m_alphadecay;
 
220
 
 
221
                /**
 
222
                 * stores the likeliness of a decay of the isotope
 
223
                 */
 
224
                ChemicalDataObject m_eclikeliness;
 
225
                ChemicalDataObject m_betapluslikeliness;
 
226
                ChemicalDataObject m_betaminuslikeliness; 
 
227
                ChemicalDataObject m_alphalikeliness;
 
228
        
 
229
                int m_numberOfNucleons;
 
230
};
 
231
 
 
232
#endif // ISOTOPE_H