Version: SMASH-2.1
smash::Experiment< Modus > Class Template Reference

#include <experiment.h>

template<typename Modus>
class smash::Experiment< Modus >

The main class, where the simulation of an experiment is executed.

The Experiment class owns all data (maybe indirectly) relevant for the execution of the experiment simulation. The experiment can be conducted in different running modi. Since the abstraction of these differences should not incur any overhead, the design is built around the Policy pattern.

The Policy pattern was defined by Andrei Alexandrescu in his book "Modern C++ Design: Generic Programming and Design Patterns Applied". Addison-Wesley:

A policy defines a class interface or a class template interface. The interface consists of one or all of the following: inner type definitions, member functions, and member variables.

The policy pattern can also be understood as a compile-time variant of the strategy pattern.

The Modus template parameter defines the "policy" of the Experiment class. It determines several aspects of the experiment execution at compile time. The original strategy pattern would select these differences at run time, thus incurring an overhead. This overhead becomes severe in cases where calls to strategy/policy functions are done very frequently. Using the policy pattern, the compiler can fully optimize: It creates a new instance of all functions in Experiment for all different Modus types.

Definition at line 177 of file experiment.h.

Inheritance diagram for smash::Experiment< Modus >:
[legend]
Collaboration diagram for smash::Experiment< Modus >:
[legend]

Public Member Functions

void run () override
 Runs the experiment. More...
 
 Experiment (Configuration config, const bf::path &output_path)
 Create a new Experiment. More...
 
void initialize_new_event ()
 This is called in the beginning of each event. More...
 
void run_time_evolution ()
 Runs the time evolution of an event with fixed-sized time steps or without timesteps, from action to actions. More...
 
void do_final_decays ()
 Performs the final decays of an event. More...
 
void final_output ()
 Output at the end of an event. More...
 
Particlesfirst_ensemble ()
 Provides external access to SMASH particles. More...
 
std::vector< Particles > * all_ensembles ()
 Getter for all ensembles. More...
 
Modus * modus ()
 Provides external access to SMASH calculation modus. More...
 
- Public Member Functions inherited from smash::ExperimentBase
 ExperimentBase ()=default
 
virtual ~ExperimentBase ()=default
 The virtual destructor avoids undefined behavior when destroying derived objects. More...
 

Private Member Functions

bool perform_action (Action &action, int i_ensemble)
 Perform the given action. More...
 
void create_output (const std::string &format, const std::string &content, const bf::path &output_path, const OutputParameters &par)
 Create a list of output files. More...
 
void propagate_and_shine (double to_time, Particles &particles)
 Propagate all particles until time to_time without any interactions and shine dileptons. More...
 
void run_time_evolution_timestepless (Actions &actions, int i_ensemble, double end_time_propagation)
 Performs all the propagations and actions during a certain time interval neglecting the influence of the potentials. More...
 
void intermediate_output ()
 Intermediate output during an event. More...
 
void update_potentials ()
 Recompute potentials on lattices if necessary. More...
 
double compute_min_cell_length (double dt) const
 Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collisions within the maximal transverse distance (which is determined by the maximal cross section). More...
 
double next_output_time () const
 Shortcut for next output time. More...
 

Private Attributes

ExperimentParameters parameters_
 Struct of several member variables. More...
 
DensityParameters density_param_
 Structure to precalculate and hold parameters for density computations. More...
 
Modus modus_
 Instance of the Modus template parameter. More...
 
std::vector< Particlesensembles_
 Complete particle list, all ensembles in one vector. More...
 
std::unique_ptr< Potentialspotentials_
 An instance of potentials class, that stores parameters of potentials, calculates them and their gradients. More...
 
std::unique_ptr< PauliBlockerpauli_blocker_
 An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and computes phase-space density. More...
 
OutputsList outputs_
 A list of output formaters. More...
 
OutputPtr dilepton_output_
 The Dilepton output. More...
 
OutputPtr photon_output_
 The Photon output. More...
 
std::vector< bool > projectile_target_interact_
 Whether the projectile and the target collided. More...
 
std::vector< FourVectorbeam_momentum_ = {}
 The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen. More...
 
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
 The Action finder objects. More...
 
std::unique_ptr< DecayActionsFinderDileptondilepton_finder_
 The Dilepton Action Finder. More...
 
std::unique_ptr< ActionFinderInterfacephoton_finder_
 The (Scatter) Actions Finder for Direct Photons. More...
 
int n_fractional_photons_
 Number of fractional photons produced per single reaction. More...
 
std::unique_ptr< DensityLatticej_QBS_lat_
 4-current for j_QBS lattice output More...
 
std::unique_ptr< DensityLatticejmu_B_lat_
 Baryon density on the lattice. More...
 
std::unique_ptr< DensityLatticejmu_I3_lat_
 Isospin projection density on the lattice. More...
 
std::unique_ptr< DensityLatticejmu_el_lat_
 Electric charge density on the lattice. More...
 
std::unique_ptr< FieldsLatticefields_lat_
 Mean-field A^mu on the lattice. More...
 
std::unique_ptr< DensityLatticejmu_custom_lat_
 Custom density on the lattices. More...
 
DensityType dens_type_lattice_printout_ = DensityType::None
 Type of density for lattice printout. More...
 
std::unique_ptr< RectangularLattice< FourVector > > UB_lat_ = nullptr
 Lattices for Skyrme or VDF potentials (evaluated in the local rest frame) times the baryon flow 4-velocity. More...
 
std::unique_ptr< RectangularLattice< FourVector > > UI3_lat_ = nullptr
 Lattices for symmetry potentials (evaluated in the local rest frame) times the isospin flow 4-velocity. More...
 
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FB_lat_
 Lattices for the electric and magnetic components of the Skyrme or VDF force. More...
 
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
 Lattices for the electric and magnetic component of the symmetry force. More...
 
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > EM_lat_
 Lattices for electric and magnetic field in fm^-2. More...
 
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
 Lattices of energy-momentum tensors for printout. More...
 
std::unique_ptr< RectangularLattice< FourVector > > old_jmu_auxiliary_
 Auxiliary lattice for values of jmu at a time step t0. More...
 
std::unique_ptr< RectangularLattice< FourVector > > new_jmu_auxiliary_
 Auxiliary lattice for values of jmu at a time step t0 + dt. More...
 
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > four_gradient_auxiliary_
 Auxiliary lattice for calculating the four-gradient of jmu. More...
 
std::unique_ptr< RectangularLattice< FourVector > > old_fields_auxiliary_
 Auxiliary lattice for values of Amu at a time step t0. More...
 
std::unique_ptr< RectangularLattice< FourVector > > new_fields_auxiliary_
 Auxiliary lattice for values of Amu at a time step t0 + dt. More...
 
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > fields_four_gradient_auxiliary_
 Auxiliary lattice for calculating the four-gradient of Amu. More...
 
bool printout_tmn_ = false
 Whether to print the energy-momentum tensor. More...
 
bool printout_tmn_landau_ = false
 Whether to print the energy-momentum tensor in Landau frame. More...
 
bool printout_v_landau_ = false
 Whether to print the 4-velocity in Landau frame. More...
 
bool printout_j_QBS_ = false
 Whether to print the Q, B, S 4-currents. More...
 
bool printout_lattice_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices. More...
 
bool printout_full_lattice_ascii_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in ASCII format. More...
 
bool printout_full_lattice_binary_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in Binary format. More...
 
bool printout_full_lattice_any_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in any format. More...
 
std::unique_ptr< GrandCanThermalizerthermalizer_
 Instance of class used for forced thermalization. More...
 
StringProcessprocess_string_ptr_
 Pointer to the string process class object, which is used to set the random seed for PYTHIA objects in each event. More...
 
const int nevents_
 Number of events. More...
 
int event_ = 0
 Current event. More...
 
const double end_time_
 simulation time at which the evolution is stopped. More...
 
const double delta_time_startup_
 The clock's timestep size at start up. More...
 
const bool force_decays_
 This indicates whether we force all resonances to decay in the last timestep. More...
 
const bool use_grid_
 This indicates whether to use the grid. More...
 
const ExpansionProperties metric_
 This struct contains information on the metric to be used. More...
 
const bool dileptons_switch_
 This indicates whether dileptons are switched on. More...
 
const bool photons_switch_
 This indicates whether photons are switched on. More...
 
const bool bremsstrahlung_switch_
 This indicates whether bremsstrahlung is switched on. More...
 
const bool IC_output_switch_
 This indicates whether the IC output is enabled. More...
 
const TimeStepMode time_step_mode_
 This indicates whether to use time steps. More...
 
double max_transverse_distance_sqr_ = std::numeric_limits<double>::max()
 Maximal distance at which particles can interact in case of the geometric criterion, squared. More...
 
QuantumNumbers conserved_initial_
 The conserved quantities of the system. More...
 
double initial_mean_field_energy_
 The initial total mean field energy in the system. More...
 
SystemTimePoint time_start_ = SystemClock::now()
 system starting time of the simulation More...
 
DensityType dens_type_ = DensityType::None
 Type of density to be written to collision headers. More...
 
uint64_t interactions_total_ = 0
 Total number of interactions for current timestep. More...
 
uint64_t previous_interactions_total_ = 0
 Total number of interactions for previous timestep. More...
 
uint64_t wall_actions_total_ = 0
 Total number of wall-crossings for current timestep. More...
 
uint64_t previous_wall_actions_total_ = 0
 Total number of wall-crossings for previous timestep. More...
 
uint64_t total_pauli_blocked_ = 0
 Total number of Pauli-blockings for current timestep. More...
 
uint64_t total_hypersurface_crossing_actions_ = 0
 Total number of particles removed from the evolution in hypersurface crossing actions. More...
 
