24 switch (metric.
mode_) {
29 h = metric.
b_ / (2 * (metric.
b_ * time + 1));
32 h = 2 * metric.
b_ / (3 * (metric.
b_ * time + 1));
45 const std::vector<FourVector> &beam_momentum) {
46 bool negative_dt_error =
false;
49 const double t0 = data.position().x0();
51 if (dt < 0.0 && !negative_dt_error) {
53 negative_dt_error =
true;
65 assert(data.id() >= 0);
66 const bool avoid_fermi_motion =
67 (
static_cast<uint64_t
>(data.id()) <
68 static_cast<uint64_t
>(beam_momentum.size())) &&
69 (data.get_history().collisions_per_particle == 0);
71 if (avoid_fermi_motion) {
72 const FourVector vbeam = beam_momentum[data.id()];
79 FourVector position = data.position() + distance;
81 data.set_4position(position);
89 const double dt = parameters.
labclock->timestep_duration();
95 FourVector(0.0, h * data.position().threevec() * dt);
98 " expansion motion: ", expan_dist);
100 FourVector position = data.position() + expan_dist;
101 FourVector momentum = data.momentum() - delta_mom;
104 data.set_4position(position);
105 data.set_4momentum(momentum);
107 data.set_4momentum(data.pole_mass(), data.momentum().threevec());
112 std::vector<Particles> &ensembles,
double dt,
const Potentials &pot,
120 const ParticleList tmp = particles.copy_to_vector();
121 plist.insert(plist.end(), tmp.begin(), tmp.end());
124 bool possibly_use_lattice =
125 (pot.
use_skyrme() ? (FB_lat !=
nullptr) :
true) &&
126 (pot.
use_vdf() ? (FB_lat !=
nullptr) :
true) &&
128 std::pair<ThreeVector, ThreeVector> FB, FI3, EM_fields;
129 double min_time_scale = std::numeric_limits<double>::infinity();
134 if (!(data.is_baryon() || data.is_nucleus())) {
142 const bool use_lattice =
143 possibly_use_lattice &&
144 (pot.
use_skyrme() ? FB_lat->value_at(r, FB) :
true) &&
145 (pot.
use_vdf() ? FB_lat->value_at(r, FB) :
true) &&
146 (pot.
use_symmetry() ? FI3_lat->value_at(r, FI3) :
true);
155 FB = std::make_pair(std::get<0>(tmp), std::get<1>(tmp));
156 FI3 = std::make_pair(std::get<2>(tmp), std::get<3>(tmp));
160 (FB.first + data.momentum().velocity().cross_product(FB.second)) +
161 scale.second * data.type().isospin3_rel() *
163 data.momentum().velocity().cross_product(FI3.second));
165 if (pot.
use_coulomb() && EM_lat->value_at(r, EM_fields)) {
169 data.momentum().velocity().cross_product(EM_fields.second));
172 data.set_4momentum(data.effective_mass(),
173 data.momentum().threevec() + Force * dt);
176 const double Force_abs = Force.
abs();
180 const double time_scale = data.momentum().x0() / Force_abs;
181 if (time_scale < min_time_scale) {
182 min_time_scale = time_scale;
187 constexpr
double safety_factor = 0.1;
188 if (dt > safety_factor * min_time_scale) {
190 <<
"The time step size is too large for an accurate propagation "
191 <<
"with potentials. Maximum safe value: "
192 << safety_factor * min_time_scale <<
" fm/c.\n"
193 <<
"In case of Triangular or Discrete smearing you may additionally "
194 <<
"need to increase the number of ensembles or testparticles.";
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
ParticleData contains the dynamic information of a certain particle.
The Particles class abstracts the storage and manipulation of particles.
A class that stores parameters of potentials, calculates potentials and their gradients.
virtual bool use_symmetry() const
virtual bool use_skyrme() const
virtual bool use_coulomb() const
static std::pair< double, int > force_scale(const ParticleType &data)
Evaluates the scaling factor of the forces acting on the particles.
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.
virtual bool use_vdf() const
A container class to hold all the arrays on the lattice and access them.
The ThreeVector class represents a physical three-vector with the components .
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
void update_momenta(std::vector< Particles > &particles, double dt, const Potentials &pot, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FB_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FI3_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *EM_lat)
Updates the momenta of all particles at the current time step according to the equations of motion:
void expand_space_time(Particles *particles, const ExperimentParameters ¶meters, const ExpansionProperties &metric)
Modifies positions and momentum of all particles to account for space-time deformation.
double propagate_straight_line(Particles *particles, double to_time, const std::vector< FourVector > &beam_momentum)
Propagates the positions of all particles on a straight line to a given moment.
constexpr double hbarc
GeV <-> fm conversion factor.
constexpr double really_small
Numerical error tolerance.
double calc_hubble(double time, const ExpansionProperties &metric)
Calculate the Hubble parameter , which describes how large the expansion flow is.
static constexpr int LPropagation
const double elementary_charge
Elementary electric charge in natural units, approximately 0.3.
Struct containing the type of the metric and the expansion parameter of the metric.
double b_
Expansion parameter in the metric (faster expansion for larger values)
ExpansionMode mode_
Type of metric used.
Helper structure for Experiment.
std::unique_ptr< Clock > labclock
System clock (for simulation time keeping in the computational frame)