25 :
Nucleus(particle_list, nTest, spin_interaction_type) {}
28 bool auto_deformation)
30 if (auto_deformation) {
40 const auto &orientation_section = [&config]() {
71 return a_direction.
threevec() * a_radius;
80 const std::map<int, std::string> A_map = {{238,
"Uranium"},
85 const std::map<std::string, std::string> Z_map = {{
"Uranium",
"92"},
137 }
else if (Z == 44) {
141 throw std::domain_error(
142 "Number of protons for nuclei with mass number A = 96 does not "
143 "match that of Zirconium or Ruthenium. The deformation parameters "
144 "for additional isobars are currently not implemented."
145 " Please specify at least \"Beta_2\" and \"Beta_4\" "
146 "manually and set \"Automatic: False.\" ");
150 throw std::domain_error(
151 "Mass number not listed for automatically setting deformation "
152 "parameters. Please specify at least \"Beta_2\" and \"Beta_4\" "
153 "manually and set \"Automatic: False.\" ");
156 throw std::domain_error(
"Mass number is listed under " + A_map.at(A) +
162 Z_map.at(A_map.at(A)) +
164 "Please specify at least \"Beta_2\" and \"Beta_4\" "
165 "manually and set \"Automatic: False.\" ");
173 const auto &[beta2_key, beta3_key, beta4_key,
174 gamma_key] = [&is_projectile]() {
203 double y_l_m(
int l,
int m,
double cosx,
double phi) {
204 if (l == 2 && m == 0) {
205 return (1. / 4) * std::sqrt(5 / M_PI) * (3. * (cosx * cosx) - 1);
206 }
else if (l == 2 && m == 2) {
207 double sinx2 = 1. - cosx * cosx;
208 return (1. / 4) * std::sqrt(15 / (2. * M_PI)) * sinx2 * std::cos(2. * phi);
209 }
else if (l == 3 && m == 0) {
210 return (1. / 4) * std::sqrt(7 / M_PI) *
211 (5. * cosx * (cosx * cosx) - 3. * cosx);
212 }
else if (l == 4 && m == 0) {
213 return (3. / 16) * std::sqrt(1 / M_PI) *
214 (35. * (cosx * cosx) * (cosx * cosx) - 30. * (cosx * cosx) + 3);
216 throw std::domain_error(
217 "Not a valid angular momentum quantum number in y_l_m.");
227 y_l_m(2, 0, cosx, phi) +
228 std::sqrt(2) * std::sin(
gamma_) *
229 y_l_m(2, 2, cosx, phi)) +
241 y_l_m(2, 0, cosx, phi) +
242 std::sqrt(2) * std::sin(
gamma_) *
243 y_l_m(2, 2, cosx, phi)) +
257 const auto result =
integrate(0.0, 2.0 * M_PI, [&](
double phi) {
260 return result.value();
271 const auto result =
integrate(0.01, 1, -1, 1, [&](
double t,
double cosx) {
272 const double r = (1 - t) / t;
273 return twopi * std::pow(r, 2.0) *
279 const auto result =
integrate(0.01, 1, -1, 1, [&](
double t,
double cosx) {
280 const double r = (1 - t) / t;
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
ThreeVector threevec() const
void distribute_isotropically()
Populate the object with a new direction.
Interface to the SMASH configuration files.
bool has_value(const Key< T > &key) const
Return whether there is a non-empty value behind the requested key (which is supposed not to refer to...
bool has_section(const KeyLabels &labels) const
Return whether there is a (possibly empty) section with the given labels.
Configuration extract_complete_sub_configuration(KeyLabels section, Configuration::GetEmpty empty_if_not_existing=Configuration::GetEmpty::No)
Alternative method to extract a sub-configuration, which retains the labels from the top-level in the...
T take(const Key< T > &key)
The default interface for SMASH to read configuration values.
A C++ interface for numerical integration in two dimensions with the Cuba Cuhre integration function.
A C++ interface for numerical integration in one dimension with the GSL CQUAD integration functions.
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
double get_diffusiveness() const
double get_saturation_density() const
double get_nuclear_radius() const
virtual void set_saturation_density(double density)
Sets the saturation density of the nucleus.
size_t number_of_protons() const
Number of physical protons in the nucleus:
size_t number_of_particles() const
Number of physical particles in the nucleus:
void set_orientation_from_config(Configuration &orientation_config)
Set angles for rotation of the nucleus from config file.
The ThreeVector class represents a physical three-vector with the components .
Collection of useful constants that are known at compile time.
SpinInteractionType
Possible spin interaction types.
static Integrator integrate
double y_l_m(int l, int m, double cosx, double phi)
Spherical harmonics Y_2_0, Y_2_2, Y_3_0 and Y_4_0.
std::string to_string(ThermodynamicQuantity quantity)
Convert a ThermodynamicQuantity enum value to its corresponding string.
bool has_projectile_or_target(const Configuration &config)
Find out whether a configuration has a projectile or a target sub-section.
bool is_about_projectile(const Configuration &config)
Find out whether a configuration is about projectile or target.