Hex  2.2
Hydrogen-electron collision solver
wave_distort.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_DISTORTED_WAVE
33 #define HEX_DISTORTED_WAVE
34 
35 #include <gsl/gsl_interp.h>
36 
37 #include "hex-special.h"
38 
39 #include "potential.h"
40 
73 class DistortedWave : public special::RadialFunction<double>
74 {
75 public:
76 
77  // constructors
78  // @{
79  DistortedWave(double _kn, int _ln, DistortingPotential const & _U);
80  DistortedWave(DistortedWave const& W) { *this = W; }
81  // @}
82 
83  // destructor
85 
86  // assignment
88 
92  double operator() (double x) const;
93 
97  Complex getPhasef() const { return Complex(cos(phase),sin(phase)); }
98 
102  double getPhase() const { return phase; }
103 
105  double k() const { return kn; }
106 
108  int l() const { return ln; }
109 
111  double getTurningPoint () const { return r0; }
112 
114  std::pair<double,int> getZeroAsymptotic (double x) const;
115 
117  void toFile(const char * filename) const { write_array(grid, array, filename); }
118 
122  double farRadius() const { return rf; }
123 
124  std::size_t sampleCount() const { return grid.size(); }
125 
127  mutable unsigned Evaluations;
128 
129 private:
130 
131  // distorting potential
133 
134  // interpolator
135  gsl_interp *interpolator, *interpolator0;
136 
137  // distorted wave input parameters
138  double kn; // wavenumber of the distorted wave
139  int ln; // angular momentum of the distorted wave
140 
141  // classical turning point and far radius
142  double r0, rf;
143 
144  // distorted wave computed attributes
145  int samples, samples0; // sample count
146  double h, h0; // discretization step
147 
148  // distorted wave data
149  double phase; // phase shift
150  rArray grid, grid0; // grid
151  rArray array, array0; // samples
152 };
153 
154 #endif
unsigned Evaluations
(debuging parameter) number of evaluations
Definition: wave_distort.h:127
DistortedWave(DistortedWave const &W)
Definition: wave_distort.h:80
Distorting potential information.
Definition: potential.h:86
Distorted wave information.
Definition: wave_distort.h:73
std::size_t sampleCount() const
Definition: wave_distort.h:124
DistortedWave(double _kn, int _ln, DistortingPotential const &_U)
Definition: wave_distort.cpp:122
void toFile(const char *filename) const
Export data to file using write_array.
Definition: wave_distort.h:117
int l() const
Angular momentum.
Definition: wave_distort.h:108
double operator()(double x) const
Definition: wave_distort.cpp:283
DistortedWave operator=(DistortedWave const &W)
Definition: wave_distort.cpp:50
~DistortedWave()
Definition: wave_distort.cpp:276
double farRadius() const
Definition: wave_distort.h:122
double getPhase() const
Definition: wave_distort.h:102
std::pair< double, int > getZeroAsymptotic(double x) const
Near-zero asymptotic behaviour.
Definition: wave_distort.cpp:303
Complex getPhasef() const
Definition: wave_distort.h:97
double k() const
Wavenumber.
Definition: wave_distort.h:105
double getTurningPoint() const
Classical turning point.
Definition: wave_distort.h:111