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.");
270 const auto &log = logger<LogArea::Experiment>();
273 const int ntest = config.
take({
"General",
"Testparticles"}, 1);
275 throw std::invalid_argument(
"Testparticle number should be positive!");
278 const std::string modus_chooser = config.
take({
"General",
"Modus"});
285 const double dt = config.
take({
"General",
"Delta_Time"}, 1.);
286 const double t_end = config.
read({
"General",
"End_Time"});
287 const double output_dt = config.
take({
"Output",
"Output_Interval"}, t_end);
288 auto config_coll = config[
"Collision_Term"];
291 const double low_snn_cut =
292 config_coll.
take({
"Elastic_NN_Cutoff_Sqrts"}, 1.98);
295 if (proton && pion &&
296 low_snn_cut > proton->mass() + proton->mass() + pion->mass()) {
297 log.warn(
"The cut-off should be below the threshold energy",
298 " of the process: NN to NNpi");
300 const bool potential_affect_threshold =
301 config.
take({
"Lattice",
"Potentials_Affect_Thresholds"},
false);
305 config.
take({
"General",
"Gaussian_Sigma"}, 1.),
306 config.
take({
"General",
"Gauss_Cutoff_In_Sigma"}, 4.),
307 config_coll.take({
"Two_to_One"},
true),
309 config_coll.take({
"Strings"}, modus_chooser !=
"Box"),
310 config_coll.take({
"Use_AQM"},
true),
311 config_coll.take({
"Strings_with_Probability"},
true),
315 potential_affect_threshold};
319 uint64_t scatterings_this_interval,
322 const SystemTimeSpan elapsed_seconds = SystemClock::now() - time_start;
325 const QuantumNumbers difference = conserved_initial - current_values;
327 std::ostringstream ss;
329 ss << field<5> << time << field<11, 3> << difference.
momentum().
x0()
330 << field<14, 3> << scatterings_this_interval
331 << field<14, 3> << particles.
size() << field<12, 3> << elapsed_seconds;
Value read(std::initializer_list< const char *> keys) const
Additional interface for SMASH to read configuration values without removing them.
static std::unique_ptr< ExperimentBase > create(Configuration config, const bf::path &output_path)
Factory method that creates and initializes a new Experiment<Modus>.
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...
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.
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.
Value take(std::initializer_list< const char *> keys)
The default interface for SMASH to read configuration values.
The Particles class abstracts the storage and manipulation of particles.
FourVector momentum() const
Helper structure for Experiment.