Version: SMASH-3.4
propagation.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2023,2025
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 
8 #ifndef SRC_INCLUDE_SMASH_PROPAGATION_H_
9 #define SRC_INCLUDE_SMASH_PROPAGATION_H_
10 
11 #include <utility>
12 #include <vector>
13 
14 #include "lattice.h"
15 #include "particles.h"
16 #include "potentials.h"
17 
18 namespace smash {
19 
20 /**
21  * Struct containing the type of the metric and the expansion parameter of
22  * the metric. These elements shall be used in the Expansion Mode, which is
23  * implemented in SMASH to compare with the analytical solution
24  * \iref{Bazow:2015dha} to the Boltzmann equation with a Hubble expansion.
25  */
27  /// Type of metric used
29  /// Expansion parameter in the metric (faster expansion for larger values)
30  double b_;
31  /**
32  * Constructor of ExpansionProperties
33  *
34  * \param[in] mode Type of metric used in the Expansion Mode.
35  * \param[in] b Expansion parameter in the metric
36  */
37  ExpansionProperties(ExpansionMode mode, double b) : mode_(mode), b_(b) {}
38 };
39 
40 /**
41  * Calculate the Hubble parameter \f$H(t)\f$, which describes how large
42  * the expansion flow is. The flow \f$\mathbf{v}=H(t)\:\mathbf{x}\f$
43  * \iref{Tindall:2016try}
44  *
45  * \param[in] time time in the computational frame. [fm]
46  * \param[in] metric Struct containing the parameters needed to
47  * calculate the metric.
48  * \return Hubble parameter [fm^\f${-1}\f$]
49  */
50 double calc_hubble(double time, const ExpansionProperties &metric);
51 
52 /**
53  * Propagates the positions of all particles on a straight line
54  * to a given moment.
55  *
56  * For each particle, the position is shifted:
57  * \f[ \mathbf{x}^\prime = \mathbf{x} + \mathbf{v}\:\Delta t \f]
58  * where \f$\mathbf{x}\f$ is the current position, \f$\mathbf{v}\f$ its
59  * velocity and \f$\Delta t\f$ the duration of this timestep.
60  *
61  * \param[out] particles The particle list in the event
62  * \param[in] to_time final time [fm]
63  * \param[in] beam_momentum This vector of 4-momenta should have
64  * non-zero size only if "frozen Fermi motion" is on.
65  * The the Fermi momenta are only used for collisions,
66  * but not for propagation. In this case beam_momentum
67  * is used for propagating the initial nucleons. [GeV]
68  * \return dt time interval of propagation which is equal to the
69  * difference between the final time and the initial
70  * time read from the 4-position of the particle.
71  */
72 double propagate_straight_line(Particles *particles, double to_time,
73  const std::vector<FourVector> &beam_momentum);
74 
75 void backpropagate_straight_line(Particles *particles, double to_time);
76 
77 /**
78  * Modifies positions and momentum of all particles to account for
79  * space-time deformation.
80  *
81  * \param[out] particles All the particles in the event
82  * \param[in] parameters A struct containing the parameters from which
83  * we extract the time in the computational frame.
84  * \param[in] metric A struct containing the parameters need to calculate
85  * the metric
86  */
87 void expand_space_time(Particles *particles,
88  const ExperimentParameters &parameters,
89  const ExpansionProperties &metric);
90 
91 /**
92  * Updates the momenta of all particles at the current
93  * time step according to the equations of motion:
94  *
95  * \f[ \frac{dp}{dt} = q\,(\mathbf{E} + \mathbf{v} \times \mathbf{B}) \f]
96  *
97  * \param[out] particles The particle list in the event
98  * \param[in] dt timestep
99  * \param[in] pot The potentials in the system
100  * \param[in] FB_lat Lattice for the electric and magnetic
101  * components of the Skyrme force
102  * \param[in] FI3_lat Lattice for the electric and magnetic
103  * components of the symmetry force
104  * \param[in] EM_lat Lattice for the electric and magnetic field
105  * \param[in] jB_lat Lattice of the net baryon density
106  */
107 void update_momenta(
108  std::vector<Particles> &particles, double dt, const Potentials &pot,
109  RectangularLattice<std::pair<ThreeVector, ThreeVector>> *FB_lat,
110  RectangularLattice<std::pair<ThreeVector, ThreeVector>> *FI3_lat,
111  RectangularLattice<std::pair<ThreeVector, ThreeVector>> *EM_lat,
112  DensityLattice *jB_lat);
113 
114 } // namespace smash
115 #endif // SRC_INCLUDE_SMASH_PROPAGATION_H_
ExpansionMode
Defines properties of expansion for the metric (e.g.
Definition: action.h:24
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, DensityLattice *jB_lat)
Updates the momenta of all particles at the current time step according to the equations of motion:
Definition: propagation.cc:131
void expand_space_time(Particles *particles, const ExperimentParameters &parameters, const ExpansionProperties &metric)
Modifies positions and momentum of all particles to account for space-time deformation.
Definition: propagation.cc:106
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.
Definition: propagation.cc:44
RectangularLattice< DensityOnLattice > DensityLattice
Conveniency typedef for lattice of density.
Definition: density.h:516
void backpropagate_straight_line(Particles *particles, double to_time)
Definition: propagation.cc:86
double calc_hubble(double time, const ExpansionProperties &metric)
Calculate the Hubble parameter , which describes how large the expansion flow is.
Definition: propagation.cc:21
Struct containing the type of the metric and the expansion parameter of the metric.
Definition: propagation.h:26
double b_
Expansion parameter in the metric (faster expansion for larger values)
Definition: propagation.h:30
ExpansionMode mode_
Type of metric used.
Definition: propagation.h:28
ExpansionProperties(ExpansionMode mode, double b)
Constructor of ExpansionProperties.
Definition: propagation.h:37