2 #include "FGRadPot.hpp"
3 #include "IO/FRW_fileReadWrite.hpp"
4 #include "IO/InputBlock.hpp"
5 #include "Maths/Interpolator.hpp"
6 #include "Physics/PhysConst_constants.hpp"
7 #include "qip/Vector.hpp"
21 double u, h, l, m, wk;
33 std::vector<double> m_x;
37 Xl(std::vector<double> x);
39 double operator()(
int l)
const;
44 double m_Z, m_rN, m_rcut;
49 std::vector<double> mVu{};
50 std::vector<double> mVh{};
51 std::vector<double> mVl{};
52 std::vector<double> mHm{};
53 std::vector<double> mVwk{};
63 RadPot(
const std::vector<double> &r,
double Z,
double rN = 0.0,
64 double rcut = 0.0, Scale f = {1.0, 1.0, 1.0, 1.0, 0.0}, Xl xl = {},
65 bool tprint =
true,
bool do_readwrite =
true);
67 bool read_write(
const std::vector<double> &r, IO::FRW::RoW rw);
69 void form_potentials(
const std::vector<double> &r);
72 std::vector<double>
Vel(
int l = 0)
const;
74 std::vector<double>
Hmag(
int)
const;
75 std::vector<double> Vu(
int l = 0)
const;
76 std::vector<double> Vl(
int l = 0)
const;
77 std::vector<double> Vh(
int l = 0)
const;
79 template <
typename Func>
80 std::vector<double> fill(Func f,
const std::vector<double> &r);
82 template <
typename Func>
83 std::vector<double> fill(Func f,
const std::vector<double> &r,
89 template <
typename Func>
90 std::vector<double> RadPot::fill(Func f,
const std::vector<double> &r) {
91 std::vector<double> v;
94 const auto rcut = m_rcut == 0.0 ? r.back() : m_rcut;
97 const auto icut = std::size_t(std::distance(
99 std::find_if(begin(r), end(r), [rcut](
auto ri) {
return ri > rcut; })));
101 #pragma omp parallel for
102 for (
auto i = 0ul; i < icut; ++i) {
104 v[i] = -
f(m_Z, r[i], m_rN);
110 template <
typename Func>
111 std::vector<double> RadPot::fill(Func f,
const std::vector<double> &r,
112 std::size_t stride) {
114 const auto rcut = m_rcut == 0.0 ? r.back() : m_rcut;
118 std::size_t(std::distance(
119 begin(r), std::find_if(begin(r), end(r),
120 [rcut](
auto ri) {
return ri > rcut; }))) /
123 std::vector<double> tv, tr;
127 #pragma omp parallel for
128 for (
auto i = 0ul; i < icut; ++i) {
130 tv[i] = -
f(m_Z, r[i * stride], m_rN);
131 tr[i] = r[i * stride];
138 RadPot ConstructRadPot(
const std::vector<double> &r,
double Z_eff,
double rN_au,
140 bool do_readwrite =
true);
Class holds Flambaum-Ginges QED Radiative Potential.
Definition: RadPot.hpp:15
std::vector< double > Vel(int l=0) const
Returns entire electric part of potential.
Definition: RadPot.cpp:151
RadPot()
Empty constructor.
Definition: RadPot.cpp:25
std::vector< double > Hmag(int) const
Returns H_mag.
Definition: RadPot.cpp:160
double f(RaB r, PrincipalQN n, DiracQN k, Zeff z, AlphaFS a)
Upper radial component.
Definition: DiracHydrogen.cpp:71
std::vector< double > interpolate(const std::vector< double > &x_in, const std::vector< double > &y_in, const std::vector< double > &x_out, Method method=Method::cspline)
Performs interpolation using GSL (GNU Scientific Library)
Definition: Interpolator.hpp:162
void QED(const IO::InputBlock &input, const Wavefunction &wf)
Calculates QED corrections to energies and matrix elements.
Definition: qed.cpp:20
Scale factors for Uehling, high, low, magnetic, Wickman-Kroll.
Definition: RadPot.hpp:20
Extra fitting for s,p,d etc. states.
Definition: RadPot.hpp:30