Version: SMASH-2.1
smash::DeformedNucleus Class Reference

#include <deformednucleus.h>

DeformedNucleus: Child of nucleus for deformed nuclei.

All options from the nucleus will still apply. The deformed nucleus adds new or updated features which are outlined below.

Definition at line 36 of file deformednucleus.h.

Inheritance diagram for smash::DeformedNucleus:
[legend]
Collaboration diagram for smash::DeformedNucleus:
[legend]

Public Member Functions

 DeformedNucleus (const std::map< PdgCode, int > &particle_list, int nTest)
 Constructor for DeformedNucles which takes a particle list and the number of testparticles. More...
 
 DeformedNucleus (Configuration &config, int nTest, bool auto_deformation)
 Constructor for DeformedNucleus, that needs the configuration parameters from the inputfile and the number of testparticles. More...
 
ThreeVector distribute_nucleon () override
 Deformed Woods-Saxon sampling routine. More...
 
void set_deformation_parameters_automatic ()
 Sets the deformation parameters of the radius according to the current mass number. More...
 
void set_deformation_parameters_from_config (Configuration &config)
 Set parameters for spherical deformation of the nucleus from the values specified in the configuration file. More...
 
void set_orientation_from_config (Configuration &orientation_config)
 Set angles for orientation of nucleus from config file. More...
 
void rotate () override
 Rotates the nucleus according to members nucleus_polar_angle_ and nucleus_azimuthal_angle_ and updates nucleon positions. More...
 
double nucleon_density (double r, double cosx) const override
 Return the deformed Woods-Saxon probability density for the given position. More...
 
void set_beta_2 (double b2)
 Set deformation coefficient for Y_2_0. More...
 
void set_beta_4 (double b4)
 Set deformation coefficient for Y_4_0. More...
 
void set_polar_angle (double theta)
 Set the nucleus polar angle. More...
 
void set_azimuthal_angle (double phi)
 Set the nucleus azimuthal angle. More...
 
double get_beta2 ()
 return the beta2 value. More...
 
double get_beta4 ()
 return the beta4 value. More...
 
- Public Member Functions inherited from smash::Nucleus
 Nucleus ()=default
 default constructor More...
 
 Nucleus (Configuration &config, int nTest)
 Constructor for Nucleus, that needs the configuration parameters from the inputfile and the number of testparticles. More...
 
 Nucleus (const std::map< PdgCode, int > &particle_list, int nTest)
 Constructor which directly initializes the Nucleus with particles and respective counts. More...
 
virtual ~Nucleus ()=default
 
double mass () const
 
double woods_saxon (double x)
 Woods-Saxon distribution. More...
 
virtual void arrange_nucleons ()
 Sets the positions of the nucleons inside a nucleus. More...
 
virtual void set_parameters_automatic ()
 Sets the deformation parameters of the Woods-Saxon distribution according to the current mass number. More...
 
virtual void set_parameters_from_config (Configuration &config)
 Sets the parameters of the Woods-Saxon according to manually added values in the configuration file. More...
 
virtual void generate_fermi_momenta ()
 Generates momenta according to Fermi motion for the nucleons. More...
 
void boost (double beta_scalar)
 Boosts the nuclei into the computational frame, such that the nucleons have the appropriate momentum and the nuclei are lorentz-contracted. More...
 
void fill_from_list (const std::map< PdgCode, int > &particle_list, int testparticles)
 Adds particles from a map PDG code => Number_of_particles_with_that_PDG_code to the nucleus. More...
 
void shift (double z_offset, double x_offset, double simulation_time)
 Shifts the nucleus to correct impact parameter and z displacement. More...
 
void copy_particles (Particles *particles)
 Copies the particles from this nucleus into the particle list. More...
 
size_t size () const
 Number of numerical (=test-)particles in the nucleus: More...
 
size_t number_of_particles () const
 Number of physical particles in the nucleus: More...
 
size_t number_of_protons () const
 Number of physical protons in the nucleus: More...
 
FourVector center () const
 Calculate geometrical center of the nucleus. More...
 
void set_label (BelongsTo label)
 Sets target / projectile labels on nucleons. More...
 
void align_center ()
 Shifts the nucleus so that its center is at (0,0,0) More...
 
std::vector< ParticleData >::iterator begin ()
 For iterators over the particle list: More...
 
std::vector< ParticleData >::iterator end ()
 For iterators over the particle list: More...
 
std::vector< ParticleData >::const_iterator cbegin () const
 For const iterators over the particle list: More...
 
std::vector< ParticleData >::const_iterator cend () const
 For const iterators over the particle list: More...
 
