Version: SMASH-2.1
boxmodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2021
3  * SMASH Team
4  *
5  * GNU General Public License (GPLv3 or later)
6  */
7 #ifndef SRC_INCLUDE_SMASH_BOXMODUS_H_
8 #define SRC_INCLUDE_SMASH_BOXMODUS_H_
9 
10 #include <map>
11 #include <memory>
12 
13 #include "forwarddeclarations.h"
14 #include "modusdefault.h"
15 
16 namespace smash {
17 
46 class BoxModus : public ModusDefault {
47  public:
58  explicit BoxModus(Configuration modus_config,
59  const ExperimentParameters &parameters);
60 
71  double initial_conditions(Particles *particles,
72  const ExperimentParameters &parameters);
73 
91  const OutputsList &output_list = {});
92 
95  const Particles &particles, double min_cell_length,
96  double timestep_duration, CollisionCriterion crit,
99  if (crit == CollisionCriterion::Stochastic) {
101  }
102  return {{{0, 0, 0}, {length_, length_, length_}},
103  particles,
104  min_cell_length,
105  timestep_duration,
106  limit,
107  strategy};
108  }
109 
116  std::unique_ptr<GrandCanThermalizer> create_grandcan_thermalizer(
117  Configuration &conf) const {
118  const std::array<double, 3> lat_size = {length_, length_, length_};
119  const std::array<double, 3> origin = {0., 0., 0.};
120  const bool periodicity = true;
121  return make_unique<GrandCanThermalizer>(conf, lat_size, origin,
122  periodicity);
123  }
124 
126  double max_timestep(double max_transverse_distance_sqr) const {
127  return 0.5 * std::sqrt(length_ * length_ - max_transverse_distance_sqr);
128  }
129 
131  double equilibration_time() const { return equilibration_time_; }
133  bool is_box() const { return true; }
135  double length() const { return length_; }
136 
137  private:
141  const double length_;
143  const double equilibration_time_;
145  const double temperature_;
147  const double start_time_ = 0.;
152  const bool use_thermal_ = false;
157  const double mub_;
162  const double mus_;
167  const double muq_;
178  const std::map<PdgCode, int> init_multipl_;
183  std::map<PdgCode, double> average_multipl_;
184 
189  const bool insert_jet_ = false;
198  const double jet_mom_;
199 
208  friend std::ostream &operator<<(std::ostream &out, const BoxModus &m);
209 };
210 
211 } // namespace smash
212 
213 #endif // SRC_INCLUDE_SMASH_BOXMODUS_H_
BoxModus: Provides a modus for infinite matter calculations.
Definition: boxmodus.h:46
std::unique_ptr< GrandCanThermalizer > create_grandcan_thermalizer(Configuration &conf) const
Creates GrandCanThermalizer.
Definition: boxmodus.h:116
double equilibration_time() const
Definition: boxmodus.h:131
double max_timestep(double max_transverse_distance_sqr) const
Definition: boxmodus.h:126
const double muq_
Charge chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:167
const double jet_mom_
Initial momentum of the jet particle; only used if insert_jet_ is true.
Definition: boxmodus.h:198
int impose_boundary_conditions(Particles *particles, const OutputsList &output_list={})
Enforces that all particles are inside the box at the beginning of an event.
Definition: boxmodus.cc:365
BoxModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
Definition: boxmodus.cc:219
const bool use_thermal_
Whether to use a thermal initialization for all particles instead of specific numbers.
Definition: boxmodus.h:152
const bool insert_jet_
Whether to insert a single high energy particle at the center of the box (0,0,0).
Definition: boxmodus.h:189
bool is_box() const
Definition: boxmodus.h:133
const double mub_
Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:157
double initial_conditions(Particles *particles, const ExperimentParameters &parameters)
Generates initial state of the particles in the system according to specified parameters: number of p...
Definition: boxmodus.cc:253
double length() const
Definition: boxmodus.h:135
const PdgCode jet_pdg_
Pdg of the particle to use as a jet; necessary if insert_jet_ is true, unused otherwise.
Definition: boxmodus.h:194
const BoxInitialCondition initial_condition_
Initial momenta distribution: thermal or peaked momenta.
Definition: boxmodus.h:139
const std::map< PdgCode, int > init_multipl_
Particle multiplicities at initialization; required if use_thermal_ is false.
Definition: boxmodus.h:178
const bool account_for_resonance_widths_
In case of thermal initialization: true – account for resonance spectral functions,...
Definition: boxmodus.h:173
const double temperature_
Temperature of the Box in GeV.
Definition: boxmodus.h:145
Grid< GridOptions::PeriodicBoundaries > create_grid(const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
Creates the Grid with normal boundary conditions.
Definition: boxmodus.h:94
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:162
std::map< PdgCode, double > average_multipl_
Average multiplicities in case of thermal initialization.
Definition: boxmodus.h:183
const double start_time_
Initial time of the box.
Definition: boxmodus.h:147
const double equilibration_time_
time after which output is written
Definition: boxmodus.h:143
const double length_
Length of the cube's edge in fm/c.
Definition: boxmodus.h:141
Interface to the SMASH configuration files.
Abstracts a list of cells that partition the particles in the experiment into regions of space that c...
Definition: grid.h:96
Base class for Modus classes that provides default function implementations.
Definition: modusdefault.h:44
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
PdgCode stores a Particle Data Group Particle Numbering Scheme particle type number.
Definition: pdgcode.h:108
CollisionCriterion
Criteria used to check collisions.
@ Stochastic
Stochastic Criteiron.
BoxInitialCondition
Initial condition for a particle in a box.
friend std::ostream & operator<<(std::ostream &out, const BoxModus &m)
Console output on startup of box specific parameters; writes the initial state for the box to the out...
Definition: boxmodus.cc:31
Definition: action.h:24
CellNumberLimitation
Identifies whether the number of cells should be limited.
Definition: grid.h:55
@ ParticleNumber
Limit the number of cells to the number of particles.
@ None
No cell number limitation.
CellSizeStrategy
Indentifies the strategy of determining the cell size.
Definition: grid.h:33
@ Optimal
Look for optimal cell size.
Helper structure for Experiment.