Cantera  2.1.2
Nuclei.h
Go to the documentation of this file.
1 /**
2  * @file Nuclei.h Provides class Nucleus
3  */
4 
5 #ifndef CT_NUCL_H
6 #define CT_NUCL_H
7 
8 #include "cantera/base/ct_defs.h"
9 #include "cantera/base/global.h"
10 
11 namespace Cantera
12 {
13 
14 /**
15  * Represents atomic nuclei. These classes only provide minimal
16  * information, and are designed only to handle nuclear statistics
17  * effects on spectra.
18  * @ingroup spectroscopy
19  * @deprecated incomplete / abandoned
20  */
21 class Nucleus
22 {
23 public:
24  Nucleus(const std::string& symbol,
25  int nP, int nN, doublereal spin) : m_np(nP),
26  m_nn(nN), m_spin(spin),
27  m_sym(symbol) {
28  warn_deprecated("class Nucleus");
29  }
30  virtual ~Nucleus() {}
31  int nProtons() {
32  return m_np;
33  }
34  int mNeutrons() {
35  return m_nn;
36  }
37  doublereal spin() {
38  return m_spin;
39  }
40  int multiplicity() {
41  return (int)(2*m_spin) + 1;
42  }
43  int atomicNumber() {
44  return m_np;
45  }
46  std::string symbol() {
47  return m_sym;
48  }
49 
50  bool operator==(Nucleus& b) {
51  if (m_np == b.m_np && m_nn == b.m_nn) {
52  return true;
53  } else {
54  return false;
55  }
56  }
57 
58  bool operator!=(Nucleus& b) {
59  return !(*this == b);
60  }
61 
62  bool isBoson() {
63  return (m_spin - std::floor(m_spin) < 0.001);
64  }
65 
66 
67 protected:
68 
69  int m_np; //< Number of protons
70  int m_nn; //< Number of electrons
71  doublereal m_spin; //< Spin.
72  std::string m_sym; //< Symbol.
73 };
74 
75 inline Nucleus* HydrogenNucleus()
76 {
77  return new Nucleus("H", 1, 0, 0.5);
78 }
79 inline Nucleus* DeuteriumNucleus()
80 {
81  return new Nucleus("D", 1, 1, 1.0);
82 }
83 inline Nucleus* TritiumNucleus()
84 {
85  return new Nucleus("T", 1, 2, 0.5);
86 }
87 inline Nucleus* He3Nucleus()
88 {
89  return new Nucleus("He3", 2, 1, 0.5);
90 }
91 inline Nucleus* He4Nucleus()
92 {
93  return new Nucleus("He3", 2, 2, 0.0);
94 }
95 inline Nucleus* C12nucleus()
96 {
97  return new Nucleus("C12", 6, 6, 0.0);
98 }
99 inline Nucleus* C13nucleus()
100 {
101  return new Nucleus("C13", 6, 7, 0.5);
102 }
103 inline Nucleus* N14nucleus()
104 {
105  return new Nucleus("N14", 7, 7, 1.0);
106 }
107 inline Nucleus* N15nucleus()
108 {
109  return new Nucleus("N15", 7, 8, 0.5);
110 }
111 inline Nucleus* O16nucleus()
112 {
113  return new Nucleus("O16", 8, 8, 0.0);
114 }
115 inline Nucleus* O17nucleus()
116 {
117  return new Nucleus("O17", 8, 9, 2.5);
118 }
119 inline Nucleus* O18nucleus()
120 {
121  return new Nucleus("O18", 8, 10, 0.0);
122 }
123 inline Nucleus* F19nucleus()
124 {
125  return new Nucleus("F19", 9, 10, 0.5);
126 }
127 
128 
129 } // Cantera
130 
131 #endif
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:76
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, HTML_logs (see Input File Handling, Diagnostic Output, Writing messages to the screen and Writing HTML Logfiles).
Represents atomic nuclei.
Definition: Nuclei.h:21