Version: SMASH-1.6
potentials.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2018
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #include "smash/potentials.h"
11 
12 #include "smash/constants.h"
13 #include "smash/density.h"
14 
15 namespace smash {
16 
17 Potentials::Potentials(Configuration conf, const DensityParameters &param)
18  : param_(param),
19  use_skyrme_(conf.has_value({"Skyrme"})),
20  use_symmetry_(conf.has_value({"Symmetry"})) {
72  if (use_skyrme_) {
73  skyrme_a_ = conf.take({"Skyrme", "Skyrme_A"});
74  skyrme_b_ = conf.take({"Skyrme", "Skyrme_B"});
75  skyrme_tau_ = conf.take({"Skyrme", "Skyrme_Tau"});
76  }
77 
89  if (use_symmetry_) {
90  symmetry_s_ = conf.take({"Symmetry", "S_Pot"});
91  }
92 }
93 
95 
96 double Potentials::skyrme_pot(const double baryon_density) const {
97  const double tmp = baryon_density / nuclear_density;
98  /* U = U(|rho|) * sgn , because the sign of the potential changes
99  * under a charge reversal transformation. */
100  const int sgn = tmp > 0 ? 1 : -1;
101  // Return in GeV
102  return 1.0e-3 * sgn *
103  (skyrme_a_ * std::abs(tmp) +
104  skyrme_b_ * std::pow(std::abs(tmp), skyrme_tau_));
105 }
106 
107 double Potentials::symmetry_pot(const double baryon_isospin_density) const {
108  return 1.0e-3 * 2. * symmetry_s_ * baryon_isospin_density / nuclear_density;
109 }
110 
111 double Potentials::potential(const ThreeVector &r, const ParticleList &plist,
112  const ParticleType &acts_on) const {
113  double total_potential = 0.0;
114  const bool compute_gradient = false;
115  const bool smearing = true;
116  const auto scale = force_scale(acts_on);
117 
118  if (!acts_on.is_baryon()) {
119  return total_potential;
120  }
121 
122  if (use_skyrme_) {
123  const double rho_eck = std::get<0>(current_eckart(
124  r, plist, param_, DensityType::Baryon, compute_gradient, smearing));
125  total_potential += scale.first * skyrme_pot(rho_eck);
126  }
127  if (use_symmetry_) {
128  const double rho_iso = std::get<0>(
130  compute_gradient, smearing));
131  const double sym_pot = symmetry_pot(rho_iso) * acts_on.isospin3_rel();
132  total_potential += scale.second * sym_pot;
133  }
134  return total_potential;
135 }
136 
137 std::pair<double, int> Potentials::force_scale(const ParticleType &data) const {
138  double skyrme_scale = data.is_baryon() ? 1.0 : 0.0;
139  if (data.pdgcode().is_hyperon()) {
140  if (data.pdgcode().is_Xi()) {
141  skyrme_scale = 1. / 3.;
142  } else if (data.pdgcode().is_Omega()) {
143  skyrme_scale = 0.;
144  } else {
145  skyrme_scale = 2. / 3.;
146  }
147  }
148  skyrme_scale = skyrme_scale * data.pdgcode().baryon_number();
149  const int symmetry_scale = data.pdgcode().baryon_number();
150  return std::make_pair(skyrme_scale, symmetry_scale);
151 }
152 
153 std::pair<ThreeVector, ThreeVector> Potentials::skyrme_force(
154  const double density, const ThreeVector grad_rho, const ThreeVector dj_dt,
155  const ThreeVector rot_j) const {
156  const double MeV_to_GeV = 1.0e-3;
157  ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
158  if (use_skyrme_) {
159  const double dV_drho =
161  std::pow(density / nuclear_density, skyrme_tau_ - 1)) *
162  MeV_to_GeV / nuclear_density;
163  E_component -= dV_drho * (grad_rho + dj_dt);
164  B_component += dV_drho * rot_j;
165  }
166  return std::make_pair(E_component, B_component);
167 }
168 
169 std::pair<ThreeVector, ThreeVector> Potentials::symmetry_force(
170  const ThreeVector grad_rho, const ThreeVector dj_dt,
171  const ThreeVector rot_j) const {
172  const double MeV_to_GeV = 1.0e-3;
173  ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
174  if (use_symmetry_) {
175  const double dV_drho = MeV_to_GeV * 2. * symmetry_s_ / nuclear_density;
176  E_component -= dV_drho * (grad_rho + dj_dt);
177  B_component += dV_drho * rot_j;
178  }
179  return std::make_pair(E_component, B_component);
180 }
181 
182 std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
183 Potentials::all_forces(const ThreeVector &r, const ParticleList &plist) const {
184  const bool compute_gradient = true;
185  const bool smearing = true;
186  auto F_skyrme =
187  std::make_pair(ThreeVector(0., 0., 0.), ThreeVector(0., 0., 0.));
188  auto F_symmetry =
189  std::make_pair(ThreeVector(0., 0., 0.), ThreeVector(0., 0., 0.));
190 
191  if (use_skyrme_) {
192  const auto density_and_gradient = current_eckart(
193  r, plist, param_, DensityType::Baryon, compute_gradient, smearing);
194  const double rho = std::get<0>(density_and_gradient);
195  const ThreeVector grad_rho = std::get<2>(density_and_gradient);
196  const ThreeVector dj_dt = std::get<3>(density_and_gradient);
197  const ThreeVector rot_j = std::get<4>(density_and_gradient);
198  F_skyrme = skyrme_force(rho, grad_rho, dj_dt, rot_j);
199  }
200 
201  if (use_symmetry_) {
202  const auto density_and_gradient =
204  compute_gradient, smearing);
205  const ThreeVector grad_rho = std::get<2>(density_and_gradient);
206  const ThreeVector dj_dt = std::get<3>(density_and_gradient);
207  const ThreeVector rot_j = std::get<4>(density_and_gradient);
208  F_symmetry = symmetry_force(grad_rho, dj_dt, rot_j);
209  }
210 
211  return std::make_tuple(F_skyrme.first, F_skyrme.second, F_symmetry.first,
212  F_symmetry.second);
213 }
214 
215 } // namespace smash
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:30
double skyrme_pot(const double baryon_density) const
Evaluates skyrme potential given a baryon density.
Definition: potentials.cc:96
double skyrme_a_
Parameter of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:186
bool use_symmetry_
Symmetry potential on/off.
Definition: potentials.h:180
~Potentials()
Standard destructor.
Definition: potentials.cc:94
Collection of useful constants that are known at compile time.
int baryon_number() const
Definition: pdgcode.h:308
bool is_Omega() const
Definition: pdgcode.h:346
double symmetry_s_
coefficent in front of the symmetry term.
Definition: potentials.h:201
Potentials(Configuration conf, const DensityParameters &parameters)
Potentials constructor.
virtual std::tuple< ThreeVector, ThreeVector, ThreeVector, ThreeVector > all_forces(const ThreeVector &r, const ParticleList &plist) const
Evaluates the electrical and magnetic components of the forces at point r.
Definition: potentials.cc:183
bool is_baryon() const
Definition: particletype.h:200
Particle type contains the static properties of a particle species.
Definition: particletype.h:97
const DensityParameters param_
Struct that contains the gaussian smearing width , the distance cutoff and the testparticle number n...
Definition: potentials.h:174
bool use_skyrme_
Skyrme potential on/off.
Definition: potentials.h:177
bool is_Xi() const
Definition: pdgcode.h:351
double skyrme_b_
Parameters of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:192
std::pair< ThreeVector, ThreeVector > symmetry_force(const ThreeVector grad_rho, const ThreeVector dj_dt, const ThreeVector rot_j) const
Evaluates the electrical and magnetic components of the symmetry force.
Definition: potentials.cc:169
double potential(const ThreeVector &r, const ParticleList &plist, const ParticleType &acts_on) const
Evaluates potential at point r.
Definition: potentials.cc:111
std::tuple< double, FourVector, ThreeVector, ThreeVector, ThreeVector > current_eckart(const ThreeVector &r, const ParticleList &plist, const DensityParameters &par, DensityType dens_type, bool compute_gradient, bool smearing)
Calculates Eckart rest frame density and 4-current of a given density type and optionally the gradien...
Definition: density.cc:149
std::pair< double, int > force_scale(const ParticleType &data) const
Evaluates the scaling factor of the forces acting on the particles.
Definition: potentials.cc:137
PdgCode pdgcode() const
Definition: particletype.h:156
double skyrme_tau_
Parameters of skyrme potentials: the power index.
Definition: potentials.h:198
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].
Definition: constants.h:42
std::pair< ThreeVector, ThreeVector > skyrme_force(const double density, const ThreeVector grad_rho, const ThreeVector dj_dt, const ThreeVector rot_j) const
Evaluates the electrical and magnetic components of the skyrme force.
Definition: potentials.cc:153
double isospin3_rel() const
Definition: particletype.h:179
bool is_hyperon() const
Definition: pdgcode.h:343
Definition: action.h:24
int sgn(T val)
Signum function.
Definition: random.h:190
double symmetry_pot(const double baryon_isospin_density) const
Evaluates symmetry potential given baryon isospin density.
Definition: potentials.cc:107