void set_diffusiveness (double diffuse)
 Sets the diffusiveness of the nucleus. More...
 
double get_diffusiveness () const
 
void set_saturation_density (double density)
 Sets the saturation density of the nucleus. More...
 
double get_saturation_density () const
 
double default_nuclear_radius ()
 Default nuclear radius calculated as: More...
 
void set_nuclear_radius (double rad)
 Sets the nuclear radius. More...
 
double get_nuclear_radius () const
 

Private Attributes

double beta2_ = 0.0
 Deformation parameter for angular momentum l=2. More...
 
double beta4_ = 0.0
 Deformation parameter for angular momentum l=4. More...
 
Angles nuclear_orientation_
 Nucleus orientation (initial profile in xz plane) in terms of a pair of angles (theta, phi) More...
 
bool random_rotation_ = false
 Whether the nuclei should be rotated randomly. More...
 

Additional Inherited Members

- Protected Member Functions inherited from smash::Nucleus
void random_euler_angles ()
 Randomly generate Euler angles. More...
 
- Protected Attributes inherited from smash::Nucleus
std::vector< ParticleDataparticles_
 Particles associated with this nucleus. More...
 
double euler_phi_
 Euler angel phi. More...
 
double euler_theta_
 Euler angel theta. More...
 
double euler_psi_
 Euler angel psi. More...
 

Constructor & Destructor Documentation

◆ DeformedNucleus() [1/2]

smash::DeformedNucleus::DeformedNucleus ( const std::map< PdgCode, int > &  particle_list,
int  nTest 
)

Constructor for DeformedNucles which takes a particle list and the number of testparticles.

This constructor is only used for testing purposes.

Parameters
[in]particle_listMap with PDGCode and number of particles which make up the nucleus
[in]nTestnumber of testparticles

Definition at line 93 of file deformednucleus.cc.

95  : Nucleus(particle_list, nTest) {}
Nucleus()=default
default constructor

◆ DeformedNucleus() [2/2]

smash::DeformedNucleus::DeformedNucleus ( Configuration config,
int  nTest,
bool  auto_deformation 
)

Constructor for DeformedNucleus, that needs the configuration parameters from the inputfile and the number of testparticles.

Parameters
[in]configcontains the parameters from the inputfile on the numbers of particles with a certain PDG code
[in]nTestnumber of testparticles
[in]auto_deformationwhether or not deformation parameters should be set automatically

Definition at line 97 of file deformednucleus.cc.

99  : Nucleus(config, nTest) {
100  if (auto_deformation) {
102  } else {
104  }
105 
106  if (config.has_value({"Deformed", "Orientation"})) {
107  Configuration subconfig = config["Deformed"]["Orientation"];
108  set_orientation_from_config(subconfig);
109  }
110 }
void set_orientation_from_config(Configuration &orientation_config)
Set angles for orientation of nucleus from config file.
void set_deformation_parameters_from_config(Configuration &config)
Set parameters for spherical deformation of the nucleus from the values specified in the configuratio...
void set_deformation_parameters_automatic()
Sets the deformation parameters of the radius according to the current mass number.
Here is the call graph for this function:

Member Function Documentation

◆ distribute_nucleon()

ThreeVector smash::DeformedNucleus::distribute_nucleon ( )
overridevirtual

Deformed Woods-Saxon sampling routine.

Returns
Spatial position from uniformly sampling the deformed woods-saxon distribution

Reimplemented from smash::Nucleus.

Definition at line 112 of file deformednucleus.cc.

