19 use_skyrme_(conf.has_value({
"Skyrme"})),
20 use_symmetry_(conf.has_value({
"Symmetry"})),
21 use_coulomb_(conf.has_value({
"Coulomb"})),
22 use_vdf_(conf.has_value({
"VDF"})) {
24 skyrme_a_ = conf.take({
"Skyrme",
"Skyrme_A"});
25 skyrme_b_ = conf.take({
"Skyrme",
"Skyrme_B"});
26 skyrme_tau_ = conf.take({
"Skyrme",
"Skyrme_Tau"});
30 symmetry_S_Pot_ = conf.take({
"Symmetry",
"S_Pot"});
31 if (conf.has_value({
"Symmetry",
"gamma"})) {
32 symmetry_gamma_ = conf.take({
"Symmetry",
"gamma"});
33 symmetry_is_rhoB_dependent_ =
true;
37 coulomb_r_cut_ = conf.take({
"Coulomb",
"R_Cut"});
40 saturation_density_ = conf.take({
"VDF",
"Sat_rhoB"});
41 std::vector<double> aux_coeffs = conf.take({
"VDF",
"Coeffs"});
42 std::vector<double> aux_powers = conf.take({
"VDF",
"Powers"});
43 if (aux_coeffs.size() != aux_powers.size()) {
44 throw std::invalid_argument(
45 "The number of coefficients should equal the number of powers.");
47 const int n_terms = aux_powers.size();
48 for (
int i = 0; i < n_terms; i++) {
49 if (aux_powers[i] < 0.0) {
50 throw std::invalid_argument(
"Powers need to be positive real numbers.");
54 powers_.push_back(aux_powers[i]);
65 const int sgn = tmp > 0 ? 1 : -1;
80 const double baryon_density)
const {
85 baryon_isospin_density / (baryon_density * baryon_density);
94 const int sgn = rhoB > 0 ? 1 : -1;
95 double abs_rhoB = std::abs(rhoB);
109 return F_2 * jmuB_net;
114 double total_potential = 0.0;
115 const bool compute_gradient =
false;
116 const bool smearing =
true;
120 return total_potential;
124 const double rhoB = std::get<0>(baryon_density_and_gradient);
126 total_potential += scale.first *
skyrme_pot(rhoB);
129 const double rho_iso = std::get<0>(
131 compute_gradient, smearing));
133 total_potential += scale.second * sym_pot;
137 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
139 total_potential += scale.first * VDF_potential.
x0();
142 return total_potential;
146 const auto &pdg = data.
pdgcode();
147 const double skyrme_or_VDF_scale =
148 (3 - std::abs(pdg.strangeness())) / 3. * pdg.
baryon_number();
149 const int symmetry_scale = pdg.baryon_number();
150 return std::make_pair(skyrme_or_VDF_scale, symmetry_scale);
156 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
158 const int sgn = rhoB > 0 ? 1 : -1;
159 const double abs_rhoB = std::abs(rhoB);
160 const double dV_drho =
sgn *
165 E_component -= dV_drho * (grad_j0B + dvecjB_dt);
166 B_component += dV_drho * curl_vecjB;
168 return std::make_pair(E_component, B_component);
176 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
178 E_component -=
dVsym_drhoI3(rhoB, rhoI3) * (grad_j0I3 + dvecjI3_dt) +
180 B_component +=
dVsym_drhoI3(rhoB, rhoI3) * curl_vecjI3 +
183 return std::make_pair(E_component, B_component);
187 double rhoB,
const double drhoB_dt,
const ThreeVector grad_rhoB,
188 const ThreeVector gradrhoB_cross_vecjB,
const double j0B,
193 const int sgn = rhoB > 0 ? 1 : -1;
194 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
196 double abs_rhoB = std::abs(rhoB);
206 std::pow(abs_rhoB,
powers_[i] - 3.0) /
218 E_component -= (F_1 * (grad_rhoB * j0B + drhoB_dt * vecjB) +
219 F_2 * (grad_j0B + dvecjB_dt));
220 B_component += F_1 * gradrhoB_cross_vecjB + F_2 * curl_vecjB;
222 return std::make_pair(E_component, B_component);
229 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
231 E_component -= (grad_A_0 + dA_dt);
232 B_component += curl_A;
234 return std::make_pair(E_component, B_component);
240 double term2 = 2. * rhoI3 *
symmetry_S(rhoB) / (rhoB * rhoB);
250 double term1 = 8.2 * std::pow(rhoB_over_rho0, -1. / 3.) /
nuclear_density +
254 return mev_to_gev * (term1 + term2) * rhoI3 * rhoI3 / (rhoB * rhoB);
260 std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
262 const bool compute_gradient =
true;
263 const bool smearing =
true;
264 auto F_skyrme_or_VDF =
271 double rhoB = std::get<0>(baryon_density_and_gradient);
272 const ThreeVector grad_j0B = std::get<2>(baryon_density_and_gradient);
273 const ThreeVector curl_vecjB = std::get<3>(baryon_density_and_gradient);
274 const FourVector djmuB_dt = std::get<4>(baryon_density_and_gradient);
281 const auto density_and_gradient =
283 compute_gradient, smearing);
284 const double rhoI3 = std::get<0>(density_and_gradient);
285 const ThreeVector grad_j0I3 = std::get<2>(density_and_gradient);
286 const ThreeVector curl_vecjI3 = std::get<3>(density_and_gradient);
287 const FourVector dvecjI3_dt = std::get<4>(density_and_gradient);
290 rhoB, grad_j0B, djmuB_dt.
threevec(), curl_vecjB);
294 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
295 const FourVector djmuB_dx = std::get<5>(baryon_density_and_gradient);
296 const FourVector djmuB_dy = std::get<6>(baryon_density_and_gradient);
297 const FourVector djmuB_dz = std::get<7>(baryon_density_and_gradient);
300 const int sgn = rhoB > 0 ? 1 : -1;
305 const double drhoB_dt =
306 (1 / rhoB) * (jmuB.
x0() * djmuB_dt.
x0() - jmuB.
x1() * djmuB_dt.
x1() -
307 jmuB.
x2() * djmuB_dt.
x2() - jmuB.
x3() * djmuB_dt.
x3());
309 const double drhoB_dx =
310 (1 / rhoB) * (jmuB.
x0() * djmuB_dx.
x0() - jmuB.
x1() * djmuB_dx.
x1() -
311 jmuB.
x2() * djmuB_dx.
x2() - jmuB.
x3() * djmuB_dx.
x3());
313 const double drhoB_dy =
314 (1 / rhoB) * (jmuB.
x0() * djmuB_dy.
x0() - jmuB.
x1() * djmuB_dy.
x1() -
315 jmuB.
x2() * djmuB_dy.
x2() - jmuB.
x3() * djmuB_dy.
x3());
317 const double drhoB_dz =
318 (1 / rhoB) * (jmuB.
x0() * djmuB_dz.
x0() - jmuB.
x1() * djmuB_dz.
x1() -
319 jmuB.
x2() * djmuB_dz.
x2() - jmuB.
x3() * djmuB_dz.
x3());
321 const FourVector drhoB_dxnu = {drhoB_dt, drhoB_dx, drhoB_dy, drhoB_dz};
328 rhoB, drhoB_dt, drhoB_dxnu.
threevec(), Drho_cross_vecj, jmuB.
x0(),
332 return std::make_tuple(F_skyrme_or_VDF.first, F_skyrme_or_VDF.second,
333 F_symmetry.first, F_symmetry.second);
Interface to the SMASH configuration files.
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.
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 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.
double symmetry_gamma_
Power in formula for :
bool symmetry_is_rhoB_dependent_
Whether the baryon density dependence of the symmetry potential is included.
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].