Version: SMASH-1.5
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 133 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 (const int evt_num)
 Output at the end of an event. More...
 
Particlesparticles ()
 Provides external access to SMASH particles. 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

template<typename Container >
bool perform_action (Action &action, const Container &particles_before_actions)
 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)
 Propagate all particles until time to_time without any interactions and shine dileptons. More...
 
void run_time_evolution_timestepless (Actions &actions)
 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...
 
Particles particles_
 Complete particle list. 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 > nucleon_has_interacted_ = {}
 nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or not. 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_ = 100
 Number of fractional photons produced per single reaction. More...
 
std::unique_ptr< DensityLatticejmu_B_lat_
 Baryon density on the lattices. More...
 
std::unique_ptr< DensityLatticejmu_I3_lat_
 Isospin projection density on the lattices. 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 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 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< EnergyMomentumTensor > > Tmn_
 Lattices of energy-momentum tensors for printout. 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 fram. More...
 
bool printout_lattice_td_ = false
 Whether to print the thermodynamics quantities evaluated on the lattices. 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...
 
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 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, squared. More...
 
QuantumNumbers conserved_initial_
 The conserved quantities of 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...
 
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 1785 of file experiment.h.

1785  {
1786  const auto &mainlog = logger<LogArea::Main>();
1787  for (int j = 0; j < nevents_; j++) {
1788  mainlog.info() << "Event " << j;
1789 
1790  // Sample initial particles, start clock, some printout and book-keeping
1792  /* In the ColliderModus, if the first collisions within the same nucleus are
1793  * forbidden, 'nucleon_has_interacted_', which records whether a nucleon has
1794  * collided with another nucleon, is initialized equal to false. If allowed,
1795  * 'nucleon_has_interacted' is initialized equal to true, which means these
1796  * incoming particles have experienced some fake scatterings, they can
1797  * therefore collide with each other later on since these collisions are not
1798  * "first" to them. */
1799  if (modus_.is_collider()) {
1800  if (!modus_.cll_in_nucleus()) {
1801  nucleon_has_interacted_.assign(modus_.total_N_number(), false);
1802  } else {
1803  nucleon_has_interacted_.assign(modus_.total_N_number(), true);
1804  }
1805  }
1806  /* In the ColliderModus, if Fermi motion is frozen, assign the beam momenta
1807  * to the nucleons in both the projectile and the target. */
1808  if (modus_.is_collider() && modus_.fermi_motion() == FermiMotion::Frozen) {
1809  for (int i = 0; i < modus_.total_N_number(); i++) {
1810  const auto mass_beam = particles_.copy_to_vector()[i].effective_mass();
1811  const auto v_beam = i < modus_.proj_N_number()
1812  ? modus_.velocity_projectile()
1813  : modus_.velocity_target();
1814  const auto gamma = 1.0 / std::sqrt(1.0 - v_beam * v_beam);
1815  beam_momentum_.emplace_back(FourVector(gamma * mass_beam, 0.0, 0.0,
1816  gamma * v_beam * mass_beam));
1817  }
1818  }
1819 
1820  // Output at event start
1821  for (const auto &output : outputs_) {
1822  output->at_eventstart(particles_, j);
1823  }
1824 
1826 
1827  if (force_decays_) {
1828  do_final_decays();
1829  }
1830 
1831  // Output at event end
1832  final_output(j);
1833  }
1834 }
void run_time_evolution()
Runs the time evolution of an event with fixed-sized time steps or without timesteps, from action to actions.
Definition: experiment.h:1402
void final_output(const int evt_num)
Output at the end of an event.
Definition: experiment.h:1748
void do_final_decays()
Performs the final decays of an event.
Definition: experiment.h:1712
const bool force_decays_
This indicates whether we force all resonances to decay in the last timestep.
Definition: experiment.h:458
Particles particles_
Complete particle list.
Definition: experiment.h:314
void initialize_new_event()
This is called in the beginning of each event.
Definition: experiment.h:1199
std::vector< bool > nucleon_has_interacted_
nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or...
Definition: experiment.h:345
ParticleList copy_to_vector() const
Definition: particles.h:44
Use fermi motion without potentials.
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:311
const int nevents_
Number of events.
Definition: experiment.h:442
std::vector< FourVector > beam_momentum_
The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen...
Definition: experiment.h:352

◆ 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 1199 of file experiment.h.

1199  {
1200  const auto &log = logger<LogArea::Experiment>();
1201 
1203  log.info() << "random number seed: " << seed_;
1204  /* Set seed for the next event. It has to be positive, so it can be entered
1205  * in the config.
1206  *
1207  * We have to be careful about the minimal integer, whose absolute value
1208  * cannot be represented. */
1209  int64_t r = random::advance();
1210  while (r == INT64_MIN) {
1211  r = random::advance();
1212  }
1213  seed_ = std::abs(r);
1214  /* Set the random seed used in PYTHIA hadronization
1215  * to be same with the SMASH one.
1216  * In this way we ensure that the results are reproducible
1217  * for every event if one knows SMASH random seed. */
1218  if (process_string_ptr_ != NULL) {
1220  }
1221 
1222  particles_.reset();
1223 
1224  // Sample particles according to the initial conditions
1225  double start_time = modus_.initial_conditions(&particles_, parameters_);
1226  /* For box modus make sure that particles are in the box. In principle, after
1227  * a correct initialization they should be, so this is just playing it safe.
1228  */
1229  modus_.impose_boundary_conditions(&particles_, outputs_);
1230  // Reset the simulation clock
1231  double timestep = delta_time_startup_;
1232 
1233  switch (time_step_mode_) {
1234  case TimeStepMode::Fixed:
1235  break;
1236  case TimeStepMode::None:
1237  timestep = end_time_ - start_time;
1238  // Take care of the box modus + timestepless propagation
1239  const double max_dt = modus_.max_timestep(max_transverse_distance_sqr_);
1240  if (max_dt > 0. && max_dt < timestep) {
1241  timestep = max_dt;
1242  }
1243  break;
1244  }
1245  Clock clock_for_this_event(start_time, timestep);
1246  parameters_.labclock = std::move(clock_for_this_event);
1247 
1248  // Reset the output clock
1249  const double dt_output = parameters_.outputclock.timestep_duration();
1250  const double zeroth_output_time =
1251  std::floor(start_time / dt_output) * dt_output;
1252  Clock output_clock(zeroth_output_time, dt_output);
1253  parameters_.outputclock = std::move(output_clock);
1254 
1255  log.debug("Lab clock: t_start = ", parameters_.labclock.current_time(),
1256  ", dt = ", parameters_.labclock.timestep_duration());
1257  log.debug("Output clock: t_start = ", parameters_.outputclock.current_time(),
1259 
1260  /* Save the initial conserved quantum numbers and total momentum in
1261  * the system for conservation checks */
1262  conserved_initial_ = QuantumNumbers(particles_);
1263  wall_actions_total_ = 0;
1265  interactions_total_ = 0;
1268  // Print output headers
1269  log.info() << hline;
1270  log.info() << "Time [fm] Ediff [GeV] Scatt.|Decays "
1271  "Particles Timing ";
1272  log.info() << hline;
1273 }
void reset()
Reset the state of the Particles object to an empty list and a new id counter.
Definition: particles.cc:139
int64_t seed_
random seed for the next event.
Definition: experiment.h:524
uint64_t total_pauli_blocked_
Total number of Pauli-blockings for current timestep.
Definition: experiment.h:521
double timestep_duration() const
Definition: clock.h:128
Clock labclock
System clock (for simulation time keeping in the computational frame)
const TimeStepMode time_step_mode_
This indicates whether to use time steps.
Definition: experiment.h:473
void set_seed(T &&seed)
Sets the seed of the random number engine.
Definition: random.h:68
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:509
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:426
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:485
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
Particles particles_
Complete particle list.
Definition: experiment.h:314
const std::string hline(67, '-')
String representing a horizontal line.
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:445
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:515
double max_transverse_distance_sqr_
Maximal distance at which particles can interact, squared.
Definition: experiment.h:476
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
Engine::result_type advance()
Advance the engine&#39;s state and return the generated value.
Definition: random.h:75
const double delta_time_startup_
The clock&#39;s timestep size at start up.
Definition: experiment.h:452
Clock outputclock
Output clock to keep track of the next output time.
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:503
Use fixed time step.
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:311
void init_pythia_hadron_rndm()
Set PYTHIA random seeds to be desired values.
double current_time() const
Definition: clock.h:110
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 1402 of file experiment.h.

1402  {
1403  Actions actions;
1404 
1405  const auto &log = logger<LogArea::Experiment>();
1406 
1408  time_start_,
1410 
1412  const double t = parameters_.labclock.current_time();
1413  const double dt =
1415  log.debug("Timestepless propagation for next ", dt, " fm/c.");
1416 
1417  // Perform forced thermalization if required
1418  if (thermalizer_ &&
1419  thermalizer_->is_time_to_thermalize(parameters_.labclock)) {
1420  const bool ignore_cells_under_treshold = true;
1421  thermalizer_->update_thermalizer_lattice(particles_, density_param_,
1422  ignore_cells_under_treshold);
1423  const double current_t = parameters_.labclock.current_time();
1424  thermalizer_->thermalize(particles_, current_t,
1426  ThermalizationAction th_act(*thermalizer_, current_t);
1427  if (th_act.any_particles_thermalized()) {
1428  perform_action(th_act, particles_);
1429  }
1430  }
1431 
1432  /* (1.a) Create grid. */
1433  double min_cell_length = compute_min_cell_length(dt);
1434  log.debug("Creating grid with minimal cell length ", min_cell_length);
1435  const auto &grid = use_grid_
1436  ? modus_.create_grid(particles_, min_cell_length)
1437  : modus_.create_grid(particles_, min_cell_length,
1439 
1440  /* (1.b) Iterate over cells and find actions. */
1441  grid.iterate_cells(
1442  [&](const ParticleList &search_list) {
1443  for (const auto &finder : action_finders_) {
1444  actions.insert(finder->find_actions_in_cell(search_list, dt));
1445  }
1446  },
1447  [&](const ParticleList &search_list,
1448  const ParticleList &neighbors_list) {
1449  for (const auto &finder : action_finders_) {
1450  actions.insert(finder->find_actions_with_neighbors(
1451  search_list, neighbors_list, dt));
1452  }
1453  });
1454 
1455  /* \todo (optimizations) Adapt timestep size here */
1456 
1457  /* (2) Propagation from action to action until the end of timestep */
1459 
1460  /* (3) Update potentials (if computed on the lattice) and
1461  * compute new momenta according to equations of motion */
1462  if (potentials_) {
1465  *potentials_, FB_lat_.get(), FI3_lat_.get());
1466  }
1467 
1468  /* (4) Expand universe if non-minkowskian metric; updates
1469  * positions and momenta according to the selected expansion */
1472  }
1473 
1475 
1476  /* (5) Check conservation laws.
1477  *
1478  * Check conservation of conserved quantities if potentials and string
1479  * fragmentation are off. If potentials are on then momentum is conserved
1480  * only in average. If string fragmentation is on, then energy and
1481  * momentum are only very roughly conserved in high-energy collisions. */
1484  std::string err_msg = conserved_initial_.report_deviations(particles_);
1485  if (!err_msg.empty()) {
1486  log.error() << err_msg;
1487  throw std::runtime_error("Violation of conserved quantities!");
1488  }
1489  }
1490  }
1491 
1492  if (pauli_blocker_) {
1493  log.info("Interactions: Pauli-blocked/performed = ", total_pauli_blocked_,
1495  }
1496 }
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FB_lat_
Lattices for the electric and magnetic components of the Skyrme force.
Definition: experiment.h:398
uint64_t total_pauli_blocked_
Total number of Pauli-blockings for current timestep.
Definition: experiment.h:521
double timestep_duration() const
Definition: clock.h:128
void update_momenta(Particles *particles, double dt, const Potentials &pot, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FB_lat, RectangularLattice< std::pair< ThreeVector, ThreeVector >> *FI3_lat)
Updates the momenta of all particles at the current time step according to the equations of motion: ...
Definition: propagation.cc:111
Clock labclock
System clock (for simulation time keeping in the computational frame)
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:509
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:288
std::unique_ptr< GrandCanThermalizer > thermalizer_
Instance of class used for forced thermalization.
Definition: experiment.h:420
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:485
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
void update_potentials()
Recompute potentials on lattices if necessary.
Definition: experiment.h:1675
const bool use_grid_
This indicates whether to use the grid.
Definition: experiment.h:461
Particles particles_
Complete particle list.
Definition: experiment.h:314
bool perform_action(Action &action, const Container &particles_before_actions)
Perform the given action.
std::string report_deviations(const Particles &particles) const
Checks if the current particle list has still the same values and reports about differences.
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:445
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
std::unique_ptr< RectangularLattice< std::pair< ThreeVector, ThreeVector > > > FI3_lat_
Lattices for the electric and magnetic component of the symmetry force.
Definition: experiment.h:402
std::string format_measurements(const Particles &particles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time)
Generate the tabulated string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:318
const ExpansionProperties metric_
This struct contains information on the metric to be used.
Definition: experiment.h:464
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:488
void run_time_evolution_timestepless(Actions &actions)
Performs all the propagations and actions during a certain time interval neglecting the influence of ...
Definition: experiment.h:1524
std::unique_ptr< Potentials > potentials_
An instance of potentials class, that stores parameters of potentials, calculates them and their grad...
Definition: experiment.h:320
ExpansionMode mode_
Type of metric used.
Definition: propagation.h:27
bool strings_switch
This indicates whether string fragmentation is switched on.
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:311
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
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:355
int testparticles
Number of test particle.
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:305
double current_time() const
Definition: clock.h:110
Make cells as large as possible.
std::unique_ptr< PauliBlocker > pauli_blocker_
An instance of PauliBlocker class that stores parameters needed for Pauli blocking calculations and c...
Definition: experiment.h:326
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 1712 of file experiment.h.

