Version: SMASH-3.1
boxmodus.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2023
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,
97  const bool include_unformed_particles,
100  if (crit == CollisionCriterion::Stochastic) {
102  }
103  return {{{0, 0, 0}, {length_, length_, length_}},
104  particles,
105  min_cell_length,
106  timestep_duration,
107  limit,
108  include_unformed_particles,
109  strategy};
110  }
111 
118  std::unique_ptr<GrandCanThermalizer> create_grandcan_thermalizer(
119  Configuration &conf) const {
120  const std::array<double, 3> lat_size = {length_, length_, length_};
121  const std::array<double, 3> origin = {0., 0., 0.};
122  const bool periodicity = true;
123  return std::make_unique<GrandCanThermalizer>(conf, lat_size, origin,
124  periodicity);
125  }
126 
128  double max_timestep(double max_transverse_distance_sqr) const {
129  return 0.5 * std::sqrt(length_ * length_ - max_transverse_distance_sqr);
130  }
131 
133  double equilibration_time() const { return equilibration_time_; }
135  bool is_box() const { return true; }
137  double length() const { return length_; }
138 
139  private:
143  const double length_;
145  const double equilibration_time_;
147  const double temperature_;
149  const double start_time_ = 0.;
154  const bool use_thermal_ = false;
159  const double mub_;
164  const double mus_;
169  const double muq_;
180  const std::map<PdgCode, int> init_multipl_;
185  std::map<PdgCode, double> average_multipl_;
190  const std::optional<PdgCode> jet_pdg_;
194  const double jet_mom_;
195 
204  friend std::ostream &operator<<(std::ostream &out, const BoxModus &m);
205 };
206 
207 } // namespace smash
208 
209 #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:118
const std::optional< PdgCode > jet_pdg_
Optional PDG code of the particle to use as a jet.
Definition: boxmodus.h:190
double equilibration_time() const
Definition: boxmodus.h:133
double max_timestep(double max_transverse_distance_sqr) const
Definition: boxmodus.h:128
const double muq_
Charge chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:169
const double jet_mom_
Initial momentum of the jet particle; only used if insert_jet_ is true.
Definition: boxmodus.h:194
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:218
BoxModus(Configuration modus_config, const ExperimentParameters &parameters)
Constructor.
Definition: boxmodus.cc:65
const bool use_thermal_
Whether to use a thermal initialization for all particles instead of specific numbers.
Definition: boxmodus.h:154
bool is_box() const
Definition: boxmodus.h:135
const double mub_
Baryon chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:159
Grid< GridOptions::PeriodicBoundaries > create_grid(const Particles &particles, double min_cell_length, double timestep_duration, CollisionCriterion crit, const bool include_unformed_particles, CellSizeStrategy strategy=CellSizeStrategy::Optimal) const
Creates the Grid with normal boundary conditions.
Definition: boxmodus.h:94
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:106
double length() const
Definition: boxmodus.h:137
const BoxInitialCondition initial_condition_
Initial momenta distribution: thermal or peaked momenta.
Definition: boxmodus.h:141
const std::map< PdgCode, int > init_multipl_
Particle multiplicities at initialization; required if use_thermal_ is false.
Definition: boxmodus.h:180
const bool account_for_resonance_widths_
In case of thermal initialization: true – account for resonance spectral functions,...
Definition: boxmodus.h:175
const double temperature_
Temperature of the Box in GeV.
Definition: boxmodus.h:147
const double mus_
Strange chemical potential for thermal initialization; only used if use_thermal_ is true.
Definition: boxmodus.h:164
std::map< PdgCode, double > average_multipl_
Average multiplicities in case of thermal initialization.
Definition: boxmodus.h:185
const double start_time_
Initial time of the box.
Definition: boxmodus.h:149
const double equilibration_time_
time after which output is written
Definition: boxmodus.h:145
const double length_
Length of the cube's edge in fm.
Definition: boxmodus.h:143
Interface to the SMASH configuration files.
Base class for Modus classes that provides default function implementations.
Definition: modusdefault.h:43
The Particles class abstracts the storage and manipulation of particles.
Definition: particles.h:33
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:32
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.