112  {
113  double a_radius;
114  Angles a_direction;
115  // Set a sensible maximum bound for radial sampling.
116  double radius_max =
119 
120  // Sample the distribution.
121  do {
122  a_direction.distribute_isotropically();
123  // sample r**2 dr
124  a_radius = radius_max * std::cbrt(random::canonical());
125  } while (random::canonical() >
126  nucleon_density(a_radius, a_direction.costheta()) /
128 
129  // Update (x, y, z) positions.
130  return a_direction.threevec() * a_radius;
131 }
double nucleon_density(double r, double cosx) const override
Return the deformed Woods-Saxon probability density for the given position.
double get_diffusiveness() const
Definition: nucleus.h:302
double get_saturation_density() const
Definition: nucleus.h:314
double get_nuclear_radius() const
Definition: nucleus.h:342
T canonical()
Definition: random.h:113
Here is the call graph for this function:

◆ set_deformation_parameters_automatic()

void smash::DeformedNucleus::set_deformation_parameters_automatic ( )

Sets the deformation parameters of the radius according to the current mass number.

The deformation parameters are taken from Moller:1993ed [34]. Corrections to the deformation parameter beta2 in Uranium come from Kuhlman:2005ts [29]. For finite nucleon size corrections to the nuclear density and radius for copper and gold, see Hirano:2009ah [22], and Hirano:2010jg [24] for uranium.

Definition at line 133 of file deformednucleus.cc.

133  {
134  // Set the deformation parameters
135  // reference for U, Pb, Au, Cu: \iref{Moller:1993ed}
136  // reference for Zr and Ru: \iref{Schenke:2019ruo}
137  bool listed = 0;
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"}};
143  int Z = Nucleus::number_of_protons();
144  switch (A) {
145  case 238: // Uranium
146  if (Z == 92) {
147  set_beta_2(0.28);
148  set_beta_4(0.093);
149  } else {
150  listed = true;
151  }
152  break;
153  case 208: // Lead
154  if (Z == 82) {
155  set_beta_2(0.0);
156  set_beta_4(0.0);
157  } else {
158  listed = true;
159  }
160  break;
161  case 197: // Gold
162  if (Z == 79) {
163  set_beta_2(-0.131);
164  set_beta_4(-0.031);
165  } else {
166  listed = true;
167  }
168  break;
169  case 63: // Copper
170  if (Z == 29) {
171  set_beta_2(0.162);
172  set_beta_4(-0.006);
173  } else {
174  listed = true;
175  }
176  break;
177  case 96:
178  if (Z == 40) { // Zirconium
179  set_beta_2(0.0);
180  set_beta_4(0.0);
181  } else if (Z == 44) { // Ruthenium
182  set_beta_2(0.158);
183  set_beta_4(0.0);
184  } else {
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.\" ");
191  }
192  break;
193  default:
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.\" ");
198  }
199  if (listed) {
200  throw std::domain_error("Mass number is listed under " + A_map.at(A) +
201  " but the proton "
202  "number of " +
203  std::to_string(Z) +
204  " does not match "
205  "its " +
206  Z_map.at(A_map.at(A)) +
207  " protons."
208  "Please specify at least \"Beta_2\" and \"Beta_4\" "
209  "manually and set \"Automatic: False.\" ");
210  }
211 }
void set_beta_2(double b2)
Set deformation coefficient for Y_2_0.
void set_beta_4(double b4)
Set deformation coefficient for Y_4_0.
size_t number_of_protons() const
Number of physical protons in the nucleus:
Definition: nucleus.h:183
size_t number_of_particles() const
Number of physical particles in the nucleus:
Definition: nucleus.h:164
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_deformation_parameters_from_config()

void smash::DeformedNucleus::set_deformation_parameters_from_config ( Configuration config)

Set parameters for spherical deformation of the nucleus from the values specified in the configuration file.

Parameters
configThe configuration for the deformation of this nucleus (projectile or target).

Definition at line 213 of file deformednucleus.cc.

214  {
215  // Deformation parameters.
216  if (config.has_value({"Deformed", "Beta_2"})) {
217  set_beta_2(static_cast<double>(config.take({"Deformed", "Beta_2"})));
218  }
219  if (config.has_value({"Deformed", "Beta_4"})) {
220  set_beta_4(static_cast<double>(config.take({"Deformed", "Beta_4"})));
221  }
222 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_orientation_from_config()

void smash::DeformedNucleus::set_orientation_from_config ( Configuration orientation_config)

Set angles for orientation of nucleus from config file.

Parameters
[in]orientation_configThe configuration for the deformation of this nucleus (projectile or target).

Definition at line 224 of file deformednucleus.cc.

225  {
226  // Read in orientation if provided, otherwise, the defaults are
227  // theta = pi/2, phi = 0, as declared in the angles class
228 
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. ");
235  } else {
236  set_polar_angle(static_cast<double>(orientation_config.take({"Theta"})));
237  }
238  }
239 
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. ");
246  } else {
248  static_cast<double>(orientation_config.take({"Phi"})));
249  }
250  }
251 
252  if (orientation_config.take({"Random_Rotation"}, false)) {
253  random_rotation_ = true;
254  }
255 }
bool random_rotation_
Whether the nuclei should be rotated randomly.
void set_polar_angle(double theta)
Set the nucleus polar angle.
void set_azimuthal_angle(double phi)
Set the nucleus azimuthal angle.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate()

void smash::DeformedNucleus::rotate ( )
overridevirtual

Rotates the nucleus according to members nucleus_polar_angle_ and nucleus_azimuthal_angle_ and updates nucleon positions.

Reimplemented from smash::Nucleus.

Definition at line 257 of file deformednucleus.cc.