1712  {
1713  /* At end of time evolution: Force all resonances to decay. In order to handle
1714  * decay chains, we need to loop until no further actions occur. */
1715  uint64_t interactions_old;
1716  const auto particles_before_actions = particles_.copy_to_vector();
1717  do {
1718  Actions actions;
1719 
1720  interactions_old = interactions_total_;
1721 
1722  // Dileptons: shining of remaining resonances
1723  if (dilepton_finder_ != nullptr) {
1724  for (const auto &output : outputs_) {
1725  dilepton_finder_->shine_final(particles_, output.get(), true);
1726  }
1727  }
1728  // Find actions.
1729  for (const auto &finder : action_finders_) {
1730  actions.insert(finder->find_final_actions(particles_));
1731  }
1732  // Perform actions.
1733  while (!actions.is_empty()) {
1734  perform_action(*actions.pop(), particles_before_actions);
1735  }
1736  // loop until no more decays occur
1737  } while (interactions_total_ > interactions_old);
1738 
1739  // Dileptons: shining of stable particles at the end
1740  if (dilepton_finder_ != nullptr) {
1741  for (const auto &output : outputs_) {
1742  dilepton_finder_->shine_final(particles_, output.get(), false);
1743  }
1744  }
1745 }
std::unique_ptr< DecayActionsFinderDilepton > dilepton_finder_
The Dilepton Action Finder.
Definition: experiment.h:358
Particles particles_
Complete particle list.
Definition: experiment.h:314
bool perform_action(Action &action, const Container &particles_before_actions)
Perform the given action.
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
ParticleList copy_to_vector() const
Definition: particles.h:44
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:355
Here is the call graph for this function:

◆ final_output()

template<typename Modus >
void smash::Experiment< Modus >::final_output ( const int  evt_num)

Output at the end of an event.

Parameters
[in]evt_numNumber of the event

Definition at line 1748 of file experiment.h.

1748  {
1749  const auto &log = logger<LogArea::Experiment>();
1750  /* make sure the experiment actually ran (note: we should compare this
1751  * to the start time, but we don't know that. Therefore, we check that
1752  * the time is positive, which should heuristically be the same). */
1753  if (likely(parameters_.labclock > 0)) {
1754  const uint64_t wall_actions_this_interval =
1756  const uint64_t interactions_this_interval = interactions_total_ -
1758  wall_actions_this_interval;
1759  log.info() << format_measurements(particles_, interactions_this_interval,
1762  log.info() << hline;
1763  log.info() << "Time real: " << SystemClock::now() - time_start_;
1764  log.info() << "Final interaction number: "
1766  // Check if there are unformed particles
1767  int unformed_particles_count = 0;
1768  for (const auto &particle : particles_) {
1769  if (particle.formation_time() > end_time_) {
1770  unformed_particles_count++;
1771  }
1772  }
1773  if (unformed_particles_count > 0) {
1774  log.warn("End time might be too small. ", unformed_particles_count,
1775  " unformed particles were found at the end of the evolution.");
1776  }
1777  }
1778 
1779  for (const auto &output : outputs_) {
1780  output->at_eventend(particles_, evt_num, modus_.impact_parameter());
1781  }
1782 }
#define likely(x)
Tell the branch predictor that this expression is likely true.
Definition: macros.h:14
Clock labclock
System clock (for simulation time keeping in the computational frame)
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:509
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:485
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
Particles particles_
Complete particle list.
Definition: experiment.h:314
const std::string hline(67, '-')
String representing a horizontal line.
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:445
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:515
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
std::string format_measurements(const Particles &particles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time)
Generate the tabulated string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:318
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:488
Clock outputclock
Output clock to keep track of the next output time.
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:503
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:311
double current_time() const
Definition: clock.h:110
Here is the call graph for this function:

◆ particles()

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

Provides external access to SMASH particles.

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

Definition at line 218 of file experiment.h.

218 { return &particles_; }
Particles particles_
Complete particle list.
Definition: experiment.h:314

◆ 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 224 of file experiment.h.

224 { return &modus_; }
Modus modus_
Instance of the Modus template parameter.
Definition: experiment.h:311

◆ perform_action()

template<typename Modus >
template<typename Container >
bool smash::Experiment< Modus >::perform_action ( Action action,
const Container &  particles_before_actions 
)
private

Perform the given action.

Template Parameters
Containertype that holds the particles before the action.
Parameters
[in]actionThe action to perform. If it performs, it'll modify the private member particles_.
[in]particles_before_actionsA container with the ParticleData from this time step before any actions were 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 543 of file experiment.h.

546  {
547  const auto &log = logger<LogArea::Experiment>();
548  log.info() << "Adding output " << content << " of format " << format
549  << std::endl;
550 
551  if (format == "VTK" && content == "Particles") {
552  outputs_.emplace_back(
553  make_unique<VtkOutput>(output_path, content, out_par));
554  } else if (format == "Root") {
555 #ifdef SMASH_USE_ROOT
556  outputs_.emplace_back(
557  make_unique<RootOutput>(output_path, content, out_par));
558 #else
559  log.error("Root output requested, but Root support not compiled in");
560 #endif
561  } else if (format == "Binary") {
562  if (content == "Collisions" || content == "Dileptons" ||
563  content == "Photons") {
564  outputs_.emplace_back(
565  make_unique<BinaryOutputCollisions>(output_path, content, out_par));
566  } else if (content == "Particles") {
567  outputs_.emplace_back(
568  make_unique<BinaryOutputParticles>(output_path, content, out_par));
569  }
570  } else if (format == "Oscar1999" || format == "Oscar2013") {
571  outputs_.emplace_back(
572  create_oscar_output(format, content, output_path, out_par));
573  } else if (content == "Thermodynamics" && format == "ASCII") {
574  outputs_.emplace_back(
575  make_unique<ThermodynamicOutput>(output_path, content, out_par));
576  } else if (content == "Thermodynamics" && format == "VTK") {
577  printout_lattice_td_ = true;
578  outputs_.emplace_back(
579  make_unique<VtkOutput>(output_path, content, out_par));
580  } else {
581  log.error() << "Unknown combination of format (" << format
582  << ") and content (" << content << "). Fix the config.";
583  }
584 }
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:310
bool printout_lattice_td_
Whether to print the thermodynamics quantities evaluated on the lattices.
Definition: experiment.h:417
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:732
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
Here is the call graph for this function:

◆ propagate_and_shine()

template<typename Modus >
void smash::Experiment< Modus >::propagate_and_shine ( double  to_time)
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]

