Version: SMASH-2.2
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 186 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 (const double t_end)
 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, bool include_pauli_blocking=true)
 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, const double end_time_propagation, const double end_time_run)
 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...
 
void count_nonempty_ensembles ()
 Counts the number of ensembles in wich interactions took place at the end of an event. More...
 
bool is_finished ()
 Checks wether the desired number events have been calculated. 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_ = 0
 Number of events. More...
 
int minimum_nonempty_ensembles_ = 0
 The number of ensembles, in which interactions take place, to be calculated. More...
 
EventCounting event_counting_ = EventCounting::Invalid
 The way in which the number of calculated events is specified. More...
 
int event_ = 0
 Current event. More...
 
int nonempty_ensembles_ = 0
 Number of ensembles containing an interaction. More...
 
int max_events_ = 0
 Maximum number of events to be calculated in order obtain the desired number of non-empty events using the MinimumNonemptyEnsembles option. 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...
 
bool kinematic_cuts_for_IC_output_ = false
 This indicates whether kinematic cuts are enabled for the IC output. 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 3099 of file experiment.h.

3099  {
3100  const auto &mainlog = logg[LMain];
3101  for (event_ = 0; !is_finished(); event_++) {
3102  mainlog.info() << "Event " << event_;
3103 
3104  // Sample initial particles, start clock, some printout and book-keeping
3106 
3108 
3109  if (force_decays_) {
3110  do_final_decays();
3111  }
3112 
3113  // Output at event end
3114  final_output();
3115  }
3116 }
const bool force_decays_
This indicates whether we force all resonances to decay in the last timestep.
Definition: experiment.h:586
void initialize_new_event()
This is called in the beginning of each event.
Definition: experiment.h:2059
bool is_finished()
Checks wether the desired number events have been calculated.
Definition: experiment.h:3073
int event_
Current event.
Definition: experiment.h:561
void do_final_decays()
Performs the final decays of an event.
Definition: experiment.h:2876
void run_time_evolution(const double t_end)
Runs the time evolution of an event with fixed-sized time steps or without timesteps,...
Definition: experiment.h:2407
void final_output()
Output at the end of an event.
Definition: experiment.h:2925
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:573
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 2059 of file experiment.h.

