Cantera  2.0
LineBroadener.h
Go to the documentation of this file.
1 /**
2  * @file LineBroadener.h
3  * Header file for class LineBroadener
4  * @ingroup spectroscopy
5  */
6 
7 #include "cantera/base/ct_defs.h"
9 
10 namespace Cantera
11 {
12 
13 /**
14  * Base class for classes implementing line shapes of
15  * various types.
16  * @ingroup spectroscopy
17  */
19 {
20 
21 public:
22 
23  /// Default constructor
25 
26  /// Destructor
27  virtual ~LineBroadener() {}
28 
29  /**
30  * The line shape profile
31  * \f[
32  * P(\Delta\nu)
33  *\f]
34  * as a function of distance from line
35  * center \f$ \Delta\nu \f$.
36  * This function must have total area = 1.0.
37  * Note that this method must be overloaded in each
38  * derived class. If the base class method is called,
39  * an exception will be thrown.
40  */
41  virtual doublereal profile(doublereal deltaFreq) {
42  throw CanteraError("LineBroadener::profile",
43  "base class method called!");
44  }
45 
46  doublereal operator()(doublereal deltaFreq) {
47  return profile(deltaFreq);
48  }
49 
50  /**
51  * The cumulative profile, defined as
52  * \f[
53  * C(\Delta \nu) = \int_{-\infty}^{\Delta \nu} P(x) dx
54  * \f]
55  */
56  virtual doublereal cumulative(doublereal deltaFreq) {
57  throw CanteraError("LineBroadener::cumulative",
58  "base class method called!");
59  }
60 
61  virtual doublereal width() {
62  return 0.0;
63  }
64 };
65 
66 /**
67  * The line shape for pure collisional broadening. The Lorentzian line
68  * shape is
69  * \f[
70  * L(\Delta\nu) = \frac{1}{\pi}\frac{\gamma}{\Delta\nu^2 + \gamma^2}
71  * \f]
72  * where \f$ \gamma = {\mbox{FWHM}/2} \f$.
73  */
75 {
76 public:
77  LorentzianProfile(doublereal FWHM);
78  virtual doublereal profile(doublereal deltaFreq);
79  virtual doublereal cumulative(doublereal deltaFreq);
80  virtual double width();
81 
82 protected:
83  doublereal m_hwhm;
84  doublereal m_hwhm2;
85 };
86 
87 /**
88  * A Gaussian line profile. This profile results when Doppler
89  * broadening is dominant.
90  */
92 {
93 public:
94 
95  /**
96  * Constructor.
97  */
98  GaussianProfile(doublereal sigma);
99  virtual doublereal profile(doublereal deltaFreq);
100  virtual doublereal cumulative(doublereal deltaFreq);
101  virtual doublereal width();
102 
103  doublereal standardDev() {
104  return m_sigma;
105  }
106 
107 protected:
108  doublereal m_sigma;
109  doublereal m_sigma2;
110  doublereal m_width;
111 };
112 
113 
114 /**
115  * A Voigt profile is the convolution of a Lorentzian and a
116  * Gaussian profile. This profile results when Doppler
117  * broadening and collisional broadening both are important.
118  */
119 class Voigt : public LineBroadener
120 {
121 public:
122 
123  /**
124  * Constructor.
125  */
126  Voigt(doublereal sigma, doublereal gamma);
127  virtual doublereal profile(doublereal deltaFreq);
128  //virtual doublereal cumulative(doublereal deltaFreq)
129  //virtual doublereal width()
130 
131  void testv();
132 
133 protected:
134 
135  doublereal F(doublereal x);
136 
137  doublereal m_sigma;
138  doublereal m_gamma_lor;
139  doublereal m_sigma2;
140  doublereal m_width;
141  doublereal m_gamma;
142  doublereal m_sigsqrt2;
143  doublereal m_a;
144  doublereal m_eps;
145 };
146 
147 }