uint64_t discarded_interactions_total_ = 0
 Total number of discarded interactions, because they were invalidated before they could be performed. More...
 
double total_energy_removed_ = 0.0
 Total energy removed from the system in hypersurface crossing actions. More...
 
int64_t seed_ = -1
 random seed for the next event. More...
 

Friends

class ExperimentBase
 
std::ostream & operator<< (std::ostream &out, const Experiment &e)
 Writes the initial state for the Experiment to the output stream. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from smash::ExperimentBase
static std::unique_ptr< ExperimentBasecreate (Configuration config, const bf::path &output_path)
 Factory method that creates and initializes a new Experiment<Modus>. More...
 

Constructor & Destructor Documentation

◆ Experiment()

template<typename Modus >
smash::Experiment< Modus >::Experiment ( Configuration  config,
const bf::path &  output_path 
)
explicit

Create a new Experiment.

This constructor is only called from the ExperimentBase::create factory method.

Parameters
[in]configThe Configuration object contains all initial setup of the experiment. It is forwarded to the constructors of member variables as needed. Note that the object is passed by non-const reference. This is only necessary for bookkeeping: Values are not only read, but actually taken out of the object. Thus, all values that remain were not used.
[in]output_pathThe directory where the output files are written.

Member Function Documentation

◆ run()

template<typename Modus >
void smash::Experiment< Modus >::run
overridevirtual

Runs the experiment.

The constructor does the setup of the experiment. The run function executes the complete experiment.

Implements smash::ExperimentBase.

Definition at line 2823 of file experiment.h.

2823  {
2824  const auto &mainlog = logg[LMain];
2825  for (event_ = 0; event_ < nevents_; event_++) {
2826  mainlog.info() << "Event " << event_;
2827 
2828  // Sample initial particles, start clock, some printout and book-keeping
2830 
2832 
2833  if (force_decays_) {
2834  do_final_decays();
2835  }
2836 
2837  // Output at event end
2838  final_output();
2839  }
2840 }
const bool force_decays_
This indicates whether we force all resonances to decay in the last timestep.
Definition: experiment.h:523
const int nevents_
Number of events.
Definition: experiment.h:504
void initialize_new_event()
This is called in the beginning of each event.
Definition: experiment.h:1840
void run_time_evolution()
Runs the time evolution of an event with fixed-sized time steps or without timesteps,...
Definition: experiment.h:2186
int event_
Current event.
Definition: experiment.h:507
void do_final_decays()
Performs the final decays of an event.
Definition: experiment.h:2648
void final_output()
Output at the end of an event.
Definition: experiment.h:2687
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
Definition: logging.cc:39
static constexpr int LMain
Definition: experiment.h:87

◆ initialize_new_event()

template<typename Modus >
void smash::Experiment< Modus >::initialize_new_event

This is called in the beginning of each event.

It initializes particles according to selected modus, resets the clock and saves the initial conserved quantities for subsequent sanity checks.

Definition at line 1840 of file experiment.h.

1840  {
1842  logg[LExperiment].info() << "random number seed: " << seed_;
1843  /* Set seed for the next event. It has to be positive, so it can be entered
1844  * in the config.
1845  *
1846  * We have to be careful about the minimal integer, whose absolute value
1847  * cannot be represented. */
1848  int64_t r = random::advance();
1849  while (r == INT64_MIN) {
1850  r = random::advance();
1851  }
1852  seed_ = std::abs(r);
1853  /* Set the random seed used in PYTHIA hadronization
1854  * to be same with the SMASH one.
1855  * In this way we ensure that the results are reproducible
1856  * for every event if one knows SMASH random seed. */
1857  if (process_string_ptr_ != NULL) {
1859  }
1860 
1861  for (Particles &particles : ensembles_) {
1862  particles.reset();
1863  }
1864 
1865  // Sample particles according to the initial conditions
1866  double start_time = -1.0;
1867 
1868  // Sample impact parameter only once per all ensembles
1869  // It should be the same for all ensembles
1870  if (modus_.is_collider()) {
1871  modus_.sample_impact();
1872  logg[LExperiment].info("Impact parameter = ", modus_.impact_parameter(),
1873  " fm");
1874  }
1875  for (Particles &particles : ensembles_) {
1876  start_time = modus_.initial_conditions(&particles, parameters_);
1877  }
1878  /* For box modus make sure that particles are in the box. In principle, after
1879  * a correct initialization they should be, so this is just playing it safe.
1880  */
1881  for (Particles &particles : ensembles_) {
1882  modus_.impose_boundary_conditions(&particles, outputs_);
1883  }
1884  // Reset the simulation clock
1885  double timestep = delta_time_startup_;
1886 
1887  switch (time_step_mode_) {
1888  case TimeStepMode::Fixed:
1889  break;
1890  case TimeStepMode::None:
1891  timestep = end_time_ - start_time;
1892  // Take care of the box modus + timestepless propagation
1893  const double max_dt = modus_.max_timestep(max_transverse_distance_sqr_);
1894  if (max_dt > 0. && max_dt < timestep) {
1895  timestep = max_dt;
1896  }
1897  break;
1898  }
1899  std::unique_ptr<UniformClock> clock_for_this_event;
1900  if (modus_.is_list() && (timestep < 0.0)) {
1901  throw std::runtime_error(
1902  "Timestep for the given event is negative. \n"
1903  "This might happen if the formation times of the input particles are "
1904  "larger than the specified end time of the simulation.");
1905  }
1906  clock_for_this_event = make_unique<UniformClock>(start_time, timestep);
1907  parameters_.labclock = std::move(clock_for_this_event);
1908 
1909  // Reset the output clock
1910  parameters_.outputclock->reset(start_time, true);
1911  // remove time before starting time in case of custom output times.
1912  parameters_.outputclock->remove_times_in_past(start_time);
1913 
1914  logg[LExperiment].debug(
1915  "Lab clock: t_start = ", parameters_.labclock->current_time(),
1916  ", dt = ", parameters_.labclock->timestep_duration());
1917 
1918  /* Save the initial conserved quantum numbers and total momentum in
1919  * the system for conservation checks */
1920  conserved_initial_ = QuantumNumbers(ensembles_);
1921  wall_actions_total_ = 0;
1923  interactions_total_ = 0;
1929  total_energy_removed_ = 0.0;
1930  // Print output headers
1931  logg[LExperiment].info() << hline;
1932  logg[LExperiment].info() << "Time[fm] Ekin[GeV] E_MF[GeV] ETotal[GeV] "
1933  << "ETot/N[GeV] D(ETot/N)[GeV] Scatt&Decays "
1934  << "Particles Comp.Time";
1935  logg[LExperiment].info() << hline;
1936  double E_mean_field = 0.0;
1937  if (potentials_) {
1938  // update_potentials();
1939  // if (parameters.outputclock->current_time() == 0.0 )
1940  // using the lattice is necessary
1941  if ((jmu_B_lat_ != nullptr)) {
1946  parameters_.labclock->timestep_duration(), true);
1947  // Because there was no lattice at t=-Delta_t, the time derivatives
1948  // drho_dt and dj^mu/dt at t=0 are huge, while they shouldn't be; we
1949  // overwrite the time derivative to zero by hand.
1950  for (auto &node : *jmu_B_lat_) {
1951  node.overwrite_drho_dt_to_zero();
1952  node.overwrite_djmu_dt_to_zero();
1953  }
1955  EM_lat_.get(), parameters_);
1956  }
1957  }
1958  initial_mean_field_energy_ = E_mean_field;
1961  parameters_.labclock->current_time(), E_mean_field,
1963 
1964  // Output at event start
1965  for (const auto &output : outputs_) {
1966  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
1967  auto event_info =
1968  fill_event_info(ensembles_, E_mean_field, modus_.impact_parameter(),
1970  output->at_eventstart(ensembles_[i_ens],
1971  // Pretend each ensemble is an independent event
1972  event_ * parameters_.n_ensembles + i_ens,
1973  event_info);
1974  }
1975  // For thermodynamic output
1976  output->at_eventstart(ensembles_, event_);
1977  // For thermodynamic lattice output
1979  switch (dens_type_lattice_printout_) {
1980  case DensityType::Baryon:
1981  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
1983  break;
1985  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
1987  break;
1988  case DensityType::None:
1989  break;
1990  default:
1991  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
1993  }
1994  if (printout_tmn_) {
1995  output->at_eventstart(event_, ThermodynamicQuantity::Tmn,
1997  }
1998  if (printout_tmn_landau_) {
1999  output->at_eventstart(event_, ThermodynamicQuantity::TmnLandau,
2001  }
2002  if (printout_v_landau_) {
2003  output->at_eventstart(event_, ThermodynamicQuantity::LandauVelocity,
2005  }
2006  if (printout_j_QBS_) {
2007  output->at_eventstart(event_, ThermodynamicQuantity::j_QBS,
2009  }
2010  }
2011  }
2012 
2013  /* In the ColliderModus, if Fermi motion is frozen, assign the beam momenta
2014  * to the nucleons in both the projectile and the target. Every ensemble
2015  * gets the same beam momenta, so no need to create beam_momenta_ vector
2016  * for every ensemble.
2017  */
2018  if (modus_.is_collider() && modus_.fermi_motion() == FermiMotion::Frozen) {
2019  for (ParticleData &particle : ensembles_[0]) {
2020  const double m = particle.effective_mass();
2021  double v_beam = 0.0;
2022  if (particle.belongs_to() == BelongsTo::Projectile) {
2023  v_beam = modus_.velocity_projectile();
2024  } else if (particle.belongs_to() == BelongsTo::Target) {
2025  v_beam = modus_.velocity_target();
2026  }
2027  const double gamma = 1.0 / std::sqrt(1.0 - v_beam * v_beam);
2028  beam_momentum_.emplace_back(
2029  FourVector(gamma * m, 0.0, 0.0, gamma * v_beam * m));
2030  } // loop over particles
2031  }
2032 }
double initial_mean_field_energy_
The initial total mean field energy in the system.
Definition: experiment.h:565
bool printout_tmn_
Whether to print the energy-momentum tensor.
Definition: experiment.h:455
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:559
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:321
double total_energy_removed_
Total energy removed from the system in hypersurface crossing actions.
Definition: experiment.h:619
DensityType dens_type_lattice_printout_
Type of density for lattice printout.
Definition: experiment.h:406
double max_transverse_distance_sqr_
Maximal distance at which particles can interact in case of the geometric criterion,...
Definition: experiment.h:550
bool printout_j_QBS_
Whether to print the Q, B, S 4-currents.
Definition: experiment.h:464
const TimeStepMode time_step_mode_
This indicates whether to use time steps.
Definition: experiment.h:544
std::unique_ptr< DensityLattice > jmu_custom_lat_
Custom density on the lattices.
Definition: experiment.h:403
bool printout_full_lattice_any_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:479
std::unique_ptr< DensityLattice > jmu_B_lat_
Baryon density on the lattice.
Definition: experiment.h:385
std::vector< FourVector > beam_momentum_
The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen.
Definition: experiment.h:367
std::unique_ptr< RectangularLattice< FourVector > > new_jmu_auxiliary_
Auxiliary lattice for values of jmu at a time step t0 + dt.
Definition: experiment.h:441
const double delta_time_startup_
The clock's timestep size at start up.
Definition: experiment.h:517
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
Lattices of energy-momentum tensors for printout.
Definition: experiment.h:436
std::vector< Particles > ensembles_
Complete particle list, all ensembles in one vector.
Definition: experiment.h:330
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:568
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:595
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:348
bool printout_v_landau_
Whether to print the 4-velocity in Landau frame.
Definition: experiment.h:461
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > EM_lat_
Lattices for electric and magnetic field in fm^-2.
Definition: experiment.h:433
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:327
std::unique_ptr< RectangularLattice< FourVector > > old_jmu_auxiliary_
Auxiliary lattice for values of jmu at a time step t0.
Definition: experiment.h:439
std::unique_ptr< DensityLattice > j_QBS_lat_
4-current for j_QBS lattice output
Definition: experiment.h:382
bool printout_tmn_landau_
Whether to print the energy-momentum tensor in Landau frame.
Definition: experiment.h:458
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > four_gradient_auxiliary_
Auxiliary lattice for calculating the four-gradient of jmu.
Definition: experiment.h:444
StringProcess * process_string_ptr_
Pointer to the string process class object, which is used to set the random seed for PYTHIA objects i...
Definition: experiment.h:488
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:318
std::unique_ptr< Potentials > potentials_
An instance of potentials class, that stores parameters of potentials, calculates them and their grad...
Definition: experiment.h:336
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:589
uint64_t total_hypersurface_crossing_actions_
Total number of particles removed from the evolution in hypersurface crossing actions.
Definition: experiment.h:607
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:577
std::unique_ptr< DensityLattice > jmu_I3_lat_
Isospin projection density on the lattice.
Definition: experiment.h:388
uint64_t total_pauli_blocked_
Total number of Pauli-blockings for current timestep.
Definition: experiment.h:601
std::vector< bool > projectile_target_interact_
Whether the projectile and the target collided.
Definition: experiment.h:360
int64_t seed_
random seed for the next event.
Definition: experiment.h:622
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:583
uint64_t discarded_interactions_total_
Total number of discarded interactions, because they were invalidated before they could be performed.
Definition: experiment.h:613
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:510
void init_pythia_hadron_rndm()
Set PYTHIA random seeds to be desired values.
@ Frozen
Use fermi motion without potentials.
@ Fixed
Use fixed time step.
@ None
Don't use time steps; propagate from action to action.
Engine::result_type advance()
Advance the engine's state and return the generated value.
Definition: random.h:78
void set_seed(T &&seed)
Sets the seed of the random number engine.
Definition: random.h:71
std::string format_measurements(const std::vector< Particles > &ensembles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time, double E_mean_field, double E_mean_field_initial)
Generate a string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:679
void update_lattice(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const std::vector< Particles > &ensembles, const bool compute_gradient)
Updates the contents on the lattice.
Definition: density.h:536
double calculate_mean_field_energy(const Potentials &potentials, RectangularLattice< smash::DensityOnLattice > &jmu_B_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *em_lattice, const ExperimentParameters &parameters)
Calculate the total mean field energy of the system; this will be printed to the screen when SMASH is...
Definition: experiment.cc:727
static constexpr int LExperiment
EventInfo fill_event_info(const std::vector< Particles > &ensembles, double E_mean_field, double modus_impact_parameter, const ExperimentParameters &parameters, bool projectile_target_interact)
Generate the EventInfo object which is passed to outputs_.
Definition: experiment.cc:947
const std::string hline(113, '-')
String representing a horizontal line.
int n_ensembles
Number of parallel ensembles.
std::unique_ptr< Clock > outputclock
Output clock to keep track of the next output time.
std::unique_ptr< Clock > labclock
System clock (for simulation time keeping in the computational frame)
Here is the call graph for this function:

◆ run_time_evolution()

template<typename Modus >
void smash::Experiment< Modus >::run_time_evolution

Runs the time evolution of an event with fixed-sized time steps or without timesteps, from action to actions.

Within one timestep (fixed) evolution from action to action is invoked.

Definition at line 2186 of file experiment.h.

2186  {
2187  while (parameters_.labclock->current_time() < end_time_) {
2188  const double t = parameters_.labclock->current_time();
2189  const double dt =
2190  std::min(parameters_.labclock->timestep_duration(), end_time_ - t);
2191  logg[LExperiment].debug("Timestepless propagation for next ", dt, " fm/c.");
2192 
2193  // Perform forced thermalization if required
2194  if (thermalizer_ &&
2195  thermalizer_->is_time_to_thermalize(parameters_.labclock)) {
2196  const bool ignore_cells_under_treshold = true;
2197  // Thermodynamics in thermalizer is computed from all ensembles,
2198  // but thermalization actions act on each ensemble independently
2199  thermalizer_->update_thermalizer_lattice(ensembles_, density_param_,
2200  ignore_cells_under_treshold);
2201  const double current_t = parameters_.labclock->current_time();
2202  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2203  thermalizer_->thermalize(ensembles_[i_ens], current_t,
2205  ThermalizationAction th_act(*thermalizer_, current_t);
2206  if (th_act.any_particles_thermalized()) {
2207  perform_action(th_act, i_ens);
2208  }
2209  }
2210  }
2211 
2212  std::vector<Actions> actions(parameters_.n_ensembles);
2213  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2214  actions[i_ens].clear();
2215  if (ensembles_[i_ens].size() > 0 && action_finders_.size() > 0) {
2216  /* (1.a) Create grid. */
2217  const double min_cell_length = compute_min_cell_length(dt);
2218  logg[LExperiment].debug("Creating grid with minimal cell length ",
2219  min_cell_length);
2220  const auto &grid =
2221  use_grid_ ? modus_.create_grid(ensembles_[i_ens], min_cell_length,
2222  dt, parameters_.coll_crit)
2223  : modus_.create_grid(ensembles_[i_ens], min_cell_length,
2224  dt, parameters_.coll_crit,
2226 
2227  const double gcell_vol = grid.cell_volume();
2228  /* (1.b) Iterate over cells and find actions. */
2229  grid.iterate_cells(
2230  [&](const ParticleList &search_list) {
2231  for (const auto &finder : action_finders_) {
2232  actions[i_ens].insert(finder->find_actions_in_cell(
2233  search_list, dt, gcell_vol, beam_momentum_));
2234  }
2235  },
2236  [&](const ParticleList &search_list,
2237  const ParticleList &neighbors_list) {
2238  for (const auto &finder : action_finders_) {
2239  actions[i_ens].insert(finder->find_actions_with_neighbors(
2240  search_list, neighbors_list, dt, beam_momentum_));
2241  }
2242  });
2243  }
2244  }
2245 
2246  /* \todo (optimizations) Adapt timestep size here */
2247 
2248  /* (2) Propagate from action to action until next output or timestep end */
2249  const double end_timestep_time =
2250  std::min(parameters_.labclock->next_time(), end_time_);
2251  while (next_output_time() <= end_timestep_time) {
2252  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2253  run_time_evolution_timestepless(actions[i_ens], i_ens,
2254  next_output_time());
2255  }
2256  ++(*parameters_.outputclock);
2257 
2258  // Avoid duplication of final output
2259  if (parameters_.outputclock->current_time() < end_time_) {
2261  }
2262  }
2263  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2264  run_time_evolution_timestepless(actions[i_ens], i_ens, end_timestep_time);
2265  }
2266 
2267  /* (3) Update potentials (if computed on the lattice) and
2268  * compute new momenta according to equations of motion */
2269  if (potentials_) {
2271  update_momenta(ensembles_, parameters_.labclock->timestep_duration(),
2272  *potentials_, FB_lat_.get(), FI3_lat_.get(),
2273  EM_lat_.get());
2274  }
2275 
2276  /* (4) Expand universe if non-minkowskian metric; updates
2277  * positions and momenta according to the selected expansion */
2279  for (Particles &particles : ensembles_) {
2280  expand_space_time(&particles, parameters_, metric_);
2281  }
2282  }
2283 
2284  ++(*parameters_.labclock);
2285 
2286  /* (5) Check conservation laws.
2287  *
2288  * Check conservation of conserved quantities if potentials and string
2289  * fragmentation are off. If potentials are on then momentum is conserved
2290  * only in average. If string fragmentation is on, then energy and
2291  * momentum are only very roughly conserved in high-energy collisions. */
2294  std::string err_msg = conserved_initial_.report_deviations(ensembles_);
2295  if (!err_msg.empty()) {
2296  logg[LExperiment].error() << err_msg;
2297  throw std::runtime_error("Violation of conserved quantities!");
2298  }
2299  }
2300  }
2301 
2302  if (pauli_blocker_) {
2303  logg[LExperiment].info(
2304  "Interactions: Pauli-blocked/performed = ", total_pauli_blocked_, "/",
2306  }
2307 }
const ExpansionProperties metric_
This struct contains information on the metric to be used.
Definition: experiment.h:529
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:370
double next_output_time() const
Shortcut for next output time.
Definition: experiment.h:309
std::unique_ptr< GrandCanThermalizer > thermalizer_
Instance of class used for forced thermalization.
Definition: experiment.h:482
bool perform_action(Action &action, int i_ensemble)
Perform the given action.
void intermediate_output()
Intermediate output during an event.
Definition: experiment.h:2402
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
Lattices for the electric and magnetic component of the symmetry force.
Definition: experiment.h:429
double compute_min_cell_length(double dt) const
Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collis...
Definition: experiment.h:301
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FB_lat_
Lattices for the electric and magnetic components of the Skyrme or VDF force.
Definition: experiment.h:425
std::unique_ptr< PauliBlocker > pauli_blocker_
An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and c...
Definition: experiment.h:342
void run_time_evolution_timestepless(Actions &actions, int i_ensemble, double end_time_propagation)
Performs all the propagations and actions during a certain time interval neglecting the influence of ...
Definition: experiment.h:2336
const bool use_grid_
This indicates whether to use the grid.
Definition: experiment.h:526
void update_potentials()
Recompute potentials on lattices if necessary.
Definition: experiment.h:2548
const bool IC_output_switch_
This indicates whether the IC output is enabled.
Definition: experiment.h:541
std::string report_deviations(const std::vector< Particles > &ensembles) const
Checks if the current particle list has still the same values and reports about differences.
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:
Definition: propagation.cc:111
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:86
@ Largest
Make cells as large as possible.
ExpansionMode mode_
Type of metric used.
Definition: propagation.h:28
const CollisionCriterion coll_crit
Employed collision criterion.
bool strings_switch
This indicates whether string fragmentation is switched on.
int testparticles
Number of test-particles.
Here is the call graph for this function:

◆ do_final_decays()

template<typename Modus >
void smash::Experiment< Modus >::do_final_decays

Performs the final decays of an event.

Definition at line 2648 of file experiment.h.

2648  {
2649  /* At end of time evolution: Force all resonances to decay. In order to handle
2650  * decay chains, we need to loop until no further actions occur. */
2651  uint64_t interactions_old = 0;
2652  do {
2653  interactions_old = interactions_total_;
2654 
2655  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2656  Actions actions;
2657 
2658  // Dileptons: shining of remaining resonances
2659  if (dilepton_finder_ != nullptr) {
2660  for (const auto &output : outputs_) {
2661  dilepton_finder_->shine_final(ensembles_[i_ens], output.get(), true);
2662  }
2663  }
2664  // Find actions.
2665  for (const auto &finder : action_finders_) {
2666  actions.insert(finder->find_final_actions(ensembles_[i_ens]));
2667  }
2668  // Perform actions.
2669  while (!actions.is_empty()) {
2670  perform_action(*actions.pop(), i_ens);
2671  }
2672  }
2673  // loop until no more decays occur
2674  } while (interactions_total_ > interactions_old);
2675 
2676  // Dileptons: shining of stable particles at the end
2677  if (dilepton_finder_ != nullptr) {
2678  for (const auto &output : outputs_) {
2679  for (Particles &particles : ensembles_) {
2680  dilepton_finder_->shine_final(particles, output.get(), false);
2681  }
2682  }
2683  }
2684 }
std::unique_ptr< DecayActionsFinderDilepton > dilepton_finder_
The Dilepton Action Finder.
Definition: experiment.h:373
Here is the call graph for this function:

◆ final_output()

template<typename Modus >
void smash::Experiment< Modus >::final_output

Output at the end of an event.

Definition at line 2687 of file experiment.h.