2059  {
2061  logg[LExperiment].info() << "random number seed: " << seed_;
2062  /* Set seed for the next event. It has to be positive, so it can be entered
2063  * in the config.
2064  *
2065  * We have to be careful about the minimal integer, whose absolute value
2066  * cannot be represented. */
2067  int64_t r = random::advance();
2068  while (r == INT64_MIN) {
2069  r = random::advance();
2070  }
2071  seed_ = std::abs(r);
2072  /* Set the random seed used in PYTHIA hadronization
2073  * to be same with the SMASH one.
2074  * In this way we ensure that the results are reproducible
2075  * for every event if one knows SMASH random seed. */
2076  if (process_string_ptr_ != NULL) {
2078  }
2079 
2080  for (Particles &particles : ensembles_) {
2081  particles.reset();
2082  }
2083 
2084  // Sample particles according to the initial conditions
2085  double start_time = -1.0;
2086 
2087  // Sample impact parameter only once per all ensembles
2088  // It should be the same for all ensembles
2089  if (modus_.is_collider()) {
2090  modus_.sample_impact();
2091  logg[LExperiment].info("Impact parameter = ", modus_.impact_parameter(),
2092  " fm");
2093  }
2094  for (Particles &particles : ensembles_) {
2095  start_time = modus_.initial_conditions(&particles, parameters_);
2096  }
2097  /* For box modus make sure that particles are in the box. In principle, after
2098  * a correct initialization they should be, so this is just playing it safe.
2099  */
2100  for (Particles &particles : ensembles_) {
2101  modus_.impose_boundary_conditions(&particles, outputs_);
2102  }
2103  // Reset the simulation clock
2104  double timestep = delta_time_startup_;
2105 
2106  switch (time_step_mode_) {
2107  case TimeStepMode::Fixed:
2108  break;
2109  case TimeStepMode::None:
2110  timestep = end_time_ - start_time;
2111  // Take care of the box modus + timestepless propagation
2112  const double max_dt = modus_.max_timestep(max_transverse_distance_sqr_);
2113  if (max_dt > 0. && max_dt < timestep) {
2114  timestep = max_dt;
2115  }
2116  break;
2117  }
2118  std::unique_ptr<UniformClock> clock_for_this_event;
2119  if (modus_.is_list() && (timestep < 0.0)) {
2120  throw std::runtime_error(
2121  "Timestep for the given event is negative. \n"
2122  "This might happen if the formation times of the input particles are "
2123  "larger than the specified end time of the simulation.");
2124  }
2125  clock_for_this_event = make_unique<UniformClock>(start_time, timestep);
2126  parameters_.labclock = std::move(clock_for_this_event);
2127 
2128  // Reset the output clock
2129  parameters_.outputclock->reset(start_time, true);
2130  // remove time before starting time in case of custom output times.
2131  parameters_.outputclock->remove_times_in_past(start_time);
2132 
2133  logg[LExperiment].debug(
2134  "Lab clock: t_start = ", parameters_.labclock->current_time(),
2135  ", dt = ", parameters_.labclock->timestep_duration());
2136 
2137  /* Save the initial conserved quantum numbers and total momentum in
2138  * the system for conservation checks */
2139  conserved_initial_ = QuantumNumbers(ensembles_);
2140  wall_actions_total_ = 0;
2142  interactions_total_ = 0;
2148  total_energy_removed_ = 0.0;
2149  // Print output headers
2150  logg[LExperiment].info() << hline;
2151  logg[LExperiment].info() << "Time[fm] Ekin[GeV] E_MF[GeV] ETotal[GeV] "
2152  << "ETot/N[GeV] D(ETot/N)[GeV] Scatt&Decays "
2153  << "Particles Comp.Time";
2154  logg[LExperiment].info() << hline;
2155  double E_mean_field = 0.0;
2156  if (potentials_) {
2157  // update_potentials();
2158  // if (parameters.outputclock->current_time() == 0.0 )
2159  // using the lattice is necessary
2160  if ((jmu_B_lat_ != nullptr)) {
2165  parameters_.labclock->timestep_duration(), true);
2166  // Because there was no lattice at t=-Delta_t, the time derivatives
2167  // drho_dt and dj^mu/dt at t=0 are huge, while they shouldn't be; we
2168  // overwrite the time derivative to zero by hand.
2169  for (auto &node : *jmu_B_lat_) {
2170  node.overwrite_drho_dt_to_zero();
2171  node.overwrite_djmu_dt_to_zero();
2172  }
2174  EM_lat_.get(), parameters_);
2175  }
2176  }
2177  initial_mean_field_energy_ = E_mean_field;
2180  parameters_.labclock->current_time(), E_mean_field,
2182 
2183  // Output at event start
2184  for (const auto &output : outputs_) {
2185  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2186  auto event_info = fill_event_info(
2187  ensembles_, E_mean_field, modus_.impact_parameter(), parameters_,
2189  output->at_eventstart(ensembles_[i_ens],
2190  // Pretend each ensemble is an independent event
2191  event_ * parameters_.n_ensembles + i_ens,
2192  event_info);
2193  }
2194  // For thermodynamic output
2195  output->at_eventstart(ensembles_, event_);
2196  // For thermodynamic lattice output
2198  switch (dens_type_lattice_printout_) {
2199  case DensityType::Baryon:
2200  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
2202  break;
2204  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
2206  break;
2207  case DensityType::None:
2208  break;
2209  default:
2210  output->at_eventstart(event_, ThermodynamicQuantity::EckartDensity,
2212  }
2213  if (printout_tmn_) {
2214  output->at_eventstart(event_, ThermodynamicQuantity::Tmn,
2216  }
2217  if (printout_tmn_landau_) {
2218  output->at_eventstart(event_, ThermodynamicQuantity::TmnLandau,
2220  }
2221  if (printout_v_landau_) {
2222  output->at_eventstart(event_, ThermodynamicQuantity::LandauVelocity,
2224  }
2225  if (printout_j_QBS_) {
2226  output->at_eventstart(event_, ThermodynamicQuantity::j_QBS,
2228  }
2229  }
2230  }
2231 
2232  /* In the ColliderModus, if Fermi motion is frozen, assign the beam momenta
2233  * to the nucleons in both the projectile and the target. Every ensemble
2234  * gets the same beam momenta, so no need to create beam_momenta_ vector
2235  * for every ensemble.
2236  */
2237  if (modus_.is_collider() && modus_.fermi_motion() == FermiMotion::Frozen) {
2238  for (ParticleData &particle : ensembles_[0]) {
2239  const double m = particle.effective_mass();
2240  double v_beam = 0.0;
2241  if (particle.belongs_to() == BelongsTo::Projectile) {
2242  v_beam = modus_.velocity_projectile();
2243  } else if (particle.belongs_to() == BelongsTo::Target) {
2244  v_beam = modus_.velocity_target();
2245  }
2246  const double gamma = 1.0 / std::sqrt(1.0 - v_beam * v_beam);
2247  beam_momentum_.emplace_back(
2248  FourVector(gamma * m, 0.0, 0.0, gamma * v_beam * m));
2249  } // loop over particles
2250  }
2251 }
double initial_mean_field_energy_
The initial total mean field energy in the system.
Definition: experiment.h:628
bool printout_tmn_
Whether to print the energy-momentum tensor.
Definition: experiment.h:491
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:622
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:357
double total_energy_removed_
Total energy removed from the system in hypersurface crossing actions.
Definition: experiment.h:682
DensityType dens_type_lattice_printout_
Type of density for lattice printout.
Definition: experiment.h:442
double max_transverse_distance_sqr_
Maximal distance at which particles can interact in case of the geometric criterion,...
Definition: experiment.h:613
bool printout_j_QBS_
Whether to print the Q, B, S 4-currents.
Definition: experiment.h:500
const TimeStepMode time_step_mode_
This indicates whether to use time steps.
Definition: experiment.h:607
std::unique_ptr< DensityLattice > jmu_custom_lat_
Custom density on the lattices.
Definition: experiment.h:439
bool printout_full_lattice_any_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:515
std::unique_ptr< DensityLattice > jmu_B_lat_
Baryon density on the lattice.
Definition: experiment.h:421
std::vector< FourVector > beam_momentum_
The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen.
Definition: experiment.h:403
std::unique_ptr< RectangularLattice< FourVector > > new_jmu_auxiliary_
Auxiliary lattice for values of jmu at a time step t0 + dt.
Definition: experiment.h:477
const double delta_time_startup_
The clock's timestep size at start up.
Definition: experiment.h:580
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
Lattices of energy-momentum tensors for printout.
Definition: experiment.h:472
std::vector< Particles > ensembles_
Complete particle list, all ensembles in one vector.
Definition: experiment.h:366
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:631
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:658
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:384
bool printout_v_landau_
Whether to print the 4-velocity in Landau frame.
Definition: experiment.h:497
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > EM_lat_
Lattices for electric and magnetic field in fm^-2.
Definition: experiment.h:469
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:363
std::unique_ptr< RectangularLattice< FourVector > > old_jmu_auxiliary_
Auxiliary lattice for values of jmu at a time step t0.
Definition: experiment.h:475
std::unique_ptr< DensityLattice > j_QBS_lat_
4-current for j_QBS lattice output
Definition: experiment.h:418
bool printout_tmn_landau_
Whether to print the energy-momentum tensor in Landau frame.
Definition: experiment.h:494
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > four_gradient_auxiliary_
Auxiliary lattice for calculating the four-gradient of jmu.
Definition: experiment.h:480
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:524
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:354
std::unique_ptr< Potentials > potentials_
An instance of potentials class, that stores parameters of potentials, calculates them and their grad...
Definition: experiment.h:372
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:652
uint64_t total_hypersurface_crossing_actions_
Total number of particles removed from the evolution in hypersurface crossing actions.
Definition: experiment.h:670
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:640
std::unique_ptr< DensityLattice > jmu_I3_lat_
Isospin projection density on the lattice.
Definition: experiment.h:424
uint64_t total_pauli_blocked_
Total number of Pauli-blockings for current timestep.
Definition: experiment.h:664
std::vector< bool > projectile_target_interact_
Whether the projectile and the target collided.
Definition: experiment.h:396
int64_t seed_
random seed for the next event.
Definition: experiment.h:688
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:646
uint64_t discarded_interactions_total_
Total number of discarded interactions, because they were invalidated before they could be performed.
Definition: experiment.h:676
bool kinematic_cuts_for_IC_output_
This indicates whether kinematic cuts are enabled for the IC output.
Definition: experiment.h:685
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
EventInfo fill_event_info(const std::vector< Particles > &ensembles, double E_mean_field, double modus_impact_parameter, const ExperimentParameters &parameters, bool projectile_target_interact, bool kinematic_cut_for_SMASH_IC)
Generate the EventInfo object which is passed to outputs_.
Definition: experiment.cc:968
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:700
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:535
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:748
static constexpr int LExperiment
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 ( const double  t_end)

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.

Parameters
[in]t_endtime until run_time_evolution is run, in SMASH this is the configured end_time, but it might differ if SMASH is used as an external library

Definition at line 2407 of file experiment.h.

2407  {
2408  while (parameters_.labclock->current_time() < t_end) {
2409  const double t = parameters_.labclock->current_time();
2410  const double dt =
2411  std::min(parameters_.labclock->timestep_duration(), t_end - t);
2412  logg[LExperiment].debug("Timestepless propagation for next ", dt, " fm/c.");
2413 
2414  // Perform forced thermalization if required
2415  if (thermalizer_ &&
2416  thermalizer_->is_time_to_thermalize(parameters_.labclock)) {
2417  const bool ignore_cells_under_treshold = true;
2418  // Thermodynamics in thermalizer is computed from all ensembles,
2419  // but thermalization actions act on each ensemble independently
2420  thermalizer_->update_thermalizer_lattice(ensembles_, density_param_,
2421  ignore_cells_under_treshold);
2422  const double current_t = parameters_.labclock->current_time();
2423  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2424  thermalizer_->thermalize(ensembles_[i_ens], current_t,
2426  ThermalizationAction th_act(*thermalizer_, current_t);
2427  if (th_act.any_particles_thermalized()) {
2428  perform_action(th_act, i_ens);
2429  }
2430  }
2431  }
2432 
2433  std::vector<Actions> actions(parameters_.n_ensembles);
2434  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2435  actions[i_ens].clear();
2436  if (ensembles_[i_ens].size() > 0 && action_finders_.size() > 0) {
2437  /* (1.a) Create grid. */
2438  const double min_cell_length = compute_min_cell_length(dt);
2439  logg[LExperiment].debug("Creating grid with minimal cell length ",
2440  min_cell_length);
2441  /* For the hyper-surface-crossing actions also unformed particles are
2442  * searched and therefore needed on the grid. */
2443  const bool include_unformed_particles = IC_output_switch_;
2444  const auto &grid =
2445  use_grid_ ? modus_.create_grid(ensembles_[i_ens], min_cell_length,
2446  dt, parameters_.coll_crit,
2447  include_unformed_particles)
2448  : modus_.create_grid(ensembles_[i_ens], min_cell_length,
2449  dt, parameters_.coll_crit,
2450  include_unformed_particles,
2452 
2453  const double gcell_vol = grid.cell_volume();
2454  /* (1.b) Iterate over cells and find actions. */
2455  grid.iterate_cells(
2456  [&](const ParticleList &search_list) {
2457  for (const auto &finder : action_finders_) {
2458  actions[i_ens].insert(finder->find_actions_in_cell(
2459  search_list, dt, gcell_vol, beam_momentum_));
2460  }
2461  },
2462  [&](const ParticleList &search_list,
2463  const ParticleList &neighbors_list) {
2464  for (const auto &finder : action_finders_) {
2465  actions[i_ens].insert(finder->find_actions_with_neighbors(
2466  search_list, neighbors_list, dt, beam_momentum_));
2467  }
2468  });
2469  }
2470  }
2471 
2472  /* \todo (optimizations) Adapt timestep size here */
2473 
2474  /* (2) Propagate from action to action until next output or timestep end */
2475  const double end_timestep_time =
2476  std::min(parameters_.labclock->next_time(), t_end);
2477  while (next_output_time() <= end_timestep_time) {
2478  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2479  run_time_evolution_timestepless(actions[i_ens], i_ens,
2480  next_output_time(), t_end);
2481  }
2482  ++(*parameters_.outputclock);
2483 
2484  // Avoid duplication of final output
2485  if (parameters_.outputclock->current_time() < t_end) {
2487  }
2488  }
2489  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2490  run_time_evolution_timestepless(actions[i_ens], i_ens, end_timestep_time,
2491  t_end);
2492  }
2493 
2494  /* (3) Update potentials (if computed on the lattice) and
2495  * compute new momenta according to equations of motion */
2496  if (potentials_) {
2498  update_momenta(ensembles_, parameters_.labclock->timestep_duration(),
2499  *potentials_, FB_lat_.get(), FI3_lat_.get(),
2500  EM_lat_.get());
2501  }
2502 
2503  /* (4) Expand universe if non-minkowskian metric; updates
2504  * positions and momenta according to the selected expansion */
2506  for (Particles &particles : ensembles_) {
2507  expand_space_time(&particles, parameters_, metric_);
2508  }
2509  }
2510 
2511  ++(*parameters_.labclock);
2512 
2513  /* (5) Check conservation laws.
2514  *
2515  * Check conservation of conserved quantities if potentials and string
2516  * fragmentation are off. If potentials are on then momentum is conserved
2517  * only in average. If string fragmentation is on, then energy and
2518  * momentum are only very roughly conserved in high-energy collisions. */
2521  std::string err_msg = conserved_initial_.report_deviations(ensembles_);
2522  if (!err_msg.empty()) {
2523  logg[LExperiment].error() << err_msg;
2524  throw std::runtime_error("Violation of conserved quantities!");
2525  }
2526  }
2527  }
2528 
2529  if (pauli_blocker_) {
2530  logg[LExperiment].info(
2531  "Interactions: Pauli-blocked/performed = ", total_pauli_blocked_, "/",
2533  }
2534 }
const ExpansionProperties metric_
This struct contains information on the metric to be used.
Definition: experiment.h:592
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:406
double next_output_time() const
Shortcut for next output time.
Definition: experiment.h:332
std::unique_ptr< GrandCanThermalizer > thermalizer_
Instance of class used for forced thermalization.
Definition: experiment.h:518
void run_time_evolution_timestepless(Actions &actions, int i_ensemble, const double end_time_propagation, const double end_time_run)
Performs all the propagations and actions during a certain time interval neglecting the influence of ...
Definition: experiment.h:2563
void intermediate_output()
Intermediate output during an event.
Definition: experiment.h:2630
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
Lattices for the electric and magnetic component of the symmetry force.
Definition: experiment.h:465
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:324
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:461
std::unique_ptr< PauliBlocker > pauli_blocker_
An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and c...
Definition: experiment.h:378
bool perform_action(Action &action, int i_ensemble, bool include_pauli_blocking=true)
Perform the given action.
const bool use_grid_
This indicates whether to use the grid.
Definition: experiment.h:589
void update_potentials()
Recompute potentials on lattices if necessary.
Definition: experiment.h:2776
const bool IC_output_switch_
This indicates whether the IC output is enabled.
Definition: experiment.h:604
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.