257  {
258  if (random_rotation_) {
259  // Randomly generate euler angles for theta and phi. Psi needs not be
260  // assigned, as the nucleus objects are symmetric with respect to psi.
264  }
265  for (auto &particle : *this) {
266  /* Rotate every vector by the nuclear azimuth phi and polar angle
267  * theta (the Euler angles). This means applying the matrix for a
268  * rotation of phi about z, followed by the matrix for a rotation
269  * theta about the rotated x axis. The third angle psi is 0 by symmetry.*/
270  ThreeVector three_pos = particle.position().threevec();
271  three_pos.rotate(nuclear_orientation_.phi(), nuclear_orientation_.theta(),
272  0.);
273  particle.set_3position(three_pos);
274  }
275 }
double theta() const
Definition: angles.h:272
double phi() const
Definition: angles.h:260
Angles nuclear_orientation_
Nucleus orientation (initial profile in xz plane) in terms of a pair of angles (theta,...
double euler_theta_
Euler angel theta.
Definition: nucleus.h:274
void random_euler_angles()
Randomly generate Euler angles.
Definition: nucleus.cc:497
double euler_phi_
Euler angel phi.
Definition: nucleus.h:272
Here is the call graph for this function:

◆ nucleon_density()

double smash::DeformedNucleus::nucleon_density ( double  r,
double  cosx 
) const
overridevirtual

Return the deformed Woods-Saxon probability density for the given position.

This corresponds to the nuclear density at the very same position.

Parameters
[in]rThe radius at which to sample
[in]cosxThe cosine of the polar angle at which to sample
Returns
The Woods-Saxon density

Reimplemented from smash::Nucleus.

Definition at line 289 of file deformednucleus.cc.

289  {
291  (1 + std::exp((r - Nucleus::get_nuclear_radius() *
292  (1 + beta2_ * y_l_0(2, cosx) +
293  beta4_ * y_l_0(4, cosx))) /
295 }
double beta4_
Deformation parameter for angular momentum l=4.
double beta2_
Deformation parameter for angular momentum l=2.
double y_l_0(int l, double cosx)
Spherical harmonics Y_2_0 and Y_4_0.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_beta_2()

void smash::DeformedNucleus::set_beta_2 ( double  b2)
inline

Set deformation coefficient for Y_2_0.

Parameters
[in]b2deformation coefficient for l=2

Definition at line 110 of file deformednucleus.h.

110 { beta2_ = b2; }
Here is the caller graph for this function:

◆ set_beta_4()

void smash::DeformedNucleus::set_beta_4 ( double  b4)
inline

Set deformation coefficient for Y_4_0.

Parameters
[in]b4deformation coefficient for l=4

Definition at line 115 of file deformednucleus.h.

115 { beta4_ = b4; }
Here is the caller graph for this function:

◆ set_polar_angle()

void smash::DeformedNucleus::set_polar_angle ( double  theta)
inline

Set the nucleus polar angle.

Parameters
[in]thetaPolar angle of position inside nucleus

Definition at line 120 of file deformednucleus.h.

120  {
122  }
void set_theta(const double theta)
Set the polar angle.
Definition: angles.h:218
Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_azimuthal_angle()

void smash::DeformedNucleus::set_azimuthal_angle ( double  phi)
inline

Set the nucleus azimuthal angle.

Parameters
[in]phiAzimuthal angle of position inside nucleus

Definition at line 127 of file deformednucleus.h.

127  {
129  }
void set_phi(const double phi)
Sets the azimuthal angle.
Definition: angles.h:194
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_beta2()

double smash::DeformedNucleus::get_beta2 ( )
inline

return the beta2 value.

Definition at line 133 of file deformednucleus.h.

133 { return beta2_; }

◆ get_beta4()

double smash::DeformedNucleus::get_beta4 ( )
inline

return the beta4 value.

Definition at line 137 of file deformednucleus.h.

137 { return beta4_; }

Member Data Documentation

◆ beta2_

double smash::DeformedNucleus::beta2_ = 0.0
private

Deformation parameter for angular momentum l=2.

Definition at line 141 of file deformednucleus.h.

◆ beta4_

double smash::DeformedNucleus::beta4_ = 0.0
private

Deformation parameter for angular momentum l=4.

Definition at line 143 of file deformednucleus.h.

◆ nuclear_orientation_

Angles smash::DeformedNucleus::nuclear_orientation_
private

Nucleus orientation (initial profile in xz plane) in terms of a pair of angles (theta, phi)

Definition at line 148 of file deformednucleus.h.

◆ random_rotation_

bool smash::DeformedNucleus::random_rotation_ = false
private

Whether the nuclei should be rotated randomly.

Definition at line 152 of file deformednucleus.h.


The documentation for this class was generated from the following files: