Version: SMASH-1.5
experiment.h File Reference
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include "actionfinderfactory.h"
#include "actions.h"
#include "chrono.h"
#include "decayactionsfinder.h"
#include "decayactionsfinderdilepton.h"
#include "energymomentumtensor.h"
#include "fourvector.h"
#include "grandcan_thermalizer.h"
#include "grid.h"
#include "outputparameters.h"
#include "pauliblocking.h"
#include "potential_globals.h"
#include "potentials.h"
#include "processstring.h"
#include "propagation.h"
#include "quantumnumbers.h"
#include "scatteractionphoton.h"
#include "scatteractionsfinder.h"
#include "thermalizationaction.h"
#include "binaryoutput.h"
#include "oscaroutput.h"
#include "thermodynamicoutput.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...
 
class  smash::Experiment< Modus >
 The main class, where the simulation of an experiment is executed. 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 (67, '-')
 String representing a horizontal line. More...
 
std::string smash::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. More...
 
void smash::check_interactions_total (uint64_t interactions_total)
 Make sure interactions_total can be represented as a 32-bit integer. More...
 

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

57  {
58  using Seconds = chrono::duration<double>;
59  using Minutes = chrono::duration<double, std::ratio<60>>;
60  using Hours = chrono::duration<double, std::ratio<60 * 60>>;
61  constexpr Minutes threshold_for_minutes{10};
62  constexpr Hours threshold_for_hours{3};
63  if (seconds < threshold_for_minutes) {
64  return out << Seconds(seconds).count() << " [s]";
65  }
66  if (seconds < threshold_for_hours) {
67  return out << Minutes(seconds).count() << " [min]";
68  }
69  return out << Hours(seconds).count() << " [h]";
70 }