Exceptions
runtime_errorif found actions cannot be performed

Definition at line 2876 of file experiment.h.

2876  {
2877  /* At end of time evolution: Force all resonances to decay. In order to handle
2878  * decay chains, we need to loop until no further actions occur. */
2879  bool actions_performed, decays_found;
2880  uint64_t interactions_old;
2881  do {
2882  decays_found = false;
2883  interactions_old = interactions_total_;
2884  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2885  Actions actions;
2886 
2887  // Dileptons: shining of remaining resonances
2888  if (dilepton_finder_ != nullptr) {
2889  for (const auto &output : outputs_) {
2890  dilepton_finder_->shine_final(ensembles_[i_ens], output.get(), true);
2891  }
2892  }
2893  // Find actions.
2894  for (const auto &finder : action_finders_) {
2895  auto found_actions = finder->find_final_actions(ensembles_[i_ens]);
2896  if (!found_actions.empty()) {
2897  actions.insert(std::move(found_actions));
2898  decays_found = true;
2899  }
2900  }
2901  // Perform actions.
2902  while (!actions.is_empty()) {
2903  perform_action(*actions.pop(), i_ens, false);
2904  }
2905  }
2906  actions_performed = interactions_total_ > interactions_old;
2907  // Throw an error if actions were found but not performed
2908  if (decays_found && !actions_performed) {
2909  throw std::runtime_error("Final decays were found but not performed.");
2910  }
2911  // loop until no more decays occur
2912  } while (actions_performed);
2913 
2914  // Dileptons: shining of stable particles at the end
2915  if (dilepton_finder_ != nullptr) {
2916  for (const auto &output : outputs_) {
2917  for (Particles &particles : ensembles_) {
2918  dilepton_finder_->shine_final(particles, output.get(), false);
2919  }
2920  }
2921  }
2922 }
std::unique_ptr< DecayActionsFinderDilepton > dilepton_finder_
The Dilepton Action Finder.
Definition: experiment.h:409
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 2925 of file experiment.h.