Definition at line 1499 of file experiment.h.

1499  {
1500  const double dt =
1502  if (dilepton_finder_ != nullptr) {
1503  for (const auto &output : outputs_) {
1504  dilepton_finder_->shine(particles_, output.get(), dt);
1505  }
1506  }
1507 }
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:43
std::unique_ptr< DecayActionsFinderDilepton > dilepton_finder_
The Dilepton Action Finder.
Definition: experiment.h:358
Particles particles_
Complete particle list.
Definition: experiment.h:314
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
std::vector< FourVector > beam_momentum_
The initial nucleons in the ColliderModus propagate with beam_momentum_, if Fermi motion is frozen...
Definition: experiment.h:352
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)
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. In a time stepless case, the time interval should be equal to the whole evolution time, while in the case with time step, the intervals are given by the 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.

Definition at line 1524 of file experiment.h.

1524  {
1525  const auto &log = logger<LogArea::Experiment>();
1526 
1527  const double start_time = parameters_.labclock.current_time();
1528  const double end_time = std::min(parameters_.labclock.next_time(), end_time_);
1529  double time_left = end_time - start_time;
1530  log.debug("Timestepless propagation: ", "Actions size = ", actions.size(),
1531  ", start time = ", start_time, ", end time = ", end_time);
1532 
1533  // iterate over all actions
1534  while (!actions.is_empty()) {
1535  // get next action
1536  ActionPtr act = actions.pop();
1537  if (!act->is_valid(particles_)) {
1538  log.debug(~einhard::DRed(), "✘ ", act, " (discarded: invalid)");
1539  continue;
1540  }
1541  if (act->time_of_execution() > end_time) {
1542  log.error(act, " scheduled later than end time: t_action[fm/c] = ",
1543  act->time_of_execution(), ", t_end[fm/c] = ", end_time);
1544  }
1545  log.debug(~einhard::Green(), "✔ ", act);
1546 
1547  while (next_output_time() <= act->time_of_execution()) {
1548  log.debug("Propagating until output time: ", next_output_time());
1552  }
1553 
1554  /* (1) Propagate to the next action. */
1555  log.debug("Propagating until next action ", act,
1556  ", action time = ", act->time_of_execution());
1557  propagate_and_shine(act->time_of_execution());
1558 
1559  /* (2) Perform action.
1560  *
1561  * Update the positions of the incoming particles, because the information
1562  * in the action object will be outdated as the particles have been
1563  * propagated since the construction of the action. */
1564  act->update_incoming(particles_);
1565 
1566  const bool performed = perform_action(*act, particles_);
1567 
1568  /* No need to update actions for outgoing particles
1569  * if the action is not performed. */
1570  if (!performed) {
1571  continue;
1572  }
1573 
1574  /* (3) Update actions for newly-produced particles. */
1575 
1576  time_left = end_time - act->time_of_execution();
1577  const ParticleList &outgoing_particles = act->outgoing_particles();
1578  for (const auto &finder : action_finders_) {
1579  // Outgoing particles can still decay, cross walls...
1580  actions.insert(
1581  finder->find_actions_in_cell(outgoing_particles, time_left));
1582  // ... and collide with other particles.
1583  actions.insert(finder->find_actions_with_surrounding_particles(
1584  outgoing_particles, particles_, time_left));
1585  }
1586 
1588  }
1589 
1590  while (next_output_time() <= end_time) {
1591  log.debug("Propagating until output time: ", next_output_time());
1594  // Avoid duplicating printout at event end time
1597  }
1598  }
1599 
1600  log.debug("Propagating to time ", end_time);
1601  propagate_and_shine(end_time);
1602 }
void check_interactions_total(uint64_t interactions_total)
Make sure interactions_total can be represented as a 32-bit integer.
Definition: experiment.h:1516
double next_output_time() const
Shortcut for next output time.
Definition: experiment.h:293
Clock labclock
System clock (for simulation time keeping in the computational frame)
void propagate_and_shine(double to_time)
Propagate all particles until time to_time without any interactions and shine dileptons.
Definition: experiment.h:1499
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
Particles particles_
Complete particle list.
Definition: experiment.h:314
bool perform_action(Action &action, const Container &particles_before_actions)
Perform the given action.
const double end_time_
simulation time at which the evolution is stopped.
Definition: experiment.h:445
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
Clock outputclock
Output clock to keep track of the next output time.
void intermediate_output()
Intermediate output during an event.
Definition: experiment.h:1605
std::vector< std::unique_ptr< ActionFinderInterface > > action_finders_
The Action finder objects.
Definition: experiment.h:355
double next_time() const
Definition: clock.h:120
A stream modifier that allows to colorize the log output.
Definition: einhard.hpp:142
double current_time() const
Definition: clock.h:110
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.

