Version: SMASH-3.0
potentials.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2015,2017-2022
4  * SMASH Team
5  *
6  * GNU General Public License (GPLv3 or later)
7  *
8  */
9 
10 #ifndef SRC_INCLUDE_SMASH_POTENTIALS_H_
11 #define SRC_INCLUDE_SMASH_POTENTIALS_H_
12 
13 #include <tuple>
14 #include <utility>
15 #include <vector>
16 
17 #include "configuration.h"
18 #include "density.h"
19 #include "forwarddeclarations.h"
20 #include "particledata.h"
21 #include "threevector.h"
22 
23 namespace smash {
24 
32 class Potentials {
33  public:
45  Potentials(Configuration conf, const DensityParameters &parameters);
47  virtual ~Potentials();
48 
57  double skyrme_pot(const double baryon_density) const;
58 
72  double symmetry_pot(const double baryon_isospin_density,
73  const double baryon_density) const;
74 
81  double symmetry_S(const double baryon_density) const;
82 
94  FourVector vdf_pot(double rhoB, const FourVector jmuB_net) const;
95 
116  double potential(const ThreeVector &r, const ParticleList &plist,
117  const ParticleType &acts_on) const;
118 
135  static std::pair<double, int> force_scale(const ParticleType &data);
136 
159  std::pair<ThreeVector, ThreeVector> skyrme_force(
160  const double rhoB, const ThreeVector grad_j0B,
161  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
162 
197  std::pair<ThreeVector, ThreeVector> symmetry_force(
198  const double rhoI3, const ThreeVector grad_j0I3,
199  const ThreeVector dvecjI3_dt, const ThreeVector curl_vecjI3,
200  const double rhoB, const ThreeVector grad_j0B,
201  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
202 
218  DensityOnLattice &charge_density,
219  ThreeVector point) {
220  ThreeVector dr = point - pos;
221  if (dr.abs() < really_small) {
222  return {0., 0., 0.};
223  }
224  return elementary_charge * charge_density.rho() * dr /
225  std::pow(dr.abs(), 3);
226  }
227 
236  DensityOnLattice &charge_density,
237  ThreeVector point) {
238  ThreeVector dr = point - pos;
239  if (dr.abs() < really_small) {
240  return {0., 0., 0.};
241  }
242  return elementary_charge *
243  charge_density.jmu_net().threevec().cross_product(dr) /
244  std::pow(dr.abs(), 3);
245  }
284  std::pair<ThreeVector, ThreeVector> vdf_force(
285  double rhoB, const double drhoB_dt, const ThreeVector grad_rhoB,
286  const ThreeVector gradrhoB_cross_vecjB, const double j0B,
287  const ThreeVector grad_j0B, const ThreeVector vecjB,
288  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
289 
307  std::pair<ThreeVector, ThreeVector> vdf_force(
308  const ThreeVector grad_A_0, const ThreeVector dA_dt,
309  const ThreeVector curl_vecA) const;
310 
326  virtual std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
327  all_forces(const ThreeVector &r, const ParticleList &plist) const;
328 
330  virtual bool use_skyrme() const { return use_skyrme_; }
332  virtual bool use_symmetry() const { return use_symmetry_; }
334  virtual bool use_coulomb() const { return use_coulomb_; }
335 
337  double skyrme_a() const { return skyrme_a_; }
339  double skyrme_b() const { return skyrme_b_; }
341  double skyrme_tau() const { return skyrme_tau_; }
343  double symmetry_S_pot() const { return symmetry_S_Pot_; }
344 
346  virtual bool use_vdf() const { return use_vdf_; }
348  double saturation_density() const { return saturation_density_; }
350  const std::vector<double> &coeffs() const { return coeffs_; }
352  const std::vector<double> &powers() const { return powers_; }
354  int number_of_terms() const { return powers_.size(); }
355 
357  double coulomb_r_cut() const { return coulomb_r_cut_; }
358 
359  private:
366 
369 
372 
375 
377  bool use_vdf_;
378 
383  double skyrme_a_;
384 
389  double skyrme_b_;
390 
395  double skyrme_tau_;
396 
399 
412 
415 
422  std::vector<double> coeffs_;
424  std::vector<double> powers_;
425 
441  double dVsym_drhoI3(const double rhoB, const double rhoI3) const;
442 
461  double dVsym_drhoB(const double rhoB, const double rhoI3) const;
462 };
463 
464 } // namespace smash
465 
466 #endif // SRC_INCLUDE_SMASH_POTENTIALS_H_
Interface to the SMASH configuration files.
A class for time-efficient (time-memory trade-off) calculation of density on the lattice.
Definition: density.h:315
double rho(const double norm_factor=1.0)
Compute the net Eckart density on the local lattice.
Definition: density.h:384
FourVector jmu_net() const
Definition: density.h:434
A class to pre-calculate and store parameters relevant for density calculation.
Definition: density.h:108
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Definition: fourvector.h:33
ThreeVector threevec() const
Definition: fourvector.h:329
Particle type contains the static properties of a particle species.
Definition: particletype.h:97
A class that stores parameters of potentials, calculates potentials and their gradients.
Definition: potentials.h:32
const std::vector< double > & powers() const
Definition: potentials.h:352
bool use_skyrme_
Skyrme potential on/off.
Definition: potentials.h:368
bool use_symmetry_
Symmetry potential on/off.
Definition: potentials.h:371
double skyrme_pot(const double baryon_density) const
Evaluates skyrme potential given a baryon density.
Definition: potentials.cc:61
virtual bool use_symmetry() const
Definition: potentials.h:332
double symmetry_pot(const double baryon_isospin_density, const double baryon_density) const
Evaluates symmetry potential given baryon isospin density.
Definition: potentials.cc:79
const std::vector< double > & coeffs() const
Definition: potentials.h:350
static ThreeVector B_field_integrand(ThreeVector pos, DensityOnLattice &charge_density, ThreeVector point)
Integrand for calculating the magnetic field using the Biot-Savart formula.
Definition: potentials.h:235
static ThreeVector E_field_integrand(ThreeVector pos, DensityOnLattice &charge_density, ThreeVector point)
Integrand for calculating the electric field.
Definition: potentials.h:217
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.
Definition: potentials.cc:171
virtual bool use_skyrme() const
Definition: potentials.h:330
double potential(const ThreeVector &r, const ParticleList &plist, const ParticleType &acts_on) const
Evaluates potential (Skyrme with optional Symmetry or VDF) at point r.
Definition: potentials.cc:112
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...
Definition: potentials.cc:90
std::vector< double > powers_
Parameters of the VDF potential: exponents .
Definition: potentials.h:424
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...
Definition: potentials.cc:247
virtual bool use_coulomb() const
Definition: potentials.h:334
double skyrme_a() const
Definition: potentials.h:337
double symmetry_S(const double baryon_density) const
Calculate the factor in the symmetry potential.
Definition: potentials.cc:71
double symmetry_S_Pot_
Parameter S_Pot in the symmetry potential in MeV.
Definition: potentials.h:398
double skyrme_a_
Parameter of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:383
std::vector< double > coeffs_
Parameters of the VDF potential: coefficients , in GeV.
Definition: potentials.h:422
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...
Definition: potentials.cc:186
double skyrme_tau() const
Definition: potentials.h:341
double coulomb_r_cut() const
Definition: potentials.h:357
double skyrme_tau_
Parameters of skyrme potentials: the power index.
Definition: potentials.h:395
double symmetry_S_pot() const
Definition: potentials.h:343
Potentials(Configuration conf, const DensityParameters &parameters)
Potentials constructor.
Definition: potentials.cc:17
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.
Definition: potentials.cc:237
int number_of_terms() const
Definition: potentials.h:354
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
Definition: potentials.cc:145
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.
Definition: potentials.cc:153
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.
Definition: potentials.cc:261
double skyrme_b() const
Definition: potentials.h:339
bool use_coulomb_
Coulomb potential on/Off.
Definition: potentials.h:374
double symmetry_gamma_
Power in formula for :
Definition: potentials.h:411
bool symmetry_is_rhoB_dependent_
Whether the baryon density dependence of the symmetry potential is included.
Definition: potentials.h:404
double coulomb_r_cut_
Cutoff in integration for coulomb potential.
Definition: potentials.h:414
virtual bool use_vdf() const
Definition: potentials.h:346
const DensityParameters param_
Struct that contains the gaussian smearing width , the distance cutoff and the testparticle number n...
Definition: potentials.h:365
double saturation_density() const
Definition: potentials.h:348
bool use_vdf_
VDF potential on/off.
Definition: potentials.h:377
double saturation_density_
Saturation density of nuclear matter used in the VDF potential; it may vary between different paramet...
Definition: potentials.h:420
virtual ~Potentials()
Standard destructor.
Definition: potentials.cc:59
double skyrme_b_
Parameters of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:389
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
double abs() const
Definition: threevector.h:268
ThreeVector cross_product(const ThreeVector &b) const
Definition: threevector.h:246
Definition: action.h:24
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37
const double elementary_charge
Elementary electric charge in natural units, approximately 0.3.
Definition: constants.h:98