2925  {
2926  /* make sure the experiment actually ran (note: we should compare this
2927  * to the start time, but we don't know that. Therefore, we check that
2928  * the time is positive, which should heuristically be the same). */
2929  double E_mean_field = 0.0;
2930  if (likely(parameters_.labclock > 0)) {
2931  const uint64_t wall_actions_this_interval =
2933  const uint64_t interactions_this_interval = interactions_total_ -
2935  wall_actions_this_interval;
2936  if (potentials_) {
2937  // using the lattice is necessary
2938  if ((jmu_B_lat_ != nullptr)) {
2940  EM_lat_.get(), parameters_);
2941  }
2942  }
2944  ensembles_, interactions_this_interval, conserved_initial_, time_start_,
2945  end_time_, E_mean_field, initial_mean_field_energy_);
2946  int total_particles = 0;
2947  for (const Particles &particles : ensembles_) {
2948  total_particles += particles.size();
2949  }
2950  if (IC_output_switch_ && (total_particles == 0)) {
2951  // Verify there is no more energy in the system if all particles were
2952  // removed when crossing the hypersurface
2953  const double remaining_energy =
2955  if (remaining_energy > really_small) {
2956  throw std::runtime_error(
2957  "There is remaining energy in the system although all particles "
2958  "were removed.\n"
2959  "E_remain = " +
2960  std::to_string(remaining_energy) + " [GeV]");
2961  } else {
2962  logg[LExperiment].info() << hline;
2963  logg[LExperiment].info()
2964  << "Time real: " << SystemClock::now() - time_start_;
2965  logg[LExperiment].info()
2966  << "Interactions before reaching hypersurface: "
2969  logg[LExperiment].info()
2970  << "Total number of particles removed on hypersurface: "
2972  }
2973  } else {
2974  const double precent_discarded =
2976  ? static_cast<double>(discarded_interactions_total_) * 100.0 /
2978  : 0.0;
2979  std::stringstream msg_discarded;
2980  msg_discarded
2981  << "Discarded interaction number: " << discarded_interactions_total_
2982  << " (" << precent_discarded
2983  << "% of the total interaction number including wall crossings)";
2984 
2985  logg[LExperiment].info() << hline;
2986  logg[LExperiment].info()
2987  << "Time real: " << SystemClock::now() - time_start_;
2988  logg[LExperiment].debug() << msg_discarded.str();
2989 
2991  precent_discarded > 1.0) {
2992  // The choosen threshold of 1% is a heuristical value
2993  logg[LExperiment].warn()
2994  << msg_discarded.str()
2995  << "\nThe number of discarded interactions is large, which means "
2996  "the assumption for the stochastic criterion of\n1 interaction "
2997  "per particle per timestep is probably violated. Consider "
2998  "reducing the timestep size.";
2999  }
3000 
3001  logg[LExperiment].info() << "Final interaction number: "
3003  }
3004 
3005  // Check if there are unformed particles
3006  int unformed_particles_count = 0;
3007  for (const Particles &particles : ensembles_) {
3008  for (const ParticleData &particle : particles) {
3009  if (particle.formation_time() > end_time_) {
3010  unformed_particles_count++;
3011  }
3012  }
3013  }
3014  if (unformed_particles_count > 0) {
3015  logg[LExperiment].warn(
3016  "End time might be too small. ", unformed_particles_count,
3017  " unformed particles were found at the end of the evolution.");
3018  }
3019  }
3020 
3021  // Keep track of how many ensembles had interactions
3023 
3024  for (const auto &output : outputs_) {
3025  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
3026  auto event_info = fill_event_info(
3027  ensembles_, E_mean_field, modus_.impact_parameter(), parameters_,
3029  output->at_eventend(ensembles_[i_ens],
3030  // Pretend each ensemble is an independent event
3031  event_ * parameters_.n_ensembles + i_ens, event_info);
3032  }
3033  // For thermodynamic output
3034  output->at_eventend(ensembles_, event_);
3035 
3036  // For thermodynamic lattice output
3038  output->at_eventend(event_, ThermodynamicQuantity::EckartDensity,
3040  output->at_eventend(ThermodynamicQuantity::EckartDensity);
3041  }
3042  if (printout_tmn_) {
3043  output->at_eventend(event_, ThermodynamicQuantity::Tmn,
3045  output->at_eventend(ThermodynamicQuantity::Tmn);
3046  }
3047  if (printout_tmn_landau_) {
3048  output->at_eventend(event_, ThermodynamicQuantity::TmnLandau,
3050  output->at_eventend(ThermodynamicQuantity::TmnLandau);
3051  }
3052  if (printout_v_landau_) {
3053  output->at_eventend(event_, ThermodynamicQuantity::LandauVelocity,
3055  output->at_eventend(ThermodynamicQuantity::LandauVelocity);
3056  }
3057  if (printout_j_QBS_) {
3058  output->at_eventend(ThermodynamicQuantity::j_QBS);
3059  }
3060  }
3061 }
void count_nonempty_ensembles()
Counts the number of ensembles in wich interactions took place at the end of an event.
Definition: experiment.h:3064
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 248 of file experiment.h.

248 { return &ensembles_[0]; }

◆ all_ensembles()

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

Getter for all ensembles.

Definition at line 250 of file experiment.h.

250 { 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 256 of file experiment.h.

256 { return &modus_; }

◆ perform_action()

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

Perform the given action.

Parameters
[in]actionThe action to perform
[in]i_ensembleindex of ensemble in which action is performed
[in]include_pauli_blockingwheter to take Pauli blocking into account. Skipping Pauli blocking is useful for example for final decays.
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 707 of file experiment.h.

710  {
711  logg[LExperiment].info() << "Adding output " << content << " of format "
712  << format << std::endl;
713 
714  if (format == "VTK" && content == "Particles") {
715  outputs_.emplace_back(
716  make_unique<VtkOutput>(output_path, content, out_par));
717  } else if (format == "Root") {
718 #ifdef SMASH_USE_ROOT
719  if (content == "Initial_Conditions") {
720  outputs_.emplace_back(
721  make_unique<RootOutput>(output_path, "SMASH_IC", out_par));
722  } else {
723  outputs_.emplace_back(
724  make_unique<RootOutput>(output_path, content, out_par));
725  }
726 #else
727  logg[LExperiment].error(
728  "Root output requested, but Root support not compiled in");
729 #endif
730  } else if (format == "Binary") {
731  if (content == "Collisions" || content == "Dileptons" ||
732  content == "Photons") {
733  outputs_.emplace_back(
734  make_unique<BinaryOutputCollisions>(output_path, content, out_par));
735  } else if (content == "Particles") {
736  outputs_.emplace_back(
737  make_unique<BinaryOutputParticles>(output_path, content, out_par));
738  } else if (content == "Initial_Conditions") {
739  outputs_.emplace_back(make_unique<BinaryOutputInitialConditions>(
740  output_path, content, out_par));
741  }
742  } else if (format == "Oscar1999" || format == "Oscar2013") {
743  outputs_.emplace_back(
744  create_oscar_output(format, content, output_path, out_par));
745  } else if (content == "Thermodynamics" && format == "ASCII") {
746  outputs_.emplace_back(
747  make_unique<ThermodynamicOutput>(output_path, content, out_par));
748  } else if (content == "Thermodynamics" &&
749  (format == "Lattice_ASCII" || format == "Lattice_Binary")) {
751  if (format == "Lattice_ASCII") {
753  }
754  if (format == "Lattice_Binary") {
756  }
757  outputs_.emplace_back(make_unique<ThermodynamicLatticeOutput>(
758  output_path, content, out_par, printout_full_lattice_ascii_td_,
760  } else if (content == "Thermodynamics" && format == "VTK") {
761  printout_lattice_td_ = true;
762  outputs_.emplace_back(
763  make_unique<VtkOutput>(output_path, content, out_par));
764  } else if (content == "Initial_Conditions" && format == "ASCII") {
765  outputs_.emplace_back(
766  make_unique<ICOutput>(output_path, "SMASH_IC", out_par));
767  } else if ((format == "HepMC") || (format == "HepMC_asciiv3") ||
768  (format == "HepMC_treeroot")) {
769 #ifdef SMASH_USE_HEPMC
770  if (content == "Particles") {
771  if ((format == "HepMC") || (format == "HepMC_asciiv3")) {
772  outputs_.emplace_back(make_unique<HepMcOutput>(
773  output_path, "SMASH_HepMC_particles", false, "asciiv3"));
774  } else if (format == "HepMC_treeroot") {
775 #ifdef SMASH_USE_HEPMC_ROOTIO
776  outputs_.emplace_back(make_unique<HepMcOutput>(
777  output_path, "SMASH_HepMC_particles", false, "root"));
778 #else
779  logg[LExperiment].error(
780  "Requested HepMC_treeroot output not available, "
781  "ROOT or HepMC3 ROOTIO missing or not found by cmake.");
782 #endif
783  }
784  } else if (content == "Collisions") {
785  if ((format == "HepMC") || (format == "HepMC_asciiv3")) {
786  outputs_.emplace_back(make_unique<HepMcOutput>(
787  output_path, "SMASH_HepMC_collisions", true, "asciiv3"));
788  } else if (format == "HepMC_treeroot") {
789 #ifdef SMASH_USE_HEPMC_ROOTIO
790  outputs_.emplace_back(make_unique<HepMcOutput>(
791  output_path, "SMASH_HepMC_collisions", true, "root"));
792 #else
793  logg[LExperiment].error(
794  "Requested HepMC_treeroot output not available, "
795  "ROOT or HepMC3 ROOTIO missing or not found by cmake.");
796 #endif
797  }
798  } else {
799  logg[LExperiment].error(
800  "HepMC only available for Particles and "
801  "Collisions content. Requested for " +
802  content + ".");
803  }
804 #else
805  logg[LExperiment].error(
806  "HepMC output requested, but HepMC support not compiled in");
807 #endif
808  } else if (content == "Coulomb" && format == "VTK") {
809  outputs_.emplace_back(
810  make_unique<VtkOutput>(output_path, "Fields", out_par));
811  } else if (content == "Rivet") {
812 #ifdef SMASH_USE_RIVET
813  // flag to ensure that the Rivet format has not been already assigned
814  static bool rivet_format_already_selected = false;
815  // if the next check is true, then we are trying to assign the format twice
816  if (rivet_format_already_selected) {
817  logg[LExperiment].warn(
818  "Rivet output format can only be one, either YODA or YODA-full. "
819  "Only your first valid choice will be used.");
820  return;
821  }
822  if (format == "YODA") {
823  outputs_.emplace_back(
824  make_unique<RivetOutput>(output_path, "SMASH_Rivet", false, out_par));
825  rivet_format_already_selected = true;
826  } else if (format == "YODA-full") {
827  outputs_.emplace_back(make_unique<RivetOutput>(
828  output_path, "SMASH_Rivet_full", true, out_par));
829  rivet_format_already_selected = true;
830  } else {
831  logg[LExperiment].error("Rivet format " + format +
832  "not one of YODA or YODA-full");
833  }
834 #else
835  logg[LExperiment].error(
836  "Rivet output requested, but Rivet support not compiled in");
837 #endif
838  } else {
839  logg[LExperiment].error()
840  << "Unknown combination of format (" << format << ") and content ("
841  << content << "). Fix the config.";
842  }
843 }
bool printout_full_lattice_ascii_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:507
bool printout_lattice_td_
Whether to print the thermodynamics quantities evaluated on the lattices.
Definition: experiment.h:503
bool printout_full_lattice_binary_td_
Whether to print the thermodynamics quantities evaluated on the lattices, point by point,...
Definition: experiment.h:511
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 2537 of file experiment.h.

2538  {
2539  const double dt =
2540  propagate_straight_line(&particles, to_time, beam_momentum_);
2541  if (dilepton_finder_ != nullptr) {
2542  for (const auto &output : outputs_) {
2543  dilepton_finder_->shine(particles, output.get(), dt);
2544  }
2545  }
2546 }
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,
const double  end_time_propagation,
const double  end_time_run 
)
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
[in]end_time_runtime until the whole evolution is run

Definition at line 2563 of file experiment.h.

2565  {
2566  Particles &particles = ensembles_[i_ensemble];
2567  logg[LExperiment].debug(
2568  "Timestepless propagation: ", "Actions size = ", actions.size(),
2569  ", end time = ", end_time_propagation);
2570 
2571  // iterate over all actions
2572  while (!actions.is_empty()) {
2573  if (actions.earliest_time() > end_time_propagation) {
2574  break;
2575  }
2576  // get next action
2577  ActionPtr act = actions.pop();
2578  if (!act->is_valid(particles)) {
2580  logg[LExperiment].debug(~einhard::DRed(), "✘ ", act,
2581  " (discarded: invalid)");
2582  continue;
2583  }
2584  logg[LExperiment].debug(~einhard::Green(), "✔ ", act,
2585  ", action time = ", act->time_of_execution());
2586 
2587  /* (1) Propagate to the next action. */
2588  propagate_and_shine(act->time_of_execution(), particles);
2589 
2590  /* (2) Perform action.
2591  *
2592  * Update the positions of the incoming particles, because the information
2593  * in the action object will be outdated as the particles have been
2594  * propagated since the construction of the action. */
2595  act->update_incoming(particles);
2596  const bool performed = perform_action(*act, i_ensemble);
2597 
2598  /* No need to update actions for outgoing particles
2599  * if the action is not performed. */
2600  if (!performed) {
2601  continue;
2602  }
2603 
2604  /* (3) Update actions for newly-produced particles. */
2605 
2606  const double end_time_timestep =
2607  std::min(parameters_.labclock->next_time(), end_time_run);
2608  assert(!(end_time_propagation > end_time_timestep));
2609  // New actions are always search until the end of the current timestep
2610  const double time_left = end_time_timestep - act->time_of_execution();
2611  const ParticleList &outgoing_particles = act->outgoing_particles();
2612  // Grid cell volume set to zero, since there is no grid
2613  const double gcell_vol = 0.0;
2614  for (const auto &finder : action_finders_) {
2615  // Outgoing particles can still decay, cross walls...
2616  actions.insert(finder->find_actions_in_cell(outgoing_particles, time_left,
2617  gcell_vol, beam_momentum_));
2618  // ... and collide with other particles.
2619  actions.insert(finder->find_actions_with_surrounding_particles(
2620  outgoing_particles, particles, time_left, beam_momentum_));
2621  }
2622 
2624  }
2625 
2626  propagate_and_shine(end_time_propagation, particles);
2627 }
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:2537
void check_interactions_total(uint64_t interactions_total)
Make sure interactions_total can be represented as a 32-bit integer.
Definition: experiment.h:2555
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 2630 of file experiment.h.

2630  {
2631  const uint64_t wall_actions_this_interval =
2634  const uint64_t interactions_this_interval = interactions_total_ -
2636  wall_actions_this_interval;
2638  double E_mean_field = 0.0;
2641  double computational_frame_time = 0.0;
2642  if (potentials_) {
2643  // using the lattice is necessary
2644  if ((jmu_B_lat_ != nullptr)) {
2646  EM_lat_.get(), parameters_);
2647  /*
2648  * Mean field calculated in a box should remain approximately constant if
2649  * the system is in equilibrium, and so deviations from its original value
2650  * may signal a phase transition or other dynamical process. This
2651  * comparison only makes sense in the Box Modus, hence the condition.
2652  */
2653  if (modus_.is_box()) {
2654  double tmp = (E_mean_field - initial_mean_field_energy_) /
2655  (E_mean_field + initial_mean_field_energy_);
2656  /*
2657  * This is displayed when the system evolves away from its initial
2658  * configuration (which is when the total mean field energy in the box
2659  * deviates from its initial value).
2660  */
2661  if (std::abs(tmp) > 0.01) {
2662  logg[LExperiment].info()
2663  << "\n\n\n\t The mean field at t = "
2664  << parameters_.outputclock->current_time()
2665  << " [fm/c] differs from the mean field at t = 0:"
2666  << "\n\t\t initial_mean_field_energy_ = "
2667  << initial_mean_field_energy_ << " [GeV]"
2668  << "\n\t\t abs[(E_MF - E_MF(t=0))/(E_MF + E_MF(t=0))] = "
2669  << std::abs(tmp)
2670  << "\n\t\t E_MF/E_MF(t=0) = "
2671  << E_mean_field / initial_mean_field_energy_ << "\n\n";
2672  }
2673  }
2674  }
2675  }
2676 
2678  ensembles_, interactions_this_interval, conserved_initial_, time_start_,
2679  parameters_.outputclock->current_time(), E_mean_field,
2681  const LatticeUpdate lat_upd = LatticeUpdate::AtOutput;
2682 
2683  // save evolution data
2684  if (!(modus_.is_box() && parameters_.outputclock->current_time() <
2685  modus_.equilibration_time())) {
2686  for (const auto &output : outputs_) {
2687  if (output->is_dilepton_output() || output->is_photon_output() ||
2688  output->is_IC_output()) {
2689  continue;
2690  }
2691  for (int i_ens = 0; i_ens < parameters_.n_ensembles; i_ens++) {
2692  auto event_info = fill_event_info(
2693  ensembles_, E_mean_field, modus_.impact_parameter(), parameters_,
2695 
2696  output->at_intermediate_time(ensembles_[i_ens], parameters_.outputclock,
2697  density_param_, event_info);
2698  computational_frame_time = event_info.current_time;
2699  }
2700  // For thermodynamic output
2701  output->at_intermediate_time(ensembles_, parameters_.outputclock,
2702  density_param_);
2703 
2704  // Thermodynamic output on the lattice versus time
2705  switch (dens_type_lattice_printout_) {
2706  case DensityType::Baryon:
2708  density_param_, ensembles_, false);
2709  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2711  output->thermodynamics_lattice_output(*jmu_B_lat_,
2712  computational_frame_time);
2713  break;
2715  update_lattice(jmu_I3_lat_.get(), lat_upd,
2717  ensembles_, false);
2718  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2720  *jmu_I3_lat_);
2721  output->thermodynamics_lattice_output(*jmu_I3_lat_,
2722  computational_frame_time);
2723  break;
2724  case DensityType::None:
2725  break;
2726  default:
2727  update_lattice(jmu_custom_lat_.get(), lat_upd,
2729  ensembles_, false);
2730  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
2732  *jmu_custom_lat_);
2733  output->thermodynamics_lattice_output(*jmu_custom_lat_,
2734  computational_frame_time);
2735  }
2738  density_param_, ensembles_, false);
2739  if (printout_tmn_) {
2740  output->thermodynamics_output(ThermodynamicQuantity::Tmn,
2742  output->thermodynamics_lattice_output(
2743  ThermodynamicQuantity::Tmn, *Tmn_, computational_frame_time);
2744  }
2745  if (printout_tmn_landau_) {
2746  output->thermodynamics_output(ThermodynamicQuantity::TmnLandau,
2748  output->thermodynamics_lattice_output(
2750  computational_frame_time);
2751  }
2752  if (printout_v_landau_) {
2753  output->thermodynamics_output(ThermodynamicQuantity::LandauVelocity,
2755  output->thermodynamics_lattice_output(
2757  computational_frame_time);
2758  }
2759  }
2760  if (EM_lat_) {
2761  output->fields_output("Efield", "Bfield", *EM_lat_);
2762  }
2763  if (printout_j_QBS_) {
2764  output->thermodynamics_lattice_output(
2765  *j_QBS_lat_, computational_frame_time, ensembles_, density_param_);
2766  }
2767 
2768  if (thermalizer_) {
2769  output->thermodynamics_output(*thermalizer_);
2770  }
2771  }
2772  }
2773 }
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 2776 of file experiment.h.

2776  {
2777  if (potentials_) {
2778  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2783  parameters_.labclock->timestep_duration(), true);
2784  }
2785  if ((potentials_->use_skyrme() || potentials_->use_symmetry()) &&
2786  jmu_B_lat_ != nullptr) {
2791  parameters_.labclock->timestep_duration(), true);
2792  const size_t UBlattice_size = UB_lat_->size();
2793  for (size_t i = 0; i < UBlattice_size; i++) {
2794  auto jB = (*jmu_B_lat_)[i];
2795  const FourVector flow_four_velocity_B =
2796  std::abs(jB.rho()) > very_small_double ? jB.jmu_net() / jB.rho()
2797  : FourVector();
2798  double baryon_density = jB.rho();
2799  ThreeVector baryon_grad_j0 = jB.grad_j0();
2800  ThreeVector baryon_dvecj_dt = jB.dvecj_dt();
2801  ThreeVector baryon_curl_vecj = jB.curl_vecj();
2802  if (potentials_->use_skyrme()) {
2803  (*UB_lat_)[i] =
2804  flow_four_velocity_B * potentials_->skyrme_pot(baryon_density);
2805  (*FB_lat_)[i] =
2806  potentials_->skyrme_force(baryon_density, baryon_grad_j0,
2807  baryon_dvecj_dt, baryon_curl_vecj);
2808  }
2809  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
2810  auto jI3 = (*jmu_I3_lat_)[i];
2811  const FourVector flow_four_velocity_I3 =
2812  std::abs(jI3.rho()) > very_small_double
2813  ? jI3.jmu_net() / jI3.rho()
2814  : FourVector();
2815  (*UI3_lat_)[i] = flow_four_velocity_I3 *
2816  potentials_->symmetry_pot(jI3.rho(), baryon_density);
2817  (*FI3_lat_)[i] = potentials_->symmetry_force(
2818  jI3.rho(), jI3.grad_j0(), jI3.dvecj_dt(), jI3.curl_vecj(),
2819  baryon_density, baryon_grad_j0, baryon_dvecj_dt,
2820  baryon_curl_vecj);
2821  }
2822  }
2823  }
2824  if (potentials_->use_coulomb()) {
2827  for (size_t i = 0; i < EM_lat_->size(); i++) {
2828  ThreeVector electric_field = {0., 0., 0.};
2829  ThreeVector position = jmu_el_lat_->cell_center(i);
2830  jmu_el_lat_->integrate_volume(electric_field,
2832  potentials_->coulomb_r_cut(), position);
2833  ThreeVector magnetic_field = {0., 0., 0.};
2834  jmu_el_lat_->integrate_volume(magnetic_field,
2836  potentials_->coulomb_r_cut(), position);
2837  (*EM_lat_)[i] = std::make_pair(electric_field, magnetic_field);
2838  }
2839  } // if ((potentials_->use_skyrme() || ...
2840  if (potentials_->use_vdf() && jmu_B_lat_ != nullptr) {
2845  parameters_.labclock->timestep_duration(), true);
2848  fields_lat_.get(), old_fields_auxiliary_.get(),
2851  parameters_.labclock->timestep_duration());
2852  }
2853  const size_t UBlattice_size = UB_lat_->size();
2854  for (size_t i = 0; i < UBlattice_size; i++) {
2855  auto jB = (*jmu_B_lat_)[i];
2856  (*UB_lat_)[i] = potentials_->vdf_pot(jB.rho(), jB.jmu_net());
2859  (*FB_lat_)[i] = potentials_->vdf_force(
2860  jB.rho(), jB.drho_dxnu().x0(), jB.drho_dxnu().threevec(),
2861  jB.grad_rho_cross_vecj(), jB.jmu_net().x0(), jB.grad_j0(),
2862  jB.jmu_net().threevec(), jB.dvecj_dt(), jB.curl_vecj());
2863  break;
2865  auto Amu = (*fields_lat_)[i];
2866  (*FB_lat_)[i] = potentials_->vdf_force(
2867  Amu.grad_A0(), Amu.dvecA_dt(), Amu.curl_vecA());
2868  break;
2869  }
2870  } // for (size_t i = 0; i < UBlattice_size; i++)
2871  } // if potentials_->use_vdf()
2872  }
2873 }
std::unique_ptr< RectangularLattice< FourVector > > new_fields_auxiliary_
Auxiliary lattice for values of Amu at a time step t0 + dt.
Definition: experiment.h:485
std::unique_ptr< RectangularLattice< std::array< FourVector, 4 > > > fields_four_gradient_auxiliary_
Auxiliary lattice for calculating the four-gradient of Amu.
Definition: experiment.h:488
std::unique_ptr< FieldsLattice > fields_lat_
Mean-field A^mu on the lattice.
Definition: experiment.h:430
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:448
std::unique_ptr< RectangularLattice< FourVector > > old_fields_auxiliary_
Auxiliary lattice for values of Amu at a time step t0.
Definition: experiment.h:483
std::unique_ptr< DensityLattice > jmu_el_lat_
Electric charge density on the lattice.
Definition: experiment.h:427
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 324 of file experiment.h.