Definition at line 1605 of file experiment.h.

1605  {
1606  const auto &log = logger<LogArea::Experiment>();
1607  const uint64_t wall_actions_this_interval =
1610  const uint64_t interactions_this_interval = interactions_total_ -
1612  wall_actions_this_interval;
1614  log.info() << format_measurements(particles_, interactions_this_interval,
1617  const LatticeUpdate lat_upd = LatticeUpdate::AtOutput;
1618  // save evolution data
1619  for (const auto &output : outputs_) {
1620  if (output->is_dilepton_output() || output->is_photon_output()) {
1621  continue;
1622  }
1623  output->at_intermediate_time(particles_, parameters_.outputclock,
1624  density_param_);
1625 
1626  // Thermodynamic output on the lattice versus time
1627  switch (dens_type_lattice_printout_) {
1628  case DensityType::Baryon:
1630  density_param_, particles_, false);
1631  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
1633  break;
1636  density_param_, particles_, false);
1637  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
1639  *jmu_I3_lat_);
1640  break;
1641  case DensityType::None:
1642  break;
1643  default:
1644  update_lattice(jmu_custom_lat_.get(), lat_upd,
1646  false);
1647  output->thermodynamics_output(ThermodynamicQuantity::EckartDensity,
1649  *jmu_custom_lat_);
1650  }
1654  if (printout_tmn_) {
1655  output->thermodynamics_output(ThermodynamicQuantity::Tmn,
1657  }
1658  if (printout_tmn_landau_) {
1659  output->thermodynamics_output(ThermodynamicQuantity::TmnLandau,
1661  }
1662  if (printout_v_landau_) {
1663  output->thermodynamics_output(ThermodynamicQuantity::LandauVelocity,
1665  }
1666  }
1667 
1668  if (thermalizer_) {
1669  output->thermodynamics_output(*thermalizer_);
1670  }
1671  }
1672 }
std::unique_ptr< RectangularLattice< EnergyMomentumTensor > > Tmn_
Lattices of energy-momentum tensors for printout.
Definition: experiment.h:405
std::unique_ptr< DensityLattice > jmu_custom_lat_
Custom density on the lattices.
Definition: experiment.h:379
void update_lattice(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const Particles &particles, const bool compute_gradient=false)
Updates the contents on the lattice.
Definition: density.h:386
LatticeUpdate
Enumerator option for lattice updates.
Definition: lattice.h:35
uint64_t wall_actions_total_
Total number of wall-crossings for current timestep.
Definition: experiment.h:509
std::unique_ptr< GrandCanThermalizer > thermalizer_
Instance of class used for forced thermalization.
Definition: experiment.h:420
QuantumNumbers conserved_initial_
The conserved quantities of the system.
Definition: experiment.h:485
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
bool printout_tmn_landau_
Whether to print the energy-momentum tensor in Landau frame.
Definition: experiment.h:411
Particles particles_
Complete particle list.
Definition: experiment.h:314
std::unique_ptr< DensityLattice > jmu_I3_lat_
Isospin projection density on the lattices.
Definition: experiment.h:370
uint64_t previous_wall_actions_total_
Total number of wall-crossings for previous timestep.
Definition: experiment.h:515
uint64_t interactions_total_
Total number of interactions for current timestep.
Definition: experiment.h:497
std::string format_measurements(const Particles &particles, uint64_t scatterings_this_interval, const QuantumNumbers &conserved_initial, SystemTimePoint time_start, double time)
Generate the tabulated string which will be printed to the screen when SMASH is running.
Definition: experiment.cc:318
SystemTimePoint time_start_
system starting time of the simulation
Definition: experiment.h:488
Clock outputclock
Output clock to keep track of the next output time.
uint64_t previous_interactions_total_
Total number of interactions for previous timestep.
Definition: experiment.h:503
OutputsList outputs_
A list of output formaters.
Definition: experiment.h:332
bool printout_v_landau_
Whether to print the 4-velocity in Landau fram.
Definition: experiment.h:414
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:305
double current_time() const
Definition: clock.h:110
DensityType dens_type_lattice_printout_
Type of density for lattice printout.
Definition: experiment.h:382
std::unique_ptr< DensityLattice > jmu_B_lat_
Baryon density on the lattices.
Definition: experiment.h:367
bool printout_tmn_
Whether to print the energy-momentum tensor.
Definition: experiment.h:408
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 1675 of file experiment.h.

