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());
118 bool possibly_use_lattice =
119 (pot.
use_skyrme() ? (FB_lat !=
nullptr) :
true) &&
121 std::pair<ThreeVector, ThreeVector> FB, FI3;
122 double min_time_scale = std::numeric_limits<double>::infinity();
126 if (!(data.is_baryon() || data.is_nucleus())) {
134 const bool use_lattice =
135 possibly_use_lattice &&
136 (pot.
use_skyrme() ? FB_lat->value_at(r, FB) :
true) &&
137 (pot.
use_symmetry() ? FI3_lat->value_at(r, FI3) :
true);
146 FB = std::make_pair(std::get<0>(tmp), std::get<1>(tmp));
147 FI3 = std::make_pair(std::get<2>(tmp), std::get<3>(tmp));
151 (FB.first + data.momentum().velocity().cross_product(FB.second)) +
152 scale.second * data.type().isospin3_rel() *
153 (FI3.first + data.momentum().velocity().cross_product(FI3.second));
155 data.set_4momentum(data.effective_mass(),
156 data.momentum().threevec() + Force * dt);
159 const double Force_abs = Force.
abs();
163 const double time_scale = data.momentum().x0() / Force_abs;
164 if (time_scale < min_time_scale) {
165 min_time_scale = time_scale;
170 constexpr
double safety_factor = 0.1;
171 if (dt > safety_factor * min_time_scale) {
173 <<
"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.";