324  {
327  }
328  return std::sqrt(4 * dt * dt + max_transverse_distance_sqr_);
329  }
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 332 of file experiment.h.

332  {
333  return parameters_.outputclock->next_time();
334  }

◆ count_nonempty_ensembles()

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

Counts the number of ensembles in wich interactions took place at the end of an event.

Definition at line 3064 of file experiment.h.

3064  {
3065  for (bool has_interaction : projectile_target_interact_) {
3066  if (has_interaction) {
3068  }
3069  }
3070 }
int nonempty_ensembles_
Number of ensembles containing an interaction.
Definition: experiment.h:564

◆ is_finished()

template<typename Modus >
bool smash::Experiment< Modus >::is_finished
private

Checks wether the desired number events have been calculated.

Returns
wether the experiment is is_finished

Definition at line 3073 of file experiment.h.

3073  {
3075  return event_ >= nevents_;
3076  }
3079  return true;
3080  }
3081  if (event_ >= max_events_) {
3082  logg[LExperiment].warn()
3083  << "Maximum number of events (" << max_events_
3084  << ") exceeded. Stopping calculation. "
3085  << "The fraction of empty ensembles is "
3086  << (1.0 - static_cast<double>(nonempty_ensembles_) /
3088  << ". If this fraction is expected, try increasing the "
3089  "Maximum_Ensembles_Run.";
3090  return true;
3091  }
3092  return false;
3093  }
3094  throw std::runtime_error("Event counting option is invalid");
3095  return false;
3096 }
int minimum_nonempty_ensembles_
The number of ensembles, in which interactions take place, to be calculated.
Definition: experiment.h:550
const int nevents_
Number of events.
Definition: experiment.h:540
int max_events_
Maximum number of events to be calculated in order obtain the desired number of non-empty events usin...
Definition: experiment.h:570
EventCounting event_counting_
The way in which the number of calculated events is specified.
Definition: experiment.h:558

