111 :
Nucleus(particle_list, nTest) {}
114 bool auto_deformation)
116 if (auto_deformation) {
122 if (config.
has_value({
"Deformed",
"Orientation"})) {
146 return a_direction.
threevec() * a_radius;
154 std::map<int, std::string> A_map = {
155 {238,
"Uranium"}, {208,
"Lead"}, {197,
"Gold"}, {63,
"Copper"}};
156 std::map<std::string, std::string> Z_map = {
157 {
"Uranium",
"92"}, {
"Lead",
"82"}, {
"Gold",
"79"}, {
"Copper",
"29"}};
197 }
else if (Z == 44) {
200 }
else if (Z == 44) {
204 throw std::domain_error(
205 "Number of protons for nuclei with mass number A = 96 does not " 206 "match that of Zirconium or Ruthenium. The deformation parameters " 207 "for additional isobars are currently not implemented." 208 " Please specify at least \"Beta_2\" and \"Beta_4\" " 209 "manually and set \"Automatic: False.\" ");
213 throw std::domain_error(
214 "Mass number not listed for automatically setting deformation " 215 "parameters. Please specify at least \"Beta_2\" and \"Beta_4\" " 216 "manually and set \"Automatic: False.\" ");
219 throw std::domain_error(
"Mass number is listed under " + A_map[A] +
227 "Please specify at least \"Beta_2\" and \"Beta_4\" " 228 "manually and set \"Automatic: False.\" ");
235 if (config.
has_value({
"Deformed",
"Beta_2"})) {
236 set_beta_2(static_cast<double>(config.
take({
"Deformed",
"Beta_2"})));
238 if (config.
has_value({
"Deformed",
"Beta_4"})) {
239 set_beta_4(static_cast<double>(config.
take({
"Deformed",
"Beta_4"})));
248 if (orientation_config.
has_value({
"Theta"})) {
249 if (orientation_config.
has_value({
"Random_Rotation"}) &&
250 orientation_config.
take({
"Random_Rotation"})) {
251 throw std::domain_error(
252 "Random rotation of nuclei is activated although" 253 " theta is provided. Please specify only either of them. ");
259 if (orientation_config.
has_value({
"Phi"})) {
260 if (orientation_config.
has_value({
"Random_Rotation"}) &&
261 orientation_config.
take({
"Random_Rotation"})) {
262 throw std::domain_error(
263 "Random rotation of nuclei is activated although" 264 " phi is provided. Please specify only either of them. ");
267 static_cast<double>(orientation_config.
take({
"Phi"})));
271 if (orientation_config.
take({
"Random_Rotation"},
false)) {
284 for (
auto &particle : *
this) {
289 ThreeVector three_pos = particle.position().threevec();
292 particle.set_3position(three_pos);
298 return (1. / 4) * std::sqrt(5 / M_PI) * (3. * (cosx * cosx) - 1);
300 return (3. / 16) * std::sqrt(1 / M_PI) *
301 (35. * (cosx * cosx) * (cosx * cosx) - 30. * (cosx * cosx) + 3);
303 throw std::domain_error(
304 "Not a valid angular momentum quantum number in y_l_0.");
double y_l_0(int l, double cosx)
Spherical harmonics Y_2_0 and Y_4_0.
The ThreeVector class represents a physical three-vector with the components .
double get_nuclear_radius() const
Collection of useful constants that are known at compile time.
A nucleus is a collection of particles that are initialized, before the beginning of the simulation a...
double euler_phi_
Euler angel phi.
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.
double get_saturation_density() const
ThreeVector threevec() const
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
double get_diffusiveness() const
double euler_theta_
Euler angel theta.
void random_euler_angles()
Randomly generate Euler angles.
size_t number_of_protons() const
Number of physical protons in the nucleus:
Angles provides a common interface for generating directions: i.e., two angles that should be interpr...
size_t number_of_particles() const
Number of physical particles in the nucleus:
void distribute_isotropically()
Populate the object with a new direction.
void rotate(double phi, double theta, double psi)
Rotate vector by the given Euler angles phi, theta, psi.