ampsci
c++ program for high-precision atomic structure calculations of single-valence systems
NuclearPotentials.hpp
1 #pragma once
2 #include "IO/InputBlock.hpp"
3 #include "NuclearData.hpp" //for Isotope
4 #include <optional>
5 #include <string>
6 #include <vector>
7 class Grid;
8 
9 namespace Nuclear {
10 
12 enum class ChargeDistro { Fermi, spherical, point, Gaussian, custom, Error };
13 
14 ChargeDistro parseType(const std::string &str_type);
15 std::string parseType(ChargeDistro type);
16 
17 //------------------------------------------------------------------------------
18 
20 class Nucleus {
21  // Isotope data
22  Isotope m_iso;
23  // Charge distribution type
24  Nuclear::ChargeDistro m_type;
25  // skin thickness parameter (in fm). Usually 2.3
26  double m_t;
27  // Deformation parameter beta. Usually 0.
28  double m_beta;
29  // Name of input file used to read in custom nuclear potential
30  std::string m_custom_pot_file_name;
31  // Other parameters: not used for now
32  std::vector<double> m_params;
33 
34 public:
35  Nucleus(int in_z = 1, int in_a = 0, const std::string &str_type = "Fermi",
36  double in_rrms = -1.0, double in_t = -1.0, double in_beta = 0.0,
37  const std::vector<double> &in_params = {},
38  const std::string &custom_pot_file_name = "");
39 
40  Nucleus(const std::string &z_str, int in_a,
41  const std::string &str_type = "Fermi", double in_rrms = -1.0,
42  double in_t = Nuclear::default_t, double in_beta = 0.0,
43  const std::vector<double> &in_params = {},
44  const std::string &custom_pot_file_name = "");
45 
46 public:
47  ChargeDistro &type() { return m_type; }
48  ChargeDistro type() const { return m_type; }
49  int &z() { return m_iso.Z; };
50  int z() const { return m_iso.Z; };
51  int &a() { return m_iso.A; };
52  int a() const { return m_iso.A; };
53 
54  const std::vector<double> &params() const { return m_params; };
55  std::vector<double> &params() { return m_params; };
56 
57  void set_rrms(double rrms) { m_iso.r_rms = rrms; }
58  double r_rms() const { return m_iso.r_rms ? *m_iso.r_rms : 0.0; };
59 
60  double &t() { return m_t; };
61  double t() const { return m_t; };
62 
63  double &beta() { return m_beta; };
64  double beta() const { return m_beta; };
65 
66  std::string &custom_pot_file() { return m_custom_pot_file_name; };
67  std::string custom_pot_file() const { return m_custom_pot_file_name; };
68 
69  double c() const { return c_hdr_formula_rrms_t(r_rms(), m_t); }
70 
71  friend std::ostream &operator<<(std::ostream &ostr, const Nucleus &n);
72 };
73 
74 //------------------------------------------------------------------------------
75 Nucleus form_nucleus(int Z, std::optional<int> A = std::nullopt,
76  IO::InputBlock input = {});
77 
78 //------------------------------------------------------------------------------
79 
81 [[nodiscard]] std::vector<double>
82 sphericalNuclearPotential(double Z, double rnuc,
83  const std::vector<double> &rgrid);
84 
86 [[nodiscard]] std::vector<double>
87 GaussianNuclearPotential(double Z, double r_rms,
88  const std::vector<double> &rgrid);
89 
92 [[nodiscard]] std::vector<double>
93 fermiNuclearPotential(double Z, double t, double c,
94  const std::vector<double> &rgrid);
95 
97 [[nodiscard]] std::vector<double>
98 fermiNuclearDensity_tcN(double t, double c, double Z_norm, const Grid &grid);
99 
101 [[nodiscard]] std::vector<double> formPotential(const Nucleus &nucleus,
102  const std::vector<double> &r);
103 
104 } // namespace Nuclear
Holds grid, including type + Jacobian (dr/du)
Definition: Grid.hpp:31
Holds list of Options, and a list of other InputBlocks. Can be initialised with a list of options,...
Definition: InputBlock.hpp:142
Stores set of nuclear parameters (all radii in fm)
Definition: NuclearPotentials.hpp:20
Data and useful functions for nuclear properties and potentials. Radii all in Fermi (fm,...
Definition: nuclear_data_table.hpp:21
double c_hdr_formula_rrms_t(double rrms, double t)
Calculates c from rrms and t.
Definition: NuclearData.cpp:73
std::vector< double > sphericalNuclearPotential(double Z, double rnuc, const std::vector< double > &rgrid)
Nuclear potentials: spherical charge distribution.
Definition: NuclearPotentials.cpp:232
std::vector< double > formPotential(const Nucleus &nuc, const std::vector< double > &r)
Calls one of the above, depending on params. Fills V(r), given r.
Definition: NuclearPotentials.cpp:358
std::vector< double > fermiNuclearDensity_tcN(double t, double c, double Z_norm, const Grid &grid)
Fermi charge distribution, rho(r) - normalised to Z_norm.
Definition: NuclearPotentials.cpp:322
std::vector< double > fermiNuclearPotential(double z, double t, double c, const std::vector< double > &rgrid)
Nuclear potentials: Fermi charge distribution [c is half-density radius, not rms].
Definition: NuclearPotentials.cpp:273
std::vector< double > GaussianNuclearPotential(double Z, double r_rms, const std::vector< double > &rgrid)
Nuclear potentials: Gaussian charge distribution.
Definition: NuclearPotentials.cpp:255
ChargeDistro
Nuclear charge distribution options.
Definition: NuclearPotentials.hpp:12
Isotope data: Z, A, r_rms/fm, I, pi, mu, Q.
Definition: NuclearData.hpp:18
std::optional< double > r_rms
root-mean-square charge radius, in Fermi (fm, e-15m)
Definition: NuclearData.hpp:24
int A
Atomic mass number (A = Z + N)
Definition: NuclearData.hpp:22
int Z
Atomic charge.
Definition: NuclearData.hpp:20