20 use_skyrme_(conf.has_value({
"Skyrme"})),
21 use_symmetry_(conf.has_value({
"Symmetry"})),
22 use_coulomb_(conf.has_value({
"Coulomb"})),
23 use_vdf_(conf.has_value({
"VDF"})),
24 use_momentum_dependence_(conf.has_value({
"Momentum_Dependence"})),
25 use_potentials_outside_lattice_(
26 conf.take({
"Use_Potentials_Outside_Lattice"},
30 skyrme_a_ = conf.take({
"Skyrme",
"Skyrme_A"});
31 skyrme_b_ = conf.take({
"Skyrme",
"Skyrme_B"});
32 skyrme_tau_ = conf.take({
"Skyrme",
"Skyrme_Tau"});
34 if (use_momentum_dependence_) {
35 mom_dependence_Lambda_ = conf.take({
"Momentum_Dependence",
"Lambda"});
36 mom_dependence_C_ = conf.take({
"Momentum_Dependence",
"C"});
40 symmetry_S_Pot_ = conf.take({
"Symmetry",
"S_Pot"});
41 if (conf.has_value({
"Symmetry",
"gamma"})) {
42 symmetry_gamma_ = conf.take({
"Symmetry",
"gamma"});
43 symmetry_is_rhoB_dependent_ =
true;
47 coulomb_r_cut_ = conf.take({
"Coulomb",
"R_Cut"});
50 saturation_density_ = conf.take({
"VDF",
"Sat_rhoB"});
51 std::vector<double> aux_coeffs = conf.take({
"VDF",
"Coeffs"});
52 std::vector<double> aux_powers = conf.take({
"VDF",
"Powers"});
53 if (aux_coeffs.size() != aux_powers.size()) {
54 throw std::invalid_argument(
55 "The number of coefficients should equal the number of powers.");
57 const int n_terms = aux_powers.size();
58 for (
int i = 0; i < n_terms; i++) {
59 if (aux_powers[i] < 0.0) {
60 throw std::invalid_argument(
"Powers need to be positive real numbers.");
64 powers_.push_back(aux_powers[i]);
72 const double B,
const double tau) {
76 const int sgn = tmp > 0 ? 1 : -1;
79 (A * std::abs(tmp) + B * std::pow(std::abs(tmp), tau));
91 const double baryon_density)
const {
96 baryon_isospin_density / (baryon_density * baryon_density);
105 const int sgn = rhoB > 0 ? 1 : -1;
106 double abs_rhoB = std::abs(rhoB);
120 return F_2 * jmuB_net;
125 double total_potential = 0.0;
126 const bool compute_gradient =
false;
127 const bool smearing =
true;
131 return total_potential;
135 const double rhoB = std::get<0>(baryon_density_and_gradient);
137 total_potential += scale.first *
skyrme_pot(rhoB);
140 const double rho_iso = std::get<0>(
142 compute_gradient, smearing));
144 total_potential += scale.second * sym_pot;
148 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
150 total_potential += scale.first * VDF_potential.
x0();
153 return total_potential;
157 const auto &pdg = data.
pdgcode();
158 const double skyrme_or_VDF_scale =
159 (3 - std::abs(pdg.strangeness())) / 3. * pdg.
baryon_number();
160 const int symmetry_scale = pdg.baryon_number();
161 return std::make_pair(skyrme_or_VDF_scale, symmetry_scale);
167 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
169 const int sgn = rhoB > 0 ? 1 : -1;
170 const double abs_rhoB = std::abs(rhoB);
171 const double dV_drho =
sgn *
176 E_component -= dV_drho * (grad_j0B + dvecjB_dt);
177 B_component += dV_drho * curl_vecjB;
179 return std::make_pair(E_component, B_component);
187 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
189 E_component -=
dVsym_drhoI3(rhoB, rhoI3) * (grad_j0I3 + dvecjI3_dt) +
191 B_component +=
dVsym_drhoI3(rhoB, rhoI3) * curl_vecjI3 +
194 return std::make_pair(E_component, B_component);
198 double rhoB,
const double drhoB_dt,
const ThreeVector grad_rhoB,
199 const ThreeVector gradrhoB_cross_vecjB,
const double j0B,
204 const int sgn = rhoB > 0 ? 1 : -1;
205 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
207 double abs_rhoB = std::abs(rhoB);
217 std::pow(abs_rhoB,
powers_[i] - 3.0) /
229 E_component -= (F_1 * (grad_rhoB * j0B + drhoB_dt * vecjB) +
230 F_2 * (grad_j0B + dvecjB_dt));
231 B_component += F_1 * gradrhoB_cross_vecjB + F_2 * curl_vecjB;
233 return std::make_pair(E_component, B_component);
240 ThreeVector E_component(0.0, 0.0, 0.0), B_component(0.0, 0.0, 0.0);
242 E_component -= (grad_A_0 + dA_dt);
243 B_component += curl_A;
245 return std::make_pair(E_component, B_component);
251 double term2 = 2. * rhoI3 *
symmetry_S(rhoB) / (rhoB * rhoB);
261 double term1 = 8.2 * std::pow(rhoB_over_rho0, -1. / 3.) /
nuclear_density +
265 return mev_to_gev * (term1 + term2) * rhoI3 * rhoI3 / (rhoB * rhoB);
271 std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
273 const bool compute_gradient =
true;
274 const bool smearing =
true;
275 auto F_skyrme_or_VDF =
282 double rhoB = std::get<0>(baryon_density_and_gradient);
283 const ThreeVector grad_j0B = std::get<2>(baryon_density_and_gradient);
284 const ThreeVector curl_vecjB = std::get<3>(baryon_density_and_gradient);
285 const FourVector djmuB_dt = std::get<4>(baryon_density_and_gradient);
292 const auto density_and_gradient =
294 compute_gradient, smearing);
295 const double rhoI3 = std::get<0>(density_and_gradient);
296 const ThreeVector grad_j0I3 = std::get<2>(density_and_gradient);
297 const ThreeVector curl_vecjI3 = std::get<3>(density_and_gradient);
298 const FourVector dvecjI3_dt = std::get<4>(density_and_gradient);
301 rhoB, grad_j0B, djmuB_dt.
threevec(), curl_vecjB);
305 const FourVector jmuB = std::get<1>(baryon_density_and_gradient);
306 const FourVector djmuB_dx = std::get<5>(baryon_density_and_gradient);
307 const FourVector djmuB_dy = std::get<6>(baryon_density_and_gradient);
308 const FourVector djmuB_dz = std::get<7>(baryon_density_and_gradient);
311 const int sgn = rhoB > 0 ? 1 : -1;
316 const double drhoB_dt =
317 (1 / rhoB) * (jmuB.
x0() * djmuB_dt.
x0() - jmuB.
x1() * djmuB_dt.
x1() -
318 jmuB.
x2() * djmuB_dt.
x2() - jmuB.
x3() * djmuB_dt.
x3());
320 const double drhoB_dx =
321 (1 / rhoB) * (jmuB.
x0() * djmuB_dx.
x0() - jmuB.
x1() * djmuB_dx.
x1() -
322 jmuB.
x2() * djmuB_dx.
x2() - jmuB.
x3() * djmuB_dx.
x3());
324 const double drhoB_dy =
325 (1 / rhoB) * (jmuB.
x0() * djmuB_dy.
x0() - jmuB.
x1() * djmuB_dy.
x1() -
326 jmuB.
x2() * djmuB_dy.
x2() - jmuB.
x3() * djmuB_dy.
x3());
328 const double drhoB_dz =
329 (1 / rhoB) * (jmuB.
x0() * djmuB_dz.
x0() - jmuB.
x1() * djmuB_dz.
x1() -
330 jmuB.
x2() * djmuB_dz.
x2() - jmuB.
x3() * djmuB_dz.
x3());
332 const FourVector drhoB_dxnu = {drhoB_dt, drhoB_dx, drhoB_dy, drhoB_dz};
339 rhoB, drhoB_dt, drhoB_dxnu.
threevec(), Drho_cross_vecj, jmuB.
x0(),
343 return std::make_tuple(F_skyrme_or_VDF.first, F_skyrme_or_VDF.second,
344 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
default_type default_value() const
Get the default value of the key.
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].