2687  {
2688  /* make sure the experiment actually ran (note: we should compare this
2689  * to the start time, but we don't know that. Therefore, we check that
2690  * the time is positive, which should heuristically be the same). */
2691  double E_mean_field = 0.0;
2692  if (likely(parameters_.labclock > 0)) {
2693  const uint64_t wall_actions_this_interval =
2695  const uint64_t interactions_this_interval = interactions_total_ -
2697  wall_actions_this_interval;
2698  if (potentials_) {
2699  // using the lattice is necessary
2700  if ((jmu_B_lat_ != nullptr)) {
2702  EM_lat_.get(), parameters_);
2703  }
2704  }
2706  ensembles_, interactions_this_interval, conserved_initial_, time_start_,
2707  end_time_, E_mean_field, initial_mean_field_energy_);
2708  int total_particles = 0;
2709  for (const Particles &particles : ensembles_) {
2710  total_particles += particles.size();
2711  }
2712  if (IC_output_switch_ && (total_particles == 0)) {
2713  // Verify there is no more energy in the system if all particles were
2714  // removed when crossing the hypersurface
2715  const double remaining_energy =
2717  if (remaining_energy > really_small) {
2718  throw std::runtime_error(
2719  "There is remaining energy in the system although all particles "
2720  "were removed.\n"
2721  "E_remain = " +
2722  std::to_string(remaining_energy) + " [GeV]");
2723  } else {
2724  logg[LExperiment].info() << hline;
2725  logg[LExperiment].info()
2726  << "Time real: " << SystemClock::now() - time_start_;
2727  logg[LExperiment].info()
2728  << "Interactions before reaching hypersurface: "
2731  logg[LExperiment].info()
2732  << "Total number of particles removed on hypersurface: "
2734  }
2735  } else {
2736  const double precent_discarded =
2738  ? static_cast<double>(discarded_interactions_total_) * 100.0 /
2740  : 0.0;
2741  std::stringstream msg_discarded;
2742  msg_discarded
2743  << "Discarded interaction number: " << discarded_interactions_total_
2744  << " (" << precent_discarded
2745  << "% of the total interaction number including wall crossings)";
2746 
2747  logg[LExperiment].info() << hline;
2748  logg[LExperiment].info()
2749  << "Time real: " << SystemClock::now() - time_start_;
2750  logg[LExperiment].debug() << msg_discarded.str();
2751 
2753  precent_discarded > 1.0) {
2754  // The choosen threshold of 1% is a heuristical value
2755  logg[LExperiment].warn()
2756  << msg_discarded.str()
2757  << "\nThe number of discarded interactions is large, which means "
2758  "the assumption for the stochastic criterion of\n1 interaction "
2759  "per particle per timestep is probably violated. Consider "
2760  "reducing the timestep size.";
2761  }
2762 
2763  logg[LExperiment].info() << "Final interaction number: "
2765  }
2766 
2767  // Check if there are unformed particles
2768  int unformed_particles_count = 0;
2769  for (const Particles &particles : ensembles_) {
2770  for (const ParticleData &particle : particles) {
2771  if (particle.formation_time() > end_time_) {
2772  unformed_particles_count++;
2773  }
2774  }
2775  }
2776  if (unformed_particles_count > 0) {
2777  logg[LExperiment].warn(
2778  "End time might be too small. ", unformed_particles_count,
2779  " unformed particles were found at the end of the evolution.");
2780  }
2781  }
2782 
2783  for (const auto &output : outputs_) {
2784  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2785  auto event_info =
2786  fill_event_info(ensembles_, E_mean_field, modus_.impact_parameter(),
2788  output->at_eventend(ensembles_[i_ens],
2789  // Pretend each ensemble is an independent event
2790  event_ * parameters_.n_ensembles + i_ens, event_info);
2791  }
2792  // For thermodynamic output
2793  output->at_eventend(ensembles_, event_);
2794 
2795  // For thermodynamic lattice output
2797  output->at_eventend(event_, ThermodynamicQuantity::EckartDensity,
2799  output->at_eventend(ThermodynamicQuantity::EckartDensity);
2800  }
2801  if (printout_tmn_) {
2802  output->at_eventend(event_, ThermodynamicQuantity::Tmn,
2804  output->at_eventend(ThermodynamicQuantity::Tmn);
2805  }
2806  if (printout_tmn_landau_) {
2807  output->at_eventend(event_, ThermodynamicQuantity::TmnLandau,
2809  output->at_eventend(ThermodynamicQuantity::TmnLandau);
2810  }
2811  if (printout_v_landau_) {
2812  output->at_eventend(event_, ThermodynamicQuantity::LandauVelocity,
2814  output->at_eventend(ThermodynamicQuantity::LandauVelocity);
2815  }
2816  if (printout_j_QBS_) {
2817  output->at_eventend(ThermodynamicQuantity::j_QBS);
2818  }
2819  }
2820 }
double x0() const
Definition: fourvector.h:308
FourVector momentum() const
@ Stochastic
Stochastic Criteiron.
#define likely(x)
Tell the branch predictor that this expression is likely true.
Definition: macros.h:14
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:37
Here is the call graph for this function:

◆ first_ensemble()

template<typename Modus >
Particles* smash::Experiment< Modus >::first_ensemble ( )
inline

Provides external access to SMASH particles.

This is helpful if SMASH is used as a 3rd-party library.

Definition at line 231 of file experiment.h.

231 { return &ensembles_[0]; }

◆ all_ensembles()

template<typename Modus >
std::vector<Particles>* smash::Experiment< Modus >::all_ensembles ( )
inline

Getter for all ensembles.

Definition at line 233 of file experiment.h.

233 { return &ensembles_; }

◆ modus()

template<typename Modus >
Modus* smash::Experiment< Modus >::modus ( )
inline

Provides external access to SMASH calculation modus.

This is helpful if SMASH is used as a 3rd-party library.

Definition at line 239 of file experiment.h.

239 { return &modus_; }

◆ perform_action()

template<typename Modus >
bool smash::Experiment< Modus >::perform_action ( Action action,
int  i_ensemble 
)
private

Perform the given action.

Parameters
[in]actionThe action to perform
[in]i_ensembleindex of ensemble in which action is performed
Returns
False if the action is rejected either due to invalidity or Pauli-blocking, or true if it's accepted and performed.

◆ create_output()

template<typename Modus >
void smash::Experiment< Modus >::create_output ( const std::string &  format,
const std::string &  content,
const bf::path &  output_path,
const OutputParameters par 
)
private

Create a list of output files.

Parameters
[in]formatFormat of the output file (e.g. Root, Oscar, Vtk)
[in]contentContent of the output (e.g. particles, collisions)
[in]output_pathPath of the output file
[in]parOutput options.(e.g. Extended)

Definition at line 641 of file experiment.h.

644  {
645  logg[LExperiment].info() << "Adding output " << content << " of format "
646  << format << std::endl;
647 
648  if (format == "VTK" && content == "Particles") {
649  outputs_.emplace_back(
650  make_unique<VtkOutput>(output_path, content, out_par));
651  } else if (format == "Root") {
652 #ifdef SMASH_USE_ROOT
653  if (content == "Initial_Conditions") {
654  outputs_.emplace_back(
655  make_unique<RootOutput>(output_path, "SMASH_IC", out_par));
656  } else {
657  outputs_.emplace_back(
658  make_unique<RootOutput>(output_path, content, out_par));
659  }
660 #else
661  logg[LExperiment].error(
662  "Root output requested, but Root support not compiled in");
663 #endif
664  } else if (format == "Binary") {
665  if (content == "Collisions" || content == "Dileptons" ||
666  content == "Photons") {
667  outputs_.emplace_back(
668  make_unique<BinaryOutputCollisions>(output_path, content, out_par));
669  } else if (content == "Particles") {
670  outputs_.emplace_back(
671  make_unique<BinaryOutputParticles>(output_path, content, out_par));
672  } else if (content == "Initial_Conditions") {
673  outputs_.emplace_back(make_unique<BinaryOutputInitialConditions>(
674  output_path, content, out_par));
675  }
676  } else if (format == "Oscar1999" || format == "Oscar2013") {
677  outputs_.emplace_back(
678  create_oscar_output(format, content, output_path, out_par));
679  } else if (content == "Thermodynamics" && format == "ASCII") {
680  outputs_.emplace_back(
681  make_unique<ThermodynamicOutput>(output_path, content, out_par));
682  } else if (content == "Thermodynamics" &&
683  (format == "Lattice_ASCII" || format == "Lattice_Binary")) {
685  if (format == "Lattice_ASCII") {
687  }
688  if (format == "Lattice_Binary") {
690  }
691  outputs_.emplace_back(make_unique<ThermodynamicLatticeOutput>(
692  output_path, content, out_par, printout_full_lattice_ascii_td_,
694  } else if (content == "Thermodynamics" && format == "VTK") {
695  printout_lattice_td_ = true;
696  outputs_.emplace_back(
697  make_unique<VtkOutput>(output_path, content, out_par));
698  } else if (content == "Initial_Conditions" && format == "ASCII") {
699  outputs_.emplace_back(
700  make_unique<ICOutput>(output_path, "SMASH_IC", out_par));
701  } else if (format == "HepMC") {
702 #ifdef SMASH_USE_HEPMC
703  if (content == "Particles") {
704  outputs_.emplace_back(make_unique<HepMcOutput>(
705  output_path, "SMASH_HepMC_particles", false));
706  } else if (content == "Collisions") {
707  outputs_.emplace_back(make_unique<HepMcOutput>(
708  output_path, "SMASH_HepMC_collisions", true));
709  } else {
710  logg[LExperiment].error(
711  "HepMC only available for Particles and "
712  "Collisions content. Requested for " +
713  content + ".");
714  }
715 #else
716  logg[LExperiment].error(
717  "HepMC output requested, but HepMC support not compiled in");
718 #endif
719  } else if (content == "Coulomb" && format == "VTK") {
720  outputs_.emplace_back(
721  make_unique<VtkOutput>(output_path, "Fields", out_par));
722  } else if (content == "Rivet") {
723 #ifdef SMASH_USE_RIVET
724  // flag to ensure that the Rivet format has not been already assigned
725  static bool rivet_format_already_selected = false;
726  // if the next check is true, then we are trying to assign the format twice
727  if (rivet_format_already_selected) {
728  logg[LExperiment].warn(
729  "Rivet output format can only be one, either YODA or YODA-full. "
730  "Only your first valid choice will be used.");
731  return;
732  }
733  if (format == "YODA") {
734  outputs_.emplace_back(
735  make_unique<RivetOutput>(output_path, "SMASH_Rivet", false, out_par));
736  rivet_format_already_selected = true;
737  } else if (format == "YODA-full") {
738  outputs_.emplace_back(make_unique<RivetOutput>(
739  output_path, "SMASH_Rivet_full", true, out_par));
740  rivet_format_already_selected = true;
741  } else {
742  logg[LExperiment].error("Rivet format " + format +
743  "not one of YODA or YODA-full");
744  }
745 #else
746  logg[LExperiment].error(
747  "Rivet output requested, but Rivet support not compiled in");
748 #endif
749  } else {
750  logg[LExperiment].error()
751  << "Unknown combination of format (" << format << ") and content ("
752  << content << "). Fix the config.";
753  }
754 }
bool printout_full_lattice_ascii_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:471
bool printout_lattice_td_
Whether to print the thermodynamics quantities evaluated on the lattices.
Definition: experiment.h:467
bool printout_full_lattice_binary_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:475
FormattingHelper< T > format(const T &value, const char *unit, int width=-1, int precision=-1)
Acts as a stream modifier for std::ostream to output an object with an optional suffix string and wit...
Definition: logging.h:307
std::unique_ptr< OutputInterface > create_oscar_output(const std::string &format, const std::string &content, const bf::path &path, const OutputParameters &out_par)
Definition: oscaroutput.cc:769
Here is the call graph for this function:

◆ propagate_and_shine()

template<typename Modus >
void smash::Experiment< Modus >::propagate_and_shine ( double  to_time,
Particles particles 
)
private

Propagate all particles until time to_time without any interactions and shine dileptons.

Parameters
[in]to_timeTime at the end of propagation [fm/c]
[in,out]particlesParticles to be propagated

Definition at line 2310 of file experiment.h.

2311  {
2312  const double dt =
2313  propagate_straight_line(&particles, to_time, beam_momentum_);
2314  if (dilepton_finder_ != nullptr) {
2315  for (const auto &output : outputs_) {
2316  dilepton_finder_->shine(particles, output.get(), dt);
2317  }
2318  }
2319 }
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
Here is the call graph for this function:

◆ run_time_evolution_timestepless()

template<typename Modus >
void smash::Experiment< Modus >::run_time_evolution_timestepless ( Actions actions,
int  i_ensemble,
double  end_time_propagation 
)
private

Performs all the propagations and actions during a certain time interval neglecting the influence of the potentials.

This function is called in either the time stepless cases or the cases with time steps.

Parameters
[in,out]actionsActions occur during a certain time interval. They provide the ending times of the propagations and are updated during the time interval.
[in]i_ensembleindex of ensemble to be evolved
[in]end_time_propagationtime until propagation should be performed

Definition at line 2336 of file experiment.h.

2337  {
2338  Particles &particles = ensembles_[i_ensemble];
2339  logg[LExperiment].debug(
2340  "Timestepless propagation: ", "Actions size = ", actions.size(),
2341  ", end time = ", end_time_propagation);
2342 
2343  // iterate over all actions
2344  while (!actions.is_empty()) {
2345  if (actions.earliest_time() > end_time_propagation) {
2346  break;
2347  }
2348  // get next action
2349  ActionPtr act = actions.pop();
2350  if (!act->is_valid(particles)) {
2352  logg[LExperiment].debug(~einhard::DRed(), "✘ ", act,
2353  " (discarded: invalid)");
2354  continue;
2355  }
2356  logg[LExperiment].debug(~einhard::Green(), "✔ ", act,
2357  ", action time = ", act->time_of_execution());
2358 
2359  /* (1) Propagate to the next action. */
2360  propagate_and_shine(act->time_of_execution(), particles);
2361 
2362  /* (2) Perform action.
2363  *
2364  * Update the positions of the incoming particles, because the information
2365  * in the action object will be outdated as the particles have been
2366  * propagated since the construction of the action. */
2367  act->update_incoming(particles);
2368  const bool performed = perform_action(*act, i_ensemble);
2369 
2370  /* No need to update actions for outgoing particles
2371  * if the action is not performed. */
2372  if (!performed) {
2373  continue;
2374  }
2375 
2376  /* (3) Update actions for newly-produced particles. */
2377 
2378  const double end_time_timestep =
2379  std::min(parameters_.labclock->next_time(), end_time_);
2380  assert(!(end_time_propagation > end_time_timestep));
2381  // New actions are always search until the end of the current timestep
2382  const double time_left = end_time_timestep - act->time_of_execution();
2383  const ParticleList &outgoing_particles = act->outgoing_particles();
2384  // Grid cell volume set to zero, since there is no grid
2385  const double gcell_vol = 0.0;
2386  for (const auto &finder : action_finders_) {
2387  // Outgoing particles can still decay, cross walls...
2388  actions.insert(finder->find_actions_in_cell(outgoing_particles, time_left,
2389  gcell_vol, beam_momentum_));
2390  // ... and collide with other particles.
2391  actions.insert(finder->find_actions_with_surrounding_particles(
2392  outgoing_particles, particles, time_left, beam_momentum_));
2393  }
2394 
2396  }
2397 
2398  propagate_and_shine(end_time_propagation, particles);
2399 }
A stream modifier that allows to colorize the log output.
Definition: einhard.hpp:143
void propagate_and_shine(double to_time, Particles &particles)
Propagate all particles until time to_time without any interactions and shine dileptons.
Definition: experiment.h:2310
void check_interactions_total(uint64_t interactions_total)
Make sure interactions_total can be represented as a 32-bit integer.
Definition: experiment.h:2328
Here is the call graph for this function:

◆ intermediate_output()

template<typename Modus >
void smash::Experiment< Modus >::intermediate_output
private

Intermediate output during an event.

Auxiliary variable to communicate the time in the computational frame at the functions printing the thermodynamics lattice output

Definition at line 2402 of file experiment.h.

2402  {
2403  const uint64_t wall_actions_this_interval =
2406  const uint64_t interactions_this_interval = interactions_total_ -
2408  wall_actions_this_interval;
2410  double E_mean_field = 0.0;
2413  double computational_frame_time = 0.0;
2414  if (potentials_) {
2415  // using the lattice is necessary
2416  if ((jmu_B_lat_ != nullptr)) {
2418  EM_lat_.get(), parameters_);
2419  /*
2420  * Mean field calculated in a box should remain approximately constant if
2421  * the system is in equilibrium, and so deviations from its original value
2422  * may signal a phase transition or other dynamical process. This
2423  * comparison only makes sense in the Box Modus, hence the condition.
2424  */
2425  if (modus_.is_box()) {
2426  double tmp = (E_mean_field - initial_mean_field_energy_) /
2427  (E_mean_field + initial_mean_field_energy_);
2428  /*
2429  * This is displayed when the system evolves away from its initial
2430  * configuration (which is when the total mean field energy in the box
2431  * deviates from its initial value).
2432  */
2433  if (std::abs(tmp) > 0.01) {
2434  logg[LExperiment].info()
2435  << "\n\n\n\t The mean field at t = "
2436  << parameters_.outputclock->current_time()
2437  << " [fm/c] differs from the mean field at t = 0:"
2438  << "\n\t\t initial_mean_field_energy_ = "
2439  << initial_mean_field_energy_ << " [GeV]"
2440  << "\n\t\t abs[(E_MF - E_MF(t=0))/(E_MF + E_MF(t=0))] = "
2441  << std::abs(tmp)
2442  << "\n\t\t E_MF/E_MF(t=0) = "
2443  << E_mean_field / initial_mean_field_energy_ << "\n\n";
2444  }
2445  }
2446  }
2447  }
2448 
2450  ensembles_, interactions_this_interval, conserved_initial_, time_start_,
2451  parameters_.outputclock->current_time(), E_mean_field,
2453  const LatticeUpdate lat_upd = LatticeUpdate::AtOutput;
2454 
2455  // save evolution data
2456  if (!(modus_.is_box() && parameters_.outputclock->current_time() <
2457  modus_.equilibration_time())) {
2458  for (const auto &output : outputs_) {
2459  if (output->is_dilepton_output() || output->is_photon_output() ||
2460  output->is_IC_output()) {
2461  continue;
2462  }
2463  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2464  auto event_info =
2465  fill_event_info(ensembles_, E_mean_field, modus_.impact_parameter(),
2467 
2468  output->at_intermediate_time(ensembles_[i_ens], parameters_.outputclock,
2469  density_param_, event_info);
2470  computational_frame_time = event_info.current_time;
2471  }
2472  // For thermodynamic output
2473  output->at_intermediate_time(ensembles_, parameters_.outputclock,
2474  density_param_);
2475 
2476  // Thermodynamic output on the lattice versus time
2477  switch (dens_type_lattice_printout_) {
2478  case DensityType::Baryon:
2480  density_param_, ensembles_, false);
2481  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2483  output->thermodynamics_lattice_output(*jmu_B_lat_,
2484  computational_frame_time);
2485  break;
2487  update_lattice(jmu_I3_lat_.get(), lat_upd,
2489  ensembles_, false);
2490  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2492  *jmu_I3_lat_);
2493  output->thermodynamics_lattice_output(*jmu_I3_lat_,
2494  computational_frame_time);
2495  break;
2496  case DensityType::None:
2497  break;
2498  default:
2499  update_lattice(jmu_custom_lat_.get(), lat_upd,
2501  ensembles_, false);
2502  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2504  *jmu_custom_lat_);
2505  output->thermodynamics_lattice_output(*jmu_custom_lat_,
2506  computational_frame_time);
2507  }
2510  density_param_, ensembles_, false);
2511  if (printout_tmn_) {
2512  output->thermodynamics_output(ThermodynamicQuantity::Tmn,
2514  output->thermodynamics_lattice_output(
2515  ThermodynamicQuantity::Tmn, *Tmn_, computational_frame_time);
2516  }
2517  if (printout_tmn_landau_) {
2518  output->thermodynamics_output(ThermodynamicQuantity::TmnLandau,
2520  output->thermodynamics_lattice_output(
2522  computational_frame_time);
2523  }
2524  if (printout_v_landau_) {
2525  output->thermodynamics_output(ThermodynamicQuantity::LandauVelocity,
2527  output->thermodynamics_lattice_output(
2529  computational_frame_time);
2530  }
2531  }
2532  if (EM_lat_) {
2533  output->fields_output("Efield", "Bfield", *EM_lat_);
2534  }
2535  if (printout_j_QBS_) {
2536  output->thermodynamics_lattice_output(
2537  *j_QBS_lat_, computational_frame_time, ensembles_, density_param_);
2538  }
2539 
2540  if (thermalizer_) {
2541  output->thermodynamics_output(*thermalizer_);
2542  }
2543  }
2544  }
2545 }
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:36
Here is the call graph for this function:

◆ update_potentials()

template<typename Modus >
void smash::Experiment< Modus >::update_potentials
private

Recompute potentials on lattices if necessary.

Definition at line 2548 of file experiment.h.

2548  {
2549  if (potentials_) {
2550  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2555  parameters_.labclock->timestep_duration(), true);
2556  }
2557  if ((potentials_->use_skyrme() || potentials_->use_symmetry()) &&
2558  jmu_B_lat_ != nullptr) {
2563  parameters_.labclock->timestep_duration(), true);
2564  const size_t UBlattice_size = UB_lat_->size();
2565  for (size_t i = 0; i < UBlattice_size; i++) {
2566  auto jB = (*jmu_B_lat_)[i];
2567  const FourVector flow_four_velocity_B =
2568  std::abs(jB.rho()) > very_small_double ? jB.jmu_net() / jB.rho()
2569  : FourVector();
2570  double baryon_density = jB.rho();
2571  ThreeVector baryon_grad_j0 = jB.grad_j0();
2572  ThreeVector baryon_dvecj_dt = jB.dvecj_dt();
2573  ThreeVector baryon_curl_vecj = jB.curl_vecj();
2574  if (potentials_->use_skyrme()) {
2575  (*UB_lat_)[i] =
2576  flow_four_velocity_B * potentials_->skyrme_pot(baryon_density);
2577  (*FB_lat_)[i] =
2578  potentials_->skyrme_force(baryon_density, baryon_grad_j0,
2579  baryon_dvecj_dt, baryon_curl_vecj);
2580  }
2581  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2582  auto jI3 = (*jmu_I3_lat_)[i];
2583  const FourVector flow_four_velocity_I3 =
2584  std::abs(jI3.rho()) > very_small_double
2585  ? jI3.jmu_net() / jI3.rho()
2586  : FourVector();
2587  (*UI3_lat_)[i] = flow_four_velocity_I3 *
2588  potentials_->symmetry_pot(jI3.rho(), baryon_density);
2589  (*FI3_lat_)[i] = potentials_->symmetry_force(
2590  jI3.rho(), jI3.grad_j0(), jI3.dvecj_dt(), jI3.curl_vecj(),
2591  baryon_density, baryon_grad_j0, baryon_dvecj_dt,
2592  baryon_curl_vecj);
2593  }
2594  }
2595  }
2596  if (potentials_->use_coulomb()) {
2599  for (size_t i = 0; i < EM_lat_->size(); i++) {
2600  ThreeVector electric_field = {0., 0., 0.};
2601  ThreeVector position = jmu_el_lat_->cell_center(i);
2602  jmu_el_lat_->integrate_volume(electric_field,
2604  potentials_->coulomb_r_cut(), position);
2605  ThreeVector magnetic_field = {0., 0., 0.};
2606  jmu_el_lat_->integrate_volume(magnetic_field,
2608  potentials_->coulomb_r_cut(), position);
2609  (*EM_lat_)[i] = std::make_pair(electric_field, magnetic_field);
2610  }
2611  } // if ((potentials_->use_skyrme() || ...
2612  if (potentials_->use_vdf() && jmu_B_lat_ != nullptr) {
2617  parameters_.labclock->timestep_duration(), true);
2620  fields_lat_.get(), old_fields_auxiliary_.get(),
2623  parameters_.labclock->timestep_duration());
2624  }
2625  const size_t UBlattice_size = UB_lat_->size();
2626  for (size_t i = 0; i < UBlattice_size; i++) {
2627  auto jB = (*jmu_B_lat_)[i];
2628  (*UB_lat_)[i] = potentials_->vdf_pot(jB.rho(), jB.jmu_net());
2631  (*FB_lat_)[i] = potentials_->vdf_force(
2632  jB.rho(), jB.drho_dxnu().x0(), jB.drho_dxnu().threevec(),
2633  jB.grad_rho_cross_vecj(), jB.jmu_net().x0(), jB.grad_j0(),
2634  jB.jmu_net().threevec(), jB.dvecj_dt(), jB.curl_vecj());
2635  break;
2637  auto Amu = (*fields_lat_)[i];
2638  (*FB_lat_)[i] = potentials_->vdf_force(
2639  Amu.grad_A0(), Amu.dvecA_dt(), Amu.curl_vecA());
2640  break;
2641  }
2642  } // for (size_t i = 0; i < UBlattice_size; i++)
2643  } // if potentials_->use_vdf()
2644  }
2645 }
std::unique_ptr< RectangularLattice< FourVector > > new_fields_auxiliary_
Auxiliary lattice for values of Amu at a time step t0 + dt.
Definition: experiment.h:449
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > fields_four_gradient_auxiliary_
Auxiliary lattice for calculating the four-gradient of Amu.
Definition: experiment.h:452
std::unique_ptr< FieldsLattice > fields_lat_
Mean-field A^mu on the lattice.
Definition: experiment.h:394
std::unique_ptr< RectangularLattice< FourVector > > UB_lat_
Lattices for Skyrme or VDF potentials (evaluated in the local rest frame) times the baryon flow 4-vel...
Definition: experiment.h:412
std::unique_ptr< RectangularLattice< FourVector > > old_fields_auxiliary_
Auxiliary lattice for values of Amu at a time step t0.
Definition: experiment.h:447
std::unique_ptr< DensityLattice > jmu_el_lat_
Electric charge density on the lattice.
Definition: experiment.h:391
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
constexpr double very_small_double
A very small double, used to avoid division by zero.
Definition: constants.h:40
void update_fields_lattice(RectangularLattice< FieldsOnLattice > *fields_lat, RectangularLattice< FourVector > *old_fields, RectangularLattice< FourVector > *new_fields, RectangularLattice< std::array< FourVector, 4 >> *fields_four_grad_lattice, DensityLattice *jmu_B_lat, const LatticeUpdate fields_lat_update, const Potentials &potentials, const double time_step)
Updates the contents on the lattice of FieldsOnLattice type.
Definition: fields.cc:14
FieldDerivativesMode field_derivatives_mode
mode of calculating field derivatives
Here is the call graph for this function:

◆ compute_min_cell_length()

template<typename Modus >
double smash::Experiment< Modus >::compute_min_cell_length ( double  dt) const
inlineprivate

Calculate the minimal size for the grid cells such that the ScatterActionsFinder will find all collisions within the maximal transverse distance (which is determined by the maximal cross section).

Parameters
[in]dtThe current time step size [fm/c]
Returns
The minimal required size of cells

Definition at line 301 of file experiment.h.

301  {
304  }
305  return std::sqrt(4 * dt * dt + max_transverse_distance_sqr_);
306  }
double fixed_min_cell_length
Fixed minimal grid cell length (in fm).

◆ next_output_time()

template<typename Modus >
double smash::Experiment< Modus >::next_output_time ( ) const
inlineprivate

Shortcut for next output time.

Definition at line 309 of file experiment.h.

309  {
310  return parameters_.outputclock->next_time();
311  }

Friends And Related Function Documentation

◆ ExperimentBase

template<typename Modus >
friend class ExperimentBase
friend

Definition at line 178 of file experiment.h.

Member Data Documentation

◆ parameters_

template<typename Modus >
ExperimentParameters smash::Experiment< Modus >::parameters_
private

Struct of several member variables.

These variables are combined into a struct for efficient input to functions outside of this class.

Definition at line 318 of file experiment.h.