Friends And Related Function Documentation

◆ ExperimentBase

template<typename Modus >
friend class ExperimentBase
friend

Definition at line 187 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 354 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 357 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 363 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 366 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 372 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 378 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 384 of file experiment.h.

◆ dilepton_output_

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

The Dilepton output.

Definition at line 387 of file experiment.h.

◆ photon_output_

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

The Photon output.

Definition at line 390 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 396 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 403 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 406 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 409 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 412 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 415 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 418 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 421 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 424 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 427 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 430 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 439 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 442 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 448 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 454 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 461 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 465 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 469 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 472 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 475 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 477 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 480 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 483 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 485 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 488 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 491 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 494 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 497 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 500 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 503 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 507 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 511 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 515 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 518 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 524 of file experiment.h.

◆ nevents_

template<typename Modus >
const int smash::Experiment< Modus >::nevents_ = 0
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 540 of file experiment.h.

◆ minimum_nonempty_ensembles_

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

The number of ensembles, in which interactions take place, to be calculated.

Can be specified as an inout instead of the number of events. In this case events will be calculated until this number of ensembles is reached.

Definition at line 550 of file experiment.h.

◆ event_counting_

template<typename Modus >
EventCounting smash::Experiment< Modus >::event_counting_ = EventCounting::Invalid
private

The way in which the number of calculated events is specified.

Can be either a fixed number of simulated events or a minimum number of events that contain interactions.

Definition at line 558 of file experiment.h.

◆ event_

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

Current event.

Definition at line 561 of file experiment.h.

◆ nonempty_ensembles_

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

Number of ensembles containing an interaction.

Definition at line 564 of file experiment.h.

◆ max_events_

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

Maximum number of events to be calculated in order obtain the desired number of non-empty events using the MinimumNonemptyEnsembles option.

Definition at line 570 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 573 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 580 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 586 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 589 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 592 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 595 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 598 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 601 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 604 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 607 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 613 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 622 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 628 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 631 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 634 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 640 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 646 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 652 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 658 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 664 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 670 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 676 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 682 of file experiment.h.

◆ kinematic_cuts_for_IC_output_

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

This indicates whether kinematic cuts are enabled for the IC output.

Definition at line 685 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 688 of file experiment.h.


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