26 const bf::path &output_path) {
27 const auto &log = logger<LogArea::Experiment>();
50 const std::string modus_chooser = config.read({
"General",
"Modus"});
51 log.debug() <<
"Modus for this calculation: " << modus_chooser;
53 if (modus_chooser ==
"Box") {
54 return make_unique<Experiment<BoxModus>>(config, output_path);
55 }
else if (modus_chooser ==
"List") {
56 return make_unique<Experiment<ListModus>>(config, output_path);
57 }
else if (modus_chooser ==
"Collider") {
58 return make_unique<Experiment<ColliderModus>>(config, output_path);
59 }
else if (modus_chooser ==
"Sphere") {
60 return make_unique<Experiment<SphereModus>>(config, output_path);
62 throw InvalidModusRequest(
"Invalid Modus (" + modus_chooser +
63 ") requested from ExperimentBase::create.");
282 const auto &log = logger<LogArea::Experiment>();
285 const int ntest = config.
take({
"General",
"Testparticles"}, 1);
287 throw std::invalid_argument(
"Testparticle number should be positive!");
290 const std::string modus_chooser = config.
take({
"General",
"Modus"});
297 const double dt = config.
take({
"General",
"Delta_Time"}, 1.);
298 const double t_end = config.
read({
"General",
"End_Time"});
299 const double output_dt = config.
take({
"Output",
"Output_Interval"}, t_end);
300 auto config_coll = config[
"Collision_Term"];
303 const double low_snn_cut =
304 config_coll.
take({
"Elastic_NN_Cutoff_Sqrts"}, 1.98);
307 if (proton && pion &&
308 low_snn_cut > proton->mass() + proton->mass() + pion->mass()) {
309 log.warn(
"The cut-off should be below the threshold energy",
310 " of the process: NN to NNpi");
312 const bool potential_affect_threshold =
313 config.
take({
"Lattice",
"Potentials_Affect_Thresholds"},
false);
317 config.
take({
"General",
"Gaussian_Sigma"}, 1.),
318 config.
take({
"General",
"Gauss_Cutoff_In_Sigma"}, 4.),
319 config_coll.take({
"Two_to_One"},
true),
321 config_coll.take({
"Strings"}, modus_chooser !=
"Box"),
322 config_coll.take({
"Use_AQM"},
true),
323 config_coll.take({
"Strings_with_Probability"},
true),
327 potential_affect_threshold};
331 uint64_t scatterings_this_interval,
334 const SystemTimeSpan elapsed_seconds = SystemClock::now() - time_start;
337 const QuantumNumbers difference = conserved_initial - current_values;
339 std::ostringstream ss;
341 ss << field<8, 3> << time << field<13, 3> << difference.
momentum().
x0()
342 << field<16, 3> << scatterings_this_interval
343 << field<11, 3> << particles.
size() << field<10, 3> << elapsed_seconds;
static std::unique_ptr< ExperimentBase > create(Configuration config, const bf::path &output_path)
Factory method that creates and initializes a new Experiment<Modus>.
Value read(std::initializer_list< const char * > keys) const
Additional interface for SMASH to read configuration values without removing them.
Interface to the SMASH configuration files.
ExperimentParameters create_experiment_parameters(Configuration config)
Gathers all general Experiment parameters.
bool has_value(std::initializer_list< const char * > keys) const
Returns whether there is a non-empty value behind the requested keys.
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.
#define source_location
Hackery that is required to output the location in the source code where the log statement occurs...
Value take(std::initializer_list< const char * > keys)
The default interface for SMASH to read configuration values.
A container for storing conserved values.
SystemClock::duration SystemTimeSpan
The time duration type (alias) used for measuring run times.
void remove_all_but(const std::string &key)
Removes all entries in the map except for key.
std::bitset< 6 > ReactionsBitSet
Container for the 2 to 2 reactions in the code.
FourVector momentum() const
Use string fragmentation.
std::chrono::time_point< std::chrono::system_clock > SystemTimePoint
Type (alias) that is used to store the current time.
static const ParticleTypePtr try_find(PdgCode pdgcode)
Returns the ParticleTypePtr for the given pdgcode.
The Particles class abstracts the storage and manipulation of particles.
Helper structure for Experiment.