◆ density_param_

template<typename Modus >
DensityParameters smash::Experiment< Modus >::density_param_
private

Structure to precalculate and hold parameters for density computations.

Definition at line 321 of file experiment.h.

◆ modus_

template<typename Modus >
Modus smash::Experiment< Modus >::modus_
private

Instance of the Modus template parameter.

May store modus-specific data and contains modus-specific function implementations.

Definition at line 327 of file experiment.h.

◆ ensembles_

template<typename Modus >
std::vector<Particles> smash::Experiment< Modus >::ensembles_
private

Complete particle list, all ensembles in one vector.

Definition at line 330 of file experiment.h.

◆ potentials_

template<typename Modus >
std::unique_ptr<Potentials> smash::Experiment< Modus >::potentials_
private

An instance of potentials class, that stores parameters of potentials, calculates them and their gradients.

Definition at line 336 of file experiment.h.

◆ pauli_blocker_

template<typename Modus >
std::unique_ptr<PauliBlocker> smash::Experiment< Modus >::pauli_blocker_
private

An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and computes phase-space density.

Definition at line 342 of file experiment.h.

◆ outputs_

template<typename Modus >
OutputsList smash::Experiment< Modus >::outputs_
private

A list of output formaters.

They will be called to write the state of the particles to file.

Definition at line 348 of file experiment.h.

◆ dilepton_output_

template<typename Modus >
OutputPtr smash::Experiment< Modus >::dilepton_output_
private

The Dilepton output.

Definition at line 351 of file experiment.h.

◆ photon_output_

template<typename Modus >
OutputPtr smash::Experiment< Modus >::photon_output_
private

The Photon output.

Definition at line 354 of file experiment.h.

◆ projectile_target_interact_

template<typename Modus >
std::vector<bool> smash::Experiment< Modus >::projectile_target_interact_
private

Whether the projectile and the target collided.

One value for each ensemble.

Definition at line 360 of file experiment.h.

◆ beam_momentum_

template<typename Modus >
std::vector<FourVector> smash::Experiment< Modus >::beam_momentum_ = {}
private

The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen.

It's only valid in the ColliderModus, so is set as an empty vector by default.

Definition at line 367 of file experiment.h.

◆ action_finders_

template<typename Modus >
std::vector<std::unique_ptr<ActionFinderInterface> > smash::Experiment< Modus >::action_finders_
private

The Action finder objects.

Definition at line 370 of file experiment.h.

◆ dilepton_finder_

template<typename Modus >
std::unique_ptr<DecayActionsFinderDilepton> smash::Experiment< Modus >::dilepton_finder_
private

The Dilepton Action Finder.

Definition at line 373 of file experiment.h.

◆ photon_finder_

template<typename Modus >
std::unique_ptr<ActionFinderInterface> smash::Experiment< Modus >::photon_finder_
private

The (Scatter) Actions Finder for Direct Photons.

Definition at line 376 of file experiment.h.

◆ n_fractional_photons_

template<typename Modus >
int smash::Experiment< Modus >::n_fractional_photons_
private

Number of fractional photons produced per single reaction.

Definition at line 379 of file experiment.h.

◆ j_QBS_lat_

template<typename Modus >
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::j_QBS_lat_
private

4-current for j_QBS lattice output

Definition at line 382 of file experiment.h.

◆ jmu_B_lat_

template<typename Modus >
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_B_lat_
private

Baryon density on the lattice.

Definition at line 385 of file experiment.h.

◆ jmu_I3_lat_

template<typename Modus >
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_I3_lat_
private

Isospin projection density on the lattice.

Definition at line 388 of file experiment.h.

◆ jmu_el_lat_

template<typename Modus >
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_el_lat_
private

Electric charge density on the lattice.

Definition at line 391 of file experiment.h.

◆ fields_lat_

template<typename Modus >
std::unique_ptr<FieldsLattice> smash::Experiment< Modus >::fields_lat_
private

Mean-field A^mu on the lattice.

Definition at line 394 of file experiment.h.

◆ jmu_custom_lat_

template<typename Modus >
std::unique_ptr<DensityLattice> smash::Experiment< Modus >::jmu_custom_lat_
private

Custom density on the lattices.

In the config user asks for some kind of density for printout. Baryon and isospin projection density are anyway needed for potentials. If user asks for some other density type for printout, it will be handled using jmu_custom variable.

Definition at line 403 of file experiment.h.

◆ dens_type_lattice_printout_

template<typename Modus >
DensityType smash::Experiment< Modus >::dens_type_lattice_printout_ = DensityType::None
private

Type of density for lattice printout.

Definition at line 406 of file experiment.h.

◆ UB_lat_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::UB_lat_ = nullptr
private

Lattices for Skyrme or VDF potentials (evaluated in the local rest frame) times the baryon flow 4-velocity.

Definition at line 412 of file experiment.h.

◆ UI3_lat_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::UI3_lat_ = nullptr
private

Lattices for symmetry potentials (evaluated in the local rest frame) times the isospin flow 4-velocity.

Definition at line 418 of file experiment.h.

◆ FB_lat_

template<typename Modus >
std::unique_ptr<RectangularLattice<std::pair<ThreeVector, ThreeVector> > > smash::Experiment< Modus >::FB_lat_
private

Lattices for the electric and magnetic components of the Skyrme or VDF force.

Definition at line 425 of file experiment.h.

◆ FI3_lat_

template<typename Modus >
std::unique_ptr<RectangularLattice<std::pair<ThreeVector, ThreeVector> > > smash::Experiment< Modus >::FI3_lat_
private

Lattices for the electric and magnetic component of the symmetry force.

Definition at line 429 of file experiment.h.

◆ EM_lat_

template<typename Modus >
std::unique_ptr<RectangularLattice<std::pair<ThreeVector, ThreeVector> > > smash::Experiment< Modus >::EM_lat_
private

Lattices for electric and magnetic field in fm^-2.

Definition at line 433 of file experiment.h.

◆ Tmn_