1675  {
1676  if (potentials_) {
1677  if (potentials_->use_skyrme() && jmu_B_lat_ != nullptr) {
1680  const size_t UBlattice_size = UB_lat_->size();
1681  for (size_t i = 0; i < UBlattice_size; i++) {
1682  auto jB = (*jmu_B_lat_)[i];
1683  const FourVector flow_four_velocity = abs(jB.density()) > really_small
1684  ? jB.jmu_net() / jB.density()
1685  : FourVector();
1686  (*UB_lat_)[i] =
1687  flow_four_velocity * potentials_->skyrme_pot(jB.density());
1688  (*FB_lat_)[i] = potentials_->skyrme_force(jB.density(), jB.grad_rho(),
1689  jB.dj_dt(), jB.rot_j());
1690  }
1691  }
1692  if (potentials_->use_symmetry() && jmu_I3_lat_ != nullptr) {
1695  true);
1696  const size_t UI3lattice_size = UI3_lat_->size();
1697  for (size_t i = 0; i < UI3lattice_size; i++) {
1698  auto jI3 = (*jmu_I3_lat_)[i];
1699  const FourVector flow_four_velocity =
1700  abs(jI3.density()) > really_small ? jI3.jmu_net() / jI3.density()
1701  : FourVector();
1702  (*UI3_lat_)[i] =
1703  flow_four_velocity * potentials_->symmetry_pot(jI3.density());
1704  (*FI3_lat_)[i] = potentials_->symmetry_force(jI3.grad_rho(),
1705  jI3.dj_dt(), jI3.rot_j());
1706  }
1707  }
1708  }
1709 }
constexpr double really_small
Numerical error tolerance.
Definition: constants.h:34
std::unique_ptr< RectangularLattice< FourVector > > UB_lat_
Lattices for Skyrme potentials (evaluated in the local rest frame) times the baryon flow 4-velocity...
Definition: experiment.h:388
void update_lattice(RectangularLattice< T > *lat, const LatticeUpdate update, const DensityType dens_type, const DensityParameters &par, const Particles &particles, const bool compute_gradient=false)
Updates the contents on the lattice.
Definition: density.h:386
Particles particles_
Complete particle list.
Definition: experiment.h:314
std::unique_ptr< DensityLattice > jmu_I3_lat_
Isospin projection density on the lattices.
Definition: experiment.h:370
std::unique_ptr< RectangularLattice< FourVector > > UI3_lat_
Lattices for symmetry potentials (evaluated in the local rest frame) times the isospin flow 4-velocit...
Definition: experiment.h:394
std::unique_ptr< Potentials > potentials_
An instance of potentials class, that stores parameters of potentials, calculates them and their grad...
Definition: experiment.h:320
DensityParameters density_param_
Structure to precalculate and hold parameters for density computations.
Definition: experiment.h:305
std::unique_ptr< DensityLattice > jmu_B_lat_
Baryon density on the lattices.
Definition: experiment.h:367
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 288 of file experiment.h.

288  {
289  return std::sqrt(4 * dt * dt + max_transverse_distance_sqr_);
290  }
double max_transverse_distance_sqr_
Maximal distance at which particles can interact, squared.
Definition: experiment.h:476

◆ next_output_time()

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

Shortcut for next output time.

Definition at line 293 of file experiment.h.

293  {
295  }
ExperimentParameters parameters_
Struct of several member variables.
Definition: experiment.h:302
Clock outputclock
Output clock to keep track of the next output time.
double next_time() const
Definition: clock.h:120
Here is the call graph for this function:

Friends And Related Function Documentation

◆ ExperimentBase

template<typename Modus >
friend class ExperimentBase
friend

Definition at line 163 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 302 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 305 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 311 of file experiment.h.

◆ particles_

template<typename Modus >
Particles smash::Experiment< Modus >::particles_
private

Complete particle list.

Definition at line 314 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 320 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 326 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 332 of file experiment.h.

◆ dilepton_output_

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

The Dilepton output.

Definition at line 335 of file experiment.h.

◆ photon_output_

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

The Photon output.

Definition at line 338 of file experiment.h.

◆ nucleon_has_interacted_

template<typename Modus >
std::vector<bool> smash::Experiment< Modus >::nucleon_has_interacted_ = {}
private

nucleon_has_interacted_ labels whether the particles in the nuclei have experienced any collisions or not.

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

Definition at line 345 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 352 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 355 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 358 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 361 of file experiment.h.

◆ n_fractional_photons_

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

Number of fractional photons produced per single reaction.

Definition at line 364 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 lattices.

Definition at line 367 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 lattices.

Definition at line 370 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 379 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 382 of file experiment.h.

◆ UB_lat_

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

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

Definition at line 388 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 394 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 force.

Definition at line 398 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 402 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 405 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 408 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 411 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 fram.

Definition at line 414 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 417 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 420 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 426 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 442 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 445 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 452 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 458 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 461 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 464 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 467 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 470 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 473 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, squared.

Definition at line 476 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 485 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 488 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 491 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 497 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 503 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 509 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 515 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 521 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 524 of file experiment.h.


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