22 use_skyrme_(conf.has_section(InputSections::
p_skyrme)),
23 use_symmetry_(conf.has_section(InputSections::
p_symmetry)),
24 use_coulomb_(conf.has_section(InputSections::
p_coulomb)),
25 use_vdf_(conf.has_section(InputSections::
p_vdf)),
26 use_momentum_dependence_(
28 use_potentials_outside_lattice_(
29 conf.take(
InputKeys::potentials_use_potentials_outside_lattice)) {
56 throw std::invalid_argument(
57 "The number of coefficients should equal the number of powers.");
61 [](
double c) { return c * mev_to_gev; });
68 const double B,
const double tau) {
72 const int sgn = tmp > 0 ? 1 : -1;
75 (A * std::abs(tmp) + B * std::pow(std::abs(tmp), tau));
87 const double baryon_density)
const {
92 baryon_isospin_density / (baryon_density * baryon_density);
101 const int sgn = rhoB > 0 ? 1 : -1;
102 double abs_rhoB = std::abs(rhoB);
116 return F_2 * jmuB_net;
121 double total_potential = 0.0;
122 const bool compute_gradient =
false;
123 const bool smearing =
true;
127 return total_potential;
131 const double rhoB = std::get<0>(baryon_density_and_gradient);
133 total_potential += scale.first *
skyrme_pot(rhoB);
136 const double rho_iso = std::get<0>(
138 compute_gradient, smearing));
140 total_potential += scale.second * sym_pot;
144 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
146 total_potential += scale.first * VDF_potential.
x0();
149 return total_potential;
153 const auto &pdg = data.
pdgcode();
154 const double skyrme_or_VDF_scale =
155 (3 - std::abs(pdg.strangeness())) / 3. * pdg.
baryon_number();
156 const int symmetry_scale = pdg.baryon_number();
157 return std::make_pair(skyrme_or_VDF_scale, symmetry_scale);
163 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
165 const int sgn = rhoB > 0 ? 1 : -1;
166 const double abs_rhoB = std::abs(rhoB);
167 const double dV_drho =
sgn *
172 E_component -= dV_drho * (grad_j0B + dvecjB_dt);
173 B_component += dV_drho * curl_vecjB;
175 return std::make_pair(E_component, B_component);
183 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
185 E_component -=
dVsym_drhoI3(rhoB, rhoI3) * (grad_j0I3 + dvecjI3_dt) +
187 B_component +=
dVsym_drhoI3(rhoB, rhoI3) * curl_vecjI3 +
190 return std::make_pair(E_component, B_component);
194 double rhoB,
const double drhoB_dt,
const ThreeVector grad_rhoB,
195 const ThreeVector gradrhoB_cross_vecjB,
const double j0B,
200 const int sgn = rhoB > 0 ? 1 : -1;
201 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
203 double abs_rhoB = std::abs(rhoB);
213 std::pow(abs_rhoB,
powers_[i] - 3.0) /
225 E_component -= (F_1 * (grad_rhoB * j0B + drhoB_dt * vecjB) +
226 F_2 * (grad_j0B + dvecjB_dt));
227 B_component += F_1 * gradrhoB_cross_vecjB + F_2 * curl_vecjB;
229 return std::make_pair(E_component, B_component);
236 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
238 E_component -= (grad_A_0 + dA_dt);
239 B_component += curl_A;
241 return std::make_pair(E_component, B_component);
247 double term2 = 2. * rhoI3 *
symmetry_S(rhoB) / (rhoB * rhoB);
257 double term1 = 8.2 * std::pow(rhoB_over_rho0, -1. / 3.) /
nuclear_density +
261 return mev_to_gev * (term1 + term2) * rhoI3 * rhoI3 / (rhoB * rhoB);
267 std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
269 const bool compute_gradient =
true;
270 const bool smearing =
true;
271 auto F_skyrme_or_VDF =
278 double rhoB = std::get<0>(baryon_density_and_gradient);
279 const ThreeVector grad_j0B = std::get<2>(baryon_density_and_gradient);
280 const ThreeVector curl_vecjB = std::get<3>(baryon_density_and_gradient);
281 const FourVector djmuB_dt = std::get<4>(baryon_density_and_gradient);
288 const auto density_and_gradient =
290 compute_gradient, smearing);
291 const double rhoI3 = std::get<0>(density_and_gradient);
292 const ThreeVector grad_j0I3 = std::get<2>(density_and_gradient);
293 const ThreeVector curl_vecjI3 = std::get<3>(density_and_gradient);
294 const FourVector dvecjI3_dt = std::get<4>(density_and_gradient);
297 rhoB, grad_j0B, djmuB_dt.
threevec(), curl_vecjB);
301 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
302 const FourVector djmuB_dx = std::get<5>(baryon_density_and_gradient);
303 const FourVector djmuB_dy = std::get<6>(baryon_density_and_gradient);
304 const FourVector djmuB_dz = std::get<7>(baryon_density_and_gradient);
307 const int sgn = rhoB > 0 ? 1 : -1;
312 const double drhoB_dt =
313 (1 / rhoB) * (jmuB.
x0() * djmuB_dt.
x0() - jmuB.
x1() * djmuB_dt.
x1() -
314 jmuB.
x2() * djmuB_dt.
x2() - jmuB.
x3() * djmuB_dt.
x3());
316 const double drhoB_dx =
317 (1 / rhoB) * (jmuB.
x0() * djmuB_dx.
x0() - jmuB.
x1() * djmuB_dx.
x1() -
318 jmuB.
x2() * djmuB_dx.
x2() - jmuB.
x3() * djmuB_dx.
x3());
320 const double drhoB_dy =
321 (1 / rhoB) * (jmuB.
x0() * djmuB_dy.
x0() - jmuB.
x1() * djmuB_dy.
x1() -
322 jmuB.
x2() * djmuB_dy.
x2() - jmuB.
x3() * djmuB_dy.
x3());
324 const double drhoB_dz =
325 (1 / rhoB) * (jmuB.
x0() * djmuB_dz.
x0() - jmuB.
x1() * djmuB_dz.
x1() -
326 jmuB.
x2() * djmuB_dz.
x2() - jmuB.
x3() * djmuB_dz.
x3());
328 const FourVector drhoB_dxnu = {drhoB_dt, drhoB_dx, drhoB_dy, drhoB_dz};
335 rhoB, drhoB_dt, drhoB_dxnu.
threevec(), Drho_cross_vecj, jmuB.
x0(),
339 return std::make_tuple(F_skyrme_or_VDF.first, F_skyrme_or_VDF.second,
340 F_symmetry.first, F_symmetry.second);
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...
T take(const Key< T > &key)
The default interface for SMASH to read configuration values.
A class to pre-calculate and store parameters relevant for density calculation.
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ThreeVector threevec() const
Particle type contains the static properties of a particle species.
double isospin3_rel() const
int baryon_number() const
bool use_skyrme_
Skyrme potential on/off.
bool use_symmetry_
Symmetry potential on/off.
double skyrme_pot(const double baryon_density) const
Evaluates Skyrme potential given a baryon density.
double symmetry_pot(const double baryon_isospin_density, const double baryon_density) const
Evaluates symmetry potential given baryon isospin density.
double mom_dependence_C_
Parameter C of the momentum-dependent part of the potentials given in MeV.
std::pair< ThreeVector, ThreeVector > symmetry_force(const double rhoI3, const ThreeVector grad_j0I3, const ThreeVector dvecjI3_dt, const ThreeVector curl_vecjI3, const double rhoB, const ThreeVector grad_j0B, const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const
Evaluates the electric and magnetic components of the symmetry force.
double potential(const ThreeVector &r, const ParticleList &plist, const ParticleType &acts_on) const
Evaluates potential (Skyrme with optional Symmetry or VDF) at point r.
FourVector vdf_pot(double rhoB, const FourVector jmuB_net) const
Evaluates the FourVector potential in the VDF model given the rest frame density and the computationa...
std::vector< double > powers_
Parameters of the VDF potential: exponents .
double dVsym_drhoB(const double rhoB, const double rhoI3) const
Calculate the derivative of the symmetry potential with respect to the net baryon density in GeV * fm...
double symmetry_S(const double baryon_density) const
Calculate the factor in the symmetry potential.
double symmetry_S_Pot_
Parameter S_Pot in the symmetry potential in MeV.
double skyrme_a_
Parameter of skyrme potentials: the coefficient in front of in GeV.
std::vector< double > coeffs_
Parameters of the VDF potential: coefficients , in GeV.
std::pair< ThreeVector, ThreeVector > vdf_force(double rhoB, const double drhoB_dt, const ThreeVector grad_rhoB, const ThreeVector gradrhoB_cross_vecjB, const double j0B, const ThreeVector grad_j0B, const ThreeVector vecjB, const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const
Evaluates the electric and magnetic components of force in the VDF model given the derivatives of the...
double mom_dependence_Lambda_
Parameter Lambda of the momentum-dependent part of the potentials given in 1/fm.
bool use_momentum_dependence_
Momentum-dependent part on/off.
double skyrme_tau_
Parameters of skyrme potentials: the power index.
Potentials(Configuration conf, const DensityParameters ¶meters)
Potentials constructor.
double dVsym_drhoI3(const double rhoB, const double rhoI3) const
Calculate the derivative of the symmetry potential with respect to the isospin density in GeV * fm^3.
int number_of_terms() const
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
std::pair< ThreeVector, ThreeVector > skyrme_force(const double rhoB, const ThreeVector grad_j0B, const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const
Evaluates the electric and magnetic components of the skyrme force.
virtual std::tuple< ThreeVector, ThreeVector, ThreeVector, ThreeVector > all_forces(const ThreeVector &r, const ParticleList &plist) const
Evaluates the electric and magnetic components of the forces at point r.
bool use_coulomb_
Coulomb potential on/Off.
double symmetry_gamma_
Power in formula for :
bool symmetry_is_rhoB_dependent_
Whether the baryon density dependence of the symmetry potential is included.
double coulomb_r_cut_
Cutoff in integration for coulomb potential.
const DensityParameters param_
Struct that contains the gaussian smearing width , the distance cutoff and the testparticle number n...
bool use_vdf_
VDF potential on/off.
double saturation_density_
Saturation density of nuclear matter used in the VDF potential; it may vary between different paramet...
virtual ~Potentials()
Standard destructor.
double skyrme_b_
Parameters of skyrme potentials: the coefficient in front of in GeV.
The ThreeVector class represents a physical three-vector with the components .
ThreeVector cross_product(const ThreeVector &b) const
Collection of useful constants that are known at compile time.
int sgn(T val)
Signum function.
constexpr double mev_to_gev
MeV to GeV conversion factor.
std::tuple< double, FourVector, ThreeVector, ThreeVector, FourVector, FourVector, FourVector, FourVector > 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...
constexpr double very_small_double
A very small double, used to avoid division by zero.
constexpr double nuclear_density
Ground state density of symmetric nuclear matter [fm^-3].