template<typename Modus >
std::unique_ptr<RectangularLattice<EnergyMomentumTensor> > smash::Experiment< Modus >::Tmn_
private

Lattices of energy-momentum tensors for printout.

Definition at line 436 of file experiment.h.

◆ old_jmu_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::old_jmu_auxiliary_
private

Auxiliary lattice for values of jmu at a time step t0.

Definition at line 439 of file experiment.h.

◆ new_jmu_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::new_jmu_auxiliary_
private

Auxiliary lattice for values of jmu at a time step t0 + dt.

Definition at line 441 of file experiment.h.

◆ four_gradient_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<std::array<FourVector, 4> > > smash::Experiment< Modus >::four_gradient_auxiliary_
private

Auxiliary lattice for calculating the four-gradient of jmu.

Definition at line 444 of file experiment.h.

◆ old_fields_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::old_fields_auxiliary_
private

Auxiliary lattice for values of Amu at a time step t0.

Definition at line 447 of file experiment.h.

◆ new_fields_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<FourVector> > smash::Experiment< Modus >::new_fields_auxiliary_
private

Auxiliary lattice for values of Amu at a time step t0 + dt.

Definition at line 449 of file experiment.h.

◆ fields_four_gradient_auxiliary_

template<typename Modus >
std::unique_ptr<RectangularLattice<std::array<FourVector, 4> > > smash::Experiment< Modus >::fields_four_gradient_auxiliary_
private

Auxiliary lattice for calculating the four-gradient of Amu.

Definition at line 452 of file experiment.h.

◆ printout_tmn_

template<typename Modus >
bool smash::Experiment< Modus >::printout_tmn_ = false
private

Whether to print the energy-momentum tensor.

Definition at line 455 of file experiment.h.

◆ printout_tmn_landau_

template<typename Modus >
bool smash::Experiment< Modus >::printout_tmn_landau_ = false
private

Whether to print the energy-momentum tensor in Landau frame.

Definition at line 458 of file experiment.h.

◆ printout_v_landau_

template<typename Modus >
bool smash::Experiment< Modus >::printout_v_landau_ = false
private

Whether to print the 4-velocity in Landau frame.

Definition at line 461 of file experiment.h.

◆ printout_j_QBS_

template<typename Modus >
bool smash::Experiment< Modus >::printout_j_QBS_ = false
private

Whether to print the Q, B, S 4-currents.

Definition at line 464 of file experiment.h.

◆ printout_lattice_td_

template<typename Modus >
bool smash::Experiment< Modus >::printout_lattice_td_ = false
private

Whether to print the thermodynamics quantities evaluated on the lattices.

Definition at line 467 of file experiment.h.

◆ printout_full_lattice_ascii_td_

template<typename Modus >
bool smash::Experiment< Modus >::printout_full_lattice_ascii_td_ = false
private

Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in ASCII format.

Definition at line 471 of file experiment.h.

◆ printout_full_lattice_binary_td_

template<typename Modus >
bool smash::Experiment< Modus >::printout_full_lattice_binary_td_ = false
private

Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in Binary format.

Definition at line 475 of file experiment.h.

◆ printout_full_lattice_any_td_

template<typename Modus >
bool smash::Experiment< Modus >::printout_full_lattice_any_td_ = false
private

Whether to print the thermodynamics quantities evaluated on the lattices, point by point, in any format.

Definition at line 479 of file experiment.h.

◆ thermalizer_

template<typename Modus >
std::unique_ptr<GrandCanThermalizer> smash::Experiment< Modus >::thermalizer_
private

Instance of class used for forced thermalization.

Definition at line 482 of file experiment.h.

◆ process_string_ptr_

template<typename Modus >
StringProcess* smash::Experiment< Modus >::process_string_ptr_
private

Pointer to the string process class object, which is used to set the random seed for PYTHIA objects in each event.

Definition at line 488 of file experiment.h.

◆ nevents_

template<typename Modus >
const int smash::Experiment< Modus >::nevents_
private

Number of events.

Event is a single simulation of a physical phenomenon: elementary particle or nucleus-nucleus collision. Result of a single SMASH event is random (by construction) as well as result of one collision in nature. To compare simulation with experiment one has to take ensemble averages, i.e. perform simulation and real experiment many times and compare average results.

nevents_ is number of times single phenomenon (particle or nucleus-nucleus collision) will be simulated.

Definition at line 504 of file experiment.h.

◆ event_

template<typename Modus >
int smash::Experiment< Modus >::event_ = 0
private

Current event.

Definition at line 507 of file experiment.h.

◆ end_time_

template<typename Modus >
const double smash::Experiment< Modus >::end_time_
private

simulation time at which the evolution is stopped.

Definition at line 510 of file experiment.h.

◆ delta_time_startup_

template<typename Modus >
const double smash::Experiment< Modus >::delta_time_startup_
private

The clock's timestep size at start up.

Stored here so that the next event will remember this.

Definition at line 517 of file experiment.h.

◆ force_decays_

template<typename Modus >
const bool smash::Experiment< Modus >::force_decays_
private

This indicates whether we force all resonances to decay in the last timestep.

Definition at line 523 of file experiment.h.

◆ use_grid_

template<typename Modus >
const bool smash::Experiment< Modus >::use_grid_
private

This indicates whether to use the grid.

Definition at line 526 of file experiment.h.

◆ metric_

template<typename Modus >
const ExpansionProperties smash::Experiment< Modus >::metric_
private

This struct contains information on the metric to be used.

Definition at line 529 of file experiment.h.

◆ dileptons_switch_

template<typename Modus >
const bool smash::Experiment< Modus >::dileptons_switch_
private

This indicates whether dileptons are switched on.

Definition at line 532 of file experiment.h.

◆ photons_switch_

template<typename Modus >
const bool smash::Experiment< Modus >::photons_switch_
private

This indicates whether photons are switched on.

Definition at line 535 of file experiment.h.

◆ bremsstrahlung_switch_

template<typename Modus >
const bool smash::Experiment< Modus >::bremsstrahlung_switch_
private

This indicates whether bremsstrahlung is switched on.

Definition at line 538 of file experiment.h.

◆ IC_output_switch_

template<typename Modus >
const bool smash::Experiment< Modus >::IC_output_switch_
private

This indicates whether the IC output is enabled.

Definition at line 541 of file experiment.h.

◆ time_step_mode_

template<typename Modus >
const TimeStepMode smash::Experiment< Modus >::time_step_mode_
private

This indicates whether to use time steps.

Definition at line 544 of file experiment.h.

◆ max_transverse_distance_sqr_

template<typename Modus >
double smash::Experiment< Modus >::max_transverse_distance_sqr_ = std::numeric_limits<double>::max()
private

Maximal distance at which particles can interact in case of the geometric criterion, squared.

Definition at line 550 of file experiment.h.

◆ conserved_initial_

template<typename Modus >
QuantumNumbers smash::Experiment< Modus >::conserved_initial_
private

The conserved quantities of the system.

This struct carries the sums of the single particle's various quantities as measured at the beginning of the evolution and can be used to regularly check if they are still good.

Definition at line 559 of file experiment.h.

◆ initial_mean_field_energy_

template<typename Modus >
double smash::Experiment< Modus >::initial_mean_field_energy_
private

The initial total mean field energy in the system.

Note: will only be calculated if lattice is on.

Definition at line 565 of file experiment.h.

◆ time_start_

template<typename Modus >
SystemTimePoint smash::Experiment< Modus >::time_start_ = SystemClock::now()
private

system starting time of the simulation

Definition at line 568 of file experiment.h.

◆ dens_type_

template<typename Modus >
DensityType smash::Experiment< Modus >::dens_type_ = DensityType::None
private

Type of density to be written to collision headers.

Definition at line 571 of file experiment.h.

◆ interactions_total_

template<typename Modus >
uint64_t smash::Experiment< Modus >::interactions_total_ = 0
private

Total number of interactions for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 577 of file experiment.h.

◆ previous_interactions_total_

template<typename Modus >
uint64_t smash::Experiment< Modus >::previous_interactions_total_ = 0
private

Total number of interactions for previous timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 583 of file experiment.h.

◆ wall_actions_total_

template<typename Modus >
uint64_t smash::Experiment< Modus >::wall_actions_total_ = 0
private

Total number of wall-crossings for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 589 of file experiment.h.

◆ previous_wall_actions_total_

template<typename Modus >
uint64_t smash::Experiment< Modus >::previous_wall_actions_total_ = 0
private

Total number of wall-crossings for previous timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 595 of file experiment.h.

◆ total_pauli_blocked_

template<typename Modus >
uint64_t smash::Experiment< Modus >::total_pauli_blocked_ = 0
private

Total number of Pauli-blockings for current timestep.

For timestepless mode the whole run time is considered as one timestep.

Definition at line 601 of file experiment.h.

◆ total_hypersurface_crossing_actions_

template<typename Modus >
uint64_t smash::Experiment< Modus >::total_hypersurface_crossing_actions_ = 0
private

Total number of particles removed from the evolution in hypersurface crossing actions.

Definition at line 607 of file experiment.h.

◆ discarded_interactions_total_

template<typename Modus >
uint64_t smash::Experiment< Modus >::discarded_interactions_total_ = 0
private

Total number of discarded interactions, because they were invalidated before they could be performed.

Definition at line 613 of file experiment.h.

◆ total_energy_removed_

template<typename Modus >
double smash::Experiment< Modus >::total_energy_removed_ = 0.0
private

Total energy removed from the system in hypersurface crossing actions.

Definition at line 619 of file experiment.h.

◆ seed_

template<typename Modus >
int64_t smash::Experiment< Modus >::seed_ = -1
private

random seed for the next event.

Definition at line 622 of file experiment.h.


The documentation for this class was generated from the following file: