Version: SMASH-2.2
potentials.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright (c) 2014-2021
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 
155  std::pair<ThreeVector, ThreeVector> skyrme_force(
156  const double rhoB, const ThreeVector grad_j0B,
157  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
158 
188  std::pair<ThreeVector, ThreeVector> symmetry_force(
189  const double rhoI3, const ThreeVector grad_j0I3,
190  const ThreeVector dvecjI3_dt, const ThreeVector curl_vecjI3,
191  const double rhoB, const ThreeVector grad_j0B,
192  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
193 
205  DensityOnLattice &charge_density,
206  ThreeVector point) {
207  ThreeVector dr = point - pos;
208  if (dr.abs() < really_small) {
209  return {0., 0., 0.};
210  }
211  return elementary_charge * charge_density.rho() * dr /
212  std::pow(dr.abs(), 3);
213  }
214 
223  DensityOnLattice &charge_density,
224  ThreeVector point) {
225  ThreeVector dr = point - pos;
226  if (dr.abs() < really_small) {
227  return {0., 0., 0.};
228  }
229  return elementary_charge *
230  charge_density.jmu_net().threevec().cross_product(dr) /
231  std::pow(dr.abs(), 3);
232  }
262  std::pair<ThreeVector, ThreeVector> vdf_force(
263  double rhoB, const double drhoB_dt, const ThreeVector grad_rhoB,
264  const ThreeVector gradrhoB_cross_vecjB, const double j0B,
265  const ThreeVector grad_j0B, const ThreeVector vecjB,
266  const ThreeVector dvecjB_dt, const ThreeVector curl_vecjB) const;
267 
282  std::pair<ThreeVector, ThreeVector> vdf_force(
283  const ThreeVector grad_A_0, const ThreeVector dA_dt,
284  const ThreeVector curl_vecA) const;
285 
301  virtual std::tuple<ThreeVector, ThreeVector, ThreeVector, ThreeVector>
302  all_forces(const ThreeVector &r, const ParticleList &plist) const;
303 
305  virtual bool use_skyrme() const { return use_skyrme_; }
307  virtual bool use_symmetry() const { return use_symmetry_; }
309  virtual bool use_coulomb() const { return use_coulomb_; }
310 
312  double skyrme_a() const { return skyrme_a_; }
314  double skyrme_b() const { return skyrme_b_; }
316  double skyrme_tau() const { return skyrme_tau_; }
318  double symmetry_S_pot() const { return symmetry_S_Pot_; }
319 
321  virtual bool use_vdf() const { return use_vdf_; }
323  double saturation_density() const { return saturation_density_; }
325  const std::vector<double> &coeffs() const { return coeffs_; }
327  const std::vector<double> &powers() const { return powers_; }
329  int number_of_terms() const { return powers_.size(); }
330 
332  double coulomb_r_cut() const { return coulomb_r_cut_; }
333 
334  private:
341 
344 
347 
350 
352  bool use_vdf_;
353 
358  double skyrme_a_;
359 
364  double skyrme_b_;
365 
370  double skyrme_tau_;
371 
374 
387 
390 
397  std::vector<double> coeffs_;
399  std::vector<double> powers_;
400 
416  double dVsym_drhoI3(const double rhoB, const double rhoI3) const;
417 
436  double dVsym_drhoB(const double rhoB, const double rhoI3) const;
437 };
438 
439 } // namespace smash
440 
441 #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:309
double rho(const double norm_factor=1.0)
Compute the net Eckart density on the local lattice.
Definition: density.h:378
FourVector jmu_net() const
Definition: density.h:428
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:324
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:327
bool use_skyrme_
Skyrme potential on/off.
Definition: potentials.h:343
bool use_symmetry_
Symmetry potential on/off.
Definition: potentials.h:346
double skyrme_pot(const double baryon_density) const
Evaluates skyrme potential given a baryon density.
Definition: potentials.cc:234
virtual bool use_symmetry() const
Definition: potentials.h:307
double symmetry_pot(const double baryon_isospin_density, const double baryon_density) const
Evaluates symmetry potential given baryon isospin density.
Definition: potentials.cc:252
const std::vector< double > & coeffs() const
Definition: potentials.h:325
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:222
static ThreeVector E_field_integrand(ThreeVector pos, DensityOnLattice &charge_density, ThreeVector point)
Integrand for calculating the electric field.
Definition: potentials.h:204
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:344
virtual bool use_skyrme() const
Definition: potentials.h:305
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:285
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:263
std::vector< double > powers_
Parameters of the VDF potential: exponents .
Definition: potentials.h:399
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:420
virtual bool use_coulomb() const
Definition: potentials.h:309
double skyrme_a() const
Definition: potentials.h:312
double symmetry_S(const double baryon_density) const
Calculate the factor in the symmetry potential.
Definition: potentials.cc:244
double symmetry_S_Pot_
Parameter S_Pot in the symmetry potential in MeV.
Definition: potentials.h:373
double skyrme_a_
Parameter of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:358
std::vector< double > coeffs_
Parameters of the VDF potential: coefficients , in GeV.
Definition: potentials.h:397
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:359
double skyrme_tau() const
Definition: potentials.h:316
double coulomb_r_cut() const
Definition: potentials.h:332
double skyrme_tau_
Parameters of skyrme potentials: the power index.
Definition: potentials.h:370
double symmetry_S_pot() const
Definition: potentials.h:318
Potentials(Configuration conf, const DensityParameters &parameters)
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.
Definition: potentials.cc:410
int number_of_terms() const
Definition: potentials.h:329
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
Definition: potentials.cc:318
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:326
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:434
double skyrme_b() const
Definition: potentials.h:314
bool use_coulomb_
Coulomb potential on/Off.
Definition: potentials.h:349
double symmetry_gamma_
Power in formula for :
Definition: potentials.h:386
bool symmetry_is_rhoB_dependent_
Whether the baryon density dependence of the symmetry potential is included.
Definition: potentials.h:379
double coulomb_r_cut_
Cutoff in integration for coulomb potential.
Definition: potentials.h:389
virtual bool use_vdf() const
Definition: potentials.h:321
const DensityParameters param_
Struct that contains the gaussian smearing width , the distance cutoff and the testparticle number n...
Definition: potentials.h:340
double saturation_density() const
Definition: potentials.h:323
bool use_vdf_
VDF potential on/off.
Definition: potentials.h:352
double saturation_density_
Saturation density of nuclear matter used in the VDF potential; it may vary between different paramet...
Definition: potentials.h:395
virtual ~Potentials()
Standard destructor.
Definition: potentials.cc:232
double skyrme_b_
Parameters of skyrme potentials: the coefficient in front of in GeV.
Definition: potentials.h:364
The ThreeVector class represents a physical three-vector with the components .
Definition: threevector.h:31
double abs() const
Definition: threevector.h:261
ThreeVector cross_product(const ThreeVector &b) const
Definition: threevector.h:239
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:104