95 :
Nucleus(particle_list, nTest) {}
98 bool auto_deformation)
100 if (auto_deformation) {
106 if (config.
has_value({
"Deformed",
"Orientation"})) {
130 return a_direction.
threevec() * a_radius;
138 const std::map<int, std::string> A_map = {
139 {238,
"Uranium"}, {208,
"Lead"}, {197,
"Gold"}, {63,
"Copper"}};
140 const std::map<std::string, std::string> Z_map = {
141 {
"Uranium",
"92"}, {
"Lead",
"82"}, {
"Gold",
"79"}, {
"Copper",
"29"}};
181 }
else if (Z == 44) {
185 throw std::domain_error(
186 "Number of protons for nuclei with mass number A = 96 does not "
187 "match that of Zirconium or Ruthenium. The deformation parameters "
188 "for additional isobars are currently not implemented."
189 " Please specify at least \"Beta_2\" and \"Beta_4\" "
190 "manually and set \"Automatic: False.\" ");
194 throw std::domain_error(
195 "Mass number not listed for automatically setting deformation "
196 "parameters. Please specify at least \"Beta_2\" and \"Beta_4\" "
197 "manually and set \"Automatic: False.\" ");
200 throw std::domain_error(
"Mass number is listed under " + A_map.at(A) +
206 Z_map.at(A_map.at(A)) +
208 "Please specify at least \"Beta_2\" and \"Beta_4\" "
209 "manually and set \"Automatic: False.\" ");
216 if (config.
has_value({
"Deformed",
"Beta_2"})) {
217 set_beta_2(
static_cast<double>(config.
take({
"Deformed",
"Beta_2"})));
219 if (config.
has_value({
"Deformed",
"Beta_4"})) {
220 set_beta_4(
static_cast<double>(config.
take({
"Deformed",
"Beta_4"})));
229 if (orientation_config.
has_value({
"Theta"})) {
230 if (orientation_config.
has_value({
"Random_Rotation"}) &&
231 orientation_config.
take({
"Random_Rotation"})) {
232 throw std::domain_error(
233 "Random rotation of nuclei is activated although"
234 " theta is provided. Please specify only either of them. ");
240 if (orientation_config.
has_value({
"Phi"})) {
241 if (orientation_config.
has_value({
"Random_Rotation"}) &&
242 orientation_config.
take({
"Random_Rotation"})) {
243 throw std::domain_error(
244 "Random rotation of nuclei is activated although"
245 " phi is provided. Please specify only either of them. ");
248 static_cast<double>(orientation_config.
take({
"Phi"})));
252 if (orientation_config.
take({
"Random_Rotation"},
false)) {
265 for (
auto &particle : *
this) {
270 ThreeVector three_pos = particle.position().threevec();
273 particle.set_3position(three_pos);
279 return (1. / 4) * std::sqrt(5 / M_PI) * (3. * (cosx * cosx) - 1);
281 return (3. / 16) * std::sqrt(1 / M_PI) *
282 (35. * (cosx * cosx) * (cosx * cosx) - 30. * (cosx * cosx) + 3);
284 throw std::domain_error(
285 "Not a valid angular momentum quantum number in y_l_0.");
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(std::initializer_list< const char * > keys) const
Returns whether there is a non-empty value behind the requested keys.
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
double get_diffusiveness() const
double euler_theta_
Euler angel theta.
double get_saturation_density() const
void random_euler_angles()
Randomly generate Euler angles.
double get_nuclear_radius() const
double euler_phi_
Euler angel phi.
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:
The ThreeVector class represents a physical three-vector with the components .
void rotate(double phi, double theta, double psi)
Rotate vector by the given Euler angles phi, theta, psi.
Collection of useful constants that are known at compile time.
double y_l_0(int l, double cosx)
Spherical harmonics Y_2_0 and Y_4_0.