Version: SMASH-3.1
experiment.h File Reference
#include <algorithm>
#include <limits>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "actionfinderfactory.h"
#include "actions.h"
#include "bremsstrahlungaction.h"
#include "chrono.h"
#include "decayactionsfinder.h"
#include "decayactionsfinderdilepton.h"
#include "energymomentumtensor.h"
#include "fields.h"
#include "fourvector.h"
#include "grandcan_thermalizer.h"
#include "grid.h"
#include "hypersurfacecrossingaction.h"
#include "outputparameters.h"
#include "pauliblocking.h"
#include "potential_globals.h"
#include "potentials.h"
#include "propagation.h"
#include "quantumnumbers.h"
#include "scatteractionphoton.h"
#include "scatteractionsfinder.h"
#include "stringprocess.h"
#include "thermalizationaction.h"
#include "binaryoutput.h"
#include "icoutput.h"
#include "oscaroutput.h"
#include "thermodynamiclatticeoutput.h"
#include "thermodynamicoutput.h"
#include "freeforallaction.h"
#include "vtkoutput.h"
#include "wallcrossingaction.h"

Go to the source code of this file.

Classes

class  smash::ExperimentBase
 Non-template interface to Experiment<Modus>. More...
 
struct  smash::ExperimentBase::InvalidModusRequest
 Exception class that is thrown if an invalid modus is requested from the Experiment factory. More...
 
struct  smash::ExperimentBase::NonExistingOutputPathRequest
 Exception class that is thrown if the requested output path in the Experiment factory is not existing. More...
 
class  smash::Experiment< Modus >
 The main class, where the simulation of an experiment is executed. More...
 

Namespaces

 smash
 

Functions

template<typename T , typename Ratio >
static ostream & std::operator<< (ostream &out, const chrono::duration< T, Ratio > &seconds)
 Print time span in a human readable way: time < 10 min => seconds 10 min < time < 3 h => minutes time > 3h => hours. More...
 
template<typename Modus >
std::ostream & smash::operator<< (std::ostream &out, const Experiment< Modus > &e)
 Creates a verbose textual description of the setup of the Experiment. More...
 
ExperimentParameters smash::create_experiment_parameters (Configuration &config)
 Gathers all general Experiment parameters. More...
 
const std::string smash::hline (113, '-')
 String representing a horizontal line. More...
 
std::string smash::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. More...
 
double smash::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 running. More...
 
EventInfo smash::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_. More...
 
void smash::validate_and_adjust_particle_list (ParticleList &particle_list)
 Validate a particle list adjusting each particle to be a valid SMASH particle. More...
 
void smash::check_interactions_total (uint64_t interactions_total)
 Make sure interactions_total can be represented as a 32-bit integer. More...
 

Variables

static constexpr int smash::LMain = LogArea::Main::id
 
static constexpr int smash::LInitialConditions = LogArea::InitialConditions::id
 

Function Documentation

◆ operator<<()

template<typename T , typename Ratio >
static ostream& std::operator<< ( ostream &  out,
const chrono::duration< T, Ratio > &  seconds 
)
static

Print time span in a human readable way: time < 10 min => seconds 10 min < time < 3 h => minutes time > 3h => hours.

Note
This operator has to be in the std namespace for argument dependent lookup to find it. If it were in the smash namespace then the code would not compile since none of its arguments is a type from the smash namespace.

Definition at line 71 of file experiment.h.

72  {
73  using Seconds = chrono::duration<double>;
74  using Minutes = chrono::duration<double, std::ratio<60>>;
75  using Hours = chrono::duration<double, std::ratio<60 * 60>>;
76  constexpr Minutes threshold_for_minutes{10};
77  constexpr Hours threshold_for_hours{3};
78  if (seconds < threshold_for_minutes) {
79  return out << Seconds(seconds).count() << " [s]";
80  }
81  if (seconds < threshold_for_hours) {
82  return out << Minutes(seconds).count() << " [min]";
83  }
84  return out << Hours(seconds).count() << " [h]";
85 }