Hex: src/amplitudes.h Source File

| Hex 2.2 Hydrogen-electron collision solver

amplitudes.h
Go to the documentation of this file.
1 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
2 // //
3 // / / / / __ \ \ / / //
4 // / /__ / / / _ \ \ \/ / //
5 // / ___ / | |/_/ / /\ \ //
6 // / / / / \_\ / / \ \ //
7 // //
8 // //
9 // Copyright (c) 2016, Jakub Benda, Charles University in Prague //
10 // //
11 // MIT License: //
12 // //
13 // Permission is hereby granted, free of charge, to any person obtaining a //
14 // copy of this software and associated documentation files (the "Software"), //
15 // to deal in the Software without restriction, including without limitation //
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense, //
17 // and/or sell copies of the Software, and to permit persons to whom the //
18 // Software is furnished to do so, subject to the following conditions: //
19 // //
20 // The above copyright notice and this permission notice shall be included //
21 // in all copies or substantial portions of the Software. //
22 // //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS //
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //
26 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, //
27 // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF //
28 // OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. //
29 // //
30 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32 #ifndef HEX_AMPLITUDES
33 #define HEX_AMPLITUDES
34
35 #include <vector>
36
37 #include "hex-arrays.h"
38 #include "hex-chebyshev.h"
39
40 #include "bspline.h"
41 #include "io.h"
42 #include "parallel.h"
43 #include "radial.h"
44
60 class Amplitudes
61 {
62 public:
63
64 Amplitudes
65 (
66 Bspline const & bspline_inner,
67 Bspline const & bspline_full,
68 InputFile const & inp,
69 Parallel const & par,
70 CommandLine const & cmd,
71 std::vector<std::pair<int,int>> const & ang
72 );
73
83 void extract (std::string directory = ".");
84
93 void writeSQL_files (std::string directory = ".");
94
114 void writeICS_files (std::string directory = ".");
115
121 void verbose (bool b) { verbose_ = b; }
122
123 private:
124
139 typedef struct tTransition
140 {
141 // initial state
142 int ni, li, mi;
143
144 // final state
145 int nf, lf, mf;
146
147 // necessary ordering operator so that we can use this structure as an index in std::map
148 bool operator < (tTransition const & t) const
149 {
150 #define Compare(x) if (x < t.x) return true; if (x > t.x) return false;
151
152 // perform standard lexicographic comparison (by components)
153 Compare(ni); Compare(li); Compare(mi);
154 Compare(nf); Compare(lf); Compare(mf);
155
156 // they are equal
157 return false;
158 }
159 }
160 Transition;
161
162 // Λ[ie] for both spins indexed by (ni,li,mi,nf,lf,mf) and l'
163 std::map<Transition,std::vector<std::pair<cArray,cArray>>> Lambda_Slp;
164
165 // T[ie] for both spins indexed by (ni,li,mi,nf,lf,mf) and l'
166 std::map<Transition,std::vector<std::pair<cArray,cArray>>> Tmat_Slp;
167
168 // σ[ie] for both spins indexed by (ni,li,mi,nf,lf,mf)
169 std::map<Transition,std::pair<rArray,rArray>> sigma_S;
170
171 // Ξ[ie] (lists of Chebyshev coefficients) indexed by (ni,li,mi) and (l1,l2)
172 std::map<Transition,std::vector<std::pair<cArray,cArray>>> Xi_Sl1l2;
173
189 void computeLambda_ (Transition T, BlockArray<Complex> & solution, int ie, int Spin);
190
204 void computeTmat_ (Transition T);
205
239 void computeXi_ (Transition T, BlockArray<Complex> & solution, int ie, int Spin);
240
247 void computeSigma_ (Transition T);
248
249 Chebyshev<double,Complex> fcheb (cArrayView const & PsiSc, Real kmax, int l1, int l2);
250 void computeSigmaIon_ (Transition T);
251
252 cArray readAtomPseudoState (int lf, int ichan) const;
253
254 // B-spline environment
255 Bspline const & bspline_inner_;
256 Bspline const & bspline_full_;
257
258 // radial integrals
259 RadialIntegrals rad_;
260
261 // input data
262 InputFile const & inp_;
263
264 // parallel environment
265 Parallel const & par_;
266
267 // command line switches
268 CommandLine const & cmd_;
269
270 // angular basis
271 std::vector<std::pair<int,int>> const & ang_;
272
273 // solution reader
274 SolutionIO reader_;
275
276 // standard output verbosity
277 bool verbose_;
278 };
279
280 #endif
RadialIntegrals
Class that calculates and manages the radial integrals for given B-spline bases.
Definition: radial.h:89
bspline.h
Bspline
B-spline environment.
Definition: bspline.h:57
Amplitudes::verbose
void verbose(bool b)
Set verbosity level.
Definition: amplitudes.h:121
Compare
#define Compare(x)
io.h
SolutionIO
Solution input/output class.
Definition: io.h:414
Amplitudes::writeICS_files
void writeICS_files(std::string directory=".")
Write integral cross sections to file.
Definition: amplitudes.cpp:342
Amplitudes::extract
void extract(std::string directory=".")
Extract the amplitudes.
Definition: amplitudes.cpp:98
CommandLine
Command line parameters.
Definition: io.h:57
parallel.h
Amplitudes::writeSQL_files
void writeSQL_files(std::string directory=".")
Write SQL batch file.
Definition: amplitudes.cpp:239
InputFile
Input parameters.
Definition: io.h:321
Amplitudes
Extraction of amplitudes from solutions.
Definition: amplitudes.h:60
Parallel
MPI info.
Definition: parallel.h:50
Amplitudes::Amplitudes
Amplitudes(Bspline const &bspline_inner, Bspline const &bspline_full, InputFile const &inp, Parallel const &par, CommandLine const &cmd, std::vector< std::pair< int, int >> const &ang)
Definition: amplitudes.cpp:83
radial.h