23 switch (metric.
mode_) {
28 h = metric.
b_ / (2 * (metric.
b_ * time + 1));
31 h = 2 * metric.
b_ / (3 * (metric.
b_ * time + 1));
44 const std::vector<FourVector> &beam_momentum) {
45 const auto &log = logger<LogArea::Propagation>();
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;
54 log.error(
"propagate_straight_line - negative dt = ", dt);
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()];
78 log.debug(
"Particle ", data,
" motion: ", distance);
79 FourVector position = data.position() + distance;
81 data.set_4position(position);
89 const auto &log = logger<LogArea::Propagation>();
96 FourVector(0.0, h * data.position().threevec() * dt);
98 log.debug(
"Particle ", data,
" 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());
118 const auto &log = logger<LogArea::Propagation>();
119 bool possibly_use_lattice =
120 (pot.
use_skyrme() ? (FB_lat !=
nullptr) :
true) &&
122 std::pair<ThreeVector, ThreeVector> FB, FI3;
123 double min_time_scale = std::numeric_limits<double>::infinity();
127 if (!data.is_baryon()) {
135 const bool use_lattice =
136 possibly_use_lattice &&
137 (pot.
use_skyrme() ? FB_lat->value_at(r, FB) :
true) &&
138 (pot.
use_symmetry() ? FI3_lat->value_at(r, FI3) :
true);
147 FB = std::make_pair(std::get<0>(tmp), std::get<1>(tmp));
148 FI3 = std::make_pair(std::get<2>(tmp), std::get<3>(tmp));
152 (FB.first + data.momentum().velocity().CrossProduct(FB.second)) +
153 scale.second * data.type().isospin3_rel() *
154 (FI3.first + data.momentum().velocity().CrossProduct(FI3.second));
155 log.debug(
"Update momenta: F [GeV/fm] = ", Force);
156 data.set_4momentum(data.effective_mass(),
157 data.momentum().threevec() + Force * dt);
160 const double Force_abs = Force.
abs();
164 const double time_scale = data.momentum().x0() / Force_abs;
165 if (time_scale < min_time_scale) {
166 min_time_scale = time_scale;
171 constexpr
double safety_factor = 0.1;
172 if (dt > safety_factor * min_time_scale) {
173 log.warn() <<
"The time step size is too large for an accurate propagation " 174 <<
"with potentials. Maximum safe value: " 175 << safety_factor * min_time_scale <<
" fm/c.";
The ThreeVector class represents a physical three-vector with the components .
constexpr double really_small
Numerical error tolerance.
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.
double timestep_duration() const
void update_momenta(Particles *particles, double dt, const Potentials &pot, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FB_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FI3_lat)
Updates the momenta of all particles at the current time step according to the equations of motion: ...
Clock labclock
System clock (for simulation time keeping in the computational frame)
virtual std::tuple< ThreeVector, ThreeVector, ThreeVector, ThreeVector > all_forces(const ThreeVector &r, const ParticleList &plist) const
Evaluates the electrical and magnetic components of the forces at point r.
virtual bool use_skyrme() const
ParticleList copy_to_vector() const
A container class to hold all the arrays on the lattice and access them.
ThreeVector velocity() const
Get the velocity (3-vector divided by zero component).
ExpansionMode mode_
Type of metric used.
virtual bool use_symmetry() const
std::pair< double, int > force_scale(const ParticleType &data) const
Evaluates the scaling factor of the forces acting on the particles.
A class that stores parameters of potentials, calculates potentials and their gradients.
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 current_time() const
double calc_hubble(double time, const ExpansionProperties &metric)
Calculate the Hubble parameter , which describes how large the expansion flow is. ...
The Particles class abstracts the storage and manipulation of particles.
double b_
Expansion parameter in the metric (faster expansion for larger values)
The FourVector class holds relevant values in Minkowski spacetime with (+, −, −, −) metric signature.
Struct containing the type of the metric and the expansion parameter of the metric.
Helper structure for Experiment.
ParticleData contains the dynamic information of a certain particle.